ajax

JS load image on click

十年热恋 提交于 2021-02-05 12:28:37
问题 I need to load an image, js need to get link url and print this image on screen. But it is not working. What is wrong with my script? what can I do to make it work and improve it? html <div id=img></div> <div id=loading></div> <a href=http://png-5.findicons.com/files/icons/1580/devine_icons_part_2/128/my_computer.png class=postmini>Open image 1</a> <br> <a href=http://www.iconshock.com/img_jpg/BETA/communications/jpg/256/smile_icon.jpg class=postmini>Open image 2</a> js $(function() { $("

How to access my variables in a web method?

∥☆過路亽.° 提交于 2021-02-05 11:14:07
问题 I am using ASP.NET Webforms and in one page I want to make an AJAX call to a web method in the code behind. The problem is that web methods are static and I can't access page variables. I need to be able to have Ninject inject a dependency. Is there a way to do this in a web method? public partial class Default : Ninject.Web.PageBase { [Inject] public ISecurityController SecurityController { get; set; } [WebMethod] public static string DoSomething() { SecurityController.WriteToLog(); // Can't

jquery posting data attribute to the next page

北慕城南 提交于 2021-02-05 09:46:34
问题 I am trying to post data stored in a data-attr to the next page, here is my code First i add a class and data-attr to all anchor tags like this: jQuery("a").addClass("wptl_link"); jQuery('a').attr('data-wptl_ip', '<?php echo $_SERVER['REMOTE_ADDR']; ?>'); I have checked my source code when uploaded and this works fine. I would like to add functionality to each anchor tag, to submit the data-attr of that anchor to the next page. I am now not quite sure on what to do. I have read into .ajax and

How can I build real time system in asp.net?

偶尔善良 提交于 2021-02-05 09:28:25
问题 I am building an asp.net application for a health care domain. I need to keep the page to reflect real time updates. One way is to refresh the page after every x minutes but it may increase the load if there is no update. Moreover doing like this may not get the exact real time data. I want to achieve the almost complete real time functionality. How it can be done in ASP.NET C#..? 回答1: Have a look at SignalR https://github.com/SignalR/SignalR and http://www.hanselman.com/blog

Ajax not sending request to localhost on same port

时光毁灭记忆、已成空白 提交于 2021-02-05 08:09:16
问题 I have a node (express) server running at localhost:3000 . On another hand, I have an HTML ( client.html ) file which is served by the server itself, on the route /client (the file is sent as the response). My goal here is to access another route, namely /test using an AJAX call on the client.html page (WHICH IS SERVED BY THE SAME SERVER). However, as it's quite obvious from the post, it isn't working. Not a duplicate : I have tried the solutions given in the following SO posts, so far,

Ajax not sending request to localhost on same port

℡╲_俬逩灬. 提交于 2021-02-05 08:08:52
问题 I have a node (express) server running at localhost:3000 . On another hand, I have an HTML ( client.html ) file which is served by the server itself, on the route /client (the file is sent as the response). My goal here is to access another route, namely /test using an AJAX call on the client.html page (WHICH IS SERVED BY THE SAME SERVER). However, as it's quite obvious from the post, it isn't working. Not a duplicate : I have tried the solutions given in the following SO posts, so far,

Ajax not sending request to localhost on same port

旧城冷巷雨未停 提交于 2021-02-05 08:08:43
问题 I have a node (express) server running at localhost:3000 . On another hand, I have an HTML ( client.html ) file which is served by the server itself, on the route /client (the file is sent as the response). My goal here is to access another route, namely /test using an AJAX call on the client.html page (WHICH IS SERVED BY THE SAME SERVER). However, as it's quite obvious from the post, it isn't working. Not a duplicate : I have tried the solutions given in the following SO posts, so far,

Ajax not sending request to localhost on same port

梦想的初衷 提交于 2021-02-05 08:07:59
问题 I have a node (express) server running at localhost:3000 . On another hand, I have an HTML ( client.html ) file which is served by the server itself, on the route /client (the file is sent as the response). My goal here is to access another route, namely /test using an AJAX call on the client.html page (WHICH IS SERVED BY THE SAME SERVER). However, as it's quite obvious from the post, it isn't working. Not a duplicate : I have tried the solutions given in the following SO posts, so far,

Ajax not sending request to localhost on same port

家住魔仙堡 提交于 2021-02-05 08:07:27
问题 I have a node (express) server running at localhost:3000 . On another hand, I have an HTML ( client.html ) file which is served by the server itself, on the route /client (the file is sent as the response). My goal here is to access another route, namely /test using an AJAX call on the client.html page (WHICH IS SERVED BY THE SAME SERVER). However, as it's quite obvious from the post, it isn't working. Not a duplicate : I have tried the solutions given in the following SO posts, so far,

Submit after a jquery-ajax function

旧巷老猫 提交于 2021-02-05 07:55:28
问题 I check two values with ajax. And if both are correct then i want to make a submit (post-back). But the post-back doesn't work. Here is the code: $('form').submit(function () { var correctCaptcha = false; var correctWebcode = false; $.ajax({ url: '/Competition/CheckForm', type: "POST", data: $(this).serialize(), success: function (data) { if (data == true) { $('#recaptcha_response_field').removeClass("captchaError"); correctCaptcha = true; } else { Recaptcha.reload(); $('#recaptcha_response