Using Javascript To Detect Frame Source
Jul 23, 2005
I have two frames. "Top" contains a local file on my server with the aforementioned javascript. "Bottom" is a remote website on a server I do not control. I want to use javascript in "Top" to determine what the current url is in the "bottom" frame...
View 1 Replies
ADVERTISEMENT
Mar 26, 2009
Let's say we have two separate files / pages:
File A - www.example.com/index.html There is an iframe on this page which contains different links. Every link leads to File B (e.g. www.example.com/news.html) which in turn has a frame.
The links on page A should change the source of the frame on page B. In brief - the frame on page A opens page B and every link should change the content/source of page B's relevant frame...
View 5 Replies
View Related
Oct 13, 2010
I need to write a hover function to detect a div's image source.If it has a 'apple.jpg' image, then change the src to 'orange.jpg'.If the div has no image, then do nothing.
<div id='CheckImg'>
<img src="apple.jpg">
</div>
View 3 Replies
View Related
Feb 10, 2010
I have these "editable" divs in my document. When you click them, a text box comes up and you type something and push enter. It changes what's in the div.There is also a blur event associated with the text box. When the user tabs or clicks away, it fires the blur event. Here lies the problem.I have other elements on the page that are clickable. I don't want those clickable things to fire their events if the user is clicking away from the text box, ie. the blur event. This isn't a problem is the user pushes tab, for instance.
View 3 Replies
View Related
Apr 18, 2011
set source of a frame equal to a varialble:
Code:
<script type="text/javascript" language="javascript" >
//test
function makelink()
{
var qual = '';
//set stud = mm_adl_API.LMSGetValue(""cmi.core.student_id")
[Code]...
View 1 Replies
View Related
Jun 3, 2010
The system uses individual PDF files for each page, and you can navigate using the controls on the side. It's not ideal, as it was made to replace a horrible system and has the limitations of the content being presented.
That being said, I think it's pretty good. The trouble area is related to navigation: when you navigate the documents, some JavaScript detects the current URL of the content frame and updates the nav controls (previous and next page numbers) and table of contents links (bold, highlight) if they have changed. That part works fine. The problem area is with IE and PDF links. If you click a page link within the PDF, it opens that PDF file in the same frame. In FF and every other browser, the JS URL detection works fine.
In IE, of course, it doesn't detect that a different PDF is being displayed. If it can't detect the new PDF file, and by extension, the file number, the nav controls don't work right. Now - before anyone asks - it DOES work in IE if you navigate to the PDF document by using the links in the navigation system that I built. It's just when you arrive at a PDF from another PDF that it fails.
This is hard to explain more clearly, so take a look: [URL]
To see this in action, visit page 4, the table of contents. Click a page number link, for instance, page 9. Once it loads, click "next page" at the top left of the interface. In FF, it goes to page 10. In IE, it goes to page 5, since the JavaScript is unaware that the frame has changed PDF files. It doesn't make sense, since FF can see it plainly.
My code is all out in the open. This thing has to be designed to run off of a CD as well as on the website. If I could use server-side scripting, it would be VERY different, I assure you.
View 8 Replies
View Related
Apr 29, 2004
Can I control the src attribute of a header <script> tag so that it loads a different script file depending on the value of a variable?
I have a javascript file that currently holds the variables for several countries and weihgts too much for a single file. I estimate that only 2-3kb of the 40+ that it now holds are used at any given point depending on the user's chosen country.
Now, I can split the file into several smaller files to reduce loading time but only if I have a way of dynamically loading the different files.
View 5 Replies
View Related
Mar 11, 2009
I have a small script that creates and removes elements from an html form. This script also renames some elements upon deletion of another element. But this does not seem to be working properly. The problem is that i can't really figure it out so i was wondering if there is a way to see the source code that is created by JavaScript,in order to track down where the problem is.
function removeDiv(divNum){
var container = document.getElementById("container");
var removedID = document.getElementById("div" + divNum);
container.removeChild(removedID);[code]....
// the code below works if i delete the "for" above, and doesn't work if the "for" is there. specifically, if the added elements are 5 or more and i delete the last one, the value of y remains the same. if i delete the first or one in he middle, it works. if i delete the last and reduce the elements to 1,then add another 5 and delete the last one (as it would not work initially) it works!
var y = parseInt(document.getElementById("totalElements").value);
document.getElementById("totalElements").value = y - 1;
}
<input type="hidden" name="totalElements" />
The value of totalElements increases every time an element is added and this works well.
View 3 Replies
View Related
Jul 23, 2005
This ist the source-code for an editable combobox implemented with HTML,CSS and Javascript. I have tested it with IE and Mozilla. But I don't know, if it will
work in other browsers (Opera, Konqueror, etc.) So I need your feedback... Code:
View 1 Replies
View Related
Oct 15, 2004
I wrote some JavaScript I misguidedly thought cool, and felt like sharing it with the world. So I put a link to the source file in my blog. If I click on the link in Mozilla, it shows the source as text, as intended. If I click on it in Internet Explorer, I get a choice between saving the file or opening it, where 'opening it' means 'trying to run it and getting an error.' Putting Code:
type="text/plain" in the a tag doesn't help. Does anything?
View 4 Replies
View Related
Jan 8, 2007
I'm working on a little frames based web market research tool (not for public consumption) which allows us select various supplier websites via a link in a header frame, to be loaded in a main frame, from which we may drag data to be dropped into a form in a third form_frame which then submits to our database. All in all, this works nicely until we come to one of the supplier sites which has implemented a frame-killer script.
Now, I know it would be bad form (probably illiegal even) to force a site into the frames of another site for public consumption but I don't think that is an issue here so I ask you all ... Is it possible to disable JavaScript (on the fly) for a given frame only?
View 2 Replies
View Related
Mar 20, 2006
I have a top-bottomLeft-bottomRight frameset and three pages (details01.html, details02.html and details03.html):
<frameset rows="80,*" cols="*" frameborder="no" border="0" framespacing="0">
View 5 Replies
View Related
Jul 20, 2005
Does javascript have acces to source code of previous page when I open a
page from the same domain with:
window.open("new_page_with_script","_self","");?
window.opener.document.innerHTML doesn't work ;(
View 2 Replies
View Related
Oct 9, 2006
I wrote a JavaScript that removes the white space from javascript source code in order to speed up download times.
For instance:
View 3 Replies
View Related
Jul 23, 2005
Can someone show me how I can have:
<a href="javascript:history.back()" name="Back" value="Back"
style=width:40px;float:right;margin-left:0px class="button" >Back</a>
but since this href exists in a frame, it only pertains to this frame?
View 4 Replies
View Related
Oct 28, 2003
I have set of frames... one contains a menu and the other a status frame. I am calling a function from the menu which sets the variables however I need some help passing those variables to the status frame. How would I go about doing such a thing?
This is called from the menu in frame 1 but doesn't work:
Code:
function jumpsec(cat, prod) {
parent.statusbar.category=cat;
parent.statusbar.product=prod;
}
// then my status frame bar has:
document.write(parent.statusbar.category);
document.write(parent.statusbar.product);
The 2 variables are blank on statusbar onload but get populated with each click.
View 4 Replies
View Related
Jul 23, 2005
I would like to generate a page of links including some of the pdf properties (title, author, version, etc.) for a folder full of pdf's. Is this possible from Javascript?
View 4 Replies
View Related
Aug 29, 2006
I am wondering if any of you Javascript experts can enlighten me on
which event to call. The use situation is that the tetxbox field is
populated from the DB and the add/update and delete will work only when
a textbox for reason for change is entered. This mean if a user simply
type in the same value as before, the ASP.NET textbox will be marked
with changed. But it should not limit that a user can not change the
whole value in the textbox at all.
I have looked at keyup, mousedown, etc. but it will calling the
function after every key is entered and that is what I don't want to
happen.
View 3 Replies
View Related
Jun 19, 2006
I am very new to javascript, it is on my list of things to learn... but I have a wide range of other traditional programming languages so I understand functions, etc
however in the mean time I am looking for a way to detect the height of a specific div.
My goal is that I have a div that is set to overflow: auto ,
If the content of the div goes beyond its set height, I would like to make a div visible. So basicly I need to get the height of a div element, and compair it to a pixel number.
To go a step beyond, it would be cool to make the div that is visible when there is scrolling, to disapear once you got to the bottom of the div.
Any ideas?
View 6 Replies
View Related
Jul 23, 2005
Is it possible to use javascript to detect if a screen reader is
running a on a users machine?
I know that on a pc, screen readers use the MSSA interface. Is there
a way to detect whether this is operational or not?
View 8 Replies
View Related
Jun 6, 2003
I'm working on an image gallery and want to popup windows that are the size of the images they're meant to show.
In php I would use getimagesize() and plug the dimensions into a new window but the server doesn't support it so I'm sort of stumped on how to dynamically size the windows appropriately. Any suggestions?
View 2 Replies
View Related
Mar 31, 2004
Is there a way to detect with javascript the height and width of a browser window that's open? Much the opposite of a pop-up where you define the height and width I guess you could say - anyone know if this is easily possible?
View 2 Replies
View Related
Dec 16, 2006
I have an outer page and an inner iframe. The outer page calculates some
javascript, and wants the inner frame to run it. The inner frame should hit
a page on the same (private) web server, so this is not a cross-site
scripting attack. But I would prefer not to taint the target page with any
extra logic to do this. (I will if I must.)
The calling page has these elements:
<script src="/javascripts/prototype.js" type="text/javascript" />...
<span id='update_me'>yo2</span>
<iframe id='grinder' src='sample.html' >
</iframe>
So here's most of the page which the iframe hits:
<script src="/javascripts/prototype.js" type="text/javascript" />...
<body bgcolor='silver'>
<span id='update_me'>yo</span>
</body></html>
Note that both the outer and inner page have a span with the same ID.
This question will resemble a JavaScript FAQ - how to evaluate Javascript on
the fly, or how to reload a JS file. The answers on the web generally do not
transport the JS across a frame boundary, so they don't address the bug I
encountered, and I can't tell if prototype.js or IE is at fault.
The outer page calls Ajax goodies that generate some JS looking like this:
Element.update("update_me", "here I B");
The page sends that, as a string, into this JS (in application.js):
function update_grinder(sauce)
{
var grinder = $('grinder');
if (grinder)
{
var doc = grinder.contentDocument;
if (!doc) doc = grinder.document;
if (doc)
{
evaluate(doc, sauce);
return;
}
}
document.write("your browser sucks");
}
So that contains enough logic to find the iframe's document, and it works
for Firefox, IE, Konqueror, and Opera. The code calls evaluate() with the
document where we need the evaluation context, and the string with our
source.
Here's evaluate():
function evaluate(doc, sauce)
{
var s = doc.createElement('script');
//s.defer = true; // <-- no effect
s.text = sauce;
var body = doc.getElementsByTagName('body').item(0);
if (body)
{
body.appendChild(s);
return;
}
body = doc.body;
if (body)
{
body.appendChild(s);
return;
}
}
That creates a <scriptblock, sticks our string in as its contents, and
pushes the block to the end of our <bodytag. Now here's the bug:
Firefox updates the inner <span id='update_me'>, and IE updates the outer
one.
If I remove the outer <span id='update_me'>, then IE simply can't find it
and throws an error. Even though it evaluates a script block clearly in the
context of the inner iframe.
I have tried calling the script from setTimeout, and from a button's onclick
handler.
Is there some script.aculo.us way to fix (yet another) bug in IE? Or is this
a bug in prototype.js?
View 15 Replies
View Related
Jul 20, 2005
I want to stream audio into a hidden frame and load, stop, and control
volume via JavaScript. I'm thinking w/ Windows Media Player.
View 2 Replies
View Related
Aug 24, 2006
So, basically, I need to detect whether an alert window was thrown. I can't find where it's thrown from but I need to disable a button only if there were no alert windows thrown.
View 3 Replies
View Related
Feb 23, 2011
I got some code that loads divs from other web pages into a particular div in my main page. In other words, I click on a button, and this tells jquery to load afragment of a particular page into my main page. For instance if I have 5 web pages onrock stars, I could have 5 buttons, and each button could load one rockstar's biography into a div on the main page (and replace whatever was there before). This works, and I do see the content that it loaded. But when I do 'view source' in IE, I do not see that content (the bio of the rock star). Another clue that this content is not really there, is when I try and run some code on that content. The content (from those external pages) have divs with specific names, and I try and make them into collapsible panels by running the following short function:
var IdentifyPanels = function() {
$("DIV.ContainerPanel > DIV.collapsePanelHeader > DIV.ArrowExpand").toggle(
function() {
[code]....
View 2 Replies
View Related