This is something that someone who is familiar with javascript might know
off the top of their heads. Unfortunately (for myself), I'm not one of those
people who are familiar with javascript.
If the frames/iframes are not for a document in the same domain, then forget it. Otherwise, it is best to go after the location object -- not the src attribute.
The frames should have names -- not ids. Then, you can use that code in your function to set the url for the frames using the location object -- not the src attribute.
The frames should have names -- not ids. Then, you can use that code in your function to set the url for the frames using the location object -- not the src attribute.
I know - the frames have names - and that's what I'm using - but I still
get a friggin' null reference - and it's driving me nuts!!!
I'll keep plugging - there's got to be a reason why its null.
Well, the HTML you posted has ids -- that is why I said something. Don't shoot the messenger.
Hi Mr Nobody;
Yes - they have id's - but they also have names.
I was trying the id's in the hope that it might get a result of some kind.
Not shooting the messenger here - I want you to know that - and know that
your assistance is greatly appreciated. AAMOF, you might have given me
the answer, it's just that - for reasons not yet known to me - the expression
comes up null.
if you want to set the src tag, you can use document.getElementById("...").src="...";
Windows XP Professional
256MB RDRAM (damn expensive)
120GB HD, 2.56GHz P4 Processor
Only 64MB GeForce4 Vid Card /w TV-Out
Wish I had money to buy more RAM lmao
If you care to explain to me the process through which you're trying to accomplish something, then I can tell you how to apply the information I've given you.
If you care to explain to me the process through which you're trying to accomplish something, then I can tell you how to apply the information I've given you.
Hi Mr Nobody;
As I mentioned in my initial post, I'm just trying to load the paths for the
Frames within a frameset dynamically using Javascript. This shouldn't be
anything difficult, but it seems to be for me - maybe I'm just dense or
something:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
function set_src_on_frames ()
{
var Qstr = opener.get_the_querystring ();
// This is the stuff that I've tried - to no avail:
//parent.frames['frame_01'].document.setAttribute
//document.frames['frame_01'].setAttribute
//frames['frame_01'].setAttribute
// This is the stuff that I've tried - to no avail:
//parent.frames['frame_02'].document.setAttribute
//document.frames['frame_01'].setAttribute
//frames['frame_01'].setAttribute
You can delay the execution of your function as follows:
Code:
window.onload = set_src_on_frames;
Hi Mr. Nobody;
I thought for sure you had given me the answer when I first read your post.
I was crestfallen when I got the same friggin' error messages for a null reference.
These are the messages that I got, as I tried each option from the code below
(in reset_URLs_in_frameset):
ERROR: 'top.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames.CPSTrans02a.location' is null or not an object
ERROR: 'window.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames["CPSTrans02a"].document' is null or not an object
ERROR: 'top.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames.CPSTrans02a.location' is null or not an object
ERROR: 'window.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames.CPSTrans02a.location' is null or not an object
ERROR: 'self.frames["CPSTrans02a"].document' is null or not an object
those errors are because instead of assigning the function to the onload event, you are calling it. and then come what mrnobody has explained you in post #13 "not to execute the function before document render". this is the line in question according to your code:
Code:
window.onload = reset_URLs_in_frameset ();
notice that mrnobody example don't include the function call (the parenthesis).
my mom is javascript, dad is javascripter, granpa is javascriptor, and my little sister is javasRidiculous. my nature language is javascript, then come spanish and english -- me
Bookmarks