[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript not working on Windows IIS server site

Posted on 2009-04-26
7
Medium Priority
?
2,856 Views
Last Modified: 2012-05-06
Site built as an ASP .Net 2.0 web site. Development PC running Visual Studio 2005 on Windows XP. Live site is hosted on Windows Server 2003 with IIS6

Once deployed to the server gallery Javascript is not working on the gallery page of the site.
- the gallery page displays items but clicking on them displays the image rather then the javascript enabled preview (using lightbox.js )

Site completely works on my machine but the gallery page does not work on the server
- to double check the site copied fromthe live server all the code for the site and did a full directory compare with my live site and one on my developer PC. Directory structure and files identical. Only difference was database connection string in web.config
- sites are therefore running same versions of javascript files and dependencies

Other javascipt files are working
- javascript is used for the pop-up menu and other places. It works in these places on the live site
- the javascript for the pop-up works on the gallery page. just the gallery javascript does not work

Paths are verified
- using FF web developer I have Viewed Jacascript. There are no 404's. All required files are listed

IIS settings look fine
- I have compared the settings on my local and live servers.
- Home Directory > Executable Permissions is set to Scripts and Executables.


Does anyone have any others ideas of what I can check or what I may have missed in things I have checked?
0
Comment
Question by:t-min
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:Pawel Witkowski
ID: 24239458
Well... any link that you can provide for this not working version ?:)))

What you can miss? Some security polices, maybe caching (in Firefox I have to offen hit CTRL+R to reload and force to get stuff from server again, because browser cache it and gives me older version), maybe something else. Experts need to see it working on some test server to give you more info.
0
 

Author Comment

by:t-min
ID: 24239501
Thanks for suggestions, I have tried various refresh options, browser resets and reseting IIS.


Link to the site with the problem (Site is not great coding. I have reworked an existing site. At this stage I wish I had of re-written it from scratch):
http://testing.sensaura.com.au/Gallery.aspx

Clicking gallery images loads the image rather then popping up in the lightbox.
0
 
LVL 18

Accepted Solution

by:
Pawel Witkowski earned 2000 total points
ID: 24239566
First of all:

"Troubleshooting:

It doesn't work at all. The image opens up in a new window.
    This is commonly caused by a conflict between JS scripts. Check your body tag and look for an onload attribute. Example:
    <body onload="MM_preloadImages(/images/menu_on.gif)&;">
    A quick fix to this problem is to append the initLightbox() to the onload attribute as so:
    <body onload="MM_preloadImages(/images/menu_on.gif)&;initLightbox()">"


You have at least 2 big frameworks there:

jQuery and Prototype.




Also what I see that:

element.dispatchEvent is not a function
[Break on this error] element.dispatchEvent(event);


It seems that you did not put jQuery in non block mode. So both of those frameworks interferees each other and makes big #@@$#@ ;))) If you can - remove one. If you cant - just read about jQuery noConflict:

http://docs.jquery.com/Core/jQuery.noConflict



If you make no errors on page then we can go further with finding your problem (but it might solve when proper onload will be called)

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:t-min
ID: 24240465
So the framework conflict is something that would appear on the server only?

On my development machine the gallery behaves as required.


Thanks for your ideas. I will look into you suggestions at work tomorrow.
0
 
LVL 18

Expert Comment

by:Pawel Witkowski
ID: 24240729
Well the error I noticed in code - I follow it in firebug and its related with dom:onload   so I assume that something that should start onload of page does not start at all. And it seems that its a lightbox because it does not work :D
0
 

Author Comment

by:t-min
ID: 24258087
Thanks for pointing out that multiple frameworks were being used. I switched from a Prototype to a JQuery lightbox but still had the problem.

I change the include order of the js libraries and it worked!



0
 

Author Closing Comment

by:t-min
ID: 31574792
Provided detail and lead to me to discovering the solution, thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month19 days, 20 hours left to enroll

872 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