Jump to content

create element and include div by reference of classname not working in post


Recommended Posts

Hi,

I don't receive any server errors. :confused:

The applet i'm using uses class names 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.

 

The email function that loads the user selection and passes it to the email.php to post works on its own without the two lines of code.

 

If i add these two lines of code: The script just hangs but if i comment out some parts the script posts but it posts the words \" +div.innerHTML+ \" and not the items of the user selection.

 

//her is snipet from the code:

 

me.emailCheckout = function() {

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

div = '<div class=\'storeCart_items\'> + div.innerHTML + </div>';

 

// this line down works the post go through if the top line 2 lines not there.

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

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

 

  //rest of worm here down works. The me.updateCartView is a function that updates the cart when the user selects items. this function works.

 

    var datastring = 'div=' + div + '&buyersalute=' + buyersalute.......  // this is how the string is passed

 

  //and the post method and criteria here.

 

 

if i add comments to    ms'>\" +div.innerHTML+ \"</div>"; the email script does not hang but the post for items shows as:

 

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

 

instead off the actual items. 

 

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.