Connecting Tech Pros Worldwide Help | Site Map

I have a question on pulling a web page in javascript

 
LinkBack Thread Tools Search this Thread
  #1  
Old February 9th, 2006, 05:15 PM
Brie
Guest
 
Posts: n/a
Default I have a question on pulling a web page in javascript

I have a user preferences page where users select what city they're
with. Once they choose that a certain page shows in a portlet on their
intranet page. I can't get this to work. Here's the code I have for
it to show those corresponding pages. Does anyone know what i'm doing
wrong? Any help would be greatly appreciated.

<script type="text/javascript">

for (var i = 0; i < cityName; i++)
if (cityName.toLowerCase() ==
cityName[i].cityName.toLowerCase())
{
open (weatherURL);
break;
}

var cityName = [
{ cityName: 'austin',
weatherURL: "austin.html" },
{ cityName: "albany",
weatherURL: "albany.html" },
{ cityName: "amsterdam",
weatherURL: "amsterdam.html" },
{ cityName: "beijing",
weatherURL: "beijing.html" },
{ cityName: "berlin",
weatherURL: "berlin.html" }

];


</script>


Thanks!
Brie


  #2  
Old February 9th, 2006, 06:55 PM
David Dorward
Guest
 
Posts: n/a
Default Re: I have a question on pulling a web page in javascript

Brie wrote:
[color=blue]
> <script type="text/javascript">
> for (var i = 0; i < cityName; i++)[/color]

So you loop through cityName ...
[color=blue]
> var cityName = [[/color]

.... /before/ cityName exists.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 

Bookmarks

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.