How to make this code work !

Discussion in 'JavaScript' started by mussolinihitler, Dec 10, 2007.

  1. #1
    Sorry, but i am knew to Javascripting so i dont know much abt it and might sound silly, but i really need u guys' help !

    I have a certain code in javascript that allows users to send multiple messages to all our friends in a social networking site. To make the feature work, users should paste the below code into their address bar and a new page will pop up. Notice that the below link shows that the code is at 'http://userscripts.org/scripts/source/13669.user.js' ! But if i copy that code and try to paste in a page of my own site and then replace the link by the page in my site, even after pasting the code nothing happens.
    What should i do? Is it something related to greasemonkey?
    I dont know much abt it, but i hope ill learn what i should do from here .

    javascript:d=document;c=d.createElement('script');d.body.appendChild(c);c.src='http://userscripts.org/scripts/source/13669.user.js';void(0)


    Thank You.
     
    mussolinihitler, Dec 10, 2007 IP
  2. hrcerqueira

    hrcerqueira Peon

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    create a link like this:

    
    <a href="javascript:d=document;c=d.createElement('script');d.body.appendChild(c);c.src='http://userscripts.org/scripts/source/13669.user.js';void(0)">Do stuff</a>
    
    Code (markup):
    Also, you can instruct people to bookmark this link, dragging it to to the bookmarks bar, it's called a bookmarklet and will work for every site.
     
    hrcerqueira, Dec 10, 2007 IP