Reno
Reno

Reputation: 1

share iframe with specific content

Lets say i have a website called http://123.com.

The index.html page of the website contains an iframe called theframe. i have three different page (1.html, 2.html, 3.html) for the iframe content and they will be displayed when i click specific button in the site. The default content of the iframe is 1.html.

My question is, if i need to share http://123.com with 2.html or 3.html displayed on the iframe, how should i write the link on facebook/blog/IM to share? Is there a way without modifying the website?

Thank you.

Upvotes: 0

Views: 1220

Answers (2)

Awang Dewangkara
Awang Dewangkara

Reputation: 1

Principally, you can make headings in h1 or h2 just above the iframe and have the page hashed-index the headings as URL to be shared. I think your button just need to also load those different headings in each next/ previous click. You'll find a way

Making life easier...just use this chrome extension to copy text (which is the headings) as URL value:

Copy Link Text Chrome Extensions

And as for sharing URL method, any social media share generator can do it, such as as this one:

Share Link Creator

Best of luck.

Upvotes: 0

Sahil Popli
Sahil Popli

Reputation: 2003

you have hard coded value in iframe src

use querystring

make a parameter named dstntn palce in your url

http://123.com/?dstntn=your_url

and then get it in a var by $_REQUEST['dstntn'];

and give var to iframe src

then change iframe by changing dstntn value by 1.html || 2.html

NOTE: read encoded and decoded form for query string i think dots are not acceptable

Upvotes: 0

Related Questions