Please help a newbie...

A

Al Murphy

Folks,

I've been given a heads-up on a Javascript project that I have to
do. As I'm a wee bit new to Javascript I'm wondering can you help me
please?
As part of the functionality of this project I have to do the
following:

1. Make a call to a remote box and cache some data on the page (I
believe JS can do this)

2. Extract a substring from a string

3. Detect a particular string and make decisions based upon it's value
(bunch of if-else statements)

Part 3 - I don't have any problems with. But part 1 and 2 is a bit
more challenging.
Can anyone offer any suggestions/comments/code snippets etc... on
either part 1 or 2 please?

Thanks a million,
Merci,
Al.
 
E

Evertjan.

Al Murphy wrote on 08 dec 2004 in comp.lang.javascript:
1. Make a call to a remote box and cache some data on the page (I
believe JS can do this)

What is a "remote box"?

A candy container in the Sahara ?


2. Extract a substring from a string

myResult = myString.substr(2,7)
 
M

Michael Winter

[snip]
1. Make a call to a remote box and cache some data on the page (I
believe JS can do this)

It *may* be possible to do this. See
2. Extract a substring from a string

That's simple enough:

string.substring(s, e)

where s and e are zero-order numbers; s denotes where extraction should
begin, and e specifies the (non-inclusive) end-point. For example:

'together'.substring(2, 5)

returns 'get'. Note that the string doesn't get modified; a new string is
returned.

[snip]

Hope that helps,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top