0

In the client application a ”click here” button is clicked, an Iframe is activated and navigated to particular URL which I already specified in that Iframe. Next step a window is popped, simultaneously my server page is getting loaded into it. Here I should get the Domain Name of the client from where the “click here” button is activated.

Is there any method to get the client Domain Name into my server which is getting loaded. I can’t include any PHP functions in client page because it's pure HTML.

Just below I am giving the link which is available in client page :

http://example.biz/manu/index.php

JellyBelly
  • 2,451
  • 2
  • 21
  • 41
manu
  • 1

2 Answers2

0

try this:

HTML

<div id="foo"></div>

JS

$("#foo").append(
    '<iframe src="'+location.hostname+'/manu/index.php"></iframe>'
);

DEMO HERE

JellyBelly
  • 2,451
  • 2
  • 21
  • 41
  • actually i need to get the client domain name; aftr a button click ma server page loaded into client home page in an iframe. a button, iframe link and one js file oly m just supposed to giv to client page.I cannot mention any js function to get domain name and cant pass with url. – manu Oct 20 '11 at 12:27
  • we cannot include any php tag bze this code may be workin in html site(client) – manu Oct 20 '11 at 12:31
0

you can use a js function to get the domain name and append that variable with Url which is mentioned in that iframe.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Megins
  • 1