Jquery/Javascript not working when accessing webpage through system IP instead of localhost

5,658

Solution 1

I guess this question wasn't really meant for serverfault it was a problem with IE7 any way here is the answer Check out the answer here!!!

Solution 2

This may due to the group policy of your company for forcing Intranet sites using a specific version of IE in compatibility mode. I experienced exactly the same issue when I introducing some IE10+ Javascript libraries to my page.

Please see the Details for my other post on another thread as follows.

Solution 3

Please check your .js calling html command.

 <script type="text/javascript" src="http://localhost:PORT/a.js">

Please change it to

  <script type="text/javascript" src="http://YOURIP:PORT/a.js">

Also IE have same problem on font defination.

Share:
5,658

Related videos on Youtube

pranky64
Author by

pranky64

Updated on September 18, 2022

Comments

  • pranky64
    pranky64 over 1 year

    I don't face this problem while working on localhost only when I access the page using the IP address of my system this happens and it only happens with IE (works on all other browsers).

    By the way I'm using Tomcat V6.0.0.29, IE8

    I tried debugging the JS code using IE developer tools debugger, of course when I open using http://localhost:8080/ everything works perfectly fine, but when I use http://myIP:8080/ this loop is giving a problem.

    $('#someId > div').each(function(){...}); 
    

    As in this loop doesn't run at all, it just kind of skips it. I have checked the IDs they are fine moreover it's working in localhost why should it give a problem when I access it using my IP?

    I also tried using Apache 2.2 with Tomcat as container but it gives the same problem.

  • pranky64
    pranky64 over 12 years
    I'm not using absolute paths, i'm using relative paths! and the js and jquery are loaded because i can see them in the IE debugger!!