3

I am using a web app called ProcessMaker.

They do not have support for jquery. So I had to figure out how to integrate it myself. There were lots of people on their forums trying to get it done, so thankfully it now has been documented. If anyone would like to do so here is the link where I have detailed the process: jQuery with ProcessMaker

My question is now using the jquery ajax request. In order to use jquery with processmaker I had to overcome 2 problems. The first the Smarty filtering since processmaker uses templating langauge. And the second the Maborak lib doesn't allow certain things. So now I believe it to be a maborak issue, but I do not know for certain. All I know when I try to run my code, the error console (firefox 4.x) gives me the following error: jqXHR[i] is not a function. This is happening at line 7323 of my jquery lib that I included (version 1.6.2).

I have Googled, and all I have come up with so far is that people are saying it can possibly be a befreSend issue and that disabling it fixes it. Maybe I don't know how to disable it properly, but it isnt working still.

If anyone can help me with this, it would be very greatly appreciated.

Thanks, Zedd

Zedd
  • 31
  • 3

4 Answers4

0

before: you need declare this: var $j = jQuery.noConflict();

and... you must don't use $() any more

instead:

use $j()

example:

// Use jQuery via $j(...)
$j(document).ready(function() {
    $j("div").hide();
});

that's all

Edward Falk
  • 9,991
  • 11
  • 77
  • 112
0

In Processmaker exist a library "makorak" this library generate problems with other libraries.. hence you Should use jquery as follows...


var $JQ = jQuery.noConflict();

$JQ("#myField").value = 'cochalo';


hope I've helped

0

Try this:

$.noConflict();
jQuery(document).ready(function($)){

    $("button").click.function(){

        $("p").text("jquery is still working");
    }

}
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
0

read new documentation about ajax in dynaform in this

or

Write this function

function ajax(url, callback, error, method, cache, async) {
    async = async || true;
    //alert(cache);
    if (typeof(cache) == 'undefined') {
        cache = false;
    }
    if (typeof(method) == 'undefined') {
        method = 'GET';
    }
    if (window.XMLHttpRequest) // code for IE7+, Firefox, Chrome, Opera, Safari
    {
        xmlhttp = new XMLHttpRequest();
    } else // code for IE5, IE6
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = function() {

        if (xmlhttp.readyState == 4) {
            if (xmlhttp.status == 200) {
                if (typeof(callback) == 'function') {
                    callback(xmlhttp.responseText);
                }

            } else {

                if (typeof(error) == 'function') {
                    error(xmlhttp.status);
                } else {
                    alert('خطا : لطفا مجددا تلاش کنید.');
                }


            }


        }

    }
    var d = new Date();
    var n = d.getTime();
    var getExplode = url.split("?");
    scriptName = url;
    param = '';
    if (getExplode.length > 1) {
        scriptName = getExplode[0];
        param = getExplode[1];
        if (cache == false) {
            param = param + "&n=" + n;
        }

    } else {
        if (cache == false) {
            param = param + "n=" + n;
        }
    }

    if (method.toLowerCase() == 'post') {
        xmlhttp.open("POST", scriptName, async);
        xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlhttp.send(param);

    } else {
        xmlhttp.open("GET", scriptName + '?' + param, async);
        xmlhttp.send();
    }



}

and use it like this

var url = ajaxUrl + "OperationRenovation.php?Command=GetDetail&IdDarkhast=" + ID + "&Code=" + Code + "&Mabna=" + Mabna;
ajax(url, function(Response) {
    alert(response);
}, function() {
    alert('مشکل در برقراری ارتباط با سرور');
}, 'post');
ashkufaraz
  • 5,179
  • 6
  • 51
  • 82