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.
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
Related
Is it possible to hide the page paths in the URL and only show the domain name without anything else?
So now I have multiple pages:
www.example.be/index.html
www.example.be/travel.html
www.example.be/links.html
...
But on all the pages I only want to show www.example.be in the address bar.
I was looking into the .htaccess file but I cannot figure it out.
You can wrap your entire website in an iframe tag. And change the src property of the iframe dynamically using client side code. This way your page names won’t be visible in the url bar.
<iframe src="/index.html" height="200" width="300" title="Page Title"></iframe>
What I want to achieve:
Extracting the current url of an iFrame.
Search info
All the sugested "similar questions" return nothing of what I want to achieve here.
The setup:
I have an iframe which links to a website. For instance, let's say:
<iframe src="http://www.google.com"></iframe>
Then, after the user searches for something on google will the iFrame src change to reflect the current URL of the page? For instance:
https://www.google.pt/search?site=&source=hp&q=test&oq=test
If not, is there any other way to extract this info?
THanks in advance :)
The content of the iframe is actually perl-generated html loaded when the links on sidebar of the home page is clicked. But even if it was just plain html. Is there a way to bookmark the home page along with a specified iframe content?
You could always add a query string or hash tag to the URL. Then have your iframe load the HTML based on the query/hash input (after sanitized, of course). That way, when a user bookmarks the page, the appropriate content will populate the iframe.
I have HTML content (mostly e-mails) that I would like to display in an archive. Seeing as some of these records contain their own styles, images, and headers, they need to be displayed independently and confined to its container so as not to interfere with the page displaying it. I immediately thought of an iframe.
I have two ways I can do this, both are somewhat indirect. 1) I can draw an iframe that points to about:blank and use Javascript to draw the content into the iframe after the page loads. 2) I can create a secondary PHP page that returns only the content of the e-mail and point the iframe to it as the src attribute. These solutions are simple enough, but I was wondering if there is a more direct way.
I found solutions like these, but they suggest using options 1 or 2 above. The point of this question is: "Is there a more direct way to preload HTML content directly into an iframe than to rely on Javascript or a secondary page?"
Html code as IFRAME source rather than a URL
Specifying content of an iframe instead of the src to a page
I am not sure how much more "direct" you can get than to specify a page in the src attribute of the iframe.
You already link to the only answer that actually works in your question that does not include using a src page or using EMCAScript to draw the iframe content. Remember thought that data urls are still limited in the number of bytes of data they can display in most browsers because there are limits to the length of the data url itself.
I would really suggest that you use the src attribute with a seperate backend script as that will decouple and increase the maintainability of your code as you can develop the scripts responsible for the page itself seperatly from those that show the iframe content.
I am attempting to link from my website to an outside website but the information that relates to the user is in the middle of the outside page. Can I make the link take them to there?
Thank you in advance
If that outside page has an anchor tag in or near the content you wish to link to, yes.
<a name="releventContent">
If the above code (or something like it) is present in the outside page, you can link to it from your site like so:
clicky
I can suggest you a dirty trick that might work or not too. Steps
Open the new link in an IFrame.
Create a javascript function that will accept the string to search as parameter.
On the bodyload call that function that will search for the text in the source file.
Some SO links
Filling an IFRAME with dynamic content from JavaScript
Read IFrame content using JavaScript