Follow us on Twitter!
One mans freedom fighter, another's terrorist.
Thursday, April 24, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 28
Guests Online: 23
Members Online: 5

Registered Members: 82901
Newest Member: sjs
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Page 1 of 2 1 2 >
Author

Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:15
Hello there people...
I've been studying and programming a webpage the whole day, and i'm completely tired... Before i go to sleep i typed the following code:

Code
<html>
<body>

<form id="welcome">
<input type="text" id="hello">
<input type="button" id="save" value="ok" onclick="display()">
</form>

<script type="text/javascript">
var name = document.welcome.hello.value
function display()
{
alert("Hello, " + name)
}
<script>


</body>
</html>




All i want it to do is to show me the name you type in the box.

There is a mistake in this, but i can't find it... :( My eyes hurt me too much now, and i can't go to sleep before figuring out what is the goddamn mistake. Can anyone please help me out here please? chess_rockie needs to sleep :P lol
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:25
chess_rock wrote:
<form name="welcome">
<input type="text" name="hello">
<input type="button" id="save" value="ok" onclick="display()">
</form>

<script type="text/javascript">
function display()
{
alert("Hello, " + document.welcome.hello.value);
}
<script>

Try that.


Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:28
it didn't work... Sad
tried that one already Sad
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:34
Zephyr_Pure wrote:
chess_rock wrote:
<form name="welcome">
<input type="text" name="hello">
<input type="button" id="save" value="ok" onclick="display()">
</form>

<script type="text/javascript">
function display()
{
alert("Hello, " + document.welcome.hello.value);
}
<script>

Try that.


<script> tag is not closed properly.


Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:38
THANK YOU!!!! GrinGrinGrinGrinGrinGrinGrinGrin
I spent a huge time looking and now i feel completely idiot for not seeing the not closed tag at the end...

thank you very much Smile

chess_rock's mind is saying silently: "chess_rock...you're stupid chess_rock...it was only a stupid tag!!!aaaaaaah!"

lmaoPfft
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:38
[edit]Well, it's already been resolved. One thing I do see that is that the <script></script> code is normally placed in the <head></head> tags. Another is to end your statements with semicolons.
Look into the FF add on Firebug. It allows you to view errors in HTML. It also allows you to edit other web sites (local changes until you refresh) coding so it is very useful for learning.




Edited by on 26-09-08 04:42
Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:39
sorry for the double post.... this is a good lesson since the mistake might be a very tiny and stupid thing...

second.... Admin can close and delete this thread! Wink
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:42
M4zh4r wrote:
<script> tag is not closed properly.

That's what I get for quoting without syntax-checking. Good catch.


Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:43
Take Pwnall's advice. It'll help to use firebug in such cases.


Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:43
Pwnzall wrote:
Try and see if you have Javascript enabled on your browser. Do you have Firefox? If so, look into an addon called Firebug. It will let you debug coding errors in your HTML.
One thing I do see that is that the <script></script> code is normally placed in the <head></head> tags. Another is to end your statements with semicolons.


thanks man... the thing is that i missed the "/" at the end for lack of attention... i'm using notepad++ and sometimes i miss some of firebug's features like correction.

about the head tags... this is only one code i'll work more tomorrow... i'll change it to be added to the cookies for people that login to be greeted.

and the semi colons... i was used to put them, but now, most browsers and progs don't require semi colons at the end, so i've stopped putting them. i'm what they call...lazy xP hehe
Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 04:46
M4zh4r wrote:
Take Pwnall's advice. It'll help to use firebug in such cases.


hehe... i will Smile the thing is that i had firebug, and then, when i upgraded firefox from 2.0 to 3.0, firebug was not compatible, and i didn't reinstall it. I'll look for it again Grin
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:57
Firebug is available with latest release of mozilla firefox 3.0.2.


Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 04:59
chess_rock wrote:
M4zh4r wrote:
Take Pwnall's advice. It'll help to use firebug in such cases.


