Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jquery chokes Internet Explorer on local host

Posted on 2013-11-27
9
Medium Priority
?
515 Views
Last Modified: 2013-11-28
Hi:

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
                });
            });

Open in new window


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
0
Comment
Question by:RBS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 43

Assisted Solution

by:Rob
Rob earned 500 total points
ID: 39683352
I can't see anything attached ...
How are you including jQuery in your page as it looks as if it isn't loading at all when you run on localhost?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 500 total points
ID: 39683405
Do you load
http://swip.codylindley.com/jquery.popupWindow.js
correctly when you are offline?
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 500 total points
ID: 39683595
You have to load JavaScript modules in a specific order for them to be recognized.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 18

Assisted Solution

by:Gary Davis
Gary Davis earned 500 total points
ID: 39683874
It appears jQuery is loaded OK but the popupWindow add-in is not. I have also seen issues where incluing two different versions of jquery could exhibit this problem

You can use IE's developer tools (F12)and tuen on the Network Capture and then refresh the page to verify you are loading the popup add-in and not getting a 404. Also verify you are not pulling in multiple jQuery javascript files.

Gary Davis
0
 

Author Closing Comment

by:RBS
ID: 39683920
Hi Thanks for this.

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

<!DOCTYPE html>
<html lang="en">
<head>

    <link href="../../Content/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <link href="../../Content/Site.css" rel="stylesheet" />
    @*move link to jquery here.....*@

    <script src="/Scripts/modernizr-2.6.2.js"></script>

   
</head>

<body>
<div>

<button id="buttonOMHA" class="btn btn-success pull-right ">OMHA Resources</button>
	<script>
		$(document).ready(function () {
			$('#buttonOMHA').popupWindow({
				windowURL: 'http://www.etc.com',
				windowName: 'swip',
				top: 50,
				left: 50,
				width: 1060,
				height: 800
				//centerBrowser: 1
			});
		});
	</script>
        @*move jquery above to just before modernizer*@
	<script src="../../Scripts/jquery-2.0.2.js"></script>
	<script src="../../Scripts/bootstrap.js"></script>
	 <script src="../../Scripts/swip.js"></script>
        

    </div>
</body>
</html>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39683968
I load ALL scripts in the head. NEVER had an issue. These scripts are smaller than the average logo on the page
0
 

Author Comment

by:RBS
ID: 39683969
hmm - Thanks - seems the safer way to go.
0
 
LVL 18

Expert Comment

by:Gary Davis
ID: 39684016
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.
0
 
LVL 43

Expert Comment

by:Rob
ID: 39684179
+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
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question