RBS
asked on
jquery chokes Internet Explorer on local host
Hi:
I have a bit of code in one of my applications that looks like this:
Whenever I run the program locally, IE pops up an error message:
Unhandled exception at line 532, column 17 in http://localhost:51476/Home/EnrollmentModules/25269
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'popupWindow'
It offers to open an exceptions window which I do and get totally lost (see attached)
The published version of the program works fine on line with ie 9 and 10, at least and all other browsers.
How can I get Microsoft to stop doing this to me on my local host?
Any help greatly appreciated.
RBS
I have a bit of code in one of my applications that looks like this:
$(document).ready(function () {
$('.example4demo').popupWindow({
windowURL: 'http://www.etc...(real address taken out - it's good',
windowName: 'swip',
top: 50,
left: 50,
width: 1060,
height: 800
//centerBrowser: 1
});
});
Whenever I run the program locally, IE pops up an error message:
Unhandled exception at line 532, column 17 in http://localhost:51476/Home/EnrollmentModules/25269
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'popupWindow'
It offers to open an exceptions window which I do and get totally lost (see attached)
The published version of the program works fine on line with ie 9 and 10, at least and all other browsers.
How can I get Microsoft to stop doing this to me on my local host?
Any help greatly appreciated.
RBS
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I load ALL scripts in the head. NEVER had an issue. These scripts are smaller than the average logo on the page
ASKER
hmm - Thanks - seems the safer way to go.
You can load jQuery at the bottom usually but before any add-ins. If the page has inline JavaScript then jQuery should load before that.
+1 mplungjan. I can't see any reason not to put all the script tags in the head. If coded properly you'll never have an issue
ASKER
I'm an idiot - the problem is with all browsers and the error message is right
I was trying to load jquery twice - once in my _layout and once in my page just before the button that attached to the function.
I moved the load jquery to the top just after loading the css files and removed it from before the button in the markup and it seems to work now. Thanks for your help!
One last note - I've never seen jquery loading at the top before - I guess this will slow down the rendering of all pages?
RBS
Unhandled exception at line 530, column 13 in http://localhost:51476/Home/EnrollmentModules/25269
0x800a1391 - JavaScript runtime error: '$' is undefined
Open in new window