Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在joomsocial中使用aJax_Jquery_Joomla - Fatal编程技术网

Jquery 在joomsocial中使用aJax

Jquery 在joomsocial中使用aJax,jquery,joomla,Jquery,Joomla,我正在joomsocial中使用ajax注册用户。 我将使用ajax(jQuery ajax)将表单数据发送到服务器。 为此,我写了如下内容 $.ajax({ type: "POST", url: '...', data: $('#form_id').serialize(), success: function(data,status, jq){ } }); 我这里有一些问题: 如何在此处编写ajax的url? 我必须在何处实现此aJax的操作 我必须以哪种方式将结果以ph

我正在joomsocial中使用ajax注册用户。
我将使用ajax(jQuery ajax)将表单数据发送到服务器。

为此,我写了如下内容

$.ajax({
  type: "POST",
  url: '...',
  data: $('#form_id').serialize(),
  success: function(data,status, jq){
  }
});
我这里有一些问题:

  • 如何在此处编写ajax的url?
  • 我必须在何处实现此aJax的操作
  • 我必须以哪种方式将结果以php文件的形式发送以处理aJax
  • 请帮帮我。

    试试这个例子

    var data = "param1="+param1+"&param2="+param2;
    jQuery.ajax ({
    
            type: "GET",
    
            url: "index.php?option=com_virtuemart&controller=productdetails&task=your_function?",
    
            data: data,
    
            success: function(data) {
    
                alert(data);//here you will get your result as html/xml/json
    
            }
    
         });
    
    在这一点上,您必须提到一个函数,它是“task”,并且调用会转到您的case joomsocial的任何组件

    要将值从控制器发送到视图,可以使用

       $view = $this->getView('recommend', 'html');
       $view->setLayout('mail_confirmed');//just use the variable and object on the layout page from here.
       $view->display();
    

    这里有一个数据变量,您可以使用它来传递查询字符串。我有两个问题1。在controller.php中,如何设置必须发送到视图的值?2.鉴于此,我必须如何获得该值?谢谢应将JomSocial的代码更改为当前的VirtueMart;)@洛德:这只是一个例子:)