473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Javascript Shift Ciper Using Charcodeat And Fromcharcode

does anyone know how to complete the following,im trying to write a function that prompts for a message, and encode the message using shift cipher. mine does not work for some reason?

change = 0
while(change<Name.length )
{
document.write("<br/> ", fName.substr(change,1), Name.charCodeAt(change))
change++;

}
encode);


function encode()
{

document.write(+ " ", str.charCodeAt(1));
document.write(Str.fromCharCode(str));
document.write("<br />");

document.write(str);
Mar 18 '07 #1
1 2447
acoder
16,027 Expert Mod 8TB
Welcome to The Scripts.

If you're going to prompt for a message, presumably, the page has loaded. document.write should be used during page load, not after the page has loaded.

Instead use a div or a form text box and change the value dynamically using Javascript.

In your code, what's Name and fName? I don't think you've copy-pasted your code correctly.
Mar 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Peter | last post by:
Hi, I try to make up a javascript string which contains numeric numbers in any positions. For example, I want to make a string: secretcode, where secretcode.charAt(0)==(-21),...
13
by: Randell D. | last post by:
Folks, I have two related questions: 1. I have seen unicode being mentioned in my javascript pocket book - is this the same as ascii codes? I think not though I'm not sure and I can't find...
1
by: johoward | last post by:
The javascript we use to help protect against email address harvesting is causing the following error when trying to validate XHTML 1.0 Transitional: Line 91 column 172: character ";" not allowed...
5
by: Christian Blackburn | last post by:
Hi Gang, I would like to use a caesar cipher on the mailto: links in my website to prevent crawlers from farming the e-mails off my site. Can someone tell me the equivalents to Chr() and Asc()...
10
by: mistral | last post by:
I need help implement based64 decoding in javascript: a function to return a script that has been base64 encoded into a string (decoding in client side). For encode, online base64 encoder tool was...
8
by: Senderos | last post by:
Hello, i try to break this code, since many days (and nights), without any success : <script type="text/javascript"> function p(a,i,c) { var x=a.charCodeAt(i)+c;
5
by: ken.roberts | last post by:
Hello, I'm hoping someone might help us understand the code listed below. One of our clients has been having unknown Javascript appear in their home page. The client swears that they are not...
8
by: rajesh | last post by:
< script language = javascript c =...
11
by: adm1n | last post by:
Hi all, Sometime ago I wrote some automation tool to get content of some site. Everything worked fine untill one day... My C# code creted url string and made http hit. I used HttpRequest and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.