This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes host name in cross domain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "host name in cross domain" Watch "host name in cross domain" New topic
Author

host name in cross domain

manikandan jayakumar
Ranch Hand

Joined: Aug 20, 2011
Posts: 41

Hi guys,

I need to get the requesting URL in a JS file.

ie., host1 has



in Host2 test.js

i need that this("http://host2:port/test.js")

NOTE: host2 is dynamic
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
I don't think that's possible in JS. But if your JSP can generate

then surely it can generate


Ping & DNS - my free Android networking tools app
manikandan jayakumar
Ranch Hand

Joined: Aug 20, 2011
Posts: 41

Thanks for your replay Dittmer,

i have coded like this

and it worked.
Your solution

also did the trick.

In my case, I need to reduce codes in host1.

Is their any drawback(security issues, etc) in parsing scripts tag?
 
Don't get me started about those stupid light bulbs.
 
subject: host name in cross domain
 
Similar Threads
connect to Oracle cluster over JDBC thin client
problem with importing importing external .js in jsp
Use Offline cache of browser
Javscript problem
2 Virt Host : dual personalities?