Javascript help needed

Started on the old forum in January 2011 · view the original in the archive · old links redirect here

3 replies · 598 views · started 15 years ago · 1 min read

2 participants
phoenix90 Developer · 113 posts #1

HI there, I am very new to js and some help from experienced javascripters, below you will see a small snippet from my code that shows the pages to my online "BOOK"m what a want to do is just upload the pages from a uploader and the script below pickup the "pages in jpg" automatically. Is this possible??

onlinebook.pages = [

"pages/page-001.jpg",
"pages/page-002.jpg",
"pages/page-003.jpg",
"pages/page-004.jpg",
"pages/page-005.jpg",
"pages/page-006.jpg",

];

Thanks in advance

frostymarvelous Senior · 266 posts #2

phoenix90 wrote: HI there, I am very new to js and some help from experienced javascripters, below you will see a small snippet from my code that shows the pages to my online "BOOK"m what a want to do is just upload the pages from a uploader and the script below pickup the "pages in jpg" automatically. Is this possible??

onlinebook.pages = [

"pages/page-001.jpg",
"pages/page-002.jpg",
"pages/page-003.jpg",
"pages/page-004.jpg",
"pages/page-005.jpg",
"pages/page-006.jpg",

];

Thanks in advance

my js is a bit rusty, but i dont think so. first of all, the period "." is an operator. unless you are accessing a property, you need to change it. also the use of square brackets i think is wrong.

try

onlinebook_pages = array ( "pages/page-001.jpg", "pages/page-002.jpg", "pages/page-003.jpg", "pages/page-004.jpg", "pages/page-005.jpg", "pages/page-006.jpg", );

i might be missing a "new" somewhere but not too sure. im mostly into mobile so though i know js i dont really practice it. ive written some mean snippets though. really mean ones

Perfection comes at a cost

I accept liberty!

phoenix90 Developer · 113 posts #3

Hey, thanks. The code i submitted is working fine, just want it to auto fetch the files in that directory, rather me editing the file if i upload new pages ect

frostymarvelous Senior · 266 posts #4

Please give more details about the process you want to achieve.

Which directory are you referring to? the client's or yours?

Perfection comes at a cost

I accept liberty!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close