Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-13-2007, 01:56 PM   PM User | #1
Darth Sensei
New Coder

 
Join Date: Mar 2007
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Darth Sensei is an unknown quantity at this point
Retrieving Javascript

I'm attempting to use AJAX to create a configurator for the product my company sells. In essence, I'm importing from a php file the controls that are necessary to configure out product based on the selections the user makes in previous controls.

All of these choices involve javascript to control those controls and validate them. Is it possible to import Javascript as an attached sheet based on the AJAX?

For example, we sell signs and if the user orders a certain type of enclosure there are all sorts of rules to follow. Could I swap (or add) the attached script file on the fly so the user wouldn't be forced to download all of the Javascript for all of the choices beforehand? Much of this js they wouldn't need based on their choices.

Does this make sense?
Darth Sensei is offline   Reply With Quote
Old 04-16-2007, 04:09 PM   PM User | #2
david_kw
Senior Coder

 
Join Date: Nov 2006
Posts: 1,000
Thanks: 0
Thanked 0 Times in 0 Posts
david_kw will become famous soon enough
Yes it is possible (if I correctly understand your question). Here is the code I have in my library for it.

Code:
/* global eval code based on blog post on ajaxian written by Joseph Smarr */

exfer.evalCodeToGlobal = function (sJSCode) {
  if (window.execScript) {
    window.execScript(sJSCode);
    return null;
  }
  var globalNamespace = this;
  return(globalNamespace.eval ? globalNamespace.eval(sJSCode) : eval(sJSCode));
};
david_kw
__________________

www.eXfer.net
david_kw is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:54 AM.


Advertisement
Log in to turn off these ads.