Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Javascript password strength not work if i make the js external!? why!?
Old 11-10-2007, 11:07 AM Javascript password strength not work if i make the js external!? why!?
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
okay i found a chunk of javascript which shows a basic weak/strong etc thing for passwords

but if i have it in a expternal file (is <script src="file") an not on the page it dont work!

why is this?

i know it isnt a wrong path i have tested and used with full url...

i want my js external so i can use them on sepertae pages etc. which i need to.

PLEASE explain!

im no javascripter and need help Lol.

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 11-10-2007, 12:12 PM Re: Javascript password strength not work if i make the js external!? why!?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
no idea do we get to see the code?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-10-2007, 03:27 PM Re: Javascript password strength not work if i make the js external!? why!?
rohan_india's Avatar
Novice Talker

Posts: 9
Name: Rohan Shenoy
Location: Thane-Vashi,Mumbai,India
Trades: 0
The code to include an external JS file is
Code:
<script src="filename.js">
</script>
You have to include the .js extension as well.

Then the next step you should see is in that external .js file, do you have the <script> at the starting of code and </script> at ending. If yes, you should remove them.

<script> & </script> tags are used to indicate that there is a script inbetween them. Because you are linking to a file with .js extension, it is understood that it is containing javascript. So you should remove the <script> and </script> tags.

Eg: If I was to include a external .js file to write Hello World, I would write on the below code in that file:
Code:
document.write("Hello World")
Note that I haven't included the script tags here
Hope that helps!
__________________
Medical entrance resources for MHT-CET:
Please login or register to view this content. Registration is FREE


My javascript showcase:
Please login or register to view this content. Registration is FREE
rohan_india is offline
Reply With Quote
View Public Profile Visit rohan_india's homepage!
 
Old 11-10-2007, 05:23 PM Re: Javascript password strength not work if i make the js external!? why!?
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
for some reason because i was plonking it in with a php echo ' ' so i had all the ' ' in the script \' ed out.

and for some reason when it was a external file (because i copied the \' ified code to the external file it wasnt parsing it

but i removed all the \' and now its working fine lol

so the whole include bit was fine.

okay... so why didnt it understand the code with quotes \' ified (i cant remember what thats called.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-10-2007, 08:16 PM Re: Javascript password strength not work if i make the js external!? why!?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
escaped

__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-10-2007, 08:19 PM Re: Javascript password strength not work if i make the js external!? why!?
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
THATS IT! Lol..

so why dont it work with the quotes escaped when its a external file?
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 11-10-2007, 09:36 PM Re: Javascript password strength not work if i make the js external!? why!?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
the \ is also the escape character in javascript, so the quotes would be treated as a literal character rather than a delimiter.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Javascript password strength not work if i make the js external!? why!?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40332 seconds with 12 queries