I am trying to write current website url in a frame using javascript. Butt my methods does not working... What I want to do is to write the current url path into this code instead of "CURRENT+WEBSITE+URL+HERE" text.

My current iframe code:
<iframe allowtransparency='true' frameborder='0' height='600px' id='web search' marginheight='0' marginwidth='0' scrolling='no' src='http://mysite.com/display?sid=1770469&title_color=0000FF&text_color=000000&background_color=FFFFFF&border_color=FFFFFF&url_color=000000&url=CURRENT+WEBSITE+URL+HERE&b=4' title='Find It' width='160px'></iframe>
In the iframe url src you will get "CURRENT+WEBSITE+URL+HERE" text where I want to put the current URL, so assuming a path of that site is "http://mysite.com/go/went/gone.html" , the iframe will show this url:
http://mysite.com/display?sid=1770469&title_color=0000FF&text_color=000000&background_color=FFFFFF&border_color=FFFFFF&url_color=000000&url=http://mysite.com/go/went/gone.html&b=4' title='Find It' width='160px
It would me much better for me if you would code it, will help me a lot. Thanks

Recommended Answers

All 2 Replies

Sorry, I'm not sure what you really want. Do you have an existing page with an existing iframe element with the said URL? Do you want to replace the "CURRENT+WEBSITE+URL+HERE" text from a current existing iframe URL?

text from a current existing iframe URL?

well i just want to put that page URL which will have that iframe, and i wanna put that page address/URL instead of "CURRENT+WEBSITE+URL+HERE" , so it is not the iframe URL it is that page URL which will bear that iframe. Suppose i have put this iframe in http://example.com/test.html so that the frame URL should like this: http://mysite.com/display?sid=1770469&title_color=0000FF&text_color=000000&background_color=FFFFFF&border_color=FFFFFF&url_color=000000&url=http://example.com/test.html&b=4 see in &url= in this address.. any idea? Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.