www.webdeveloper.com
Results 1 to 5 of 5

Thread: Get src.value

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    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.

  2. #2
    Join Date
    Mar 2011
    Posts
    4
    Oh sorry I forgot I am doing all this in firefox thats the only browser I can do everything in

  3. #3
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    Code:
    var xurl=document.getElementById("friendSelectTab1Content").location.href = src;
    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.
    Last edited by DanInMA; 03-30-2011 at 03:14 PM.

  4. #4
    Join Date
    Mar 2011
    Posts
    4

    Not sure best I can find

    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.

    HTML Code:
     <iframe style="height: 558px;" name="fbmlIFrame_0">
    it also possible this is the name i dont know here
    HTML Code:
    <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" >
    Last edited by tomkost; 03-30-2011 at 04:30 PM.

  5. #5
    Join Date
    Mar 2011
    Posts
    4
    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
    Code:
    function dget(e){ return document.getElementById(e);}
    top.location.href=dget("friendSelectTab2Content").childNodes[1].src;
    That function works in chrome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles