I am working in iframe with a scrippplet in the src, but it is not working
<iframe src="<%=urlProdMatch%>" width="550" height="500" frameborder="0" allowtransparency="true"></iframe>
However, urlProdMatch has a url
<h4><%=urlProdMatch%></h4>
It prints the value the url, but in the iframe shows nothing
Thanks a lot.
Have you had a look at the source for the IFrame? (i think they're evil, by the way)
My guess is the the data is being written out, but it gets written between the script brackets and therefore doesn't show up.
Try this version:
<script type="text/javascript">
document.write("BUT THIS DOES PRINT!");
</script>
<%
response.getWriter().println("THIS DOESN'T PRINT");
%>
Related
I have a list of urls (lets call them url1.com,url2.com,url3.com). I want to load their contents into an ifram so i can copy them. However, if i create seperate iframes for each url i cannot copy them at one. Is it possible to load multiple urls into one ifram which i can then copy. The urls only contain a string of letters and nothing else.
https://pastebin.com/mQVRPXe4
<iframe src="https://url1.com" src = name="targetframe" allowTransparency="false" scrolling="no" frameborder="0" >
</iframe>
<iframe src="https://url2.com name="targetframe" scrolling="no" frameborder="0" >
</iframe>
<iframe src="https://url3.com name="targetframe" allowTransparency="true" scrolling="no" frameborder="0" >
</iframe>
You can do a couple of things. Namely, use ajax requests or style the iframes. You can easily remove the border on the iframe with the frameBorder attribute.
I know this isn't really the best answer, and I'm not really sure what you are really trying to do here, but I was asked to put this as an answer
I have a HTML page with 30 links each pointing to a YouTube video. All videos belong to the same YouTube Channel.
The HTML page also features a YouTube player.
I am trying to figure out if the following is possible (possibly without using PHP): Once a link is clicked, the video player refreshes on the same page and showes the video. The page itself does not refresh - only the video player does.
Are there any options other than PHP?
Can anyone link me to some sort of super easy guide for doing it myself? (..."below beginner" level).
How you are linking with youtube? with iframe tag ? If you are using iframe then you can see all the videos in same page only. Page won't refresh.
If it is not the case please be more specific.
You can do this using jquery. In the href attribute of links, use video's embedded url, as in below code.
<script type='text/javascript' src='jquery.js'></script>
<script type='text/javascript'>
$(document).ready(function() {
$('a').click(function() {
$('iframe').attr('src', $(this).attr('href'));
return false;
});
})
</script>
<iframe width="560" height="315" src="http://www.youtube.com/embed/J5x5gduEWtI" frameborder="0" allowfullscreen></iframe>
<br><br>
<a href='http://www.youtube.com/embed/J5x5gduEWtI'>Link1</a>
<a href='http://www.youtube.com/embed/WmDmUDXxeXU'>Link2</a>
<a href='http://www.youtube.com/embed/UNlgAuMWuvw'>Link3</a>
Edit:
This will also works.
<iframe id='iframe' width="560" height="315" src="http://www.youtube.com/embed/J5x5gduEWtI" frameborder="0" allowfullscreen></iframe>
<br><br>
<a href='http://www.youtube.com/embed/J5x5gduEWtI' target='iframe'>Link1</a>
<a href='http://www.youtube.com/embed/WmDmUDXxeXU' target='iframe'>Link2</a>
<a href='http://www.youtube.com/embed/UNlgAuMWuvw' target='iframe'>Link3</a>
If you don't want the page to refresh, then your only option is JavaScript (i.e. you have to do it clientside).
You can do it by keep the youtube player in an iframe which has some ID (e.g: id="playerFrame"). Then in the relevant hyper link ('a' tag), put the id of the iframe as the value of "target" attribute.
<iframe id="playerFrame"></iframe>
Click to see video 1
See http://webdesign.about.com/od/iframes/qt/target-links-iframes-and-frames.htm
i have an iframe that supposed to show me the pages according to the links.
the iframe code is :
<iframe width=940px onload=reSize() src="src/HEB/registerHEB.html" id="ifrm" name="iframe_main" frameborder="0" scrolling="no"></iframe>
i want to do that when i click on link such as this one
<a href="html/guides.html" target="iframe_main">
it will open the page in the iframe, but when i click F5 (refresh) it won't load the original src of the iframe, but the last link ive clicked.
Thank you very much.
use this script after iframe same as:
<iframe src="src/HEB/registerHEB.html" id="ifrm" ......></iframe>
<script>
document.getElementById("ifrm").src = 'src/HEB/registerHEB.html';
</script>
I want to attach a google group to my website. Is there a way to do that? please help. I need HTML code to attach this group to my website.
You can use an iframe and some JavaScript
<iframe id="forum_embed"
src="javascript:void(0)"
scrolling="no"
frameborder="0"
width="900"
height="700">
</iframe>
<script type="text/javascript">
document.getElementById("forum_embed").src =
"https://groups.google.com/forum/embed/?place=forum/forum-name" +
"&showsearch=true&showpopout=true&parenturl=" +
encodeURIComponent(window.location.href);
</script>
where forum-name is the name of your Google group
Read more about it here
See this jsFiddle example for the group foresite
I've messed up my main question so I here I go again.
I have a mainrecord.html that uses iframe to display 2 html - top and lower. On the top html page I have a save button. This save button does some data work and then goes to a different html. The problem is the lower iframe is still there. Here is what I have in the mainrecord.html:
<iframe scrolling="no" noresize target="middle" src="<%=JustPath(oProp.ScriptPath)+[/top.html?id=]+tmpid"%> name="top" height="62%" class="auto-style1" style="width: 100%">You need a Frames Capable browser to view this content.</iframe>
<iframe scrolling="no" noresize target="middle" src="<%=JustPath(oProp.ScriptPath)+[/lower.html?id=]+tmpid"%> name="lower" style="width: 100%; height: 35%">You need a Frames Capable browser to view this content.</iframe>
<script type = "text/javascript" >
element = document.getElementById("lower");
</script>
In the top.html there is a save button that goes to a saverecord.html. I do some data work and then I do this:
<script type="text/javascript">
document.removeChild(element);
</script>
<% oResponse.Redirect(JUSTPATH(oProp.ScriptPath)+[/viewrecords.html])%>
It correctly displays viewrecords.html. However, the iframe containing lower.html is still there.
Any suggestions?
TIA.
You need to refer to a wrapping element in your JS to remove this Iframe.
<div class="frame2">
<iframe scrolling="no" noresize target="middle" src=""..." name="lower" style="width: 100%; height: 35%">You need a Frames Capable browser to view this content.</iframe>
</div>
JS
element = document.getElementById("frame2"); <-- this is the wrapper for your Iframe
document.removeChild(element);