I want a link to load into an iframe when the user clicks it. I have tried the following code, but unfortunately that did not work. I want to do this without using Javasvript or JQuery. I have the jquery code that can do this task, but I want to do this in simple html. Moreover, I aslo want to get the ID of the element on which the user clicked before generating the frame.
Any help will be appreciated
Thanks
clickme
<iframe src="login.html" name="frame"></iframe>
You can "popup" into a new window/tab by using the target attribute of the <a> tag. However if you want a popup window inside the same browser window, you will need to use javascript.
If all you mean is "load into an iframe" then you just need to use the "target" attribute of the link. This will load the href into the iframe (though any "popping out" would have to be handled in js). The link should look like:
clickme
<iframe src="login.html" name="frame"></iframe>
Use a dom parser, and rebuild the HTML with the links as an iframes
or use some nasty str_replace calls to make anchors iFrames
$url=str_replace("<a ","<iframe ",$url);
$url=str_replace("</a> ","</iframe> ",$url);
I wouldn't do that tho. I would use js or jquery to rebuild them or create a lightbox with the iframe upon clicking the link. Good luck!
You cant get a popup in simple Html any way.Your idea of refering to another frame is good,but it will not popup .please read the Query http://www.codingforums.com/archive/index.php/t-45236.html
Related
I understand that it is possible to hide the url in the browser status bar by using javascript, but with this method, the url can be seen when the source is viewed from the browser.
how to hide URL from downloadlink?
We are using PHP Laravel.
I would like to know how to create a link button so that the user does not see the url. I am assuming that this might need to be implemented at the server (controller) side not a view side.
I would like to know the easiest way.
There are basically three different ways to hide links in HTML.
The first way is to use the tag without the href attribute. This hides the link from the HTML reader, but the link will still be clickable in the browser.
The second way is to use the tag with the href attribute, but place the entire link inside a span tag.
The third way is to place the entire link inside a span tag, and then you can use CSS to hide that span tag.
Whichever way you choose to hide the link, your link will still be clickable. When the link is clicked, it will still open in the browser window. Hiding links is very easy in HTML.
I need to display content that was posted from the previous page within iframe. Is it possible?
The content will have HTML tags.
The reason why I need iframe, because it will also have reference to CSS. If I just echo it on page, then it will make problems with CSS style of the main webpage. The only sollution I have found is to use iframe.
Why not just correct your CSS?
FWIW, I don't think you are able to POST data to anything inside an iFrame, especially if you don't have control over the iFrame content.
Iframes link to a URL.
So if you can save the post data into a file on your server and then use ajax or refresh the page to inject the url to that file on the iframe, then you will be sorted.
How to forcefully click on a button in an iframe using jQuery or PHP?
example
<iframe src="www.google.com"></iframe>
I want to press the button or anchor tag in that iframe.
And also change anchor tag target -> '_self'
Expanding on "not possible"...
The "Same origin policies" apply: your only way of communicating with the contents of iframes that come from another [domain|subdomain|protocol|port] is through the postMessage API, which of course requires the other part (the document inside the iframe) to listen to your messages. This means that unless you're a google employee with access to the search frontend, this won't be possible.
If you work at google and want to press a button forcefully, I recommend standing with your foot on your mouse: your weight will help push it with more strength.
Not possible. Blocked by Browsers for security concerns.
On serverside you could use CasperJS to click some stuff inside an iFrame. See here
How do I access an iframe from CasperJS?
How Make Page Navigation in php without reloading the page without jquery like facebook has.
ex. for welcome page : http://www.facebook.com/?sk=welcome
for friends list : http://www.facebook.com/?sk=ff&ap=1
for news feed link http://www.fack.com/?sk=nf
with clicking the link instead of reloading whole page the appropriate content be loaded.
how to do this without javascript, jquery
Without JS and jQuery, the only way will be an <iframe>.
Look at this documentation for more.
If you want it done the same way that Facebook does, you’ll have to use JavaScript. There’s little way to do it without it.
I have a link like this:
$contact_url = "<a href=rentals_popup.php?id=$row->rentals_id >" . "Contact" . "</a>";
How can I open that page in a different window with?
Smaller width and height
Disabled maximize button
This should work
open window
Plain HTML does not support this. You'll need to use some JavaScript code.
Also, note that large parts of the world are using a popup blocker nowadays. You may want to reconsider your design!
Since many browsers block popups by default and popups are really ugly, I recommend using lightbox or thickbox.
They are prettier and are not popups. They are extra HTML markups that are appended to your document's body with the appropriate CSS content.
http://jquery.com/demo/thickbox/
I can't comment on Esben Skov Pedersen's answer directly, but using the following notation for links:
Click here
In Internet Explorer, the new browser window appears, but the current window navigates to a page which says "[Object]". To avoid this, simple put a "void(0)" behind the JavaScript function.
Source: https://support.microsoft.com/en-us/kb/257321
You might want to consider using a div element pop-up window that contains an iframe.
jQuery Dialog is a simple way to get started. Just add an iframe as the content.