Bug Tracker

Opened 13 years ago

Last modified 10 years ago

#4765 closed enhancement

Ajax/Load, "expected ';' " Bug with internet explorer 6 / 7 — at Initial Version

Reported by: D.van Loon Owned by:
Priority: minor Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: load ie Cc:
Blocked by: Blocking:


I was making an Ajax function to load html from another page within my Sharepoint site. To achieve this goal I used the following code.


<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js"></script>

<div id="mydiv"></div>

<script type="text/javascript">

$('#mydiv').load(('http://mylocalurl/page.html .ms-listviewtable'), {}, function(responseText,textStatus,XMLHttpRequest){loadResult(responseText,textStatus,XMLHttpRequest);});

function loadResult(responseText,textStatus,XMLHttpRequest) {

alert('I am succesfully called' );




What happens:

  • The target div is correctly filled with the content of the page
  • the alert is called.
  • in IE, a Javascript error appears "expected ';'"

Note #1, the line-number of the javascript error varies between refreshes. It appears on ridiculously high line numbers. Note #2, Firefox does not show the error, nor does the error console or Firebug show any error Note #3, the error dissapears when the above script is reduced to an alert.

if it helps: A blogger had a similar problem with the get command, he indicated that the problem occurs in IE when specifying datatype: 'SCRIPT' when the actual call returns html.

Also: The error cannot be reproduced when creating two simple html pages, and having 'load' get the other. The error seems to origin from the fact that sharepoint pages are shockfull of included and inline script. Perhaps a toggle to the 'load' command to choose between reading the response or running the response (which it does now ) would solve the problem.

Alternatively I tried to achieve my goal with the 'get' command, however when 'get'ting the html page it can not be traversed through css identifiers ( $('div') works, $('div.myclassname') does not.

Change History (0)

Note: See TracTickets for help on using tickets.