10 posts
  • United States
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
gillweb says

I am making a script for a client that would automatically populate the next drop down depending on the first drop down selection.. like this:

Select Make Of Vehicle: FORD

Select a Model: FUSION – FOCUS – TAURUS

etc…

I have yet to conquer AJAX but feel confident enough to do this through java script. My question here is: Would there be a problem with a javascript doing this with instead of AJAX due to web page loading? There would be alot of information in the selects since it’s going to be car makes and models. Any input on why i shouldn’t do it Javascript only?

Thanks…

1173 posts
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
Motionreactor says

AJAX is JavaScript….

“is a group of interrelated web development techniques used on the client-side to create interactive web applications or rich Internet applications.” – wikipedia

You may be thinking of AJAX being all about jQuery or MooTools, which are AJAX centric in their design… but they are very useful frameworks which make JavaScript easier by providing common functionality to solve common web development needs.

Hopefully that clears up your confusion.

10 posts
  • United States
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
gillweb says

I realize AJAX is Javascript but it also uses PHP or some other Server side language doesn’t it?

1173 posts
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
Motionreactor says
I realize AJAX is Javascript but it also uses PHP or some other Server side language doesn’t it?

Well it is true, this kind of use it quite common. You can just access the data from an XML file though, without the use of a server side language. Or, yes as you suggested… it can be completely contained in JavaScript, but then your data is embedded (which may or may not be an issue).

10 posts
  • United States
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
gillweb says

And that is where my question is. If using JS solely and having all of my options and arrays in a .js file will that be a problem and possibly slow down the webpage?

156 posts
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
  • Poland
  • Referred between 1 and 9 users
  • Sold between 1 and 100 dollars
Subeli says

gillweb i can make this functionality for you in AS3 and XML . If you are interested contact me throughout my contact form

10 posts
  • United States
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
gillweb says
And that is where my question is. If using JS solely and having all of my options and arrays in a .js file will that be a problem and possibly slow down the webpage?

I believe I can do the javascript myself but would it slow the webpage down to have all the options in the script itself? Would it be ‘better’ or safer to use an AJAX pulling from XML or database?

623 posts
  • Power Elite Author
  • Referred more than 2000 users
  • Power Elite Author: Sold between 2 000 000 - 4 999 999 dollars
  • Austria
  • Bought between 100 and 499 items
  • Has been a member for 6-7 years
+4 more
Kriesi says

to my mind it all comes down to how much data you need to load. if your initial pageload can handle loading all data upfront without slowing the page down then hiding the select boxes sound like a better option to me, since your form elements will respond faster when only using javascript and DOM Manipulation.

If you need to load alot of data (few hundred KB) then it might be smarter to load only requested data and do a few ajax requests when somehting changes..

10 posts
  • United States
  • Bought between 1 and 9 items
  • Has been a member for 5-6 years
gillweb says

Does an external .js file load immediately when the page loads or not until it’s called?

1173 posts
  • Australia
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Sold between 10 000 and 50 000 dollars
Motionreactor says
Does an external .js file load immediately when the page loads or not until it’s called?

If you reference it in the head it will load with the page, however I think the sequence of loading may mean you need to wait for the page to complete (the HTML DOM at least) and then initialise the script. jQuery has great functions that make this easier.

by
by
by
by
by
by