aspose file tools*
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
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: 44

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: 41489
    
  53
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: 44

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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: host name in cross domain