Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    63
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Help Needed with Javascript Code

    I am still learning javascript so forgive me if this question is a bad one, I am making scripts for Greasemonkey for a website I am a part of. One of the developers recently commented out (in the source code) a feature that was available before. It is a Football MMORPG game and it used to show college players 40 times but over the past month he commented out the tag that held the script function. I want to know if i can either

    A) write a js code that can remove the comment tag in the source code

    or

    B) write a code that will just add another tag under that and have that js function that was commented out valid.

    I tried something but ended up just having that function pasted onto the page instead of having it put into the source to have it read by the rest of the data.. here is what im talking about

    <TABLE width=800 cellspacing=0>
    <tr>
    <td colspan=3 style="FONT-SIZE: 11pt">
    <b>Hometown:</b>Fort Hunt,&nbsp;VA<br>
    <b>Height:</b>6-0<br>

    <b>Weight:</b>206<br>
    <!--b>40 Time:</b><if rs("team_id")>0 or bRated then><=formatnumber(rs("forty"),2)><br><end if -->

    i just want to see if there was any way to just delete the comment out of it so i can get this feature again is all. Any help would be awesome... and sorry for the long post

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Johnb21 View Post
    A) write a js code that can remove the comment tag in the source code

    or

    B) write a code that will just add another tag under that and have that js function that was commented out valid.


    Maybe just add the commented out javascript code to the html file.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,206
    Thanks
    80
    Thanked 4,566 Times in 4,530 Posts
    ??? That doesn't look like JavaScript. It looks like VBScript code. Are you sure it's not server-side code?? Or is that normal for GreaseMonkey??

    ANYWAY...

    We could simply clone that line, removing the comments in the process. But since it's not pure HTML and it's not valid JavaScript, I have no idea what the effect of doing so might be.

    ***************

    EDIT: Nope, that's not GreaseMonkey code. I just checked the GM docs. It is apparently some kind of server-side code. Looks to be ASP code.

    I don't think it will work to simply remove the comments unless it is running on a server that will support ASP and has the proper DB installed and I dunno what else.
    Last edited by Old Pedant; 09-02-2010 at 03:47 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Old Pedant View Post
    ??? That doesn't look like JavaScript. It looks like VBScript code. Are you sure it's not server-side code?? Or is that normal for GreaseMonkey??

    ANYWAY...

    We could simply clone that line, removing the comments in the process. But since it's not pure HTML and it's not valid JavaScript, I have no idea what the effect of doing so might be.

    ***************

    EDIT: Nope, that's not GreaseMonkey code. I just checked the GM docs. It is apparently some kind of server-side code. Looks to be ASP code.

    I don't think it will work to simply remove the comments unless it is running on a server that will support ASP and has the proper DB installed and I dunno what else.
    http://userscripts.org/topics/59466

  • #5
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Johnb21 View Post
    I am still learning javascript so forgive me if this question is a bad one, I am making scripts for Greasemonkey for a website I am a part of. One of the developers recently commented out (in the source code) a feature that was available before. It is a Football MMORPG game and it used to show college players 40 times but over the past month he commented out the tag that held the script function. I want to know if i can either

    A) write a js code that can remove the comment tag in the source code

    or

    B) write a code that will just add another tag under that and have that js function that was commented out valid.

    I tried something but ended up just having that function pasted onto the page instead of having it put into the source to have it read by the rest of the data.. here is what im talking about

    <TABLE width=800 cellspacing=0>
    <tr>
    <td colspan=3 style="FONT-SIZE: 11pt">
    <b>Hometown:</b>Fort Hunt,&nbsp;VA<br>
    <b>Height:</b>6-0<br>

    <b>Weight:</b>206<br>
    <!--b>40 Time:</b><if rs("team_id")>0 or bRated then><=formatnumber(rs("forty"),2)><br><end if -->

    i just want to see if there was any way to just delete the comment out of it so i can get this feature again is all. Any help would be awesome... and sorry for the long post
    Jdog21b is this you ?
    If it is there is a very simple solution.

  • #6
    New Coder
    Join Date
    Sep 2010
    Posts
    63
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Haha, yeah it's me please let me in on your secret mystery person

  • #7
    New Coder
    Join Date
    Sep 2010
    Posts
    63
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by Old Pedant View Post
    ??? That doesn't look like JavaScript. It looks like VBScript code. Are you sure it's not server-side code?? Or is that normal for GreaseMonkey??

    ANYWAY...

    We could simply clone that line, removing the comments in the process. But since it's not pure HTML and it's not valid JavaScript, I have no idea what the effect of doing so might be.

    ***************

    EDIT: Nope, that's not GreaseMonkey code. I just checked the GM docs. It is apparently some kind of server-side code. Looks to be ASP code.

    I don't think it will work to simply remove the comments unless it is running on a server that will support ASP and has the proper DB installed and I dunno what else.
    yeah its running on an asp server and everything in the database is still there, it is just that it is commented out here and that is the only change that was made

  • #8
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Quote Originally Posted by Johnb21 View Post
    Haha, yeah it's me please let me in on your secret mystery person
    No secrets and no mysteries,
    glad to see you've come over here.

  • #9
    New Coder
    Join Date
    Sep 2010
    Posts
    63
    Thanks
    1
    Thanked 2 Times in 2 Posts
    So what is this "Easy Way" to solve this? I would appreciate the help

  • #10
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,206
    Thanks
    80
    Thanked 4,566 Times in 4,530 Posts
    You would have to go change the "*.asp" file. That is, change the code that the server sees.

    He made it a comment in the HTML, but the actual original ASP code would have been:
    Code:
    <b>40 Time:</b><% if rs("team_id")>0 or bRated then %><%=formatnumber(rs("forty"),2)%><br><%end if%>
    He removed the % characters so the ASP code wouldn't even dump the values in there as a comment. (It's not the best way to comment out ASP code, but it works.)

    Anyway, won't do any good to change the code as the browser sees it if the ASP page doesn't see what I show you there.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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