Search Results

Search found 59301 results on 2373 pages for 'asp net ajax'.

Page 168/2373 | < Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >

  • .NET - Where can I start? [closed]

    - by mustang2009cobra
    I'm a moderately experienced developer with experience developing using a variety of languages. I've done C++, Java, PHP, Javascript, and several other languages. I remember the Java dev stack being rather difficult to dive into, but it's nothing like the endless sea of the .NET framework. I'd like to become experienced in .NET development, as many dev shops are microsoft-centric. But I'm a little unsure as to where the best place to start is. As I already know a bunch of programming languages, I don't really need resources that will help me learn C# or any of the .NET languages as much as I need to learn the development stack, APIs, etc. Any suggestions on the best way to start learning .NET development?

    Read the article

  • Selectively Including files in C#.net web application [migrated]

    - by segnosaur
    I am attempting to modify an application with the following characteristics: Written in C#.net Using Visual Studio 2010 The application uses a Master sheet to maintain commonality The Master sheet has the following: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="mysheet.master.cs" Inherits="master_mysheet" %> Now, currently, the master sheet has an include file that brings in a common footer: #include file="inc/my-footer.inc" Here's what I want to do: I would like to modify the master sheet to be able to read in a footer based on the value contained in a session variable... i.e. (not real code, but just something to give an idea of what I want) if session("x") = "a" then #include file="inc/my-footer1.inc" else #include file="inc/my-footer2.inc" My first instinct was to go with some vbscript: <script type="text/vbscript" language="vbscript"> document.write("vbscript example.") </script> However, it doesn't run the vbscript code automatically on page load. Does anyone know: - The syntax I need to actually get this to work? i.e. to get the vbscript to run automatically on page load, AND to do the page include? - Or, is there a better way to go about this? (perhaps by doing some coding in C#) Note: I am experienced in C#; however, I haven't done any vbscript since the days of ASP classic, so my knowledge there is out of date.

    Read the article

  • validation in datagrid while insert update in asp.net

    - by abhi
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default7.aspx.cs" Inherits="Default7" % <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" % Untitled Page   <telerik:GridTemplateColumn Visible="false"> <ItemTemplate> <asp:Label ID="lblEmpID" runat="server" Text='<%# bind("pid") %>'> </asp:Label> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn UniqueName="Fname" HeaderText="Fname" DataField="Fname" CurrentFilterFunction="NotIsNull" SortExpression="Fname"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Lname" HeaderText="Lname" DataField="Lname" CurrentFilterFunction="NotIsNull" SortExpression="Lname"> </telerik:GridBoundColumn> <telerik:GridBoundColumn UniqueName="Designation" HeaderText="Designation" DataField="Designation" CurrentFilterFunction="NotIsNull" SortExpression="Designation"> </telerik:GridBoundColumn> <telerik:GridEditCommandColumn> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column"> </telerik:GridButtonColumn> </Columns> <EditFormSettings> <FormTemplate> <table> <tr> <td>Fname*</td> <td> <asp:HiddenField ID="Fname" runat="server" Visible="false" /> <asp:TextBox ID="txtFname" runat="server" Text='<%#("Fname")%>'> </asp:TextBox> <asp:RequiredFieldValidator ID="EvalFname" ControlToValidate="txtFname" ErrorMessage="Enter Name" runat="server" ValidationGroup="Update"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td>Lname*</td> <td> <asp:HiddenField ID="HiddenField1" runat="server" Visible="false" /> <asp:TextBox ID="txtLname" runat="server" Text='<%#("Lname")%>'> </asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtLname" ErrorMessage="Enter Name" runat="server" ValidationGroup="Update"> *</asp:RequiredFieldValidator> </td> </tr> <tr> <td>Designation* </td> <td> <asp:HiddenField ID="HiddenField2" runat="server" Visible="false" /> <asp:TextBox ID="txtDesignation" runat="server" Text='<%#("Designation")%>'> </asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtDesignation" ErrorMessage="Enter Designation" runat="server" ValidationGroup="Update"> *</asp:RequiredFieldValidator> </td> </tr> </table> </FormTemplate> <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> </EditColumn> </EditFormSettings> </MasterTableView> </telerik:RadGrid> </form> this is my code i want to perform validation using the required validators but i think m missing smthin so pls help, here's my code behind using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; using Telerik.Web.UI; public partial class Default7 : System.Web.UI.Page { string strQry; public SqlDataAdapter da; public DataSet ds; public SqlCommand cmd; public DataTable dt; string strCon = "Data Source=MINETDEVDATA; Initial Catalog=ML_SuppliersProd; User Id=sa; Password=@MinetApps7;"; public SqlConnection con; protected void Page_Load(object sender, EventArgs e) { } protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) { dt = new DataTable(); con = new SqlConnection(strCon); da = new SqlDataAdapter(); try { strQry = "SELECT * FROM table2"; con.Open(); da.SelectCommand = new SqlCommand(strQry,con); da.Fill(dt); RadGrid1.DataSource = dt; } finally { con.Close(); } } protected void RadGrid1_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { con = new SqlConnection(strCon); cmd = new SqlCommand(); GridDataItem item = (GridDataItem)e.Item; string pid = item.OwnerTableView.DataKeyValues[item.ItemIndex]["pid"].ToString(); con.Open(); string delete = "DELETE from table2 where pid='"+pid+"'"; cmd.CommandText = delete; cmd.Connection = con; cmd.ExecuteNonQuery(); con.Close(); } protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) { GridEditableItem radgriditem = e.Item as GridEditableItem; string pid = radgriditem.OwnerTableView.DataKeyValues[radgriditem.ItemIndex]["pid"].ToString(); string firstname = (radgriditem["Fname"].Controls[0] as TextBox).Text; string lastname = (radgriditem["Lname"].Controls[0] as TextBox).Text; string designation = (radgriditem["Designation"].Controls[0] as TextBox).Text; con = new SqlConnection(strCon); cmd = new SqlCommand(); try { con.Open(); string update = "UPDATE table2 set Fname='" + firstname + "',Lname='" + lastname + "',Designation='" + designation + "' WHERE pid='" + pid + "'"; cmd.CommandText = update; cmd.Connection = con; cmd.ExecuteNonQuery(); con.Close(); } catch (Exception ex) { RadGrid1.Controls.Add(new LiteralControl("Unable to update Reason: " + ex.Message)); e.Canceled = true; } } protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) { GridEditFormInsertItem insertitem = (GridEditFormInsertItem)e.Item; string firstname = (insertitem["Fname"].Controls[0] as TextBox).Text; string lastname = (insertitem["Lname"].Controls[0] as TextBox).Text; string designation = (insertitem["Designation"].Controls[0] as TextBox).Text; con = new SqlConnection(strCon); cmd = new SqlCommand(); try { con.Open(); String insertQuery = "INSERT into table1(Fname,Lname,Designation) Values ('" + firstname + "','" + lastname + "','" + designation + "')"; cmd.CommandText = insertQuery; cmd.Connection = con; cmd.ExecuteNonQuery(); con.Close(); } catch(Exception ex) { RadGrid1.Controls.Add(new LiteralControl("Unable to insert Reason:" + ex.Message)); e.Canceled = true; } } }

    Read the article

  • ajax redirect dillema, how to get redirect URL OR how to set properties for redirect request

    - by Anthony
    First, I'm working in Google Chrome, if that helps. Here is the behavior: I send an xhr request via jquery to a remote site (this is a chrome Extension, and I've set all of the cross-site settings...): $.ajax({ type: "POST", contentType : "text/xml", url: some_url, data: some_xml, username: user, password: pass, success: function(data,status,xhr){ alert(data); }, error: function(xhr, status, error){ alert(xhr.status); } }); The URL that is being set returns a 302 (this is expected), and Chrome follows the redirect (also expected). The new URL returns a prompt for credentials, which are not being pulled from the original request, so Chrome shows a login dialog. If I put in the original credentials, I get back a response about invalid request sent (it's a valid HTTP request -- 200 -- the remote server just doesn't like one of the headers). When viewing the developer window in Chrome, there are two requests sent. The first is to the original URL with all settings set in the ajax request. The second is to the redirect URL, with a method of "GET", nothing from the "POST" field, and no credentials. I am at a loss as to what I can do. I either need to: Get the redirect URL so I can send a second request (xhr.getResponseHeader("Location") does NOT work), Have the new redirect request preserver the settings from the original request, or Get the final URL that the error came from so I can send another request. Ideally I don't want the user to have to put in their credentials a second time in this dialog box, but I'll take what I can get if I can just get the final URL.

    Read the article

  • Javascript - jquery ajax post error driving me mad

    - by Exception Duck
    Can't seem to figure this one out. I have a web service defined as (c#,.net) [WebMethod] public string SubmitOrder(string sessionid, string lang,int invoiceno,string email,string emailcc) { //do stuff. return stuff; } Which works fine, when I test it from the autogenerated test thingy in Vstudio. But when I call it from jquery as $j.ajax({ type: "POST", url: "/wservice/baby.asmx/SubmitOrder", data: "{'sessionid' : '"+sessionid+"',"+ "'lang': '"+usersettings.Currlang+"',"+ "'invoiceno': '"+invoicenr+"',"+ "'email':'"+$j(orderids.txtOIEMAIL).val()+"',"+ "'emailcc':'"+$j(orderids.txtOICC).val()+"'}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (msg) { submitordercallback(msg); }, error: AjaxFailed }); I get this fun error: responseText: System.InvalidOperationException: Missing parameter: sessionid. at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection) at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request) at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() data evaluates to: {'sessionid' : 'f61f8da737c046fea5633e7ec1f706dd','lang': 'SE','invoiceno': '11867','email':'[email protected]','emailcc':''} Ok, fair enough, but this function from jquery communicates fine with another webservice. Defined: c#: [WebMethod] public string CheckoutClicked(string sessionid,string lang) { //*snip* //jquery: var divCheckoutClicked = function() { $j.ajax({ type: "POST", url: "/wservice/baby.asmx/CheckoutClicked", data: "{'sessionid': '"+sessionid+"','lang': '"+usersettings.Currlang+"'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { divCheckoutClickedCallback(msg); }, error: AjaxFailed }); }

    Read the article

  • search form in html/php via ajax

    - by fusion
    i've a search form wherein the database query has been coded in php and the html file calls this php file via ajax to display the results in the search form. the problem is, i would like the result to be displayed in the same form as search.html; yet while the ajax works, it goes to search.php to display the results. search.html: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="scripts/search_ajax.js" type="text/javascript"></script> </head> <body> <form id="submitForm" method="post"> <div class="wrapper"> <div class="field"> <input name="search" id="search" /> </div><br /> <input id="button1" type="submit" value="Submit" class="submit" onclick="run_query();" /><br /> </div> <div id="searchContainer"> </div> </form> </body> </html> if i add action="search.php" to the form tag, it displays the result but on search.php. i'd like it to display on the same form [i.e search.html, and not search.php] if i just add the javascript function [as done above], it displays nothing on search.html

    Read the article

  • jQuery AJAX Character Encoding Problem

    - by Salty
    Hi everyone, I'm currently coding a French website. There's a schedule page, where a link on the side can be used to load another day's schedule. http://aquate.us/film/horaire.html (At the moment, only the links for November 13th and November 14th work) Here's the JS I'm using to do this: <script type="text/javascript"> function load(y) { $.get(y,function(d) { $("#replace").html(d); mod(); }); } function mod() { $("#dates a").click(function() { y = $(this).attr("href"); load(y); return false; }); } mod(); </script> The actual AJAX works like a charm. My problem lies with the response to the request. Because it is a French website, there are many accented letters. I'm using the ISO-8859-15 charset for that very reason. However, in the response to my AJAX request, the accents are becoming ?'s because the character encoding seems to be changed back to UTF-8. How do I avoid this? I've already tried adding some PHP at the top of the requested documents to set the character set: <?php header('Content-Type: text/html; charset=ISO-8859-15'); ?> But that doesn't seem to work either. Any thoughts? Also, while any of you are looking here...why does the rightmost column seem to become smaller when a new page is loaded, causing the table to distort and each <li> within the <td> to wrap to the next line? Cheers

    Read the article

  • Loading through Ajax request and bookmarked URL

    - by Varun
    I am working on a ticket system, having the following requirement: The home page is divided into two sections: Sec-1. Some filter options are shown here.(like closed-tickets, open-tickets, all-tickets, tickets-assigned-to-me etc.). You can select one or more of these filters. sec-2. List of tickets satisfying above filters will be displayed here. Now this is what I want: As I change the filters -- the change should be reflected in the URL, so that one is able to bookmark it. -- an ajax request will go and list of tickets satisfying the selected filters will be updated in sec-2. I want the same code to be used to load the tickets in both ways- (a) by selecting that set of filters and (b) by using the bookmark to reload the page. I have little idea on how to do it: The URL will contain the selected filters.(appended after #) changing filters on the page will modify the hash part of URL and call a function (say ajaxHandler()) to parse the URL to get the filters and then make an ajax request to get the list of tickets to be displayed in section2. and I will call the same function ajaxHandler() in window.onload. Is this the way? Any suggestions?

    Read the article

  • jQuery Countdown plugin and AJAX

    - by roman m
    I'm using jQuery Countdown plugin to implement a Countdown and call a webservice when timer expires. The problem is that I'm using AJAX on the page, and have to re-setup the Countdown on every AJAX request like so: var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_endRequest(SetupTimer); /*Initial setup*/ $(document).ready(function() { SetupTimer(); }); function SetupTimer() { var serverTime = new Date(); var cutoffTime = new Date($("#<%= cutoffTime.ClientID %>").val()); serverTime.setHours(serverTime.getHours()); if (serverTime < cutoffTime) { $('#timer').countdown('destroy'); /*should work, but doesn't*/ $('#timer').countdown({ until: cutoffTime, serverTime: serverTime, onExpiry: OrderingEnded, format: 'yowdHMS' }); } else OrderingEnded(); } This, for some reason, creates a new instance of the Countdown on ever request, resulting in numerous calls to Webservice when Countdown expires. How do I make sure that only one instance of the Countdown exists at a time? EDIT found this in documentation, doesn't do it for me though $('#timer').countdown('destroy');

    Read the article

  • Loading GMaps via ajax

    - by Marco
    Hi to all, I'm loading a page containing a GMaps using the ajax() method of jQuery. The HTML page i'm loading is: <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=MY_API_KEY" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map_canvas")); var geocoder = new GClientGeocoder(); geocoder.getLatLng("San Francisco, California",function(point) { if (point) { map.setCenter(point, 7); } }); map.setUIToDefault(); } }); </script> <div id="map_canvas"></div> After retrieving this page, I'm setting its contents to a div using the html() method. The map is not showed, while other pages containing scripts, loaded in the same way, are correctly shown. Is this a specific issue about GMaps, that doesn't allow to be loaded via an ajax request? Thanks

    Read the article

  • How do I Pass Parameter in Ajax Url?

    - by Nimit Joshi
    I have developed a service which is running successfully. Following is my service code: namespace WcfService1 { [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke(Method="GET", ResponseFormat = WebMessageFormat.Json, BodyStyle=WebMessageBodyStyle.Wrapped, UriTemplate="/display/{a}/{b}")] string Display(string a, string b); } } My Service: namespace WcfService1 { public class Service1 : IService1 { public string Display(string a, string b) { int ab = Convert.ToInt32(a); int bc = Convert.ToInt32(b); int cb = ab + bc; return cb.ToString(); } } } How do i call this with the help of ajax url? I have tried out the following code but it is not working. <script type="text/javascript"> $(document).ready(function () { $('#BtnRegister').click(function () { debugger; var No1 = document.getElementById('TxtFirstNumber').value; var No2 = document.getElementById('TxtSecondNumber').value; $.ajax({ cache: false, type: "GET", async: false, url: "http://localhost:22727/Service1.svc/Display", data: 'a=' +No1+'&b='+No2, contentType: "application/json; charset=ytf-8", dataType: "json", processData: true, success: function (result) { alert("data"); }, error: function (xhr, textStatus, errorThrown) { alert(textStatus + ':' + errorThrown); } }); }); }); </script>

    Read the article

  • Rails: Ajax: Changes Onload

    - by Jay Godse
    Hi. I have a web layout of a for that looks something like this <html> <head> </head> <body> <div id="posts"> <div id="post1" class="post" > <!--stuff 1--> </div> <div id="post2" class="post" > <!--stuff 1--> </div> <!-- 96 more posts --> <div id="post99" class="post" > <!--stuff 1--> </div> </div> </body> </html> I would like to be able to load and render the page with a blank , and then have a function called when the page is loaded which goes in and load up the posts and updates the page dynamically. In Rails, I tried using "link_to_remote" to update with all of the elements. I also tweaked the posts controller to render the collection of posts if it was an ajax request (request.xhr?). It worked fine and very fast. However the update of the blank div is triggered by clicking the link. I would like the same action to happen when the page is loaded so that I don't have to put in a link. Is there a Rails Ajax helper or RJS function or something in Rails that I could use to trigger the loading of the "posts" after the page has loaded and rendered (without the posts)? (If putsch comes to shove, I will just copy the generated JS code from the link_to_remote call and have it called from the onload handler on the body).

    Read the article

  • Prototype's Ajax.Updater not actually updating on IE7.

    - by Ben S
    I am trying to submit a form using Ajax.Updater and have the result of that update a div element in my page. Everything works great in IE6, FF3, Chrome and Opera. However, In IE7 it sporadically works, but more often than not, it just doesn't seem to do anything. Here's the javascript: function testcaseHistoryUpdate(testcase, form) { document.body.style.cursor = 'wait'; var param = Form.serialize(form); new Ajax.Updater("content", "results/testcaseHistory/" + testcase, { onComplete: function(transport) {document.body.style.cursor = 'auto'}, parameters: param, method: 'post' } ); } I've verified using alert() calls that param is set to what I expect. I've read in many places that IE7 caches aggressively and that it might be the root cause, however every after adding the following to my php response, it still doesn't work. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); To further try to fix a caching issue I've tried adding a bogus parameter which just gets filled with a random value to have different parameters for every call, but that didn't help. I've also found this, where UTF-8 seemed to be causing an issue with IE7, but my page is clearly marked: <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Does anyone have any idea what could be wrong with IE7 as opposed to the other browsers I tested to cause this kind of issue?

    Read the article

  • zeroclipboard does not work when loaded with ajax call

    - by kylex
    I have the following code which works the way one would expect (click on the button and it copies the text in the input box): <script type="text/javascript" src="ABSOLUTE_LINK/ZeroClipboard.js"></script> <script type="text/javascript"> ZeroClipboard.setMoviePath( 'ABSOLUTE_LINK/ZeroClipboard.swf' ); </script> Copy to Clipboard: <input type="text" id="clip_text" size="40" value="Copy me!"/><br/><br/> <div id="d_clip_button">Copy To Clipboard</div> <script language="JavaScript"> echo "var clip = new ZeroClipboard.Client(); clip.setText( '' ); // will be set later on mouseDown clip.setHandCursor( true ); clip.setCSSEffects( true ); clip.addEventListener( 'load', function(client) { } ); clip.addEventListener( 'complete', function(client, text) { alert("Copied text to clipboard: " + text ); } ); clip.addEventListener( 'mouseOver', function(client) { } ); clip.addEventListener( 'mouseOut', function(client) { } ); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('clip_text').value ); } ); clip.addEventListener( 'mouseUp', function(client) { } ); clip.glue( 'd_clip_button' ); </script> However, when this code is loaded using an ajax call, the functionality disappears. Is there anything I can do to get this working when it's called via ajax?

    Read the article

  • error handler isn't called when file is uploaded via ajax using jQuery form plugin

    - by scompt.com
    Here's my test case. If the form is posted, a 500 error response is sent. If not, the form is sent. If the file input tag is commented out, the error handler is called. If the file input tag is present, the error handler isn't called. I think this might have something to do with the fact that jQuery needs to use an iframe to handle the upload and iframes don't seem to respond to the error handler. Edit: If I add iframe: true to the options passed to ajaxSubmit to force the use of an iframe, the non-file-upload case stops working also, so it definitely has to do with the iframe. Edit2: I'm using the jQuery Form Plugin. <?php if($_SERVER['REQUEST_METHOD'] == 'POST') { header('HTTP/1.1 500 Internal Server Error'); die; } else {?> <html><head> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js?ver=2.9.2'></script> <script type='text/javascript' src='http://github.com/malsup/form/raw/master/jquery.form.js?v2.43'></script> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('a').click(function() {jQuery('form').ajaxSubmit({error: function(){alert('error handler called');}})}); }); </script> </head><body> <form method="POST"> <input type="text" name="mytext" /> <input type="file" name="myfile" /><!-- comment this element out --> <input type="hidden" name="blah" value="blah" /> <a>submit</a> </form> </body></html> <?php } Is there any way to get the error handler to be called in both situations?

    Read the article

  • Jquery ajax auto complete problem

    - by squeaker
    Hi all, I'm having newbie problems resolving an ajax autocomplete script if anyone would like to offer advise? In my form i wish for users to select an event type (drop down box) which on selecting then displays a text box. This text box then offers a user the ability to autocomplete as they start typing, the options having been generated through AJAX depending on the event type selected. I'm using a mix of http://pengoworks.com/workshop/jquery/autocomplete.htm - to carry out the autocomplete and some basic jquery to identify the value of the event type selected. The problem I have within the code below is to pass the selected event type value, set as the variable 'caturl', into the 'extraParams:{cat:4}' replacing the 4 with the event type dynamically selected. Any help would be greatly received. $('#select').change(function() { $('.eventtype').hide(); $('#eventtype' + $(this).find('option:selected').attr('id')).show(); caturl = $('#select :selected').val(); }); $("#CityAjax").autocomplete( 'caturl.php', { delay:10, minChars:2, matchSubset:1, matchContains:1, cacheLength:10, onItemSelect:selectItem, onFindValue:findValue, formatItem:formatItem, extraParams:{cat:4}, autoFill:true });

    Read the article

  • Help Needed With AJAX Script

    - by Brian
    Hello All I am working on an AJAX script but am having difficulties. First, here is the script: var xmlHttp; function GetXmlHttpObject(){ var objXMLHttp=null if (window.XMLHttpRequest){ objXMLHttp=new XMLHttpRequest() } else if (window.ActiveXObject){ objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp } function retrieveData(){ var jBossServer = new Array(); jBossServer[0] = "d01"; jBossServer[1] = "d02"; jBossServer[2] = "p01"; jBossServer[3] = "p02"; for(var i=0; i<jBossServer.length; i++){ xmlHttp = GetXmlHttpObject(); if (xmlHttp == null){ alert ("Something weird happened ..."); return; } var url="./retrieveData.php"; url = url + "?jBossID=" + jBossServer[i]; url = url + "&sid=" + Math.random(); xmlHttp.open("GET",url,true); xmlHttp.onreadystatechange = updateMemory; xmlHttp.send(null); } } function updateMemory(){ if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete"){ aggregateArray = new Array(); aggregateArray = xmlHttp.responseText.split(','); for(var i=0; i<aggregateArray.length; i++){ alert(aggregateArray[i]); } return; } } The "retrieveData.php" page will return data that looks like this: d01,1 MB,2 MB,3 MB They relate to my 4 servers d01, d02, p01, and p02 (dev and prod). What I am doing is scraping the memory information from http://127.0.0.1:8080/web-console/ServerInfo.jsp I want to save code so I attempted to put the AJAX xmlHttp call into a loop, but I don't think it is working. All I ever get back is the information for "p02" four times. Am I able to do what I want or do I need four different functions for each server (i.e., xmlHttpServer01, xmlHttpServer02, xmlHttpServer03, xmlHttpServer04)? Thank you all for reading, have a good day. :)

    Read the article

  • Copy to clipboard does not work when loaded with ajax call

    - by kylex
    I have the following code which works the way one would expect (click on the button and it copies the text in the input box): <script type="text/javascript" src="ABSOLUTE_LINK/ZeroClipboard.js"></script> <script type="text/javascript"> ZeroClipboard.setMoviePath( 'ABSOLUTE_LINK/ZeroClipboard.swf' ); </script> Copy to Clipboard: <input type="text" id="clip_text" size="40" value="Copy me!"/><br/><br/> <div id="d_clip_button">Copy To Clipboard</div> <script language="JavaScript"> echo "var clip = new ZeroClipboard.Client(); clip.setText( '' ); // will be set later on mouseDown clip.setHandCursor( true ); clip.setCSSEffects( true ); clip.addEventListener( 'load', function(client) { } ); clip.addEventListener( 'complete', function(client, text) { alert("Copied text to clipboard: " + text ); } ); clip.addEventListener( 'mouseOver', function(client) { } ); clip.addEventListener( 'mouseOut', function(client) { } ); clip.addEventListener( 'mouseDown', function(client) { // set text to copy here clip.setText( document.getElementById('clip_text').value ); } ); clip.addEventListener( 'mouseUp', function(client) { } ); clip.glue( 'd_clip_button' ); </script> However, when this code is loaded using an ajax call, the functionality disappears. Is there anything I can do to get this working when it's called via ajax?

    Read the article

  • modifying ajax returned data before showing

    - by Nick
    I'm processing subscribtion form with jQuery/ajax and need to display results with success function (they are different depending on if email exists in database). But the trick is I do not need h2 and first "p" tag. How can I show only div#alertmsg and second "p" tag? I've tried revoming unnecessary elements with method described here, but it didn't work. Thanks in advance. Here is my code: var dataString = $('#subscribe').serialize(); $.ajax({ type: "POST", url: "/templates/willrock/pommo/user/process.php", data: dataString, success: function(data){ var result = $(data); $('#success').append(result); } Here is the data returned: <h2>Subscription Review</h2> <p><a href="url" onClick="history.back(); return false;"><img src="/templates/willrock/pommo/themes/shared/images/icons/back.png" alt="back icon" class="navimage" /> Back to Subscription Form</a></p> <div id="alertmsg" class="error"> <ul> <li>Email address already exists. Duplicates are not allowed.</li> </ul> </div> <p><a href="login.php">Update your records</a></p>

    Read the article

  • Can't get data with spaces into the database from Ajax POST request

    - by J Jones
    I have a real simple form with a textbox and a button, and my goal is to have an asynchronous request (jQuery: $.ajax) send the text to the server (PHP/mysql a la Joomla) so that it can be added to a database table. Here's the javascript that is sending the data from the client: var value= $('#myvalue').val(); $.ajax( { type: "POST", url: "/administrator/index.php", data: { option: "com_mycomponent", task: "enterValue", thevalue: value, format: "raw"}, dataType: "text", success: reportSavedValue } ); The problem arises when the user enters text with a space in it. The $_POST variable that I receive has all the spaces stripped out, so that if the user enters "This string has spaces", the server gets the value "Thisstringhasspaces". I have been googling around, and have found lots of references that I need to use encodeURIComponent. So I have tried it, but now the value that I get from $_POST is "This20string20has20spaces". So it appears to be encoding it the way I would expect, only to have the percent signs stripped instead of the spaces, and leaving the hex numbers. I'm really confused. It seems that this sort of question is asked and answered everywhere on the web, and everywhere encodeURIComponent is hailed as the silver bullet. But apparently I'm fighting a different breed of lycanthrope. Does anyone have any suggestions?

    Read the article

  • In what order does DOJO handles ajax requests?

    - by mm2887
    Hi, Using a form in a dialog box I am using Dojo in jsp to save the form in my database. After that request is completed using dojo.xhrPost() I am sending in another request to update a dropdown box that should include the added form object that was just saved, but for some reason the request to update the dropdown is executed before saving the form in the database even though the form save is called first. Using Firebug I can see that the getLocations() request is completed before the sendForm() request. This is the code: Add Team sendForm("ajaxResult1", "addTeamForm"); dijit.byId("addTeamDialog").hide(); getLocations("locationsTeam"); </script> function sendForm(target, form){ var targetNode = dojo.byId(target); var xhrArgs = { form: form, url: "ajax", handleAs: "text", load: function(data) { targetNode.innerHTML = data; }, error: function(error) { targetNode.innerHTML = "An unexpected error occurred: " + error; } } //Call the asynchronous xhrGet var deferred = dojo.xhrPost(xhrArgs); } function getLocations(id) { var targetNode = dojo.byId(id); var xhrArgs = { url: "ajax", handleAs: "text", content: { location: "yes" }, load: function(data) { targetNode.innerHTML = data; }, error: function(error) { targetNode.innerHTML = "An unexpected error occurred: " + error; } } //Call the asynchronous xhrGet var deferred = dojo.xhrGet(xhrArgs); } Why is this happening? Is there way to make the first request complete first before the second executes? To reduce the possibilities of why this is happening I tried setting the cache property in xhrGet to false but the result is still the same. Please help!

    Read the article

  • Django + jQuery: Sometimes AJAX, but always DRY?

    - by Justin Myles Holmes
    Let's say I have an app (in Django) for which I want to sometimes (but not always) load content via ajax. An easy example is logging in. When the user logs in, I don't want to refresh the page, just change things around. Yet, if they are already logged in, and then arrive at (or refresh) the same page, I want it to show the same content. So, in the first case, obviously I do some sort of ajax login and load changes to the page accordingly. Easy enough. But what about in the second case? Do I go back through and add {% if user.authenticated %} all over the place? This seems cold, dark, and WET. On the other hand, I can just wrap all the ajaxy stuff in a javascript function, called loggedIn(), and run that if the user is authenticated. But then I'm faced with two http requests instead of one. Also undesirable. So what's the standard solution here?

    Read the article

  • Simplemodal AJAX

    - by Maxime
    Hello guys, I'm trying to implement Simplemodal on my website. Simple text boxes are really easy to do, but I can't find a way to have another page showing through AJAX. I know very little about Jquery and there is no documentation on how to do it, so could somebody help me? Thanks. This is the default code of a Simple Modal box: jQuery(function ($) { $('#basic-modal .basic').click(function (e) { $('#basic-modal-content').modal(); return false; });}); This is some code I took from the Simple Modal contact form that works with AJAX. I've been trying to tweak it but I don't really understand the structure of it. As I said, I'm completely new to Jquery. $.get("data/contact.php", function(data){ // create a modal dialog with the data $(data).modal({ closeHTML: "<a href='#' title='Close' class='modal-close'>x</a>", position: ["15%",], overlayId: 'contact-overlay', containerId: 'contact-container', onOpen: contact.open, onShow: contact.show, onClose: contact.close }); }); });

    Read the article

  • Loading Facebook fb:profile-pic via AJAX in Facebook Connect site

    - by mbrevoort
    After a page loads, I'm making an AJAX request to pull down an HTML chunk that contains tags representing a Facebook user profile picture. I append the result to a point in the DOM but the logos don't load, instead all I see is the default silhouette. Here's simply how I'm loading the HTML chunk with jQuery $.ajax({ url: "/facebookprofiles" success: function(result) { $('#profiles').append(result); } }); The HTML that I'm appending is a list of diffs like this: <div class="status Accepted"> <fb:profile-pic class="image" facebook-logo="true" linked="true" size="square" uid="1796055648"></fb:profile-pic> <p> <strong>Corona Kingsly</strong>My Status Update<br/> <span style="font-size: 0.8em">52 minutes ago</span> </p> </div> Any ideas? I assume the fb tags are not being processed once the dom is loaded. Is there any way to make that happen? I'm not seeing any exceptions or errors in my Firebug console. Thanks

    Read the article

< Previous Page | 164 165 166 167 168 169 170 171 172 173 174 175  | Next Page >