ajax

illegal character in jsonp response

Hi i am doing an exercise where I am trying to scrape content of nytimes website using javascript/ajax. In order to send cross domain ajax request I am using a proxy server that returns me jsonp response with nytimes website content. But since that html content has some charaters (single quotes) which throws "Illegal Character" error. ...

How to access the text of a remotely loaded "<script>" element?

Hello :) Well i am currently trying to write an ajax enabled Manga reader application for onemanga using greasemonkey (more precisely js / jquery) my problem is that i need to execute one of the inline scripts on their page to update the next page url. so what i attempted was the following: $.get(nextPage,function(nxtHtm) // the varia...

Is Injecting Controlled HTML via AJAX a Security Concern?

Hello All, I have a specific case here in which I would like some security advice. Basically my question is "If I control what is in a database (no user submitted data), is there a security concern to returning the results of a database query in HTML (via AJAX)"? Here's the process that is happening: daily build generates an XML doc...

jquery callback called without waiting for response

hey, i am using the following function, $.ajax({ type: 'POST', url: "/User/SaveMyDetailsSettings", data: mySettings.MyDetailsForm.serialize(), success: function (data) { alert("callback"); alert(data); if (data == "Success") { window.location = "User/MySettings"; } else...

Need a better code for this Ajax code

Hi all, Is there another code or a better one for this code: window.onload = refresh(); function refresh() { xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { alert ("Browser does not support HTTP Request") return } var url="mypage.php" xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) } fun...

jQuery AJAX document trigger?

Hi, My jQuery code: $('.Img').click(function() { alert('Test'); }); $().ready(function() { $.ajax( { type : 'POST', url : 'Post.php', success : function(Response) { $('#Response').html(Response); } } }); My HTML code: <div id="Response"></div> <img class="Img" src="blan...

What is the difference between Javascript,Jquery and Ajax programming?

Hey I am new to javascript, Ajax and Jquery.. What are the difference in these programming. It seems Ajax and Jquery are using javascript. so what is the basic difference between these programming languages? ...

Execute JavaScript within responseHTML

When using responseHTML with XHR, Firefox executes the javascripts within the loaded responseHTML, chromium does not. if i add a script that will parse and execute the scripts, it will work on chromium but they result being executed twice in Firefox. Any idea how to know if browser will execute loaded scripts or not other than through ag...

Authenticating a client-side web service request in a cached environment

We're building a set of external web services to be consumed client-side (using jquery/AJAX) by visitors to our site. The web services need to be publicly available but we'd like to limit access to site visitors. Importantly, the site in question sits behind a CDN and we cache page content for 24 hours; AJAX requests would preferably b...

How to prevent JQuery change event from triggering when select's HTML is changed?

I have a select element that has a change event attached so that, when the user selects a new option, that text is placed into a corresponding input element. That's working fine: $("select[name='" + dropdown_name + "']").live("change", function() { text = $("select[name='" + dropdown_name + "'] option:selected").text(); $("#" + ...

What is the best method to dynamically sandbox inline JavaScript?

I have a WordPress plugin that loads pages with AJAX and to ensure compatibility with other plugins and "widgets." As of right now I use the following code to evaluate all inline JS that is inside the content blocks to be updated: function do_JS(e){ var Reg = '(?:<script.*?>)((\n|.)*?)(?:</script>)'; var match = ne...

How to get JQuery to accept a JSON reply?

Hi all, Here's some simple Javascript: (function($){ var ajax_callback = function(data) { window.location.hash = data.h1; }; $('.clickable').live('click', function() { $.post('server.fcgi', {}, ajax_callback, 'json'); } ); })(jQuery); The server is a c++ binary (yes, i know) that spits out (through...

call function in jquery-ajax

hello all i have a show function in my test.php page , how may i call show() function in ajax instead url:test.php in following code $.ajax({ url: **'test.php'**, success: function(result) { alert(ersult); } }); ...

Tomcat and Servlet issues

I'am encountering a problem with my Web Apps and cannot find any answers on the web. I have a Java Web App that works on parallel with tomcat and apache using mod_jk. Everything works fine, but after one day of running in tomcat, one of my main servlet doing ajax request stop working. All the others work fine. By this i ...

Using jQuery's live() function on calling a plugin?

Hi folks, So I have a plugin - jScrollPane - http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html - which is awesome, but, I want to apply it to an Ajax-generated div. How would I use jScrollPane in conjunction with jQuery's live()? Further info on live() can be found here: http://api.jquery.com/live/ Thanks! Jack ...

Reverse AJAX : LightStreamer v/s Direct Web Remoting

Hello, I'm trying to figure out the best framework to perform AJAX push to a web application using Java EE 5 on WebLogic server. I've reduced my alternatives to LightStreamer and Direct Web Remoting. But I would like to know what's the advantage of one on the other. I would be grateful if I could have an insight from people having exp...

Can i have a popup window in rdlc report using ajax

Can i have a popup window in rdlc report using ajax which disables the back page untill the popup is closed.? ...

Google maps api V3 - Adding multiple markers dynamically from query results

Hi there. I'm trying to set up a map on a page with a couple of links set up underneath that when clicked, will dynamically query my database and the result set output on the map. I've spent quite a lot of time googling this but can't find quite what I'm looking for. I've got as far as using AJAX to return the lat and lon coordinates OK,...

Using Spring and Jackson to Render JSON without affecting all Views

http://stackoverflow.com/questions/3121252/spring-mvc-ajax-and-json-using-custom-view-resolver-and-custom-view Here I've gotten a view to display JSON by adding ".json" to the end of a URL, but using this method a visitor to the site can just put .json at the end of any URL they please and often it will result in an exception that gives...

Rate Limiting with ASP.NET and the global.asax

What is a good simple way to only allow one request per IP per second using ASP.NET's global.asax file? Is there something else built-in to ASP.NET that I'm not thinking of? If possible I'd like to only ignore requests that are multiple POSTs from jQuery's Ajax functions. I'm trying to fix a pervasive problem in an existing legacy app. ...