SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript syntax question

    <iframe src="http://bazul.org" id="lol"></iframe>
    <script>setTimeout("document.getElementById('lol').src=\"Javascript:location.href='http://www.mundodavid.com/';'+alert('hello there!!')\"",5000);</script>
    Why is this not working? I want to change the iframe's url and to show the alert exactly like that, is that possible?

    And this?
    <iframe src="http://bazul.org" id="lol"></iframe>
    <script>setTimeout("document.getElementById('lol').src=\"Javascript:location.href='http://www.mundodavid.com/';'+get_Time(arg)\"",5000);</script>
    At least i know this works:

    Javascript:location.href='http://www.google.com/';alert('lol');

    Like this test here

    Thanks!

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try
    Code:
    setTimeout(function(){
        document.getElementById("lol").src = "http://www.mundodavid.com";
        alert("Hello there");
    }, 5000);

  3. #3
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, my idea is to inject the code to the new page that opens.
    If i do:

    document.getElementById("lol").src = "Javascript:location.href='http://www.mundodavid.com';alert(document.cookie);

    Is different that:

    setTimeout(function(){
    document.getElementById("lol").src = "http://www.mundodavid.com";
    alert(document.cookie);
    }, 5000);

  4. #4
    SitePoint Addict Mr Jojo's Avatar
    Join Date
    May 2007
    Posts
    322
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes i'm looking for a way to steal cookies from other domains.


    Dont start throwing rocks at me, i'm no hacker, just a script kiddie that wants to know what's out there and a good way to protect cookies agains this attacks.


Bookmarks

Posting Permissions

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