954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

IE/IP/Javascript problem

hi
odd problem with IE and Javascript?
when I open my pages using ip (and not host name) thier javascript functions and events dont
fire.
can any one help?

raziane
Newbie Poster
23 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

> when I open my pages using ip (and not host name) thier javascript functions and events
> don't fire.
You mean http://xxx.xxx.xxx.xxx:8080/webapp/test.html over http://hostname:8080/webapp/test.html ?

> can any one help?
Use firefox to run your web app and look at the error console. (Tools -> Error Console)

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

first- thank u for your attention.
second- yes , using http://xxx.xxx.xxx.xxx:8080/webapp/test.html to access the page my javascript event dont fire and using http://hostname:8080/webapp/test.html there is no problem !
third- firefox has no problem in this case and javascript events fire correctly.

and I need the solution for IE , because of its popularity in my country.

raziane
Newbie Poster
23 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

IP addresses as web addresses are obsolete.

1. Don't use IP addresses. Use of an IP address in a web address is usually a sign of sneakiness. Some firewalls block this (keeping your user from getting to your site). An IE security setting may be blocking this.

2. If you used a relative reference to the JS file, the browser expects to build the path to find the script by using the url of the current page. It gets lost when an IP address appears instead.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

hi MidiMagic
you are right , generally speaking , using IP instead of url is'nt a good method.
and I'm not using IP address usually.
in fact I want to demo a project, and to access my server it is required to use IP address.
and javascript events and function all are inline code, (not relative reference to the JS file)

raziane
Newbie Poster
23 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

It could still be a security setting. IP addresses are usually counted as not trusted, and so the security won't allow scripts.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

I removed any limitting security settings and the still the problem exists? !!!!!!!!! ?
any help ??

raziane
Newbie Poster
23 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

If it works in Firefox using IP then what is different in IE? Seems like a security setting could disable scripting across domains and consider "xxx.xxx.xxx.xxx" a "domain"? If your objects reference by DNS...different domain. Either way...defining the IP as a "local intranet site" and checking browser scripting permissions might be worth trying if you haven't already.

antioed
Posting Whiz
336 posts since Jan 2004
Reputation Points: 70
Solved Threads: 19
 

yes , it is a security problem , I added the ip address to trusted sites and now my events work.
thanks to antioed and MidiMagic

raziane
Newbie Poster
23 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You