hehe... i will Smile the thing is that i had firebug, and then, when i upgraded firefox from 2.0 to 3.0, firebug was not compatible, and i didn't reinstall it. I'll look for it again Grin


I installed FF 3.0.1 in it's own folder so that I was able to keep both, you could try that as well. However, you can not run both at the same time and my AV got "uppity" when I tried to rename the executable to do so.
I just checked, and indeed there is an update for Firebug compatible with FF3 as of 9/12.


Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 05:05
Firebug is only necessary when you have dynamically-generated HTML in a page. The Error Console should show you script errors just fine. Other than that... make it a habit to glance over your code before you publish it. Opening and closing tags is a fundamental concept that you need to grasp quickly.


Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 05:37
Zephyr, is it common or even acceptable in professional web programming to use:
Code

<? ?>
<% %>
<script type="text/php"></script>





I've adhered to the tags insisted upon by reputable sites, but I've seen these variants in codes I've studied on the web. How often do you review code at your job and stumble upon this?

Hopefully, I will be able to land a summer job as a PHP programmer/web designer when I turn 16, and I would like to know what to expect coming from someone in the field.




Edited by on 26-09-08 05:42
Author

RE: Stupid Javascript/HTML


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-09-08 12:53
In general, you'll only see <?php and ?> surrounding PHP code (except when the shorthand <?=$variable?> is being used). The <script> tags are generally just used for Javascript (or VBScript, too, I suppose).


Author

RE: Stupid Javascript/HTML

chess_rock
Member



Posts: 244
Location:
Joined: 20.02.08
Rank:
Apprentice
Posted on 26-09-08 16:27
It seems that the expression:

Code
<?   ?>




is becoming quite popular when talking about that...it is an abbreviation which might soon replace the old and common:

Code
<?php      ?>




a simplification of the language...
Author

RE: Stupid Javascript/HTML

yours31f
Member



Posts: 1678
Location: Dallas Texas
Joined: 27.04.07
Rank:
Elite
Posted on 26-09-08 20:45
I've also noticed it becoming more and more popular, but I don't see it as a bad thing, I mean it's the only language to have the <? in it that I know of so <?PHP would be unnecessary unless there is another. Anyways, Glad you found your mistake.


Debugging is what programmers do to beta software to make it take up more room on your hard drive if it is running too efficiently.


img259.imageshack.us/img259/3713/sigr.png

yours31f@live.com yours31f@yahoo.com rpwd.info
Author

RE: Stupid Javascript/HTML

fashizzlepop
Member



Posts: 482
Location: Old folks home.
Joined: 08.04.08
Rank:
Moderate
Posted on 27-09-08 07:01
Nobody said it was a bad thing...


"The definition of insanity is doing the same thing over and over again and expecting different results.
~Albert Einstein~


csullivan.codeinspire.net/images/boomsig2.png
fashizzlepop@gmail.com http://csullivan.codeinspire.net/
Author

RE: Stupid Javascript/HTML

sam207
Member



Posts: 55
Location: MY LOVELY COUNTRY NEPAL
Joined: 30.08.08
Rank:
Newbie
Posted on 27-09-08 12:22
I think <% %> will work if u change php.ini settings.. Also <?php ?> is the default one.. & u can use <? ?> but u can disable or enable this short style in php.ini settings.. & that <script> should also work..


www.techgaun.com
The signs of real hackers:
-he doesn't flame newbies.
-he doesn't stop learning.
-he doesn't hesitate to question no matter how much he is pro.

Winners don't do different things,they do things in different way - Shiva Kheda

www.hackers.org/sig/c/33439/NEPAL:NEVER ENDS PEACE N LOVE.png
img521.imageshack.us/img521/5784/sam207jr1.jpg
[url=http://www.hackers.org/profile/yours31f.html]T

Edited by sam207 on 27-09-08 12:26
ufuckingfaggot@msn.com fuckdaworld@yahoo.com http://www.techgaun.com
Page 1 of 2 1 2 >