File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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: 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: 39552
    
  27
I don't think that's possible in JS. But if your JSP can generate

then surely it can generate


Ping & DNS - updated with new look and Ping home screen widget
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: host name in cross domain
 
Similar Threads
Javscript problem
problem with importing importing external .js in jsp
connect to Oracle cluster over JDBC thin client
Use Offline cache of browser
2 Virt Host : dual personalities?