...

View Full Version : Help Needed with Javascript Code



Johnb21
09-02-2010, 02:11 AM
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

DaveyErwin
09-02-2010, 02:38 AM
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.

Old Pedant
09-02-2010, 02:41 AM
??? 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.

DaveyErwin
09-02-2010, 02:52 AM
??? 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

DaveyErwin
09-02-2010, 03:00 AM
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.

Johnb21
09-02-2010, 04:00 AM
Haha, yeah it's me :( please let me in on your secret mystery person

Johnb21
09-02-2010, 04:08 AM
??? 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

DaveyErwin
09-02-2010, 04:47 AM
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.:D

Johnb21
09-02-2010, 05:23 AM
So what is this "Easy Way" to solve this? I would appreciate the help :p

Old Pedant
09-02-2010, 05:25 AM
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:


<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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum