Jump to content

[SOLVED] using the same object?


acidglitter

Recommended Posts

i'm really new to ajax so i'm not completely sure on the regular way to code things. this is what i have now to start an object:

 

var object = false;
if(window.XMLHttpRequest){
object = new XMLHttpRequest();
} else if(window.ActiveXObject){
object = new ActiveXObject("Microsoft.XMLHTTP");
}

 

 

what i have been doing is using javascript to start a function, then putting that code at the beginning of the function to create the object. for each thing i'm using ajax for i have a new function and a new object created for it. should i just keep doing it that way? or would it be better to start the object at the top of the page, then have each function just use that object over and over again?

Link to comment
Share on other sites

i'll try looking at their site, but like that other person said, i like trying to understand it all myself, and besides that, for me, just using someone elses code takes most of the fun out of programming for me. i like experimenting and editing every little detail

Link to comment
Share on other sites

well i'm looking at some jquery tutorials and its looking really interesting. i might actually end up using it for a couple of my sites and just edit or add a few things :)

for now i think i'll just keep creating new objects with each function. thanks for the link :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.