Home >Web Front-end >HTML Tutorial >Problems with using juery and ajaxPro together, such as content_html/css_WEB-ITnose

Problems with using juery and ajaxPro together, such as content_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:41:341473browse

前台:
 jQuery(document).ready(function($) 
            {
                $("#div1").mouseover(function() {
                    alert('ddddddd');
                });
                $("#btnGetValue").click(function() {

                    var vUrl = $("#hUrl").val();
                    $.ajax(
                                     {
                                         type: "POST",
                                         url: vUrl,
                                         data: null,
                                         beforeSend: function(xhr) {
                                             xhr.setRequestHeader("ajaxpro-method", "HelloWorld");
                                         },
                                         success: function(s) {
                                             alert(s);

                                             var a = document.getElementById("div");
                                           a.innerHTML=  s;
                                         }

                                     });

                });
            });



    


    

        

            

      
      

    

    




后台:
 AjaxPro.Utility.RegisterTypeForAjax(typeof(Default3));
             if (!IsPostBack)
             {
                 string path = "/WebSite1/ajaxpro/Default3,";
                 path += typeof(Default3).Assembly.FullName.Split(',')[0];
                 path += ".ashx";
                 hUrl.Value = path;

             }
[AjaxPro.AjaxMethod]
 public string HelloWorld()
         {
             return "
aaaa
"; }
There is a DIV1 mouse sliding over the event. In the background, the sliding event does not execute why it can perform online.


Reply to the discussion (solution)

This question has not been answered until now. But I used other methods to achieve it. Bonus points if anyone can achieve it

This question has not yet been answered. There is no answer, but I used other methods to achieve it. If anyone can achieve it, extra points


I don’t quite understand why the poster uses ajaxpro on the premise of using $.ajax.
Directly calling Default3.HelloWorld().value cannot meet your requirements?

If you have to use this method to access
$.ajax(
                                          type: "POST",
url: vUrl,
beforeSend: function ( xhr) {
                                                           xhr.setRequestHeader("X-" AjaxPro.ID "-Method", "HelloWorld ");
                                                           hr.setRequestHeader("Connection", "close"); // Mozilla Bug #246651
                                                             },
success: function (s) {
                                                                         );
                                                                                                                       );
The above supports non-ie series. If you are interested in the ie series request, please see the core.ashx and other files in ajaxpro
How is the xmlhttp request constructed in ajaxpro


This question has not been answered yet, but I implemented it using other methods. If anyone can achieve it, extra points


I don’t quite understand why the poster uses ajaxpro on the premise of using $.ajax
Directly calling Default3.HelloWorld().value cannot meet your requirements?

If you have to use this method to access
$.ajax(
                                         type: "POST",
url: vUrl,
beforeSend: function ( xhr) {
                                                             xhr.setRequestHeader("X-" AjaxPro.ID "-Method", "HelloWorld ");
                                                           hr.setRequestHeader("Connection", "close"); // Mozilla Bug #246651
                                                             },
success: function (s) {
                                                                         );
                                                                                                                       );
The above supports non-ie series. If you are interested in the ie series request, please refer to the core.ashx and other files in ajaxpro
How is the xmlhttp request in ajaxpro structured in ajaxpro?
What I want to say is that after two years, I will It feels so low to come back and read my previous question. I actually laughed
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn