Jump to content

how can i upgrade this jquery code from 1.3.2.min.js to 1.4.3.min.js


antonyfal

Recommended Posts

there's deffinetly something wrong with the posting on this Jquery function and my site-- the posting doesn't work! i have really tried everything i can think of to save the Jquery script- but there comes a time when you have to scrap something and try something else. Plewase can some one help me with an ajax version of this script!- I have waisted too much time here on this Jquery function-- its not going to work on my site-- Sorry for the FA

NS of Jquery but im sure you had your moments too..

 

Any takers on an ajax versiion for posting Vars via ajax?

Link to comment
Share on other sites

The jquery post does not work! the code might be correct but it doesnt work on my sight: here is my attempt at a ajax post can you help to correct the mistakes here:

 

 

<?PHP 

if( !isset($_POST['div']) ){



echo "No items selected";



return;
}




$div = $_POST['div'];
$buyersalute = $_POST['buyersalute'];
$buyerfirstname = $_POST['buyerfirstname'];
$buyerlastname = $_POST['buyerlastname'];
$buyerstreet = $_POST['buyerstreet'];
$buyertown = $_POST['buyertown'];
$buyerregion = $_POST['buyerregion'];
$buyercountry = $_POST['buyercountry'];
$buyerpostalcode = $_POST['buyerpostalcode'];
$buyercontact = $_POST['buyercontact'];
$buyermobile = $_POST['buyermobile'];
$buyeremail = $_POST['buyeremail'];
$buyerprefpay = $_POST['buyerprefpay'];
$buyerspecreq = $_POST['buyerspecreq'];
$adminemail = $_POST['adminemail'];
$adminstorename = $_POST['adminstorename'];

$ADMIN_EMAIL 



= "'.$adminemail.'"; 
$EMAIL_SUBJECT 



= "'.$adminstorename.': '.$buyersalute.' '.$buyerlastname.' has placed an order.";
$BUYER_EMAIL 



= "'.$buyeremail.'"; 
$BUYEREMAIL_SUBJECT 



= "Hello '.$buyersalute.' '.$buyerlastname.' your order details.";

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: <' . $ADMIN_EMAIL . ">\r\n";
$headers .= "From: \"domain.com\" <https://www.domain.com> \r\n";

$body = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"



\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">

<html xmlns=\"http://www.w3.org/1999/xhtml\" dir=\"ltr\" lang=\"en-US\">

<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><title>" . $EMAIL_SUBJECT . "</title></head><body><table cols="2" width="100%">
<tr>
<td colspan="1">Name:</td> <td colspan="1">".$buyersalute." ".$buyerfirstname." ".$buyerlastname."</td></tr><tr>
<td colspan="1">Store Name:</td><td colspan="1">".$adminstorename."</td></tr><tr>
<td colspan="2">Address details:</td></tr><tr>
<td colspan="1">Street:</td> <td colspan="1">".$buyerstreet."</td></tr><tr>
<td colspan="1">Town: </td> <td colspan="1">".$buyertown."</td></tr><tr>
<td colspan="1">Region:</td> <td colspan="1">".$buyerregion."</td></tr><tr>
<td colspan="1">Country:</td> <td colspan="1">".$buyercountry."</td></tr><tr>
<td colspan="1">PostalCode:</td> <td colspan="1">".$buyerpostalcode."</td></tr><tr>
<td colspan="2">Contact Details:</td></tr><tr>
<td colspan="1">Email:</td> <td colspan="1">".$buyeremail."</td></tr><tr>
<td colspan="1">Phone:</td> <td colspan="1">".$buyercontact."</td></tr><tr>
<td colspan="1">Mobile:</td> <td colspan="1">".$buyermobile."</td></tr><tr>
<td colspan="2">Special Requests:</td></tr><tr>
<td colspan="1">Prefered Payment Method:</td> <td colspan="1">".$buyerprefpay."</td></tr><tr>
<td colspan="2">Special Requests:</td></tr><tr>
<td colspan="2">".$buyerspecreq."</td></tr><tr>
<td colspan="2">Order Details:</td></tr><tr>
<td colspan="2">".$div."</td></tr><tr>
</tr></table></body></html>";
$subject = $EMAIL_SUBJECT;

mail( $ADMIN_EMAIL, $subject, $body, $headers);
mail( $BUYER_EMAIL, $buyersubject, $body, $headers);

echo "Success! Thank you '.$buyersalute.' '.$buyerlastname.' your order has been placed.<br>A copy of the order details were also sent to this email address: '.$BUYER_EMAIL.'";


?>

 

 

here is the ajax:

 

 

 

 

<script>

me.emailCheckout = function() {

    var div = me.updateCartView( document.createElement("diver") );

    diver = "<div class='globalStoreCart_items'>" + div.innerHTML + "</div>";

    var buyersalute = getElementById("buyersalute");

    var buyerfirstname = getElementById("buyerfirstname");

    var buyerlastname = getElementById("buyerlastname");

    var buyerstreet = getElementById("buyerstreet");

    var buyertown = getElementById("buyertown");

    var buyerregion = getElementById("buyerregion");

    var buyercountry = getElementById("buyercountry");

    var buyerpostalcode = getElementById("buyerpostalcode");

    var buyercontact = getElementById("buyercontact");

    var buyermobile = getElementById("buyermobile");

    var buyeremail = getElementById("buyeremail");

    var buyerprefpay = getElementById("buyerprefpay");

    var buyerspecreq = getElementById("buyerspecreq");

    var adminemail = getElementById("adminemail");

    var adminstorename = getElementById("adminstorename");

 

var xmlhttp;

if (window.XMLHttpRequest)

  {// code for IE7+, Firefox, Chrome, Opera, Safari

  xmlhttp=new XMLHttpRequest();

  }

else

  {// code for IE6, IE5

  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

xmlhttp.onreadystatechange=function()

  {

  if (xmlhttp.readyState==4 && xmlhttp.status==200)

    {

    document.getElementById("theResponce").innerHTML=xmlhttp.responseText;

    }

  }

xmlhttp.open("POST","email.php",true);

xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");

xmlhttp.send("div=diver&buyersalute=buyersalute&buyerfirstname=buyerfirstname&buyerlastname=buyerlastname&buyerstreet=buyerstreet&buyertown=buyertown&buyerregion=buyerregion&buyercountry=buyercountry&buyerpostalcode=buyerpostalcode&buyercontact=buyercontact&buyermobile=buyermobile&buyeremail=buyeremail&buyerprefpay=buyerprefpay&buyerspecreq=buyerspecreq&adminemail=adminemail&adminstorename=adminstorename");

};

 

</script>

 

Link to comment
Share on other sites

I pinpointed the problem:

 

 

    var div = me.updateCartView( document.createElement("div") );

    div = "<div class='globalStoreCart_items'>" + div.innerHTML + "</div>";

 

without this lines of code the form does send--- I tried changing the var names and position in the list of vars but this two lines do not work..

 

Do you have a Jquery version of the two lines here? These two lines they do work on the demo of the cart script i have to add. But they don work on my site version which didn't change much..

Link to comment
Share on other sites

Listen... You need to take a step back and think about what we're saying. If you already have the jQuery library included, what you're doing now is basically fudging the code to work. I don't want to help you develop bad habits, I want to help you solve the main problem here -- simply because you're causing yourself more problems which will bring you back here to get more help.

 

I've not really read your other posts because you post way too much and are difficult to follow. Explain things clearly and keep it relevant. If you have a new issue separate to the original, please create a new thread to keep things organised and easy to follow.

Link to comment
Share on other sites

HERE IS THE PART NEEDS SOME ATTENTION!!! >:(

 

The applet i'm using uses classes as id's.  In this case the id is " class=\"storeCart_items "

Store cart items loads all the user selections from the cart script into the <div class="storeCart items"> stuff loads here dynaically from user choice<div>. IE: their product selections with price and details.

 

//this is the email function that loads the user selection and passes it to the email.php to post to both user and store admin.

//the script works but the Var div does not work! when i add the Var div to the posting the script hangs..

if i add "\" like so:    ms'>\" +div.innerHTML+ \"</div>"; the email script does work but the post for items shows as:

 

<div class=\"StoreCart_items\">\"  div.innerHTML  \"</div>Success!

 

instead off the actual items.

 

var div = me.updateCartView( document.createElement("div") );

    div = "<div class='globalStoreCart_items'>" +div.innerHTML+ "</div>";

 

//var buyersalute = jQuery("#buyersalute").val();

//var buyerfirstname = jQuery("#buyerfirstname").val();

 

And by the way Adam I never once asked you for any personal opinions! you can stick those up your f*cki*g ass!! I asked for some assistance from some who views this post. If you don't want to be part of the solution. Don't post and don't try to piss me off.

 

For anyone else then who can see something here that could be wrong. If you need more code please let me know.

Link to comment
Share on other sites

why im so  >:(

the one post is to find a ajax solution so i could exclude jquery all together. and learn something about ajax basic (IN MY WAY).. This over here was to learn about some BASICS about Jquery. Which i think i did, and i covered a lot.

Now should i start a new topic for this last post or leave it here, because now i got double posting warning for two different questions  :confused:

Link to comment
Share on other sites

And by the way Adam I never once asked you for any personal opinions! you can stick those up your f*cki*g ass!! I asked for some assistance from some who views this post. If you don't want to be part of the solution. Don't post and don't try to piss me off.

 

Enough.  All Adam said was:

 

A. You're doing things in an odd way.

 

B. It's difficult to see what you're trying to do because you're going a hundred miles an hour.  We don't know what your project is, so we don't have the frame of reference you do.  You write as though you assume we all are following your progress.  We're not.

 

C. He said he didn't want to help in a way that would teach you bad habits.

 

With that said, here are a few things to keep in mind:

 

1. We are not obligated to help you, or anyone else.  We, even those of us with pretty badges, are all volunteers.  We don't see one red cent from being here.  So, before you cop an attitude and try to tell one of the team members off, remember that we're giving you free access to legit professionals who are volunteering out of the goodness of their hearts.

 

2. Since we are professionals, we like steering our members down the right path.  We're not going to give you an answer that will make you a worse developer down the road.  We have standards, and if you don't like that, you're free to find a place that will give you whatever hacks are necessary to make your code 'work'.

 

3. You need to learn how to write intelligent questions.  The quality of answers received is directly proportional to the quality of questions given.  If answers aren't to your liking, and if we keep asking for clarity, don't assume we're idiots who are trying to work against you.  For all questions, you should have:

 

  A. What you're attempting to do in clear terms

  B. What code you're using to get those results - relevant code only

  C. How the results differ from what was expected in explicit terms, including full error/warning text with line numbers, and the lines clearly marked in the post

 

Don't assume we're following along with your posts spread throughout various subforums.  We see thousands of messages a day.  We don't tend to keep track of what each member is doing.

 

In short, you're among professionals here.  If you can't behave appropriately, we don't want you.  You're not a precious snowflake, and neither you nor your problems are more important than any other member's.

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.