Javascript Tooltip / Posts /

work with mvc3 razor

0
i test tooltip by mvc 3 razor but give me error what is wrong with me i used this syntax

  var myAjaxSetting = {
            context: { index: -1 },
            success: callback2,
            responseType: "html"
        };

 <a onmouseover="var r = Math.floor(Math.random()*100); tooltip.ajax(this, '/Home/UpdateVotes/'+r,{success:callback2, responseType:'json'}, {position:0});" class="tooltip">Tooltip Loading Demo</a>

david  10 years ago   viewed: 3816    

3 Answers

0
Just don't split the ajax setting into two parts. So your Tooltip code should be like:
<a onmouseover="var r = Math.floor(Math.random()*100); tooltip.ajax(this, '/Home/UpdateVotes/'+r,{success:callback2, responseType:'json', position:0});" class="tooltip">Tooltip Loading Demo</a>

Also make sure your callback2 function exists on the page.
milo   10 years ago
0
i looked at your site but can not found any document about  this function:

tooltip.ajax(this, '/Home/UpdateVotes/'+r,{success:callback2, responseType:'json'}, {position:0})

can you help me please?

what is +r means and when i change 'html' to 'jason' it works not my calback2 function is available and works fine

var myAjaxSetting = {
            context: { index: -1 },
            success: callback2,
            responseType: "html"  <------------ in this line whene change html to jason makes error
        };
david   10 years ago
0
I just copied the +r from your code. If you don't know what it means, where does it come from?
milo   10 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: