Running a Javascript Line Inside A Frame

Discussion in 'HTML & JavaScript' started by wehttam, Nov 11, 2009.

  1. wehttam

    wehttam Newbie

    Joined:
    Oct 15, 2008
    Messages:
    29
    Likes Received:
    0
     
  2. showboytridin

    showboytridin Regular Member

    Joined:
    Sep 5, 2009
    Messages:
    348
    Likes Received:
    716
    Location:
    127.0.0.1
    Don 't know if I understood everything. But if you want to change one page using javascript code on other page (or frames for example), forget it. That 's impossible.
     
  3. wehttam

    wehttam Newbie

    Joined:
    Oct 15, 2008
    Messages:
    29
    Likes Received:
    0
    but how come it works when I execute the code via the browsers address bar while I'm in the forum members list page, eg:

    pasting this in the firefox url bar and hit enter:

    HTML:
    javascript:elms=document.getElementById('friends').getElementsByTagName('li');for(var fid in elms){if(typeof elms[fid] === 'object'){fs.click(elms[fid]);}} 
     
  4. cyklotrial

    cyklotrial Regular Member

    Joined:
    Oct 13, 2008
    Messages:
    248
    Likes Received:
    82
    Location:
    Wonderland
    • Thanks Thanks x 1
  5. showboytridin

    showboytridin Regular Member

    Joined:
    Sep 5, 2009
    Messages:
    348
    Likes Received:
    716
    Location:
    127.0.0.1
    Because it 's on the same page. Never read this link before:

    Code:
    [URL="http://en.wikipedia.org/wiki/Same_origin_policy"]http://en.wikipedia.org/wiki/Same_origin_policy[/URL]
    But it 's very interesting (and logical!). If it were possible would be very critical.