javascript - jQuery .insertAfter() and .append() not working with AJAX call -


I'm trying to do something that I thought I did 100 times earlier ... I'm getting I am trying to put a new image after AJAX call and putting it in a suitable, pre-existing divas

HTML looks like this

   

The AJAX call does this:

  $ Post ("script.php", {phone: phone}, function (data) {if (data) {var newImage = "& lt; img src = 'https: //api.twilio.com" + Data + "/ & Gt; "$$ (new image) .inertAfter ('create');}});  

I have also tried:

  $ ("& lt; img src = 'https: //api.twilio.com" + data + "/>").insertAfter('createYourOwn ');  

And this:

  $ (new image) .append ('.preload');  

Although not the desired result.

I would like to include the image obtained with the data after the .createYourOwn div inside .preload

Not sure what is happening but nothing is happening, there is no error, even there is no image with a borched src .

Thank you !!

align right:

change it :

  var newImage = "& lt; img src = 'https: //api.twilio.com" + data + "/>"; // You are here to stop quoting for ^^ ^^  

src:

  var newImage = "& lt; img src = 'Https: //api.twilio.com "+ Data +"' /> ";  

Or switch the quotes:

  var newImage = '& lt; Img src = "https://api.twilio.com '+ data +'" / & gt; ';  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -