Where to put page-specific JavaScript

C

Christopher Nelson

Christopher Nelson said the following on 3/1/2007 9:30 AM:
I've got:
var e = document.getElementById(id);
e.innerHTML = '<br>'+req.responseText;
var h = document.getElementsByTagName('head')[0];
var scripts = e.getElementsByTagName('script');
alert(scripts.length+' scripts found for '+id);
for (var i = 0; i < scripts.length; ++i) {
var s = scripts;
if (s.innerHTML) {
var x = document.createElement('script');
x.innerHTML = s.innerHTML;


x.text = s.innerHTML;


Thanks. IE7 gets farther now. It complains about expecting an object
on line 500,000-something and then opens the debugger with most of the
first 10 lines or so of index.html highlighted. :-(
 
R

Randy Webb

Christopher Nelson said the following on 3/1/2007 12:50 PM:
Christopher Nelson said the following on 3/1/2007 9:30 AM:
I've got:
var e = document.getElementById(id);
e.innerHTML = '<br>'+req.responseText;
var h = document.getElementsByTagName('head')[0];
var scripts = e.getElementsByTagName('script');
alert(scripts.length+' scripts found for '+id);
for (var i = 0; i < scripts.length; ++i) {
var s = scripts;
if (s.innerHTML) {
var x = document.createElement('script');
x.innerHTML = s.innerHTML;

x.text = s.innerHTML;


Thanks. IE7 gets farther now. It complains about expecting an object
on line 500,000-something and then opens the debugger with most of the
first 10 lines or so of index.html highlighted. :-(


Start making your page smaller and smaller until you either get a
minimum test case to debug or you get rid of the error. Then start
adding it back and you will find the problem. 500,000 lines of code
though? There is a bug in IE with regards to lines of code though. If
code has more than 32767 lines of un-interrupted code IE will barf all
over it. And even then, it is not all IE's, it is only certain updated IE's.

<URL:
http://groups.google.com/group/micr...279f1?lnk=gst&q=32767&rnum=1#652dd7efe51279f1>
 
C

Christopher Nelson

Christopher Nelson said the following on 3/1/2007 12:50 PM:
...

Start making your page smaller and smaller until you either get a
minimum test case to debug or you get rid of the error. Then start
adding it back and you will find the problem. 500,000 lines of code
though? ...

Actually, the error is reported on line 5 million and something;
clearly a reporting bug. <shrug>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top