Closed Thread
Results 1 to 10 of 10

Thread: Help with JavaScript ASAP

  1. #1
    Anicho is offline Newbie
    Join Date
    Nov 2009
    Posts
    14
    Rep Power
    0

    Help with JavaScript ASAP

    Well anyway, fourteen years old, and have to use a free host, and therefore I cannot access HTML. I got to do with JavaScript. But for some reason, this script won't work.

    I want it to do the function "load", but for some reason it's not working, the pages aren't showing errors for me? :shrugs:

    Code:
    <script>
    if(location.href.match('post/')){
    document.write("<iframe style='display:none' id='ZBI' name='ZBI'></iframe>");
    
    function load(){
    post = document.getElementsByName('Post')[0].value;
    document.getElementById('ZBI').src = "(link removed)?post="+ post +"";
    }
    
    // Do "load" on Submit
    button = document.getElementsByTagName('button');
    for(i=0;i<button.length;i++){
    if(button[i].type == "submit" && button[i].innerHTML == "Submit Post"){
    button[i].onClick = load
    break;
    }
    }
    </script>

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: Help with JavaScript ASAP

    my guess would be that the form fires the "submit()" and ignores the click event from the submit button
    try running the "load" on the "onsubmit()" event of the form
    "
    form.onsubmit=load;
    "
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  4. #3
    Anicho is offline Newbie
    Join Date
    Nov 2009
    Posts
    14
    Rep Power
    0

    Re: Help with JavaScript ASAP

    I don't have access to HTML.


    This script only works in IE, so I really don't know what I'm doing wrong with poor Firefox.

  5. #4
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: Help with JavaScript ASAP

    why the sad face we are here
    i found out how to fix it, i tried similar code and found out that this:
    Code:
    button[i].onClick = load
    will not work with the "C" capital , i know this may sound crazy but its the reason try this, instead:
    Code:
    button[i].onclick = load
    its tested and im sure of it, enjoy
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  6. #5
    Anicho is offline Newbie
    Join Date
    Nov 2009
    Posts
    14
    Rep Power
    0

    Re: Help with JavaScript ASAP

    Nope, it still only works on IE and Opera, but it still doesn't work on Firefox. I thought Opera was fussy with JavaScript. This is the first time I've had a problem with Firefox.

  7. #6
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: Help with JavaScript ASAP

    can i have a link ?
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  8. #7
    Anicho is offline Newbie
    Join Date
    Nov 2009
    Posts
    14
    Rep Power
    0

    Re: Help with JavaScript ASAP

    I tried, it doesn't work, believe me
    I just don't know why it won't though.

    I highly suspect it's this part of code, but where >.<
    Code:
    button = document.getElementsByTagName('button');
    for(i=0;i<button.length;i++){
    // Just thinking could it be if(button[i].type?
    if(button[i].type == "submit" && button[i].innerHTML == "Submit Post"){
    button[i].onClick = load
    break;

  9. #8
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: Help with JavaScript ASAP

    hmm,
    are you sure you are using "button" not "input"?
    remove this " button[i].type == "submit" " and try, what happens?
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  10. #9
    Anicho is offline Newbie
    Join Date
    Nov 2009
    Posts
    14
    Rep Power
    0

    Re: Help with JavaScript ASAP

    I got it working on Firefox, because I did load() onclick instead of load.
    But now, I'm having troubles getting a textarea value in a variable, Firefox issue only

  11. #10
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    Re: Help with JavaScript ASAP

    glad you got the first problem solved
    i think it would be better to use innerHTML to get value of a textarea
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need Help ASAP
    By chad in forum PHP Development
    Replies: 9
    Last Post: 04-09-2010, 07:27 AM
  2. Hey Guys Need help asap on this javascript
    By LuiDaHottest in forum JavaScript and CSS
    Replies: 12
    Last Post: 01-18-2010, 09:06 PM
  3. help ASAP pls...
    By mdeenny in forum C and C++
    Replies: 2
    Last Post: 10-29-2009, 07:06 PM

Tags for this Thread

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