Question

I am not able to see the complete query parameter in chrome dev tools in query string contains "=". It shows only till "=" and truncates there after.

Firebug shows it properly. Please find the screenshots from firebug and chrome devtools for the ajax snippet shown here.

    var qstring = "Hello=Hai";

    $.ajax({
        type: 'POST'
        , url: "/cgi-bin/printenv.pl"
        , data: "query=" + qstring
        , dataType: 'xml'
        , timeout: 10000
        , success: function(jQuerySuccessData){
                    }
            });

Firebug shows the complete query parameter

Chrome dev tools doesn't show the complete query parameter

Is there any workaround available for this?

Thanks, Naga Kiran

Was it helpful?

Solution

You need to urlencode the query string as = is a reserved character. The easiest way to do this would be the escape function in javascript. Make sure you urldecode on the other side as well.

OTHER TIPS

jQuery Ajax uses contentType :"application/x-www-form-urlencoded" by default.

                $.ajax({
                    type: 'POST'
                    , url: (isCLI == false ? this.execUiQuery : this.execCli)
                    , data: qstring
                    , dataType: 'xml'
                    , contentType: 'text/plain'
                    , timeout: 10000
                  });

I have overriden this setting and set as "text/plain" using javascript edit in chrome devtools and its showing the complete query string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top