/    Sign up×
Community /Pin to ProfileBookmark

junk after document element

I am trying to load html screens on a page. I send the http request, and then when I receive the response, I set my div.innerHTML to display the contents. This works, however I keep receiving this error in my Javascript Console that says junk after document element.

function loadScreen(screen) {
http_request.onreadystatechange = function() { screenIsLoaded(http_request); };
http_request.open(‘GET’, screen, true);
http_request.send(null);
}
function screenIsLoaded(http_request) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var text = http_request.responseText;
var mainPanel = browserObject(‘mainPanel’);
mainPanel.innerHTML = text;
} else {
alert(‘There was a problem with the request.’);
}
}
}

If anyone can see what might be happening, I would greatly appreciate it. Thank you!

Jason

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliDec 29.2006 — what is the content of the text variable?
Copy linkTweet thisAlerts:
@jrottmanauthorDec 29.2006 — The content that I am loading is mixed, it includes Javascript and html. Thank you!

Jason



[CODE]<script language="JavaScript">
tabs = new Array( );
tabs.push( new Array( 0, "Search" ) );
tabs.push( new Array( 1, "Sort" ) );
tabs.push( new Array( 2, "Mass Action" ) );
tabs.push( new Array( 4, "Options" ) );
create_tabs( "section", tabs );
</script>
<div class="tabbox" id="section_container">
<div id="section0" style="display: none">

My Search
</div>
<div id="section1" style="display: none">

My Sort
</div>
<div id="section2" style="display: none">
My Mass Action
</div>
<div id="section4" style="display: none">
My Options
</div>
</div>


<p>



<table class="listTable">
<tr>
<th width="20">
<input type="checkbox" onClick="
for (i=0;i<this.form.elements.length;i++)
if (this.form.elements[i].type=='checkbox')
this.form.elements[i].checked=this.checked">
</th>
<th width="20">
&nbsp;
</th>
<th width="20">
&nbsp;
</th>
<th>
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=subject&sort_order=ASC&rpp=20">Subject</a>
</th>
<th>
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=ticket_number&sort_order=ASC&rpp=20">Ticket ID</a>
</th>
<th>
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=last_replier&sort_order=ASC&rpp=20">Last Replier</a>
</th>
<th>
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=number_replies&sort_order=ASC&rpp=20">Replies</a>
</th>
<th>
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=last_updated&sort_order=ASC&rpp=20">Last Updated</a>
</th>
<th width="50">
<a href="tickets_set_cookies.php?cmd=setSortViewOptions&sort_method=name&sort_order=ASC&rpp=20">Name</a>
</th>
<th width="15">
&nbsp;
</th>
</tr>[/CODE]
×

Success!

Help @jrottman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...