Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
3,666,231
3,666,232
Request for JSON from externel source using $.getjson. 200 success but where is it?
<p>I'm trying to get weather data from openweathermap. This url works with coordinates I put in, and I can download the JSON when I input the url the in the browser bar. I'm trying to get this working in my page. When I run this code, in Firebug I can see the HTTP request got the 200 success code, but it's not printing the response for some reason. Am I not using getJSON properly?</p> <pre><code>var url = "http://api.openweathermap.org/data/2.5/forecast?lat="+ position.coords.latitude +"&amp;lon=" + position.coords.longitude; $.getJSON(url, function(res) { console.log(res); }); </code></pre>
javascript jquery
[3, 5]
2,512,814
2,512,815
Multiple toggle-events with jquery on php-generated html
<p>I know the title isn't the best, I didn't know how to put this in one sentence. Anyway, I've got some php code creating pairs of links and corresponding boxes which should toggle, when I hit the link. Now I was wondering how you do this in jQuery "the right way".</p> <p>Until now I gave every link the class <code>togglelink</code> and an ID <code>togglelink1</code>, <code>togglelink2</code> etc. The boxes then have the ID <code>togglebox1</code>... So I respond to <code>$(".togglelink").click()</code>, get the current ID, parse the number, add it to the box-ID and toggle the object. </p> <p>This doensn't seem very straight foward as it's a task I'm sure is pretty common. Any suggestions on how I could improve this?</p>
php jquery
[2, 5]
5,829,520
5,829,521
Gridview with DDl selected value
<p>I had gridview which in load it will get data from database .And I added option for user to filter this grid view by DDl I did my code and the grid get data when load but when I selected DDl it didnot get any data and I made break point I noticed that Gridview1.Databind() hadnot any action on grid.So please any one help me</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { DataTable DT = new DataTable(); if (DDlCity.SelectedIndex&lt;0) { using (SqlConnection con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetDealers", con); Com.CommandType = CommandType.StoredProcedure; SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(DT); GridView1.DataSource = DT; GridView1.DataBind(); } } } protected void DDlCity_SelectedIndexChanged(object sender, EventArgs e) { DataTable DT = new DataTable(); using (SqlConnection con = Connection.GetConnection()) { SqlCommand Com = new SqlCommand("GetDealersByArea", con); Com.CommandType = CommandType.StoredProcedure; Com.Parameters.Add(Parameter.NewInt("@DEALERAREA_ID", DDlCity.SelectedValue)); SqlDataAdapter DA = new SqlDataAdapter(Com); DA.Fill(DT); GridView1.DataSource = DT; GridView1.DataBind(); } } </code></pre>
c# asp.net
[0, 9]
653,723
653,724
How can I add elements to this object
<p>If I had this structure </p> <pre><code>var data = { "people": [ { "name" : "John", "id" : 1 }, { "name" : "Marc", "id" : 2 } ] } </code></pre> <p>I want to add more elements to this, in JavaScript, specifically in jQuery to then send it like this</p> <pre><code>var dataString = JSON.stringify(data); $.post('some.php', { data: dataString}, showResult, "text"); </code></pre>
javascript jquery
[3, 5]
2,110,380
2,110,381
Find the Direction travelled using Source and Destination (latitude & longtitude)
<p>I have two points say Source=(lat1,lon1) and destination=(lat2,lat3)</p> <p>I want to know which way the source traveled,</p> <p>ex: from NorthWest to Southeast (or) SouthWest to Northeast etc....</p> <p>Can any one help..</p> <p>Thanks..</p>
c# javascript
[0, 3]
1,927,266
1,927,267
Check and Uncheck Checkbox when Table Row is Clicked
<p>Right now I have my script setup so that when each checkbox inside a table row is checked it performs the functions required (addClass and some others). </p> <p>I would also like the checkboxs to check/uncheck and perform the same functions when the individual table row is clicked.</p> <p><strong>Here is my code for the checkbox functions:</strong></p> <pre><code>$('input[type="checkbox"]').bind('click',function(e) { var $this = $(this); if($this.is(':checked')) { num += 1; $('#delete_btn').fadeIn('fast'); $this.parents('tr').addClass('selected'); select_arr.unshift(this.id); } else { num -= 1; if(num &lt;= 0) { $('#delete_btn').fadeOut('fast'); } $this.parents('tr').removeClass('selected'); select_arr.shift(this.id); } }); </code></pre> <p>What would be the best way to achieve the same result that this code does by just clicking the table row itself rather than the checkbox, but still allowing the checkboxes to function the same.</p> <p><strong>Here is the table:</strong> <img src="http://i.stack.imgur.com/a06y6.gif" alt="enter image description here"></p> <p>Thanks in Advance.</p>
javascript jquery
[3, 5]
593,890
593,891
stop an looping animation on hover and click to start it again
<p>In the link below there are some bubbles wich animates from left to right in a loop. If you hover over one of them, it gets larger and stops animating. My problem is that the bubble doesnt stop for very long, I want it to stop permanently, until you click on it</p> <p><a href="http://jsfiddle.net/jukke/SU4gJ/1/" rel="nofollow">http://jsfiddle.net/jukke/SU4gJ/1/</a></p> <p>You are also more than welcome to rewrite parts of the code to make it better/cleaner. I dont really have much experience coding :)</p>
javascript jquery
[3, 5]
1,277,764
1,277,765
Resize image to specific width and fix height
<p>I want to resize big images to have a width of 150 pixels and the height will be fixed. and then save the image into a folder in my website.</p> <p>examples: (width,height) if I resize an image 300px*300px I will get a resized image of 150px*150px. if I resize an image 450px*300px I will get a resized image of 150px*100px.</p> <p>the point is that the ratio between width and height will be saved always keeping a width of 150 pixels.</p> <p>Any Help?</p>
c# asp.net
[0, 9]
3,877,906
3,877,907
Jquery How to change url for every ajax respond
<pre><code>$(".blok").newWindow({ windowTitle:"Example1", ajaxURL:"Action.php?task=BlokDuzenleFormGetirBlokId="+$(".blok").attr('id') }); </code></pre> <p>when first clicked on blok class a href, newWindow loads from data by <code>$(".blok").attr('id').</code> Then every action sen same url to ajax, with not change. is there a way change url every single respond to call function by unique id parametre or anything like that.</p>
javascript jquery
[3, 5]
4,813,643
4,813,644
Countdown clock in android
<p>i need to display a countdown clock , i calculated the difference between dates in miliseconds , how can i convert this to countown clock , like 20days 12hrs 12 min remaining ? i can get hrs remaining </p> <p><code>(mili / 24 * 60 * 60 * 1000)</code></p> <p>But This is the total hours remaining how can i convert this to 0-24 hrs 0-60 min format ? </p>
java android
[1, 4]
1,420,470
1,420,471
replace tag content using jquery
<p>In my html I have this code:</p> <pre><code>&lt;div class="selfclear"&gt; &lt;h3&gt;&lt;a id="lnkName" href="/dir/subdir/?id=577"&gt;Name&lt;/a&gt;&lt;/h3&gt; &lt;address&gt; Street name, 3 &lt;br /&gt;3222 City&lt;br /&gt;Phone. : 0202 777 876 &lt;/address&gt; &lt;/div&gt; </code></pre> <p>I want to replace the phone number depending on the id passed to the url within the tag using Jquery.</p> <p>So far I was able to get the id doing so:</p> <pre><code>function getID(){ var a = $('#lnkName').attr('href').split('='); var id= a[1]; } </code></pre> <p>and the content of with :</p> <pre><code>function print_Address(){ var div = $('#lnkName'); if (!div.length) return; var adress = $('#lnkName').parent().siblings('address').html(); adress.replace( '/Phone : .*/', '/Phone : 777' ); var newtel = $('#lnkName').parent().siblings('address').html( adress ); div.html(newtel).show('slow',function(){ }); } </code></pre> <p>The problem is with replacing function as the print_Address() just print me the content of address but does not load the new content</p> <p>Thanks for your help</p>
javascript jquery
[3, 5]
3,583,415
3,583,416
Javascript or Jquery - on Checkbox Click, how do I change the parent-element's background color?
<p><code>onclick</code>, I need to</p> <ol> <li>Locate the parent element</li> <li>Change its background color to red</li> </ol> <p>I'm having particular difficulty with the first part.</p>
javascript jquery asp.net
[3, 5, 9]
1,461,800
1,461,801
The javascript code from server side is not working in asp.net?
<p>i am developing an Asp.net application when i call javascript function from codebehind i found that for example:</p> <ol> <li>click event not fired</li> <li>i have a javascript function that fill the dropdown list with items using ajax but when page loaded i found dropdown list empty</li> </ol> <p>i am using RegisterClientScriptBlock to execute the javascript code</p> <p>so is there any solution for these problems?</p> <p>code snippet:</p> <p>code behind:</p> <pre><code> ClientScript.RegisterClientScriptBlock(this.GetType(), "ClientBlock", javacode.ToString()); </code></pre> <p>this what in javacode variable :</p> <pre><code> &lt;script type="text/javascript"&gt; &lt;!-- function ExecuteScript() { $("#divGender input").click(); GetDMspecifyList(5); $("cp1_drpDMSpecify").removeAttr('disabled'); $("cp1_drpDMSpecify option:selected").val(4); $("#divFamily input").click(); } &lt;/script&gt; // --&gt; </code></pre> <p>this the function used to fill dropdown list but it is not working</p> <pre><code> function GetDMspecifyList(DMID) { $("#DMLoader").show(); $.getJSON('FillDropDownLists.aspx?DMTypeID=' + DMID, function (types) { $.each(types, function () { $("#cp1_drpDMSpecify").append($("&lt;option&gt;&lt;/option&gt;").val(this['DMTypeCode']).html(this['DMTypeName'])); }); $("#DMLoader").hide(); $("#DMSpecify_span").show(); $("#cp1_hdDMType").val($("#cp1_drpDMSpecify").val()); $("#cp1_drpDMSpecify").removeAttr('disabled'); }); </code></pre> <p>} </p>
javascript asp.net
[3, 9]
2,233,820
2,233,821
Dividers disappear in PullToRefreshListView
<p>I want to use Pull-To-Refresh Library in my App that is already developed and the source is <a href="https://github.com/chrisbanes/Android-PullToRefresh" rel="nofollow">here</a>.</p> <p>I am running the launcher sample on Android 2.3.5.</p> <p>The problem is when we add the <code>PullToRefreshListView</code> to our List with black background, the white separators between the items (dividers) disappear.</p> <p>It is the same for me in my own app and in the sample of the link. Could you help me?</p>
java android
[1, 4]
4,547,539
4,547,540
Android: Access mysql database, forbidden files
<p>I'm trying to open a connection between my android emulator and server (currently testing on local.)</p> <p>I'm following this <a href="http://www.helloandroid.com/tutorials/connecting-mysql-database" rel="nofollow">tutorial</a></p> <p>The problem arises when trying to read the php file itself.</p> <p>I have internet permissions setup in the manifest file, so thats ok; what get's recorded into the JSON array however is infact a "403 Forbidden" html message, mentioning that I'm not allowed access to the file getAllPeopleBornAfter.php</p> <p>If anyones encountered a solution to this problem I'd greatly appreciate some help with it. Otherwise, I was hoping someone could tell me how I could allow public use of php scripts without allowing the file for download / be seen?</p> <p>Thanks in advance</p>
php android
[2, 4]
2,442,374
2,442,375
how to render a .htm page into .aspx page
<p>i have aspx page which has to render .htm page how can it be done</p> <p>if possible then i want added feature that is i want to call a JavaScript after that .htm page is rendered</p> <p>pls help</p>
javascript asp.net
[3, 9]
1,644,520
1,644,521
How do you get the user defined "Device Name" in android?
<p>I am trying to get the user defined device name that is set in settings. I've tried several options and so far nothing. </p> <p>If it helps or hurts I am needing it in a BroadcastReceiver</p> <p>Thanks</p>
java android
[1, 4]
872,939
872,940
Server Tag is not well formed?
<p>Before adding style to paragraph it was working fine but if i add style i am getting error like server tag is not well formed.please check out my code </p> <pre><code>&lt;p title='&lt;%# DataBinder.Eval(Container.DataItem, "Title") %&gt;' id="P1" runat="server" style="top:&lt;%# DataBinder.Eval(Container.DataItem, "Tops") %&gt;px; left:&lt;%#DataBinder.Eval(Container.DataItem, "Lefts") %&gt;px; font-size:15px; color:White;"&gt; &lt;/p&gt; </code></pre>
c# asp.net
[0, 9]
3,746,076
3,746,077
Abstracting an id attribute in C# or Java
<p>I am designing an API. Here are some example methods from an interface:</p> <pre><code>Entry findEntry(int processId); Entry findEntry(int processId, Filter filter); </code></pre> <p>where <code>processId</code> refers to some unique identifying information. However I don't really know what the type of <code>processId</code> is yet.</p> <p>How can I abstract away an element like <code>id</code> of something? </p> <p>The best I could come up with is creating a dummy interface:</p> <pre><code>Entry findEntry(ProcessId id); Entry findEntry(ProcessId, Filter filter); </code></pre> <p>However, I worry that with the above approach I may force the client of the API to operate on too high an abstraction level. For example, the equality of process id's will no longer work (whereas if they used int's - it would).</p> <p><em>Clarification</em>: I failed to clarify that I am writing only the interfaces (contracts), to be implemented later, possibly by a different team. That is why I cannot enforce certain things like equals method.</p>
c# java
[0, 1]
4,207,966
4,207,967
programmatically refreshing a datagrid in asp.net
<p>I have an asp.net webpage that does a bunch of (slow, hence the problem) calculations and dumps them all into a datagrid in a webpage. I would like to be able to have the page show partial results. </p> <p>I have figured out how to re-update the grid every time a row is done, but the page still doesn't display the results until all the calculations are complete. Does anyone know a call from asp.net that can tell the page to refresh itself? </p> <p>p.s. the update function I am currently using is as follows:</p> <pre><code> private void updateDisplay(DataTable outputTable) { if (outputTable.Rows.Count &gt; 0) { PlaceHolder1.Controls.Clear(); PlaceHolder1.Controls.Add(new LiteralControl("&lt;br&gt;")); GridView myView = new GridView(); myView.DataSource = outputTable; myView.DataBind(); myView.Visible = true; PlaceHolder1.Controls.Add(myView); } } </code></pre>
c# asp.net
[0, 9]
1,002,444
1,002,445
Make element own its own variable?
<p>I made a function that lists out the months. </p> <pre><code>function genDate() { var d = new Date(); var monthNames = [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]; var day = d.getUTCDate().toString(); var mon = d.getUTCMonth(); var year = d.getUTCFullYear(); $("#day").prepend('&lt;span id="day_num"&gt;' + day + '&lt;/span&gt;'); var cc = mon; for (var i = 0; i &lt; 12; i++) { $("#date_cont").append('&lt;div class="month"&gt;&lt;a href="" onclick="return false;" &gt;' + monthNames[cc] + '&lt;/a&gt;&lt;/div&gt;'); cc++; if ( cc &gt; 11 ) { cc = 0; } } } </code></pre> <p>What I want to do is have the generated .months elements hold different variables like its month index (0-11) that can be used by other functions. I guess the elements would act as objects (each element of .month class holds its own unique values). I'm new to javascript so I don't know how to implement this. </p>
javascript jquery
[3, 5]
5,670,327
5,670,328
Confirm pop up and pass php value to js with input image as submit
<p>Bascially when a user hits the delete button, the script must confirm from user if he wants to delete or not. I want to pass the id of a row. I am using input type="image" and onclick brings up the box. How do I pass $row_id['id] to the js script. </p> <pre><code>&lt;script type="text/javascript"&gt; function show_confirm() { var r=confirm("Do you want to delete"); if (r==true) { window.location = "delete.php"; //alert("You pressed OK!"); } else { } } &lt;/script&gt; &lt;input type="image" src='../images/delete.jpg' width='30px' height='30px' style="position:relative; top:0px;" onclick="show_confirm()"&gt; </code></pre>
php javascript
[2, 3]
2,949,981
2,949,982
how to dynamically (re)position an element according to the bottom of the page using JS / Jquery?
<p><strong>the back story:</strong> i have a tab section on a page which when navigated through displays sections (divs) of varying height. </p> <p><strong>the result,</strong> is that certain inputs (which are strangely positioned for reasons i can't change) on this page reposition themselves problematically. </p> <p><strong>the proposed solution:</strong> as the page height changes, have these problem inputs repositioned according to the page bottom (from which their appropriate distances are always a constant). </p> <p>what i'm thinking is that i need some js that does something like,</p> <p><strong>page height change triggers input position from bottom to = x.</strong> </p> <p>there are two inputs if that's at all relevant. :)</p> <p>if only there was css for this (i know there is under normal circumstances, but trust me -- not in this case).</p> <p>thanks for your time &amp; help i've been struggling with this for weeks!</p>
javascript jquery
[3, 5]
3,602,036
3,602,037
Resetting A webform on the ClientSide
<p>I have a webform with 3 textboxes, a checkbox and a Reset button. I need these to be reset to null values when i click the button "Reset" and i need it to be a Client-Side operation. The JS code that i have tried for this is as follows but for some reason it doesnt work. Any Help PLease?</p> <pre><code>&lt;code&gt; &lt;script type="text/javascript"&gt; function resetForm() { document.getElemenyById("&lt;%=txtbox1.ClientID%&gt;").value = ""; return false; } &lt;/script&gt; &lt;asp:LinkButton ID="wbtnReset" runat="server" Text="RESET PAGE" CssClass="stdHyperlink" Font-Bold="True" OnClientClick="javascript:return resetForm()"/&gt; &lt;/code&gt; </code></pre>
javascript asp.net
[3, 9]
5,468,346
5,468,347
How to get a count of all checked checkboxes on a page
<p>I want to count how many checkboxes a user has selected. For example, from a group of 10 checkboxes if he selects 5, then I want to be able to count it. Using the line:</p> <pre><code>$(":checkbox:checked") </code></pre> <p>I can select all of the checked checkboxes, is there a way to get the count of all the elements that are returned by that statement as well?</p>
javascript jquery
[3, 5]
2,263,569
2,263,570
can we call a java method by js?
<p>In my Java Script , I want to call a java method . Is it possible to call a java method by js w/o using ajax?</p>
java javascript
[1, 3]
2,925,671
2,925,672
using session variable in aspx page in sql query
<p>I have the sqldatasource in aspx page and in the query I want to use one parameter i.e. coming from session.</p> <p>Below is my code.Please help me out.</p> <pre><code>&lt;asp:SqlDataSource runat="server" ID="MySQLData2" ConnectionString='&lt;%$ConnectionStrings:ConnectionString %&gt;' ProviderName="MySql.Data.MySqlClient" SelectCommand="SELECT * FROM tablename WHERE id="Here I want to use session variable"" /&gt; </code></pre>
c# asp.net
[0, 9]
2,698,911
2,698,912
Postback using javascript
<p>How to cause a postback using javascript in ASP.NET.</p>
asp.net javascript
[9, 3]
3,189,256
3,189,257
How to decode text
<p>I receive back from a webservice a string in Json like this:</p> <p>conversione da voce a testo questa è una prova di compressione</p> <p>the "è" must be "è" in Italian.</p> <p>How to decode to right text in Java?</p>
java android
[1, 4]
2,065,513
2,065,514
Sending all input fields with jquery .post()
<p>I have collected the values of all input field into an array as follows:</p> <pre><code> $( ".formbox" ) . each( function(id,elem){ form_fields[ "input-" + $( elem ) . attr( "id" ) ] = $( elem ) . val( ); }); $.log( "Collected:", form_fields ); </code></pre> <p>This does work, and then I try passing the array using post</p> <pre><code> $.post( "server.php", { fields: form_fields }, function(ret) { if (!ret.success ) alert ( "Error! Reload please!" ); else { } }, 'json' ); </code></pre> <p>However while retrieving, Firebug indicates that the fields are empty</p> <p>As I understood I need to serialize the array or not use it at all. But what could I use instead?</p> <p>Please tell what is it that I am doing wrong?</p> <p>---------- added ---------- ...I just found this</p> <pre><code> form_fields = {}; </code></pre> <p>:)</p> <p>I don't understand how but that solved the problem Please tell me what the difference is between an Array and {}? What does {} in JS ?</p>
javascript jquery
[3, 5]
5,001,240
5,001,241
Browser Capabilities Files
<p>I've defined a new platform in my App_Browsers folder like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;browsers&gt; &lt;browser id="PlatformWin7" parentID="PlatformWinnt"&gt; &lt;identification&gt; &lt;userAgent match="Windows (NT 6\.1)" /&gt; &lt;/identification&gt; &lt;capture&gt; &lt;/capture&gt; &lt;capabilities&gt; &lt;capability name="platform" value="Win7" /&gt; &lt;/capabilities&gt; &lt;/browser&gt; &lt;/browsers&gt; </code></pre> <p>However, when I try and go to my site I get this error thrown:</p> <pre><code>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The browser or gateway element with ID 'PlatformWinnt' cannot be found. </code></pre> <p>However, <code>PlatformWinnt</code> IS defined in <code>gateway.browser</code> in <code>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Browsers</code> so why can't it pick it up?</p> <p>I thought <code>parentID</code> was cross file? I've even tried calling aspnet_regbrowsers but to no avail.</p> <p>Edit: This is also true if I rename <code>&lt;browser&gt;</code> to <code>&lt;gateway&gt;</code>.</p>
c# asp.net
[0, 9]
1,612,728
1,612,729
How i can convert BitArray to single int?
<p>How i can convert BitArray to single int? The fastest way pls...</p>
c# asp.net
[0, 9]
2,383,149
2,383,150
Set position for new window
<p>hello i open a new window with:</p> <pre><code>&lt;a href ="javascript:NewWindow =window.open('Default.aspx', 'NewWindow' , 'width=400, height=450'); NewWindow.focus()"&gt;Hilfe&lt;/a&gt; </code></pre> <p>at the moment the new window appears in the upper left corner. how can i set the position, so it appears somewhere else?</p>
asp.net javascript
[9, 3]
2,248,261
2,248,262
Adding jQuery to Master Pages
<p>I have the following jquery in my ASP.NET regular pages</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Color Items&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $("select option:even").addClass('evenColor'); }); &lt;/script&gt; &lt;style type="text/css"&gt; .evenColor { background-color:Gray; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server"&gt; &lt;asp:ListItem Text="Gori"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Muf"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Lizo"&gt;&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now i want to convert this into a Master Pages. I am unable to figure out what will be added to the master page and what to the content page. Will the scripts go to MasterPage?</p> <p><strong>Please Note:</strong> I have many such regular asp.net pages with individual jquery files. Will I have to add all these jquery files into one master page. </p> <p>What is the correct way?</p>
asp.net jquery
[9, 5]
2,022,752
2,022,753
global variable in javascript used in a ajax call
<p>I declared a global variable <code>var idCategories= new Array();</code> in my <code>file.js</code> I use it in this function</p> <pre><code>function test() { $.ajax({ type: "GET", url: "http://my_site/api/categories?ws_key=" + ws_key + "&amp;PHP_AUTH_USER=" + PHP_AUTH_USER, dataType: "xml", success: parseXml }); function parseXml(xml) { var i = 0; $(xml).find("category").each(function () { idCategories[i] = $(this).attr('id'); // length increments at each iteration alert("length=" + idCategories.length); i = i + 1; }); } alert("length=" + idCategories.length); //returns 0 } </code></pre> <p>in the function <code>parseXml(xml)</code> the array length is well incremented but outside of this function length = 0! so that I can't use the array <code>idCategories</code> in another function!</p>
javascript jquery
[3, 5]
3,488,786
3,488,787
How can I make a wufoo like web app
<p>I want to mimic wufoo form builder web app, I used jquery to drag and drop elements on a workspace, but I need a way to let the user save his finished work , and download his work as html page, can any one help!!!</p>
php javascript jquery
[2, 3, 5]
3,864,466
3,864,467
Java Book or Website (like Cplusplus.com) for C++ programmers to learn java very fast
<p>I am looking for a book which teaches Java very fast. Basically I am a C++ programmer and do not need to know each and every aspect of programming. I am learning java for android apps development. A lot of books like thinking in Java, learning java and others suggested are pretty big and I want something small to get me going. A website like <a href="http://www.cplusplus.com/doc/tutorial/" rel="nofollow">http://www.cplusplus.com/doc/tutorial/</a> for java also can be helpful. please answer ASAP.</p>
java android c++
[1, 4, 6]
4,339,427
4,339,428
Select (expand) a dropmenu when clicking on another element
<p>I have a div containing a select menu and another element (<em>.dropArrow</em>).</p> <p>What I would like to do is select the menu when you click on .dropArrow.</p> <p>Here's the jquery I've tried so far but with no success...</p> <pre><code>$(".dropArrow").live('click', function() { $(this).siblings("select").click(); }); </code></pre> <p>HTML</p> <pre><code>&lt;div class="selectContainer selectTest" style="width: 305px;"&gt; &lt;select id="selectTest"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;option value="3"&gt;3&lt;/option&gt; &lt;option value="4"&gt;4&lt;/option&gt; &lt;/select&gt; &lt;span class="dropArrow"&gt;^&lt;/span&gt; &lt;/div&gt; </code></pre> <p>I'm guessing it's the .click() part that's wrong as I can change that to something like .hide() and it works fine.</p>
javascript jquery
[3, 5]
4,637,165
4,637,166
using SAX parser, how do you parse an xml file with out some foreknowledge of the structure of the xml?
<p>is there a way to implement the sax parser without passing the names of the elements in the xml as it is done in getChild method or equalsIgnoreCase(tagname)? Or is there a way to find out what are the names of tags in an xml and then pass it to Sax methods.</p>
java android
[1, 4]
5,461,618
5,461,619
Can I change the HTML of the selected text?
<p>Can we change the HTML or its attributes of the selected part of the web page using javascript?</p> <p>For example, There is a random web page:(A part of it is shown)</p> <p><img src="http://i.stack.imgur.com/9Qa8S.png" alt="enter image description here"></p> <p>with HTML as</p> <pre><code>...&lt;p&gt;Sample paragraph&lt;/p&gt;.. </code></pre> <p>It is possible to get the HTML of the selected text which has already been answered <a href="http://stackoverflow.com/questions/5643635/how-to-get-selected-html-text-with-javascript">here</a>.</p> <p>But, is it possible for me change the html of the selected text? Like, add a class or id attribute to the paragraph tag.</p>
javascript jquery
[3, 5]
1,231,227
1,231,228
jQuery - Do UI change after other UI change is finished
<p>How would I execute <code>$("#login").toggle("drop", {direction: "left"});</code> then after THAT is completely finished... do <code>$("#register").toggle("drop", {direction: "right"});</code>. Because the <code>DIVS</code> are not floated and at the same time they stack up against each other when they <code>drop</code>.</p>
javascript jquery
[3, 5]
941,461
941,462
How to call javascript function/write script inside PHP echo
<p>I have written piece of code, below is the code</p> <pre><code>&lt;script type="text/javascript"&gt; function submitform() { document.myform.action='http://mysite/index.php'; document.myform.submit(); } &lt;/script&gt; &lt;?php if(isset($_POST['submit_details'])) { echo "&lt;script typ=javascript&gt; submitform();&lt;/script&gt;"; } ?&gt; &lt;form id="myform"&gt; ------ ------ &lt;input type="submit" name="submit_details"&gt; &lt;/form&gt; </code></pre> <p>when i try to submit the form , it gives me error document.myform is undefined, how to solve this error</p>
php javascript
[2, 3]
2,199,943
2,199,944
What is a good practice to combine your classes
<p>Not to keep all my classes in a single src -> 'package_name' folder I'm creating different sub-packages in order to separate my classes by groups like - utilities, models, activities themselves, etc. I'm not sure if it is a good practice and people do the same in real projects.</p>
java android
[1, 4]
252,728
252,729
how to get integer values in a string with js
<pre><code>var text = "rating-1-gray-3-blue"; </code></pre> <p>i want to get value <code>13</code></p> <p>how can i do this . basically i want to get all integers inside a string .</p> <p>i tried with <code>parseInt</code> , but it returns int when the integer value is at the beginning of the string</p> <p>thanks in advance</p>
javascript jquery
[3, 5]
5,383,278
5,383,279
unload in firefox
<p>I have a client register startup script like so:</p> <blockquote> <p>" " + "document.body.onunload = clearSession; " + "";</p> </blockquote> <p>The script works fine in IE8 by calling the clearSession() client script but not with firefox. can anyone help please?</p> <p>thanks</p>
javascript asp.net
[3, 9]
5,724,943
5,724,944
How to get URL from the text
<p>How can I get URL from the text?</p> <p>For example:</p> <pre><code>string Text = "this is text with url http://test.com"; </code></pre> <p>I have to get url and set it to other variable. How can I do this with ASP.NET?</p>
c# asp.net
[0, 9]
3,937,044
3,937,045
Javascript alert box using javascript variable and php array
<p>I am trying to print <code>johan</code> using javascript alert box with javascript variable and php array. But following code is not working. </p> <p> <pre><code>$result['firstName']['lastName']='johan'; $data = json_encode($result); ?&gt; &lt;html&gt; &lt;body onload='myfunction(&lt;?php echo $data; ?&gt;);'&gt; &lt;script&gt; function myfunction(data) { var fn = "firstName"; alert(data.+fn+.lastName); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
php javascript
[2, 3]
4,658,338
4,658,339
How to do a precompiled web application
<p>I have a webapplication that uses a master page. When I publish the site in vs2010 (running framework 4), and then I navigate to the default.aspx page I get a parser error that the masterpage's codebehind file does not exist.</p> <p>I know that a website can be precompiled and then deployed which means there would never be anything that IIS needs to parse. The above error therefore implies that IIS is still trying to compile my precompiled site.</p> <p>Is there something that needs to be configured to stop the web application from doing this?</p>
c# asp.net
[0, 9]
4,957,369
4,957,370
Common Graphs library for Android and iphone
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4995114/is-there-any-chart-library-working-both-on-iphone-and-android-applications">Is there any chart library working both on iphone and android applications?</a> </p> </blockquote> <p>I need to find a common library file to generate graphs for android and iphone. Please let me know if anyone know the library file. </p> <p>Note: I need the library file to develop a native android/iphone app.</p>
android iphone
[4, 8]
5,257,370
5,257,371
Image won't display in user control
<p>I have a user control that's got an image ..when I added it to a page that doesn't have a Master Page..the image was getting displayed alright but when I added the same user control to a page with a Master Page.the image vanished!....When I checked the Page source the image's path was there like this..</p> <pre><code>style = "background-image: url(http://localhost/web1/img1.jpg);" </code></pre> <p>Image exists too! not that its gotten deleted or whatever..</p> <p>Now idk where I read this but I did somewhere that when master page's added and user control's used..the ID s get changed or something..not sure..idk..if that's so..how on earth do IDs get changed and why and of what ? I just can't figure out what might have gone wrong..How do I test it ?? </p> <p><em><strong></em>[EDIT] I checked the Page Source minutely again and guess what some div tag IDs have changed! ..I got this one div who's ID is "div1"..inside of this div is my Sprite image..now this "div1" is being changed to ...."ctl00_ContentPlaceHolder2_ctl00_Banner_ctl00_ContentPlaceHolder2_ctl00_Banner_div1" ...Banner is variable of type UserControl declared in my test page(I am adding UserControl in code behind)...some more Div's IDs are being changed in a similar way...now what do I do about these changing IDs? ... plz help..thnx**</strong></p>
c# asp.net
[0, 9]
1,231,721
1,231,722
Is there a way to make jQuery .js file only contain the functions I use?
<p>Well, I am using jQuery in my project, but I really don't use any effects, only the $.ajax function, is there a way to make jQuery .js file only contain that function or maybe a similar function that doesn't depends on jQuery?</p> <p>I am coding a library, so I don't want to have a jQuery dependence.</p>
javascript jquery
[3, 5]
3,889,201
3,889,202
SELECTS: Hide the selected option on a secondary select
<p>I have two select with the same elements (options) in it. What I am trying to do is that when the user select a value from the first select box, the second select box hides that option, and automatically select the first visible option if the selected option was the same as the one in the first select.</p> <p>I know that <code>:first</code> selects the first element of a group of "objects", and that <code>:visible</code> only select the "visible" ones, so i was thinking that using <code>:first</code> of <code>:visible</code> should work, but what I am getting is no selection at all.</p> <p>if I remove the <code>:visible</code> it works unless the second select box has the first element selected, and the user selects the first element on the first select box</p> <p>This is what I have so far, please keep in mind that I have tried <code>:first</code> and <code>:visible</code> in any combination, but I really think that the problem here is that "hide hasn't finished its job when I use <code>:visible</code></p> <pre><code>$('#style_position').change(function(){ var sel_pos_id = $(this).val(); var sel_xtr_pos_id = $('#style_position_extra').val(); $('#style_position_extra option[value=' + sel_pos_id + ']').hide().siblings().show(); if(sel_pos_id==sel_xtr_pos_id){ $('#style_position_extra option') .removeAttr('selected') .filter(':visible') //I also tried find(':visible') .filter(':first') //I also tried find(':first') .attr('selected','selected'); } }); </code></pre>
javascript jquery
[3, 5]
193,107
193,108
$(this). methods (js or jquery)
<p>I've looked at some js/jquery code and I saw this line here:<br> <code>$(this).</code></p> <p><strong>How can one find out what methods to call on this thing.</strong> Is there something similar to javadocs for js?</p> <p>Is this code in js or is it jquery?</p> <p>Note: this might be of relevance to those who reply, I write backend code and never done front end (not more than simple html)</p>
javascript jquery
[3, 5]
1,584,717
1,584,718
Can I put buttons in SimpleCursorAdapter listView?
<p>I want to put two buttons in listView.</p> <pre><code> public class Imenik extends ListActivity { @Override public long getSelectedItemId() { // TODO Auto-generated method stub return super.getSelectedItemId(); } @Override public int getSelectedItemPosition() { // TODO Auto-generated method stub return super.getSelectedItemPosition(); } ListView lv; Cursor Cursor1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //create a cursor to query the Contacts on the device to start populating a listview Cursor1 = getContentResolver().query( ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); startManagingCursor(Cursor1); String[] from = { ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone._ID}; // get the list items for the listadapter could be TITLE or URI int[] to = {android.R.id.text1, android.R.id.text2}; //sets the items from above string to listview //new listadapter, created to use android checked template SimpleCursorAdapter listadapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_2, Cursor1, from, to ); setListAdapter(listadapter); //adds listview so I can get data from it lv = getListView(); lv.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } </code></pre> <p>}</p> <p>with this code I get all contacts names and numbers and put in the list, but I want two buttons and in every row checkBox, and user can click on item - mark checkBox and click confirm button to get those values in an array. Help, thank you, Wolf.</p>
java android
[1, 4]
305,498
305,499
Javascript - Stop a repeating function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2626005/how-to-pause-a-settimeout-call">How to pause a setTimeout call ?</a> </p> </blockquote> <p>I have a function that gets called on page load which starts off a repeating function:</p> <pre><code> setTimeout(function () { repeat(); }, 8000) </code></pre> <p>This function calls <code>repeat()</code> every 8 seconds, inside this function I have a bit of ajax which updates a counter on the page. Clicking on the counter gives the user a drop down menu with a number of messages. The counter value equals the number of messages the user has. Kind of like Facebook notifications.</p> <p>When clicking the drop down menu Im using jQuery to hide and show it:</p> <pre><code> $('#messages').click(function () { $('#messagesDropDown').slideDown(); }) .mouseleave(function () { $('#messagesDropDown').slideUp(); }); </code></pre> <p>When the <code>#messagesDropDown</code> is visible I want to stop the <code>repeat()</code> function, to prevent the list of messages from updating while Im viewing the current ones.</p> <p>On .mouseleave I want to start the <code>repeat()</code> function again.</p> <p>Anyone have any ideas how I can 'STOP' a repeating function In the <code>.click</code> function and start it again on <code>.mouseleave</code> ?</p>
javascript jquery
[3, 5]
2,237,541
2,237,542
how to use link to read from database in asp.net?
<p>I am using link in aspx page ,If i give in <code>&lt;a href="http://google.com"&gt;&lt;/a&gt;</code> it was working, Suppose if i save in database it was not working , can anyone suggest me how to use it?.</p> <p>I am new to Dnn.</p> <pre><code>&lt;a href='&lt;%# DataBinder.Eval(Container.DataItem, "ImageLink") %&gt;'&gt;&lt;/a&gt; </code></pre>
c# asp.net
[0, 9]
2,459,122
2,459,123
Why a class in App_Code/BLL is not accessible in pages?
<p>Hi I have a class in folder App_Code/BLL/Countries.cs ,which is a public class. But when I tried to access the class in a ASP.NET page like:</p> <pre><code>Countries MyCountries = new Countries(); </code></pre> <p>its showing error:</p> <p>"The type or namespace name 'Countries' could not be found (are you missing a using directive or an assembly reference?)"</p>
c# asp.net
[0, 9]
1,999,514
1,999,515
live data feed using c# from access database
<p>I'm currently building a website (ASP.net c#) and we're looking at creating a live feed (similar to the facebook one) for data events on our website. I wanted to know your thoughts on how best to implement this as I am not sure my understanding is correct. </p> <p>We have events such as: new article published, user coming online.</p> <p>Users will log in to their members area and should then see the live feed. </p> <p>My current thinking is that I'd have a query every few seconds (from the users browser) which looks for any new events since the last request date. If there are new ones since dateX (last request date) then show that. </p> <p>I'd save the last request date along with the userID so when they come back, I know what the last thing they've seen is.</p> <p>Is this the best way of doing it - or should I be looking at some sort of push methods? I need it to be cross browser friendly and supporting older browsers... so the HTML 5 methods I've looked at aren't really an option.</p> <p>Thanks for any advice. </p>
c# asp.net
[0, 9]
2,595,322
2,595,323
Request.Form.Get from a select option tag error
<p>Im trying to get a value or a text from the "select option" tag through C#, but I run on some issues :</p> <p>this is my code :</p> <pre><code>&lt;select id="country" &gt; &lt;option value="" &gt;Select One...&lt;/option&gt; &lt;%for (int i = 0; i &lt; dt.Rows.Count; i++) {%&gt; &lt;option value="&lt;%=dt.Rows[i][0].ToString() %&gt;" &gt;&lt;%=dt.Rows[i][1].ToString() %&gt;&lt;/option&gt; &lt;%} %&gt; &lt;/select&gt; </code></pre> <p>and this is my code behind :</p> <pre><code>string value = Request.Form.Get("country"); </code></pre> <p>its keep getting <code>null</code> in my value. and if Im trying to set my <code>&lt;select&gt;</code> tag with <code>runat="server"</code>, its getting an error : </p> <blockquote> <p>Code blocks are not supported in this context</p> </blockquote> <p>any help?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
5,021,942
5,021,943
StringBuilder's AppendFormat Method to create Table
<p>I have a problem with AppendFormat method of StringBuilder class. I am creating table and appending data in string builders object to send it as mail, but when i saw mail sent by me, it does not look like table, its header and there corresponding contents are miss-placed. I want table to be separated by Lines as it generally there in microsoft word's table. how can i achieve it.. I am using following code: Body is a StringBuilder Object</p> <pre><code>if ( dic1 != null ) { //Body.AppendFormat("Client: " + cl + " Success. " + dic1.Count + " :"); Body.AppendFormat("&lt;br/&gt;&lt;table&gt;"); Body.AppendFormat("&lt;h1&gt;&lt;tr&gt;&lt;td&gt;#&lt;/td&gt;&lt;td&gt;Files Name&lt;/td&gt;&lt;/tr&gt;&lt;/h1&gt;"); int count = 1; foreach ((KeyValuePair&lt;string, string&gt; pair in dic1) { if (!String.IsNullOrEmpty(pair.Key)) { Body.AppendFormat("&lt;tr&gt;&lt;td&gt;"+count.ToString()+"&lt;/td&gt;&lt;td&gt;" + pair.Key + "&lt;/td&gt;&lt;td&gt; " + pair.Value + "&lt;/td&gt;&lt;/tr&gt;"); count++; //Body.Append( ); } } Body.AppendFormat("&lt;/table&gt;"); </code></pre> <p>Following is output i am getting in my inbox.</p> <pre><code> # File Name Error 1 txt1.txt Loading File 'txt1.txt' failed: The specified File already exists in the system 2 txt2.txt Loading File 'txt2.txt' failed: The specified File already exists in the system 3 txt3.txt Loading File 'txt3.txt' failed: The specified File already exists in the system </code></pre>
c# asp.net
[0, 9]
5,190,478
5,190,479
jQuery function EventListener doesnt work
<p>I've got some code which creates an &lt; audio > element and plays a song, when I click on a button. So far so good. The button turns from "Play Music" into "Stop Music" as it's clicked.</p> <p>Now I added this code:</p> <pre><code>audioElement.addEventListener('ended', function() { $('span#pause').fadeOut('slow'); $('span#play').delay(1500).fadeIn('slow'); }); </code></pre> <p>Which technically should show the Play-Button again, when the song is over. But it doesn't. Could anybody tell my why?</p> <p>Here's the whole code:</p> <pre><code>$(document).ready(function() { var songList = [ 'song1.ogg', 'song2.ogg', 'song3.ogg' ]; var randomNumber = Math.floor(Math.random()*songList.length); var audioElement = document.createElement('audio'); audioElement.setAttribute('src', songList[randomNumber]); audioElement.load(); audioElement.addEventListener('ended', function() { $('span#pause').fadeOut('slow'); $('span#play').delay(1500).fadeIn('slow'); }); $('#play').click(function() { audioElement.play(); $('span#play').fadeOut('slow'); $('span#pause').delay(1500).fadeIn('slow'); }); $('#pause').click(function() { audioElement.pause(); $('span#pause').fadeOut('slow'); $('span#play').delay(1500).fadeIn('slow'); }); }); </code></pre>
javascript jquery
[3, 5]
1,738,849
1,738,850
What is this: $(function() {?
<p>Is this basically the same as <code>$(document).ready</code> or is this only run like this to ensure jQuery is there?</p> <p>Maybe something else I'm not seeing?</p>
javascript jquery
[3, 5]
674,108
674,109
How to in case of timeout to execute method again and again until it completes successfully?
<p>I have asp.net application. All business logic in business layer.</p> <p>Here is the example of the method</p> <pre><code>public void DoSomething() { PersonClass pc = new PersonClass(); pc.CreatePerson(); pc.AssignBasicTask(); pc.ChangePersonsStatus(); pc.CreateDefaultSettings(); } </code></pre> <p>what happens once in a while, one of the sub method can timeout, so as a result the process can be incompleted.</p> <p>what I think in this case to make sure all steps completed properly is </p> <pre><code>public void DoSomething() { PersonClass pc = new PersonClass(); var error = null; error = pc.CreatePerson(); if(error != timeout exception) error = pc.AssignBasicTask(); else return to step above if(error != timeout exception) error = pc.ChangePersonsStatus(); else return to step above if(error != timeout exception) error = pc.CreateDefaultSettings(); else return to step above } </code></pre> <p>but it's just an idea, more then sure it's a proper way how to handle this.</p>
c# asp.net
[0, 9]
3,274,558
3,274,559
What is console.log in jQuery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4539253/what-is-the-console-log-used-for-in-jquery">What is the console.log used for in jQuery?</a> </p> </blockquote> <p>What is <code>console.log</code>? What is it used for in jQuery?</p>
javascript jquery
[3, 5]
3,413,573
3,413,574
javascript Remove value from array, array problems
<p>I am trying to fill an array with strings, the elements that will be added are the HTML of the clicked &lt;\li>, im probably filling it correctly.</p> <p>My problem is when the user clicks on the checked link again, i want to remove this item from the array</p> <p>Here is a code sample:</p> <pre><code>$(document).ready(function(){ var chosen = []; var chosenCounter = 0; find("ul").find("li").click(function(){ var checkBox = $(this).find("img").first(); var checkBoxSrc = checkBox.attr("src"); if(checkBoxSrc == "images/unchecked.png"){ checkBoxSrc = "images/checked.png"; checkBox.attr("src",checkBoxSrc); checkBox = ""; checkBoxSrc = ""; var temp = this.outerHTML; chosen[chosenCounter] = temp; chosenCounter ++; } if(checkBoxSrc == "images/checked.png"){ checkBoxSrc = "images/unchecked.png"; checkBox.attr("src",checkBoxSrc); checkBox = ""; checkBoxSrc = ""; for (var j =0; j&lt;=chosen.length; j++){ var tempRemove = this.outerHTML; chosen.splice( chosen.indexOf( tempRemove ), 1 ); tempRemove = ''; } } }); </code></pre> <p>});</p> <p>I have been trying all functions and ways i found on internet .. but the results doesn't works well, i would be very thankful for a correction and explanation. Thanks all in advance.</p>
javascript jquery
[3, 5]
2,398,148
2,398,149
Update select list depending on another list
<p>I've been looking around here for a time now, but I didn't really found what I'm needing.</p> <p>I've a dropdown with some teachers in it. The second list should contain the courses he/she teaches.</p> <p>So, a little example:</p> <p>Mr X teaches maths and biology. Mrs Y teaches maths</p> <p>If X is selected in the first list, the second list should contain maths and biology. If Y is selected, the list should only contain maths.</p> <p>The PHP part, HTML, CSS, is not the issue, it's only about the 'refreshing/updating' of the second list.</p> <pre><code>&lt;select name="lecturer_id" id="lecturer_id"&gt; &lt;option value="22"&gt;X&lt;/option&gt; &lt;option value="30"&gt;Y&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I'm looking for a very simple solution, because my knowledge of javascript is poor. So that's why I prefer a jQuery solution.</p> <p>-- update</p> <p>The data is comming from a database. My application currently generates the follow HTML: <a href="http://pastebin.com/9rEWKAkF" rel="nofollow">http://pastebin.com/9rEWKAkF</a></p> <p>The two lists, lecturer_id and coure_id are dynamicly generatrd with the information in my database. The list I want to update is the second one, course_id. I hope this makes it more clear.</p>
javascript jquery
[3, 5]
4,327,664
4,327,665
trying to append content to DOM element
<p>I'm trying to add a div to a row of content with the click of a button. My code works for the first row but not for any other row. Please help. This is the function for the button:</p> <pre><code>$(".addMMbtn").each(function() { $(this).bind("click", function() { var thisRow = $(this).closest(".txtContentRow"); var thisTxt = thisRow.find(".txtContent"); var cellStr = '&lt;div class = "mmCell prep"&gt;&lt;/div&gt;'; $(cellStr).appendTo(thisTxt); } ); }); </code></pre> <p>You can see a fiddle of the problem here: <a href="http://jsfiddle.net/z7uuJ/" rel="nofollow">http://jsfiddle.net/z7uuJ/</a></p>
javascript jquery
[3, 5]
714,884
714,885
jQuery .click event binding to multiple dynamic elements
<p>Within my code I am trying to bind a click event to a dynamically created element. Each element's click event has specific metadata used within the handler. Rather than appending dynamic attributes in HTML (there's a lot of them), I have an array of objects. This is also why I've not used a global event handler.</p> <p>The code example may explain that better!</p> <p>The problem I am having, is the click event is only called for the last created element. Here's some code:</p> <pre><code>var MyObject = { additionalAttributes: { ... } getNode: function() { if (this.node) return this.node; var a = this.node = $(document.createElement("a")); // ... building the 'a' here. a.click(function(e) { e.preventDefault(); alert(this.additionalAttributes.something); }); } } </code></pre> <p>Get Node is called like so:</p> <pre><code>var x = new MyObject( ... ); $('#someDivElement').append(x.getNode()); </code></pre> <p>This works nicely, but if I call the .append() with multiple instances of 'x', the click event is only fired for the last element added to the container.</p> <p>Can anyone explain what I'm doing wrong here, or perhaps suggest a better approach to the overal problem?</p> <p><strong>Edit:</strong> I didn't use a global binding (.on('click')) because of the additional functionality/data I need within handler. Having the .click() event defined in the way I did it provided access to the specific MyObject instance associated with that link.</p> <p><strong>Edit 2:</strong> This code below would do what I am expecting, with each link having the callback, though for some reason my implementation does not do this:</p> <pre><code>for (var i = 0; i &lt;= 10; i++) { $(document.createElement("a")) .attr("href","#") .text("Test Link " + i) .click(function() { alert("clicked"); }) .appendTo("div.test"); } </code></pre>
javascript jquery
[3, 5]
269,923
269,924
javascript error with label
<p>I have a function as follows:</p> <pre><code>function textNext(element, num) { document.getElementById("lblContent").innerHTML = "hello"; } </code></pre> <p>However, the text of the <code>lblContent</code> label won't change when the function is called. </p> <p>What am I doing wrong?</p> <p>btw : lblContent is of type asp:Label</p>
javascript asp.net
[3, 9]
4,398,261
4,398,262
Repeter With multiple data source of type class
<p>Hi I have 5 different classes. And using single repeater I want to populate the each class data without writing any data binding code except assigning DataSource and DataBinding. the header values should be populated based upon the class members. I think I can use reflection. But I need clear idea. And if i use reflection, is there a possibility of violating security. </p>
c# asp.net
[0, 9]
2,330,237
2,330,238
How can I add mouse click event to Web TextBox in c#
<p>How can I add mouse click event to Web TextBox in c#</p>
c# asp.net
[0, 9]
1,264,254
1,264,255
Opposite of append in jquery
<p>I use <code>.append</code> to add to a div </p> <pre><code>$(this).append('&lt;ul&gt;&lt;li&gt;test&lt;/li&gt;&lt;/ul&gt;'); </code></pre> <p>how can I search fo a <code>&lt;ul&gt;</code> and remove it if it exists in the children of <code>$(this)</code>?</p>
javascript jquery
[3, 5]
1,833,177
1,833,178
How can I validate that several textboxes contain data when I click submit?
<p>I have 10 defined textboxes with strings.</p> <p>I have to check all if they are not empty while clicking ok button</p> <p>whats the cleanest way to check them all and when function is at end. each checkbox which was empty to give this a specific CSSclass. perhaps. ClassError. ( which highlights red) </p> <p>I'm happy for answers.</p>
c# asp.net
[0, 9]
2,065,438
2,065,439
binding several jquery ui elements to each other
<p>Is is possible to set up a group of multiple jquery ui elements to all respond to interactions with any one in the group?</p> <p><b>edit:</b> For example, I've got several version of very similar images, which I've group into different pages with jquery.tabs(). The images are all manipulatable with various jquery ui things (dragable, resizable etc.). All of my tabs should look identical, except for the path to the images. So when I drag or resize an image in one tab, I'd like the corresponding image in a the other tabs to do the same.</p>
javascript jquery
[3, 5]
2,341,268
2,341,269
JPype - Issue importing & calling methods!
<p>Here I'm attaching my code below</p> <pre><code>from jpype import * from javax.swing import JFrame classpath = "-Djava.class.path=praat.jar" startJVM(getDefaultJVMPath(),"-ea",classpath) frame = javax.swing.JFrame("Hello JPype") label = javax.swing.JLabel("Hello JPype!", JLabel.CENTER) frame.add(label) frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setSize(200, 100) frame.show() shutdownJVM() </code></pre> <p>When i run this program I get an error.</p> <pre><code> /Library/Python/2.6/site-packages/jpype/_pykeywords.py:18: DeprecationWarning: the sets module is deprecated import sets 2010-02-01 22:26:27.473 Python[754:d07] Apple AWT Java VM was loaded on first thread -- can't start AWT. Traceback (most recent call last): File "swing.py", line 10, in &lt;module&gt; frame = javax.swing.JFrame("Hello Jython") File "/Library/Python/2.6/site-packages/jpype/_jpackage.py", line 53, in __call__ raise TypeError, "Package "+self.__name+" is not Callable" TypeError: Package javax.swing.JFrame is not Callable </code></pre> <p>Is there any way to solve this problem. A normal Hello World program works fine, but when I'm trying to import packages I get similar issues.</p>
java python
[1, 7]
1,782,749
1,782,750
How to access the programmatically generated elements using jQuery
<p>How can I access a dynamically created element using jQuery? Suppose I have the following code:</p> <pre><code>for (var i = 0; i &lt; count; i++) { var div = document.createElement("div"); div.setAttribute("id", "divHour" + i); var button = document.createElement("button"); button.setAttribute("id", "btnHour" + i); div.appendChild(button); document.getElementById("divHours").appendChild(div); } </code></pre> <p>How can I access the buttons using jQuery?</p>
javascript jquery
[3, 5]
2,290,063
2,290,064
How to define which ListView have been clicked?
<p>I have been developing Android application which has 3 ListView and one ContextMenu for each view:</p> <p>@Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo info) {</p> <pre><code>menu.add(Menu.NONE, CONTEXT_MENU_ITEM_DELETE, Menu.NONE, "Delete"); super.onCreateContextMenu(menu, view, info); </code></pre> <p>}</p> <p>Registration for click catching:</p> <pre><code>this.registerForContextMenu(mFirstCategory); this.registerForContextMenu(mSecondCategory); this.registerForContextMenu(mMainCategory); </code></pre> <p>mFirstCategory, mSecondCategory, mMainCategory are ListViews. Also I have method for getting row clicked:</p> <p>@Override public boolean onContextItemSelected(MenuItem item) {</p> <pre><code>AdapterContextMenuInfo info=(AdapterContextMenuInfo)item.getMenuInfo(); String name = null; switch (info.targetView.getId()) { case (R.id.listViewFirst): name="First"; case (R.id.listViewSecond): name="Second"; case (R.id.listViewMain): name="Main"; } Toast.makeText(this, name+"_"+String.valueOf(info.position), Toast.LENGTH_LONG).show(); return super.onContextItemSelected(item); </code></pre> <p>}</p> <p>I need to define position (row) clicked of ListView and ListView clicked. My "switch/case" block doesn't work. Please, tell me, how can I do my need? </p>
java android
[1, 4]
4,530,864
4,530,865
Filtering Content using jQuery
<p>I'm attempting to create a filterable photo gallery using jQuery and multiple classes. I have some code set up, but it doesn't seem to work. Can anybody give me any insight on how to fix this function?</p> <pre><code> $(document).ready(function(){ $('#sorter a').click(function(e){ var sortName = $(this).text().toLowerCase().replace(' ','-'); if(sortName === 'all-images'){ $('#photorow1 li').show().removeClass('hidden'); } else { $('#photorow1 li').filter(sortName).show().removeClass('hidden') .end().not(sortName).hide().addClass('hidden'); } e.preventDefault(); }); }); </code></pre> <p>Any help would be greatly appreciated!!</p> <p>*updated code</p>
javascript jquery
[3, 5]
3,791,319
3,791,320
How to save the obtained chart from afreechart to some png or JPEG format
<p>I have tried to develop the chart from jfreechart but i got errors and i found Afreechart, in which i am able to draw the chart, but next is how to save the obtained chart to some image format.</p>
java android
[1, 4]
353,549
353,550
getting parts of url window.location
<p>Can someone help me with url hash? I use this code to get the current url and then send the data as json, but the hash part seems to be stripped then. i tryed to use href and hash and i always get the default.aspx but no hash part like #anchor. </p> <pre><code>var location = String(window.location); var title = String(document.title); var text = { 'url': location, 'title': title }; </code></pre> <p><strong>Thanks for help guys. I figured it out. All answers were correct as well as my code. I just put it in wrong event hadler. Because my hash parts are generating dynamically. Sorry for disturbing you guys!!!</strong></p>
c# javascript jquery
[0, 3, 5]
4,528,825
4,528,826
ASP.Net application pool use too much memory
<p>I create asp.net asmx service for online game. When it run on production server asp.net application use 1.5 - 3 GB of memory.</p> <p>When i use ANTS memory profiler, i saw what 70% of application memory is free and C# objects use 100 - 200Mb.</p> <p>How me make asp.net return free memory to OS? If i will run several similar apllication on one server i get memory out exception.</p> <p>Used technologes: ASP.Net v4 Windows 2008 C# Small used asp.net cashe for hard database request. </p>
c# asp.net
[0, 9]
4,163,494
4,163,495
How can i change image path on click for asp.net dynamic content
<p>I am using jquery for changing image path but its not working for asp.net dynamic content</p> <p>The jquery function is<br></p> <pre><code>$('img.selection').click(function () { this.src = 'images/selected_img.png'; }); </code></pre> <p>This function is not post backing in to the C#, so am not getting changed image values.<br> Please help me...</p>
c# jquery asp.net
[0, 5, 9]
3,976,962
3,976,963
document.ready is not working on showmodaldialog
<p>I am working on a Application in which i frequently uses the popups.</p> <p>but i cann't figure out why document.ready is not working on showmodaldialog</p> <p>but window.load is working fine on that.</p>
javascript jquery
[3, 5]
189,443
189,444
Which is most suitable to begin programming (java vs c#) for an intermediate php programmer
<p>i am a php programmer who has no previous programming experience neither in java nor in c#(sharp). My goal is to learn both languages java and c#, so i am looking for an experienced programmer who has in depth knowledge of both languages to suggest me which one to start first in order to make my learning process easier and to help me grasp fast on the second language once i have finished learning the first. <em>(e.g some people find it easier when they learn the difficult language first or the one that has more features and programming aspects so once they are through and they start the second one they find the learning process like walking in the park)</em></p>
c# java php
[0, 1, 2]
5,665,431
5,665,432
OpenPop.Net - The server did not respond
<p>I am using OpenPop.NET and I am trying to download the emails from the server. But, it is giving the below error message In the meantime, I could configure and download the mails without any issues in Outlook by using the same settings that I did with OpenPop.NET.</p> <p>The server did not respond with a + response. The response was: "-ERR Command is not valid in this state."</p> <pre><code>FetchAllMessages(smtpserver, 110, false, emailId, password); public static List&lt;Message&gt; FetchAllMessages(string hostname, int port, bool useSsl, string username, string password) { using (Pop3Client client = new Pop3Client()) { client.Connect(hostname, port, useSsl); client.Authenticate(username, password); int messageCount = client.GetMessageCount(); List&lt;Message&gt; allMessages = new List&lt;Message&gt;(messageCount); for (int i = messageCount; i &gt; 0; i--) { allMessages.Add(client.GetMessage(i)); } return allMessages; } } </code></pre> <p>throwing exception in client.Authenticate(username, password);</p>
c# asp.net
[0, 9]
3,856,215
3,856,216
Return unique keys from JavaScript Array
<p>I'm hoping my question is using the correct terminology...</p> <p>Can someone explain to me how I can perform the following:</p> <p>If I have an array consisting of:</p> <blockquote> <p>Object { id=1498, brandName="Booths", quality="Standard"} Object { id=1499, brandName="Booths", quality="Standard"}</p> </blockquote> <p>How can I iterate throughout that array and return another array of distinct 'keys'?</p> <p>Ultimately I want an array which would return something like:</p> <p>[id,brandName,quality] (but the original array is going to return different keys at different times.</p> <p>Have I made sense?</p>
javascript jquery
[3, 5]
4,773,149
4,773,150
Finding indices of highlighted text
<p>I'm trying to save information about text that a user has highlighted in a webpage. Currently I'm using the getSelection method shown below:</p> <pre><code> var txt = ''; if (window.getSelection){txt = window.getSelection();} else if (document.getSelection){txt = document.getSelection();} else if (document.selection){txt = document.selection.createRange().text;} else return; </code></pre> <p>to retrieve the highlighted text. Then I'm searching through the entire text body and storing the indices of the highlighted text. The getSelection method only returns what text is highlighted so the problem is that if the highlighted text appears multiple times in the text body, the search could find the wrong repeat of the text and thus save the wrong indices.</p> <p>Any ideas how to ensure that I'm saving the right indices?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
4,896,741
4,896,742
php grabbing data from javascript
<p>Apparently i try to save the data into the mysql, but it didnt work.. Anyone help?</p> <p>create_users.php</p> <pre><code>&lt;form method="post" action="checkAvailability.php"&gt; &lt;script&gt; var macs = { getMacAddress : function() { document.macaddressapplet.setSep( "-" ); return (document.macaddressapplet.getMacAddress()); }}jQuery(document).ready(function(){ var mac = macs.getMacAddress(); $.get('/checkAvailability.php?mac=' + mac, function() { alert('yeah done'); }) }); &lt;/script&gt; &lt;script type="text/javascript"&gt; document.write(macs.getMacAddress()); &lt;/script&gt; &lt;/form&gt; </code></pre> <p>checkAvailability.php</p> <pre><code>$dbhost = 'localhost'; $dbuser = 'root'; $dbname = 'registration'; mysql_connect($dbhost, $dbuser) or die("Could not connect database"); mysql_select_db($dbname); $mac = $_GET['mac']; $mac = mysql_real_escape_string($mac); $sql = "INSERT INTO test(mac) VALUES ('$mac')"; mysql_query($sql); </code></pre>
php javascript
[2, 3]
4,774,887
4,774,888
Assign dynamic div id from js var
<p>I am having trouble selecting a <code>div</code> with jQuery after assigning the <code>id</code> to a Javascript variable:</p> <pre><code>$(function() { $(".do").live("click",function() { var id = $(this).attr("id"); $.ajax({ //reload div using js var id $('id').fadeOut('fast').load('http://example.com/get.php').fadeIn("slow"); }); return false; }); }); </code></pre> <p>When I call a static div it works just fine like this:</p> <pre><code>$('#staticdiv').fadeOut('fast').load('http://example.com/get.php').fadeIn("slow"); </code></pre> <p>How can I select a <code>div</code> from a Javascript variable containing its <code>id</code>?</p> <p>*EDIT<br> Here is an example if the divs: <br> Button to engage reload</p> <pre><code>&lt;a href="" class="do" id="12"&gt;click to reload&lt;/a&gt; </code></pre> <p>DIV to reload: </p> <pre><code>&lt;div id="12"&gt;to be refreshed&lt;/div&gt; </code></pre> <p><br>keep in mind the "12" us dynamic and could be any variable.</p>
javascript jquery
[3, 5]
2,105,158
2,105,159
Adding properties to a existing object
<p>thsi is not a jquery ui question but a JavaScript object question </p> <pre><code>function uiDialog() { ............... ............... $('#dialog ').dialog({ width:'auto', height :'auto', resizable: false }); .............. .............. } </code></pre> <p>Above is a jquery ui dialog code. Now everywhere i want a dialog am calling uiDialog(). Now ui has so many options that are rarely required. So i am considering passing a object as a parameter and appending it to this default data but how can i do it .can i do </p> <pre><code>$('#dialog ').dialog({ width:'auto', height :'auto', resizable: false, myObject }); </code></pre> <p>Will this work or can you suggest any other way if this fails </p>
javascript jquery
[3, 5]
2,143,900
2,143,901
updating a input field based on selectlist option
<p>I have the following HTML</p> <pre><code>&lt;select name="title" id="title"&gt; &lt;option value="Mrs" &gt;Mrs&lt;/option&gt; &lt;option value="Mr" &gt;Mr&lt;/option&gt; &lt;option value="Miss" &gt;Miss&lt;/option&gt; &lt;option value="Dr" &gt;Dr&lt;/option&gt; &lt;/select&gt; &lt;input type="text" name="gtitle" id="gift_title" value="" /&gt; </code></pre> <p>Now by default <code>Mrs</code> is shown as the first option of the select list. What I need to do then, is to get this value and display it in the <code>input</code> field. Subsequent selections by the user, i.e he/she choses <code>Mr</code>, must also update this input field as well.</p> <p>I was hoping I could this in jQuery, but I wasn't sure how to get these values.</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,849,421
5,849,422
Javascript function to set cookie value
<p>I am new to programming and trying to write a javascript function to set a cookie value when a popup button is clicked. </p> <p>In home.aspx</p> <pre><code>&lt;input id="btnCanOK2" type="button" value="Close" class="popupButton" runat="server" onclick="return btnClose_Click" /&gt; </code></pre> <p>for this button, i have written a javascript function:</p> <pre><code>function btnClose_Click() { document.cookie = 'cookieName=closed; value=dontshowagain'; } </code></pre> <p>In merchant.login page</p> <p>In the code behind of the other page, it has to check if the value of the cookie is set to "dontshowagain". If it is set to the value, the function should not show the popup again. My task is not to show the popup in different pages. If it is closed once, it has to stop showing again until the browser is closed.</p> <pre><code>if (Request.Cookies["closed"] == null) { ModalPopupextender2.Show(); } else if(Request.Cookies["closed"].Tostring() == "dontshowagain") { ModalPopupextender2.Hide(); } </code></pre> <p>Where am i doing wrong?? Now Cookie value is always null :(</p> <p>Thanks a lot in advance. </p>
c# javascript asp.net
[0, 3, 9]
1,580,599
1,580,600
jQuery errorContainer practice
<p>I'm trying to be able to place the error message when using jQuery validation to a asp.net label if the textbox is empty.</p> <p>please advice how to modify my code to get that!!</p> <p>here is my code:</p> <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt; &lt;script src="js/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="js/jquery.validate.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#aspnetForm").validate({ errorContainer: "#&lt;%=TextBox1 %&gt;", errorLabelContainer: "#&lt;%=TextBox1 %&gt; #&lt;%=Label1 %&gt;", wrapper: "li", debug: true, submitHandler: function() { alert("Submitted!") } }) }); &lt;/script&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"&gt; &lt;p style="height: 313px"&gt; &lt;asp:TextBox ID="TextBox1" runat="server" class="required"&gt;&lt;/asp:TextBox&gt; &lt;asp:Label ID="Label1" runat="server" Text="Label" &gt;&lt;/asp:Label&gt; &lt;/p&gt; &lt;/asp:Content&gt; </code></pre>
asp.net jquery
[9, 5]
2,379,115
2,379,116
DropDownList in Repeater control, can't fire SelectedIndexChanged
<p>I have a repeater control where in the footer I have a DropDownList. In my code-behind I have:</p> <pre><code>protected void ddMyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { // Item binding code } else if (e.Item.ItemType == ListItemType.Footer) { DropDownList ddl = e.Item.FindDropDownList("ddMyDropDownList"); // Fill the list control ddl.SelectedIndexChanged += new EventHandler(ddMyDropDownList_SelectedIndexChanged); ddl.AutoPostBack = true; } } </code></pre> <p>The page appear to PostBack however my EventHandler does not get called. Any ideas?</p>
c# asp.net
[0, 9]
4,142,471
4,142,472
how to start a process as user then elevate in c# ASP.NET
<p>I am working on a web application that install software on a server.</p> <p>I can run the install by hand if I log in a user that is apart of a specific group then run install msi as administrator.</p> <p>This specific group is apart of the local administrators group.</p> <p>My app pool is running as Network_Service.</p> <p>Do I impersonate then use the runAs verb? but then I need to know the u/p as user and u/p of Administrator .. I think</p> <p>I am using the System.Diagnostics.Process classes.</p> <pre><code> System.Diagnostics.ProcessStartInfo oInfo = new System.Diagnostics.ProcessStartInfo(str); oInfo.UseShellExecute = false; oInfo.ErrorDialog = false; oInfo.CreateNoWindow = false; oInfo.RedirectStandardOutput = true; Process p = System.Diagnostics.Process.Start(oInfo); System.IO.StreamReader oReader2 = p.StandardOutput; string sRes = oReader2.ReadToEnd(); oReader2.Close(); return sRes; </code></pre>
c# asp.net
[0, 9]
340,861
340,862
How to limit number of options displayed in Jquery autocompleter?
<p>I am using Jquery autocompleter with a list of about 200 items. When I type a character into the box it suggests all the 100-150 options at once.</p> <p>The list is so long it extends well beyond the page bottom border and also gives horrible performance.</p> <p>How can I limit the number of options displayed to a reasonable number like 5 or 6?</p> <p>The official documentation given <a href="http://api.jqueryui.com/autocomplete/" rel="nofollow">here</a> does not help.</p> <p>What is the way to limit the length of the list? Is there another autocompleter library that offers good performance?</p>
javascript jquery
[3, 5]
5,011,851
5,011,852
removing scripts from html data... using javascript
<p>So I have this function to strip out scripts from the page, but some scripts that are many lines long are still showing up. Is there a way to remove all scripts from the page that loads.</p> <pre><code> function filterData(data){ // filter all the nasties out // no body tags data = data.replace(/&lt;?\/body[^&gt;]*&gt;/g,''); // no linebreaks data = data.replace(/[\r|\n]+/g,''); // no comments data = data.replace(/&lt;--[\S\s]*?--&gt;/g,''); // no noscript blocks data = data.replace(/&lt;noscript[^&gt;]*&gt;[\S\s]*?&lt;\/noscript&gt;/g,''); // no script blocks data = data.replace(/&lt;script[^&gt;]*&gt;[\S\s]*?&lt;\/script&gt;/g,''); // no self closing scripts data = data.replace(/&lt;script.*\/&gt;/,''); // [... add as needed ...] return data; } </code></pre> <p>Here is an example of the script that comes through in the html</p> <pre><code>&lt;script type="text/javascript"&gt; var ccKeywords="keyword="; if (typeof(ccauds) != 'undefined') { for (var cci = 0; cci &lt; ccauds.Profile.Audiences.Audience.length; cci++) { if (cci &gt; 0) ccKeywords += "&amp;keyword="; ccKeywords += ccauds.Profile.Audiences.Audience[cci].abbr; } } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
5,389,680
5,389,681
Change style using children()
<p>I want to change the "b" color to red with using children. Why doesn't the example above work? How can I make it work?</p> <pre><code>&lt;div id="wrap"&gt; &lt;div class="parent1"&gt; &lt;div class="parent2"&gt; &lt;b&gt;Text&lt;/b&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <pre><code>$(function(){ $('#wrap').children('parent1').children('parent2').$('b').css('color':'red'); }) </code></pre> <p>Here is my jsFiddle example: <a href="http://jsfiddle.net/L5aSt/" rel="nofollow">http://jsfiddle.net/L5aSt/</a></p>
php javascript jquery
[2, 3, 5]
4,669,039
4,669,040
Prior jQuery UI Dialogs become nonresponsive after opening a new Dialog
<p>I'm having issues with multiple jQuery dialogs. The first one opens fine - is resizable, draggable, etc. However, when I open a second the first becomes unresponsive to dragging/moving/closing, even after the second one is closed. What is the reason for this and how can it be fixed? </p> <p>According to the jQuery documentation this should work fine (since stacking is supported).</p>
javascript jquery
[3, 5]
5,792,262
5,792,263
Run .hover() inside variable jquery
<p>I'm just trying to write some code like this:</p> <pre><code>var clickAction = function(){ $('#OL_Icon_55').append("&lt;em class='well'&gt;Hello World&lt;/em&gt;"); } $("body").one("mouseenter",clickAction); </code></pre> <p>And I want to hide <code>Hello World</code> string when mouse hover around <code>#OL_Icon_55</code>, than the code will be look like this :</p> <pre><code>var clickAction = function(){ $('#OL_Icon_55').append("&lt;em class='well'&gt;Hello World&lt;/em&gt;", function() { $(this).hover(function () { $(".well").hide(); }); }); } $("body").one("mouseenter",clickAction); </code></pre> <p>But that is not working for me. Does anyone have a little more idea or correct that code so that hover function can work?</p>
javascript jquery
[3, 5]