10 posts
  • Has collected 1+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 5 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
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
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
  • Has collected 1+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 5 years
gillweb says

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

1173 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
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
  • Has collected 1+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 5 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
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $1+ on Envato Market
  • Has collected 10+ items on Envato Market
+1 more
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
  • Has collected 1+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 5 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?

631 posts
  • Has referred more than 5000 members
  • Has sold $2M+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Had an item featured in a magazine
+9 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
  • Has collected 1+ items on Envato Market
  • Located in United States
  • Has been part of the Envato Community for over 5 years
gillweb says

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

1173 posts
  • Has been part of the Envato Community for over 5 years
  • Located in Australia
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by