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 03-19-2012, 12:50 PM   PM User | #1
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Comverting Ajax call to jquery

Hello Guys,

I need some help converting this ajax call to a jquery but I am clueless to how to do it.. Please advise

Here is my code

PHP Code:
<script type="text/javascript">
  function 
loadXMLDoc(imgID,isSold,order)
  {
  if(
isSold == 1)
  $(
'.soldWatermark').css('display','');
  else
  $(
'.soldWatermark').css('display','none');
  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==&& xmlhttp.status==200)
  {
  
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;

  }
  }
  
xmlhttp.open("GET","artist_title.php?imgid=" imgID ,true);
  
xmlhttp.send();
  }



</script> 
dk4210 is offline   Reply With Quote
Old 03-19-2012, 12:57 PM   PM User | #2
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Getting Object doesn't support this property or method

The reason I want to change it to jquery is because I am seeing a strange error.

When loading my site in IE - http://frameworksgallery.com/view_ar...id=Baskin_Fran

1. I click on the second thumbnail.
2. I click on the third thumb
3. I go back to the second thumb

The large image does not display after re clicking.

IE web developer tool says it is this that it's having an issue with

PHP Code:
xmlhttp=new XMLHttpRequest(); 
dk4210 is offline   Reply With Quote
Old 03-19-2012, 01:01 PM   PM User | #3
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Did you write that code?

Is
Code:
$('.soldWatermark').css('display','');
jQuery code?
webdev1958 is offline   Reply With Quote
Old 03-19-2012, 01:10 PM   PM User | #4
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
I wrote it yes
dk4210 is offline   Reply With Quote
Old 03-19-2012, 02:15 PM   PM User | #5
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Any takers?
dk4210 is offline   Reply With Quote
Old 03-19-2012, 02:19 PM   PM User | #6
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by dk4210 View Post
Any takers?
You haven't answered my second question yet, which is your choice to make obviously, just as it is then my choice to not reply from here on.

Hopefully someone else will help you
webdev1958 is offline   Reply With Quote
Old 03-19-2012, 02:21 PM   PM User | #7
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Wow? Bad morning for ya huh?
dk4210 is offline   Reply With Quote
Old 03-19-2012, 02:27 PM   PM User | #8
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by dk4210 View Post
Wow? Bad morning for ya huh?
No not all But if you choose to not answer my question, surely you're not sugessting that I should then answer yours anyway are you?

Last edited by webdev1958; 03-19-2012 at 02:33 PM..
webdev1958 is offline   Reply With Quote
Old 03-19-2012, 02:44 PM   PM User | #9
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Well I appreciate your attempt to help me.. You didnt have to offer any help, but you did.

To answer the other half of your question. I am not sure.. I believe it's ajax actually..
dk4210 is offline   Reply With Quote
Old 03-19-2012, 02:55 PM   PM User | #10
webdev1958
Banned

 
Join Date: Apr 2011
Posts: 656
Thanks: 14
Thanked 69 Times in 69 Posts
webdev1958 can only hope to improve
Quote:
Originally Posted by dk4210 View Post
To answer the other half of your question. I am not sure.. I believe it's ajax actually..
ok, then if you're unsure and you think

Code:
$('.soldWatermark').css('display','');
is AJAX then either you didn't write that code like you claim or I have no idea what I'm talking about here so hopefully someone else will help you.

Good luck
webdev1958 is offline   Reply With Quote
Old 03-19-2012, 02:58 PM   PM User | #11
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Maybe SOME ONE else will
dk4210 is offline   Reply With Quote
Old 03-19-2012, 03:25 PM   PM User | #12
dk4210
New Coder

 
Join Date: Nov 2002
Posts: 99
Thanks: 13
Thanked 0 Times in 0 Posts
dk4210 is an unknown quantity at this point
Issue resolved. Found answer on another board..Very helpful folks over there

Here is the code

PHP Code:
$.ajax({
    
url"artist_title.php",
    
data"imgid=" imgID,
    
success: function(data)
    {
        $(
"#myDiv").html(data);
    }
}); 
dk4210 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 07:12 AM.


Advertisement
Log in to turn off these ads.