Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: "test12.aspx/GetHtmlTest",
- //data: "{ 'Dividend': '" + $("#Dividend").val() + "' }",
- data: "{}",
- // Error!
- error: function(xhr, status, error) {
- // Boil the ASP.NET AJAX error down to JSON.
- //var err = eval("(" + xhr.responseText + ")");
- // Display the specific error raised by the server
- //alert(err.Message);
- alert("AJAX Error!");
- },
- success: function(msg) {
- $("#queuediv1").removeClass('isequeue_updating');
- $("#queuediv1").html(msg);
- //an unorderd list with the tag "browserxx" was just inserted into the div
- $("#browserxx").treeview();
- }
- });
- });
- $(document).ready(function() {
- for (i= 1;i<=4;i++)
- {
- var divname ="#queuediv"+i;
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: "test12.aspx/GetHtmlTest",
- // data would be populated differently so that each div gets its own result- for now it doesn't matter
- //data: "{ 'Dividend': '" + $("#Dividend").val() + "' }",
- data: "{}",
- // Error!
- error: function(xhr, status, error) {
- // Boil the ASP.NET AJAX error down to JSON.
- //var err = eval("(" + xhr.responseText + ")");
- // Display the specific error raised by the server
- //alert(err.Message);
- alert("AJAX Error!");
- },
- success: function(msg) {
- $(divname).removeClass('isequeue_updating');
- $(divname).html(msg);
- $("#somethingfromthemsg").treeview();
- }
- });
- }
- });
- $(document).ready(function() {
- for (i= 1;i<=4;i++)
- {
- (function (){
- var divname ="#queuediv"+i;
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: "test12.aspx/GetHtmlTest",
- data: "{}",
- error: function(xhr, status, error) {
- alert("AJAX Error!");
- },
- success: function(msg) {
- $(divname).removeClass('isequeue_updating');
- $(divname).html(msg);
- $("#somethingfromthemsg").treeview();
- }
- });
- })();
- }
- });
- <div id="output1"></div><div id="output2"></div><div id="output3"></div><div id="output4"></div><div id="output5"></div>
- <script language="javascript">
- for(var a=1; a<=5; a++) {
- (function (){
- var divName = "output" + a;
- var b = a;
- setTimeout(function(){document.getElementById(divName).innerHTML = b;}, 2000);
- })();
- }
- </script>
- function makeSuccessFunc (divname) {
- return function (msg) {
- $(divname).removeClass('isequeue_updating');
- $(divname).html(msg);
- $("#somethingfromthemsg").treeview();
- };
- };
- $(document).ready(function() {
- for (i= 1;i<=4;i++)
- {
- var divname ="#queuediv"+i;
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- dataType: "json",
- url: "test12.aspx/GetHtmlTest",
- // data would be populated differently so that each div gets its own result- for now it doesn't matter
- //data: "{ 'Dividend': '" + $("#Dividend").val() + "' }",
- data: "{}",
- // Error!
- error: function(xhr, status, error) {
- // Boil the ASP.NET AJAX error down to JSON.
- //var err = eval("(" + xhr.responseText + ")");
- // Display the specific error raised by the server
- //alert(err.Message);
- alert("AJAX Error!");
- },
- success: makeSuccessFunc (divname)
- });
- }
- });
Add Comment
Please, Sign In to add comment