Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

host name in cross domain

 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that's possible in JS. But if your JSP can generate

then surely it can generate
 
manikandan jayakumar
Ranch Hand
Posts: 44
Firefox Browser Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic