Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question 1

Status
Not open for further replies.

LarrySteele

Programmer
May 18, 2004
318
US
I can't believe I'm asking this question.

I found javascript for Base64 encoding: The problem is that I can't seem to figure out how to use the script [blush]

I correctly presumed the following would not work:
[tt]var e = encode('hello world');[/tt]

So how do I use this script?

TIA,
Larry
 
is that all you did? Simply type in:

var e = encode('hello world'); ???

Did you put the script on your page?

Did you try to display the value of "e" once it was encoded???

Please post the full implementation

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Hi

There is defined a method not a function. So :
Code:
[b]var[/b] e [teal]=[/teal] [highlight]Base64[teal].[/teal][/highlight][COLOR=darkgoldenrod]encode[/color][teal]([/teal][green][i]'hello world'[/i][/green][teal]);[/teal]

Feherke.
 
is that all you did?" Nope, all I posted. Started getting verbose, but didn't want to bore with the obvious.

Right now it's an external file, with src attribute set so the script tag can find it.

[tt]
var e = encode('hello world');
alert(e);
[/tt]

Alert displays "Undefined";

Removed the src attribute from the script tag and put the complete script on page. Refreshed the page and as expected I received same results. Returned the script to external file.




 
feherke,

I swear, I attempted the very same thing with no joy. I wonder if I tried base64.

Oh, it's been a really long week.

This is one of those times when I wish we could delete our posts! [blush]

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top