/    Sign up×
Community /Pin to ProfileBookmark

Get src.value

I am new at javascript.I have been figuring things out as I go and help from different forums.Thanks in advance for any help.

What I am trying to do is strictly on my computer from the user end.I combine javascript with imacro to save time from.

I run into a problem with a page that has numerous frames and the frames # keeps changing on me.I have a frame name for it and tried using that for imacro but it doesnt work right and the better solution would be for me to get the url of the frame as a var then stick that into the rest om my code.

This is the HTML in the page.
<div class=”friendSelectTabContent active” id=”friendSelectTab1Content”> <iframe src=”http://THIS IS THE VALUE I NEED TO GET” >

i was hoping something like this would work

var xurl=document.getElementById(“friendSelectTab1Content”).value = src;

gBrowser.addTab(xurl);

also what would work was if some one had a function that would return the count of frames on the page.It just so happens that the frame number that I need is alway the newest frame.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@tomkostauthorMar 30.2011 — Oh sorry I forgot I am doing all this in firefox thats the only browser I can do everything in
Copy linkTweet thisAlerts:
@DanInMAMar 30.2011 — [CODE]var xurl=document.getElementById("friendSelectTab1Content").location.href = src;[/CODE]

no wait that wont work. does the iframe have a name or ID associated with it? I dont know how I missed that but your current example and the one I just posted both target the div and not the iframe you are trying to access.
Copy linkTweet thisAlerts:
@tomkostauthorMar 30.2011 — I can't find anything closes to it giving it a name.I did find this farther up in the html that might be it.

[code=html] <iframe style="height: 558px;" name="fbmlIFrame_0"> [/code]

it also possible this is the name i dont know here
[code=html]

<iframe class="canvas_iframe_util" frameborder="0" scrolling="no" id="iframe_canvas" name="iframe_canvas" src='javascript:""' style="height: 30000px; "></iframe>

<div class="friendSelectTabContent active" id="friendSelectTab1Content"> <iframe src="http://THIS IS THE VALUE I NEED TO GET" >
[/code]
Copy linkTweet thisAlerts:
@tomkostauthorMar 30.2011 — If this helps I added a extension to same page that injects several functions in to it for me and I used this to take frame into its own window but I cant get it to work in firefox and everything would make more sense for me to get url then just pop it out
<i>
</i>function dget(e){ return document.getElementById(e);}
top.location.href=dget("friendSelectTab2Content").childNodes[1].src;


That function works in chrome
×

Success!

Help @tomkost spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...