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
4,465,197
4,465,198
How can I establish a long-lived connection with jQuery for push notification?
<p>I am trying to establish a long lived connection using jQuery. I have a URL in the form of:</p> <pre><code>http://www.sample.com/Notify?sessionId=xxxxxx </code></pre> <p>Now if I call this URL with the sessionId, it is equivalent to registering for Asynchronous notifications. I am aware of ajax calls using jQuery but as I understand it, after getting some data, jQuery terminates the connection. Is there a way to make it retain the connection so that the server miht be able to push information?</p>
javascript jquery
[3, 5]
3,357,136
3,357,137
asp:LoginStatus automatically log out after some time
<p>I have <code>asp:LoginStatus</code> on my master page and in my <code>login.aspx.cs</code> file I have logiIn button, which have the selected event handler like.</p> <pre><code> protected void btLogIn_Click(object sender, EventArgs e) { int chk = _dbobj.CheckingIfUserExists(tbUserName_login.Text, tbPassword_login.Text); if (chk != 0) { Response.Cookies["UserName"].Value = tbUserName_login.Text.Trim(); lbUserNameValidation_logIn.Text = ""; Response.Redirect("Home.aspx", false); if (chbRemember_login.Checked) { Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(1); System.Web.Security.FormsAuthentication.RedirectFromLoginPage(tbUserName_login.Text, true); } else { Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1); System.Web.Security.FormsAuthentication.RedirectFromLoginPage(tbUserName_login.Text, false); } } else ............ </code></pre> <p>When I login without checking remember checkbox, it remembers anyway, and doesn't set loggedout after closing and opening the page.Please help me to solve this..</p>
c# asp.net
[0, 9]
1,599,302
1,599,303
ASP .Net Gridview
<p>I'm using a form to populate a gridview with x users. However I want whenever I call the function if there is only 1 user displayed inside the gridview to autoselect that first user.</p> <p>So within my callback function I have </p> <pre><code>if (users.count == 1) { // Do something } </code></pre> <p>I currently use the following function upon someone pushing "select" alongside the gridview.</p> <pre><code>Users_SelectedIndexChanged(object sender, EventArgs e) </code></pre> <p>It would be nice if I could reuse this function and do something like</p> <pre><code>if (users.count == 1) { Users_SelectedIndexChanged(object sender, EventArgs e); } </code></pre>
c# asp.net
[0, 9]
4,519,276
4,519,277
To count number of spaces using jquery?
<p><strong>Question:</strong> I need a solution to find number of empty spaces infront of checkbox inside list tag by using jquery </p> <pre><code> &lt;li id='list_id'&gt; &amp;nbsp;&amp;nbsp;&lt;input type="checkbox" name="check"&gt;good &lt;/li&gt; </code></pre>
javascript jquery
[3, 5]
5,485,493
5,485,494
Replace words in a string
<p>I have an array as follows:</p> <pre><code>var arr = ["apple", "banana", "carrot"]; </code></pre> <p>I want to replace all sentences which have the words similar to the array</p> <pre><code>function replaceString(fruits){ return fruits.replace(arr, "---"); } </code></pre> <p>So if I pass a string - "An apple a day keeps", it should return "An --- a day keeps" </p> <p>How can I do it?</p>
javascript jquery
[3, 5]
4,179,614
4,179,615
Trying to call static function in a class
<p>I am trying to call a static function from a class but the intellisense is not picking it up?</p> <p>the function return </p> <pre><code> public static ArrayList GetInfo(int infoID) </code></pre> <p>and i am calling from somewhere else in another class, I was trying to do something like</p> <pre><code>var myitem = myClassName.GetInfo(x); </code></pre> <p>but intelisense doesnt pick it up... as I type myClassName.</p> <p>How can i call it? if at all possible</p> <p>PS: I cant change the signature of the method :(.</p>
c# asp.net
[0, 9]
2,471
2,472
Detect the row and get the td value using javascript. (Dynamic table)
<p>I totally want to avoid using inline javascript! But i have a table which is being dynamically generated from a mysql database using php. I want that if a user clicks on any of the rows it creates a modal with the information about the clicked row. Now i am able to initialise the modal, however the first column of the table holds an index value which can be used to retrieve the information about that row. My question is how can i retrieve that index value using javascript. To initiate the modal i am using the following code:</p> <pre><code>$('#production tr').click(function(){ $('#review_order').modal('show'); }) ; </code></pre> <p>Table markup:</p> <pre><code>&lt;table id="order_basket" class="table table-bordered"&gt; &lt;thead&gt; &lt;th&gt;Voucher ID&lt;/th&gt; &lt;th&gt;Title&lt;/th&gt; &lt;th&gt;Created By&lt;/th&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt;&lt;td&gt;1&lt;td&gt; &lt;td&gt;Something here&lt;/td&gt; &lt;td&gt;Some Person&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;table&gt; </code></pre>
javascript jquery
[3, 5]
4,799,368
4,799,369
Javascript plugin to manage placeholder
<p>Look at the Twitter sign up page at <a href="https://twitter.com/signup" rel="nofollow">https://twitter.com/signup</a></p> <p>Even when you click on first input field "Full name" placeholder stays there until I start typing something. That is awesome.</p> <p>Does anyone know of a good jQuery plugin that comes close to that?</p>
javascript jquery
[3, 5]
679,461
679,462
jQuery: stopPropagation for link
<p>How can i stop propagation for link?</p> <pre><code>&lt;script src="http://code.jquery.com/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function() { $("#g").click(function(event){ alert("Link clicked"); event.stopPropagation(); }); }); &lt;/script&gt; &lt;a id="g" href="http://google.com"&gt;Google&lt;/a&gt; </code></pre> <p>I want the browser don't go to google, just show alert.</p>
javascript jquery
[3, 5]
1,883,934
1,883,935
Adding cells in GridView
<p>How can i add cell in specific column for each row in gridview,i want to use <strong><em>RowCreated</em></strong> Events.</p> <p>i have gridview that has 3 columns (ProductName, Price, Count) i get (ProductName, Price) from database, and i want to add value for (count), ex: (Kitkat, 2$ ) i want to add number 5 to (count) column, i want to handle this operation when each row created.</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,765,351
5,765,352
How to make an if statement in jquery method
<pre><code> .data( "autocomplete" )._renderItem = function( ul, item ) { return $( "&lt;li&gt;&lt;/li&gt;" ) .data( "item.autocomplete", item ) if ( ( item.parent_term_id == "16" ) ) { .append( "&lt;a&gt;" + (item.child_term ? item.child_term : + "") + "&lt;/a&gt;" ) } .appendTo( ul ); }; </code></pre> <p>This code is belong to JqueryUi Autocomplete widget. I want autocomplete text input to suggest items if their "parent_term_id" is equals to something, else suggest nothing. (It's Wordpress)</p> <p>But that if statement is not working. Any idea?</p>
javascript jquery
[3, 5]
4,840,488
4,840,489
Jquery Keypress is not working for my input box
<pre><code>$("#epFilter").keypress(function(){ query = $("#epFilter").val(); alert(query); }); </code></pre> <p>In this code, whenever I type in my text box, it always alert one character less. It doesn't catch the last character. Why?</p>
javascript jquery
[3, 5]
2,349,056
2,349,057
How can I add a new row to my datagrid?
<p>Currently, it's outputting everything on one row. How can I separate the rows?</p> <p>For example, the code is outputting:</p> <pre><code>&lt;tr&gt; &lt;td&gt;blah&lt;/td&gt; &lt;td&gt;blah&lt;/td&gt; &lt;td&gt;blah&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>When it should be:</p> <pre><code>&lt;tr&gt; &lt;td&gt;blah&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;blah&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;blah&lt;/td&gt; &lt;/tr&gt; &lt;asp:DataGrid ID="DataGrid1" runat="server" AlternatingItemStyle-BackColor="#e4e4e4" AutoGenerateColumns="false"&gt; DbCommand command = db.GetStoredProcCommand("sel_Member_p"); db2.AddInParameter(command2, "@pMemberID", DbType.String, s); ds2 = db2.ExecuteDataSet(command2); try { BoundColumn memberIdColumn = new BoundColumn(); memberIdColumn.DataField = "ID"; memberIdColumn.HeaderText = "ID"; BoundColumn statusColumn = new BoundColumn(); statusColumn.DataField = "Status"; statusColumn.HeaderText = "Status"; DataGrid1.Columns.Add(memberIdColumn); DataGrid1.Columns.Add(statusColumn); } DataGrid1.DataSource = ds2; DataBind(); </code></pre>
c# asp.net
[0, 9]
1,308,944
1,308,945
Issue reading preferences in android activity
<p>I'm trying to use the PreferenceActivity in a java app and I'm able to bring up a screen to modify the preferences but I'm unable to read the preferences in a nother activity in the same App.</p> <p>I have one xml file under the xml/ folder called default_values.xml that contains just a single preference. </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;EditTextPreference android:key="json_url_pref" android:defaultValue="@string/json_url" android:title="@string/title_edittext_preference" android:summary="@string/summary_edittext_preference" android:dialogTitle="@string/dialog_title_edittext_preference" /&gt; &lt;/PreferenceScreen&gt; </code></pre> <p>This is the code I'm trying to use in my Activity to read the preference:</p> <pre><code>SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(EarningsActivity.this); String tmp = sp.getString("json_url_pref","-1"); </code></pre> <p>sp.getString(...) is always returning -1.</p> <p>I think this is a contextual issue that for some reason this activity does not have access to the application preferences (at least my intention is to have the preferences be visible by all activities in the application).</p>
java android
[1, 4]
4,297,158
4,297,159
Javascript (jQuery) flasher effect: how to do that?
<p>I want to make a flasher effect: when hover on some specified field there shows anything (yellow icon in my case) and when mouseout it disappeares.</p> <p>The problem that there are a lot of such similar fields (they will be the comments in future) so I've tried to do all this in one for cycle. But it's not working... I do not know why.</p> <p><em><strong>Some notes: I have to do that all without html, only in javascript, so I've used document.write method.</em></strong></p> <p><a href="http://jsfiddle.net/Vitali_Ponomar/TSSn6/" rel="nofollow">Demo on jsfiddle</a></p> <p>Here the code:</p> <pre><code>var data = ['one', 'two', 'three']; for(var i in data){ (function(){ $('#id'+i).mouseover(function(){ $("#hdn"+i).show(); }); $('#id'+i).mouseout(function(){ $("#hdn"+i).hide(); }); }); document.write('&lt;div id="id'+i+'" style="border:1px solid;margin:10px 0;float:left;width:100%;"&gt;'); document.write('&lt;div style="float:left;width:20px;height:20px;"&gt;'+data[i]+'&lt;/div&gt;'); document.write('&lt;div id="hdn'+i+'" style="display:none;float:right;width:20px;height:20px;"&gt;&lt;img src="http://t0.gstatic.com/images?q=tbn:ANd9GcSa7ebCG4VGWcTTXH8j7ebfpFWhYuV9ojisNmsrnZaQHk8wRMTNqGfaNA" /&gt;&lt;/div&gt;') document.write('&lt;/div&gt;'); } </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
1,903,637
1,903,638
how to create play list from list of songs
<p>I have list of songs in my system/database i want to create add song to playlist which is selected by me by using JQuery. Can any one help to me. Thanks</p>
php jquery
[2, 5]
842,282
842,283
Add an onBlur to all form elements
<p>So on a specific page I have some number of form elements, anywhere between 3 and 8, depending upon the user and their action on the page.</p> <p>How can I add a specific onblur event to all of the form elements dynamically on the page?</p> <p>If I have:</p> <pre><code>function doThisOnBlur() { stuff } </code></pre> <p>How can I add that same function to all of these once the page loads. No elements are created after the page loads but different elements may appear for different users.</p> <pre><code>&lt;input type="text" id="x"&gt; &lt;input type="text" id="y"&gt; &lt;select id="z"&gt;...&lt;/select&gt; </code></pre> <p>Is that possible?</p>
javascript jquery
[3, 5]
5,070,608
5,070,609
jquery $.each is non-blocking?
<pre><code>$("&lt;ol&gt;").appendTo(some_div); $.each(map, function(i,example){ $("&lt;li&gt;" + example + "&lt;/li&gt;").appendTo(some_div) }); $("&lt;/ol&gt;").appendTo(some_div); </code></pre> <p>expected: <code>&lt;ol&gt;&lt;li&gt;example1&lt;/li&gt;&lt;li&gt;example2&lt;/li&gt;&lt;/ol&gt;</code></p> <p>actual: <code>&lt;ol&gt;&lt;/ol&gt;&lt;li&gt;example1&lt;/li&gt;&lt;li&gt;example2&lt;/li&gt;</code></p> <p>Any idea why this happens?</p>
javascript jquery
[3, 5]
882,889
882,890
In ASP.Net C#, on button click event I find the FileUpload Control within DataList and It gives error?
<p>This is the Error:</p> <blockquote> <ul> <li>Collection was modified; enumeration operation may not execute.</li> </ul> </blockquote> <p>This error is found when for each process tries to find the items.</p> <pre><code> protected void SubmitButton_Click(object sender, EventArgs e) { foreach (DataListItem item in this.ImageRepeater.Items) { FileUpload fup = (FileUpload)ImageRepeater.FindControl("ImageUpload"); if (fup.HasFile) { updateImageChanges(); divTopImageCheckChangedmessage.Visible = false; } } } </code></pre> <p>My requirement is that I want to satisfy the check if there is no file loaded into Fileupload control within ASP.Net DataList then not to allow, the <code>updateImageChanges();</code> function to be hit.</p> <p>I will be grateful to you all.</p>
c# asp.net
[0, 9]
5,379,671
5,379,672
depth effect using Javascript (jQuery)
<p>Does anyone know (as in <a href="http://james.padolsey.com/" rel="nofollow">http://james.padolsey.com/</a>) how the upper body layer is scrolling at a faster speed while the background is scrolled at a slower speed making it give an effect of depth??</p> <p>Can I implement multiple layers (more then 2) scrolling at different speeds using the similar concept??</p>
javascript jquery
[3, 5]
3,738,651
3,738,652
asp.net WebClient.DownloadString blocks all requests
<p>I have a website for website seo analysis.(www.onlineseoanalyzer.com) People enters website urls and my c# codes download and processes site content. But when downloading website contents, it blocks all other requests. So my website hanging until the analysis complete.</p> <p>I tried WebClient.DownloadStringAsync, it is same. This is strange because Webclient downloads data but when people open my site it uploads data. And asp.net wp blocks not only the current thread but all the threads.</p> <p>Any idea? Thanks in advance.</p>
asp.net c#
[9, 0]
3,127,196
3,127,197
Loading ASPX markup from database
<p>Let say I have one default.aspx page in local development but in production we have different mark up according to client requirement might be we will not use up-comming.ascx user control on client page but we using on local or using for other client. in short how can load aspx markup from database not .cs code since it is already compiled only change aspx.</p>
c# asp.net
[0, 9]
2,721,854
2,721,855
Is there a way I can check how long it takes for javascript to execute a function in milliseconds?
<p>I have code like the following:</p> <pre><code>oTable = $('#dataTable').dataTable({ "sScrollX": "100%", "bScrollCollapse": true, iDisplayLength: -1, aLengthMenu: [[-1, 25, 50, 200, "All"], [10, 25, 50, 200, "All"]], aoColumnDefs: [ { "sSortDataType":"dom-data-rk", "aTargets": ["sort-data-rk"] }, { "sType": "date-uk", "aTargets": ["sort-date-uk"] }, { "sType": "datetime-uk", "aTargets": ["sort-datetime-uk"] } ] }); </code></pre> <p>Is there a way I can time how long this code takes to execute using javascript or jQuery. Something like the Stopwatch method in C#?</p>
javascript jquery
[3, 5]
2,631,153
2,631,154
Get hidden field text to appear in textbox
<p>I encountered a problem. I wish to get a hidden field text to appear in a textbox when I click on a button so I can show the user what the input is. It is necessary for me to use a hidden field, as I'm getting the hidden field value via javascript.</p>
c# asp.net
[0, 9]
318,571
318,572
How do I get the value of a form element that has brackets in the ID?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1239095/find-dom-element-by-id-when-id-contains-square-brackets">Find DOM element by ID when ID contains square brackets?</a> </p> </blockquote> <p>I am unable to get the value of form elements that are somewhat crazy. For example I have a HTML form element that "has" to have the name of "<code>data[User][notify_one_day_out]</code>". The problem is that I am unable to get the value of the form element. </p> <pre><code>&lt;label for="data[User][notify_one_day_out]"&gt;One day away:&lt;/label&gt; &lt;select name="slider" id="data[User][notify_one_day_out]" data-role="slider"&gt; &lt;option value="0"&gt;OFF&lt;/option&gt; &lt;option value="1" selected="selected"&gt;ON&lt;/option&gt; &lt;/select&gt; </code></pre> <p>However </p> <pre><code>alert( $("#data[User][notify_one_day_out]").val()); </code></pre> <p>comes out as undefined. Any help?</p>
javascript jquery
[3, 5]
2,818,558
2,818,559
JQuery Onclick clear action value before submitting
<p>I have a form:</p> <pre><code>&lt;form id="Myform" action="something here" method="post"&gt; ... &lt;input type="image" src="submit.png" id="mysubmit" name="submit" /&gt; </code></pre> <p>What I need the action value of the form to cleared before it submits.</p> <p>How could I do that in JQuery?</p>
javascript jquery
[3, 5]
5,244,767
5,244,768
how to display text from response from javascript
<pre><code>using System; using System.Data; using System.Configuration; 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; public partial class _Default : System.Web.UI.Page { NurseCounter nc; protected void Page_Load(object sender, EventArgs e) { int id = int.Parse(Request.QueryString["counterid"]); int play = int.Parse(Request.QueryString["display"]); try { nc = new NurseCounter(id); Response.Write(nc.RenterCounter(play)); } catch { Response.Write("Counter Error Id=" + Request.QueryString["counterid"]); } } } </code></pre> <p>When i test in test.htm</p> <p><hr /></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript" src="http://localhost:4464/NurseCounter/Default.aspx?counterid=2&amp;display=6"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and , response dont display in test.htm</p>
c# javascript
[0, 3]
1,819,558
1,819,559
query datatable sorting not working for run time values
<p>I used jquery data table for sorting. It works fine under normal condition. If i changed the value in run time, the sorting is not working.</p> <p>This is my table data</p> <pre><code>&lt;table width="94%" cellpadding="2" cellspacing="1" class="tablehead" id="pls-batting"&gt; &lt;thead&gt; &lt;tr class="tab_head" align="right" id="pls-play" &gt; &lt;th width="44" align="center" &gt;# No &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr id="116706"&gt; &lt;td align="left" id='1' &gt;test&lt;/td&gt; &lt;/tr&gt; &lt;tr id="116707"&gt; &lt;td align="left" id='2'&gt;bbb&lt;/td&gt; &lt;/tr&gt; &lt;tr id="116708"&gt; &lt;td align="left" id='3' &gt;xxx&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>Jquery method used for sorting is :</p> <pre><code>$(document).ready(function() { $('#pls-batting').dataTable( { } ); } ); </code></pre> <p>By clicking the '# No' head the corresponding column displayed in asc and desc order respectively. These TD values will be changed onload by using</p> <pre><code> document.getElementById(3).innerHTML = 'something'; </code></pre> <p>So as a result the 3rd column value is 'something'. So sorting will be done by this values. But it is not working.</p> <p>It takes the old values. Please help me. Thanks</p>
php jquery
[2, 5]
3,676,830
3,676,831
Difference between homegrown cms and wordpress cms
<p>Can any one please explain the difference between the wordpress cms using php and home grown cms using asp.net.</p>
php asp.net
[2, 9]
4,082,796
4,082,797
How do I determine if my javascript uses too many resources (and help optimizing)
<p>Is this horribly inefficient or does it look ok??? How do I test resources used by it?</p> <pre><code>$.easing.def = "easeOutBack"; $(document).ready(function() { var numResults = $("#scroll &gt; div").size(); var scrollSize = numResults * 264; var stopSize = ((numResults - 6) * 264) * -1; $("#scroll").width(scrollSize); $("#page-left").hide(); $("#page-right").click(function() { var marginleft = parseInt(jQuery("#scroll").css("margin-left")); if(marginleft &gt; stopSize) { $("#page-left").show(); $(this).hide(); $("#scroll").animate({"margin-left": "-=783px"}, 800, function() { var marginleft = parseInt(jQuery("#scroll").css("margin-left")); if(marginleft &gt; stopSize) { $("#page-right").show(); } }); } }); $("#page-left").click(function() { var marginright = parseInt(jQuery("#scroll").css("margin-left")); if(marginright &lt; -10) { $("#page-right").show(); $(this).hide(); $("#scroll").animate({"margin-left": "+=783px"}, 800, function() { var marginright = parseInt(jQuery("#scroll").css("margin-left")); if(marginright &lt; -10) { $("#page-left").show(); } }); } }); }); </code></pre>
javascript jquery
[3, 5]
4,285,757
4,285,758
jQuery toggle() doesn't work inside included (using PHP) code.
<p>I have the following code defined in order to hide certain elements of a list:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("button").click(function(){ $(".done").toggle(); }); }); &lt;/script&gt; </code></pre> <p>Basically, any &lt; button > element being clicked will execute the toggle() function on any element with the "done" class. I know this works, because it works on some of my buttons. I have a page made up of several included files (using PHP include()). Usually, the javascript works in and out of these included files, but for some reason if I put a button inside one of them, it doesn't work - the function only works for buttons placed on the document where the script is defined. Is this always the case, or am I doing something wrong?</p>
php javascript jquery
[2, 3, 5]
5,997,139
5,997,140
how to get file without as it is
<p>Hi I am trying to read a html file and store its content but when I am converting it I am Getting all the special characters are converted to Question mark.</p> <p>I am using stream reader to read the file and stream writer to write the content of that file to another file after storing the content in the Database.</p>
c# asp.net
[0, 9]
322,647
322,648
can you tell how to bring the image in image view
<p>I am using camera in my application.Once i click the button to capture an image i need to get the same image in the image view which is placed right side of the preview immediately.Please tell me the code</p>
java android
[1, 4]
43,830
43,831
Accessing a variable passed by jquery using php
<p>How does php access a variable passed by JQuery?</p> <p>I have the following code:</p> <pre><code>$.post("getLatLong.php", { latitude: 500000}, function(data){ alert("Data Loaded: " + data); }); </code></pre> <p>but I don't understand how to access this value using php.</p> <p>I've tried </p> <pre><code>$userLat=$_GET["latitude"]; </code></pre> <p>and </p> <pre><code>$userLat=$_GET[latitude]; </code></pre> <p>and then I try to print out the value (to check that it worked) using:</p> <p><code>echo $userLat;</code> but it does not return anything. I can't figure out how to access what is being passed to it. </p>
php jquery
[2, 5]
2,736,936
2,736,937
How to maintain a pointer for a list item [jquery]
<p>I'm trying to enable keyboard control (arrow up/down)</p> <p>I've my jquery codes as</p> <pre><code>if($('.yumnak').hasClass('itemCur')) { var pntr = $('.yumnak').hasClass('itemCur'); pntr.next().addClass('itemCur'); pntr.next().removeClass('item'); pntr.removeClass('itemCur'); pntr.addClass('item'); } </code></pre> <p>and the markup as</p> <pre><code>&lt;ul&gt; &lt;li class="yumnak itemCur"&gt;&lt;a href="#"&gt;one&lt;/a&gt;&lt;/li&gt; &lt;li class="yumnak item"&gt;&lt;a href="#"&gt;two&lt;/a&gt;&lt;/li&gt; &lt;li class="yumnak item"&gt;&lt;a href="#"&gt;three&lt;/a&gt;&lt;/li&gt; &lt;li class="yumnak item"&gt;&lt;a href="#"&gt;four&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Here, won't my <code>pntr</code> not work?? It seems it's not working. How do I maintain a pointer??</p>
javascript jquery
[3, 5]
1,392,622
1,392,623
How to remove JavaScript loaded dynamically with AJAX
<p>In less words:</p> <p>I have multiple JavaScript sections located at different places in document. Some of them are loaded and evaluated with AJAX:</p> <pre><code>&lt;script id="js5533" type="text/javascript"&gt; javascript and jquery stuff (lots) &lt;/script&gt; &lt;script id="js7711" type="text/javascript"&gt; javascript and jquery stuff (lots) &lt;/script&gt; </code></pre> <p>As you can see I ID every section.</p> <p>My goal is to get rid of specific section by clicking on button.</p> <pre><code>$('.somebutton').click(function() { $('#js7711').remove(); }); </code></pre> <p>Of course this function removes only element from the document and all JavaScript functions in section js7711 are still working.</p> <p>I don't want to manually remove every function and variable from the section by doing things like a(); a = 0;</p> <p>Are there any less coding solutions?</p> <p>Thanks.</p> <p>P.S. jQuery is also used.</p>
javascript jquery
[3, 5]
2,840,688
2,840,689
Is there a way to not load jQuery?
<p>Is there a way to recognize that javascript is disabled on the user's PC and not include the jQuery file for people who won't use javascript?<br> It'll improve performance for those who have disabled javasript. thanks in advance.</p>
javascript jquery
[3, 5]
3,335,177
3,335,178
Static code analysis tools
<p>Whether JavaSript, C# or C++ main problem i face while reading the code is which function is called by which function. This problem is big when dealing with BIG code. Is there any static code analysis tool/technique/plugins using which a graphical representation of the code can be generated(something like below) so that reading/analyzing code becomes easy?</p> <pre> .... --outerFuntion() ---innerFunction() ----innerFunction2() --outerFunction2() .... </pre> <p>Please provide your inputs/opinions on this Thanks all,</p>
c# javascript c++
[0, 3, 6]
3,105,945
3,105,946
javascript not storing value in textbox in asp
<p>I am using javascript in an asp.net page where I am also using html textarea to get the text from users.</p> <p>I want to store that text in the <code>asp:TextBox</code> below and set the visibility of that textbox to "false".. The problem arises as I use the hidden textbox to store the value , my javascript is not working, and as I set the visibility to "true" it starts working again. but i didn't want to show textbox.. I included the textbox as:</p> <pre><code> &lt;asp:TextBox ID="txtboxhead" runat="server" Visible="false"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>and i use javascript as:</p> <pre><code>document.getElementById('txtareahead').readOnly = true; text = document.getElementById('txtareahead').value; document.getElementById('&lt;%= txtboxhead.ClientID %&gt;').value = text; </code></pre> <p>how this problem can be solved.. please help me out..</p>
javascript asp.net
[3, 9]
5,627,440
5,627,441
JavaScript and ASP.. How do I create an if statement that looks at the value of an asp drop down control?
<p>The following javascript works with a simple test site i made, but does not work when i put it into my production site. in..:</p> <pre><code>&lt;script type="text/javascript"&gt; strLen = function(input){ var errorLabel = document.getElementById("errorLabel"); var drpDown = document.getElementById("Select1"); if (drpDown.value == "USA") if (errorLabel) errorLabel.style.display = input.value.length &gt; 2 ? "block" : "none" ; if (drpDown.value != "USA") errorLabel.style.display = "none"; } &lt;/script&gt; &lt;asp:textbox id="txtShipState" CssClass="style5" TabIndex="2" runat="server" Width="40px" MaxLength="10" onkeyup="strLen(this)"&gt;&lt;/asp:textbox&gt;&amp;nbsp; &lt;asp:dropdownlist id="drpShipCountry" runat="server" style="display:none" AutoPostBack="true" TabIndex="2"&gt;&lt;/asp:dropdownlist&gt; &lt;select name="drpShipCountry"onchange="javascript:setTimeout('__doPostBack(\'drpShipCountry\',\'\')', 0)" id="Select1" tabindex="2"&gt; &lt;option selected="selected" value="USA"&gt;United States&lt;/option&gt; &lt;option value="ALB"&gt;Albania&lt;/option&gt; &lt;option value="DZA"&gt;Algeria&lt;/option&gt; &lt;option value="ATA"&gt;Antarctica&lt;/option&gt; &lt;option value="ATG"&gt;Antigua and Barbuda&lt;/option&gt; &lt;/select&gt; </code></pre> <p>i dont know where or how its being added.. i shortened the list because its very long</p>
javascript asp.net
[3, 9]
296,519
296,520
How to switch activity with item specific data sent
<p>I've had a look around, and it might be because I'm not sure what I'm looking for, but I can't find out how to do something I presume should be quite easy with android.</p> <p>I have an array of data to display on the screen. This data is a class that holds a database key, name and image.</p> <p>I'm currently displaying this data as an ImageView and a TextView. I loop through the array and add a new row to a TableLayout containing the image and text.</p> <p>I'd like both the image and text to be clickable, changing to a new activity.</p> <p>This new activity needs to know the database key of the row clicked in order to display the correct data.</p> <p>Here's what I have so far:</p> <pre><code>private void fillSuggestionTable(TableLayout tabSuggestions, Suggestion[] arrToAdd) { for(int i = 0; i &lt; arrToAdd.length; i++) { /* Create a new row to be added. */ TableRow trSuggestion = new TableRow(this); trSuggestion.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT)); /* Create objects for the row-content. */ ImageView imgDisplayPicture = new ImageView(this); ImageHandler.loadBitmap(arrToAdd[i].strImageURL, imgDisplayPicture); imgDisplayPicture.setLayoutParams(new LayoutParams(50,50)); TextView txtArtistName = new TextView(this); txtArtistName.setText(arrToAdd[i].strName); txtArtistName.setTextColor(Color.parseColor("#000000")); /* Add data to row. */ trSuggestion.addView(imgDisplayPicture); trSuggestion.addView(txtArtistName); /* Add row to TableLayout. */ tabSuggestions.addView(trSuggestion, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); } } </code></pre>
java android
[1, 4]
3,659,938
3,659,939
Browse path shows c:\fakepath\filemae.................... how to get exact file path
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4851595/how-to-resolve-the-c-fakepath">how to resolve the C:\fakepath ?</a> </p> </blockquote> <p>Hi Am using a Jquery to browse a file from hard disk when i select a file, am getting its path as fakepath like below .... any idea how to display the exact file path in text box....?</p> <p><img src="http://i.stack.imgur.com/ySWji.png" alt="enter image description here"></p> <p>Thank you......</p>
javascript jquery
[3, 5]
2,847,371
2,847,372
Using Jquery to get a specific element out of many repeated classes on the page
<p>I have this bit of code that repeates.</p> <pre><code>&lt;div class='commentfloatleft'&gt; &lt;button type='button' class='button2' onclick='upvote($id8)'&gt; &lt;img src='images/likebutton.png' class='upvoteimage' width='12' height='12' alt='PearlSquirrel'/&gt; &lt;/button&gt; &lt;button type='button' class='button2' onclick='downvote($id8)'&gt; &lt;img src='images/unlikebutton.png' width='12' height='12' alt='PearlSquirrel'/&gt; &lt;/button&gt; &lt;/div&gt; </code></pre> <p>When I click on the onclick code for upvote is this:</p> <pre><code>function upvote(box){ $(this).siblings('.upvoteimage').load('upvote.php?box=' + box); } </code></pre> <p>I have tried everything to get this to work. The get function is working, but I can not see any changes in ".upvoteimage". Does anyone know how to fix this problem. Help would be greatly appreciated. Thanks.</p>
javascript jquery
[3, 5]
3,348,046
3,348,047
help with validationEngine
<p>Hi i am new to jquery plugin validateEngine. Can someone help me in this. I have a form and by the way this stackoverflow's quality controll sucks i had to rephrase thsi post 5 times. Coming back i have a few doubts with validateEngine</p> <p>I saw that validateEngine outputs it's errors in <strong>formErrorContent</strong> how can change without manually editing the js i mean like global config . </p> <p>Also does this require name and id to be same what if i want to have different name and id and still not have to do much</p> <p>Does this have any known conflicts with any popular jquery plugins like ui,cycle,.....</p>
javascript jquery
[3, 5]
4,566,776
4,566,777
javascript encode url for url rewrite context and php decode it
<p>I have a pattern of my page as following: <code>search/:key</code> it means that if browser is pointed to <code>http://..../.../search/cat</code> then <code>cat</code> will be recognized as search keyword and will be further searched by server-side.</p> <p>A problem is that if you go <code>http://..../.../search/keywi/th/slash</code> then only part of it will be recognized as key <code>keywi</code>, so I want to encode it in a way that even large html portions would be processed as a search keyword. For example <code>http://..../.../search/first!@#$!@":;/\asd/&lt;b&gt;hello&lt;/b&gt;everythign&lt;script&gt;&lt;/script&gt;</code>.</p> <p>A client-side code:</p> <pre><code>$("#search-form").submit(function(){ var key = $("#key").val(); // Encode Here window.location = "/search/"+key; return false; }); </code></pre> <p>A server-side code:</p> <pre><code>$key = $_GET['key']; // Decode here </code></pre> <p>Thanks.</p>
php javascript jquery
[2, 3, 5]
3,122,695
3,122,696
Bringing a div back from .hide or .fadeOut onclick
<p>Okay, so this is the example HTML.</p> <pre><code>&lt;a href="http://www.google.com/"&gt; &lt;div id="link"&gt; This is a link &lt;/div&gt; &lt;/a&gt; &lt;div class="example"&gt; Example div 1 &lt;/div&gt; &lt;div class="example"&gt; Example div 2 &lt;/div&gt; &lt;div class="example"&gt; Example div 3 &lt;/div&gt; </code></pre> <p>Whenever #link is clicked, all the divs with the class .example are hidden.</p> <pre><code>$("#link").click(function ( event ) { $(".example").hide(); }); </code></pre> <p>or</p> <pre><code>$("#link").click(function ( event ) { $(".example").fadeOut("fast"); }); </code></pre> <p>Now whenever any spot on the page is clicked, all of the .example divs return.</p> <p>Is it possible? It doesn't all necessarily have to be done with jQuery.<br>Thanks in advance. </p>
javascript jquery
[3, 5]
3,374,474
3,374,475
Javascript module pattern, ajax functions callbacks
<pre><code>var ajaxStuff = (function () { var doAjaxStuff = function() { //an ajax call } return { doAjaxStuff : doAjaxStuff } })(); </code></pre> <p>Is there any way to make use of this pattern, and fetch the response from a successful ajaxcall when calling my method? Something like this:</p> <pre><code>ajaxStuff.doAjaxStuff(successHandler(data){ //data should contain the object fetched by ajax }); </code></pre> <p>Hope you get the idea, otherwise I'll elaborate.</p>
javascript jquery
[3, 5]
2,726,479
2,726,480
Form Validation in external JavaScript File using document.getElementById
<p>My document.getElementById function is returning null on a value I know exists. Specifically I try:</p> <pre><code>//in an external .js file var UserName = document.getElementById('&lt;%=_username.ClientID%&gt;'); </code></pre> <p>And test it using some conditions, which never happen due to the element id value being null. I define _username in a user control file here:</p> <pre><code>... &lt;fieldset class="login"&gt; &lt;legend class="login"&gt;Login&lt;/legend&gt; &lt;label for="&lt;%=_username.ClientID%&gt;"&gt; User Name:&lt;/label&gt; &lt;asp:TextBox ID="_username" runat="server" CssClass="login" /&gt; &lt;label for="&lt;%=_password.ClientID%&gt;"&gt; Password:&lt;/label&gt; &lt;asp:TextBox ID="_password" runat="server" CssClass="login" TextMode="Password" /&gt; &lt;br /&gt; &lt;span class="response"&gt; &lt;asp:Literal ID="_response" runat="server" /&gt;&lt;/span&gt; &lt;asp:Button ID="_login" runat="server" Text="Login"/&gt; &lt;/fieldset&gt; </code></pre> <p>I verified my page is listening to the javascript file by testing a simpler function that doesn't require use of getElementById().</p>
javascript asp.net
[3, 9]
1,684,629
1,684,630
jQuery/Javascript custom email validation not working
<p>I didn't want to us a plugin for simple email validations so i tried to create my own but it doesn't work. Its always returning false. Here is my code:</p> <pre><code>var regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i; if(regex.test($("#email").val())) { //pass } </code></pre> <p>What am I doing wrong? Thank you!</p>
javascript jquery
[3, 5]
1,164,637
1,164,638
How do I go straight to the shopping cart with the item added
<p>So I am trying add an item to the shopping cart without clicking on the add to cart in miva. For example</p> <p>I go here </p> <p><a href="http://posnation.com/pos_knowledge" rel="nofollow">http://posnation.com/pos_knowledge</a> </p> <p>and i click on the Buy now button</p> <p>it takes me to </p> <p><a href="http://posnation.com/pos_support/online_kbase" rel="nofollow">http://posnation.com/pos_support/online_kbase</a></p> <p>but on that page there is an add to cart button, if you hit it the item gets added to the Miva cart. How do I skip this page </p> <p><a href="http://posnation.com/pos_support/online_kbase" rel="nofollow">http://posnation.com/pos_support/online_kbase</a></p> <p>and go straight to the cart with the item added</p> <p>If i firebug over the add to cart there is a javascript onchange function called ComputeTotalCost but i am not sure how to get there from the first page</p>
php javascript
[2, 3]
906,218
906,219
Remove Style that was placed with appendTo
<p>I have used <code>.appendTo</code> to place style in the head of my document using the jQuery below:</p> <pre><code>$("&lt;style type='text/css'&gt; #sb-container{ visibility: visible !important; display: block !important;} #sb-overlay{ opacity: 0.5 !important; } &lt;/style&gt;").appendTo("head"); </code></pre> <p>This code was fired at the beginning of a function. At the end of the function I would like to remove the style I placed. </p> <p>How would I go about doing this using jQuery? Perhaps there's a way to toggle the appended code? It will only ever be placed if it is not there, and it will always be removed if it is.</p>
javascript jquery
[3, 5]
4,879,785
4,879,786
document.referrer encoding issue
<p>referrer` and saving the value in a cookie. The result is coming like this with strange characters: </p> <pre><code>http%3A//www.rzammit.com/props/testpage.asp%3Fadv%3D123%26loc%3D45 </code></pre> <p>How I can remove those strange characters so the link will show correctly please?</p> <p>thanks</p>
javascript jquery
[3, 5]
5,373,177
5,373,178
IMAGE_CAPTURE Intent never returns to onActivityResult(int, int, Intent);
<p>I start an <code>IMAGE_CAPTURE</code> Intent like this, and my activity's <code>onActivityResult()</code> get called:</p> <pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null); i.putExtra("return-data", true); startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID); </code></pre> <p>But, if I start my Intent like this, the Capture Image Intent did get called, but my activity's <code>onActivityResult()</code> never get called:</p> <pre><code>Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null); i.putExtra(MediaStore.EXTRA_OUTPUT, Uri.parse("file:/" + "MyTestFile")); i.putExtra("outputFormat", Bitmap.CompressFormat.PNG.name()); startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID); </code></pre> <p>Can you please tell me how to get the 2nd case to work?</p> <p>Thank you.</p>
java android
[1, 4]
751,202
751,203
Want to create a multilingual javascript object, how to handle if lots of labels?
<p>I want to create a javascript file for multilingual functionality</p> <p>i.e. display the error message in the correct language.</p> <p>If I have allot of labels for a page, error messages, etc., what is a smart way of making this so the actual output on the page isn't huge?</p> <p><strong>i guess the best way is to somehow output the labels that I need ONLY?</strong></p> <pre><code>lang.getkey('username'); </code></pre> <p>will output the correct label, depending on the language.</p>
javascript jquery
[3, 5]
2,572,452
2,572,453
Search and replace "-p"
<p>how to search for exactly "-p" in the ids of huge html and append a counter after it i.e -p+counter. Please help.</p>
javascript jquery
[3, 5]
5,542,487
5,542,488
C# - How to get Class Name and Line Number when an Exception is called
<p>I need two methods, one for getting the Class from where the exception was called, and another one which gets the line number where an exception was called.</p> <p>So far I have this code, which gets me the Class Name and Line Number together (example: DatabaseHandler.cs:line 70):</p> <pre><code> private string GetClassAndLine() { string tempName = e.GetBaseException().ToString(); int tempPosition = 0; int length = tempName.Length; for (int i = 0; i &lt; length; i++) { if (tempName.ElementAt(i).Equals('\\')) { tempPosition = i + 1; } } return tempName.Substring(tempPosition, length - tempPosition); } </code></pre> <p>So if you have any ideas how I could get them individually, it would be of great help. These are then passed into Oracle to store any exceptions which occur.</p> <p>Update 2:</p> <p>I am currently testing this code, as some suggested:</p> <pre><code> private string GetClassName() { System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(e, true); return trace.GetFrame(0).GetMethod().ReflectedType.FullName; } private int GetLineNumber() { System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(e, true); return trace.GetFrame(0).GetFileLineNumber(); } </code></pre> <p>This is what was returned at a particular Database Exception. No Line Number or Class Name where it was triggered. How can I get that?</p> <pre><code> Error was found at Class: Oracle.DataAccess.Client.OracleException. Line Number: 0 </code></pre> <p>What I want is for Example: "Class: Logging.cs, Line: 57" </p> <p>Thanks, Ryan</p>
c# asp.net
[0, 9]
3,427,036
3,427,037
jquery click callback
<p>I have jquery function that is triggered by a 'click' handler:</p> <pre><code>$('#showDatesCheckbox').click(function(){ var table = $('#planningViewTable').find('tr'); if ($('#showDatesCheckbox').is(':checked')) { table.find('.textDate').stop().animate({ "opacity": 1 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 1 }, 1000); } else { table.find('.textDate').stop().animate({ "opacity": 0 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 0 }, 1000); } }); </code></pre> <p>I wanted to have an <em>ajax loading indicator</em> animation, so I need it to show when the click is triggered, and hide when the operation is completed, so I figure <strong><em>callback</em></strong> but it doesn't seem to be working when I set it up as follows:</p> <pre><code>$('#showDatesCheckbox').click(function(){ $('#planningView').mask('Loading...'); var table = $('#planningViewTable').find('tr'); if ($('#showDatesCheckbox').is(':checked')) { table.find('.textDate').stop().animate({ "opacity": 1 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 1 }, 1000); } else { table.find('.textDate').stop().animate({ "opacity": 0 }, 1000); table.find('.inlineTextDate').stop().animate({ "opacity": 0 }, 1000); } }, $('#planningView').unmask(); ); </code></pre>
javascript jquery
[3, 5]
1,250,127
1,250,128
define: cannot convert org.w3c.dom.domElement to boolean
<p>I have translated the following Javascript code to Java. The problem occurs at sib; <a href="http://snippets.dzone.com/posts/show/3754" rel="nofollow">http://snippets.dzone.com/posts/show/3754</a></p> <p>I have never seen such for statements. What does it do exactly when you add a semicolon? Is this like while() statement?</p> <pre><code> public static String getElementXpath(DOMElement elt){ String path = ""; for (;elt.ELEMENT_NODE == elt.getNodeType(); elt = (DOMElement) elt.getParentNode()){ int idx = getElementIdx(elt); } return path; } private static int getElementIdx(DOMElement elt) { int count = 1; for (DOMElement sib = (DOMElement) elt.getPreviousSibling(); sib ; sib = (DOMElement) sib.getPreviousSibling()) { if(sib.ELEMENT_NODE == sib.getNodeType() &amp;&amp; sib.getTagName() == elt.getTagName()) count++; } return count; } </code></pre>
java javascript
[1, 3]
5,964,321
5,964,322
Detecting jQuery knob value
<p>Hi guys I've spent hours trying to solve this small problem, I want to use this <a href="http://anthonyterrien.com/knob/" rel="nofollow">jQuery knob</a> to trigger different jQuery animations at each point. I can't seem to detect the value? </p> <pre><code>&lt;script&gt; $(document).ready(function(){ $('.knob').bind('change', function(){ var newvalue = $(this).val(); if (newvalue == 50) { alert("newvalue is 50!"); }; }); }); &lt;/script&gt; &lt;input class="knob" data-width="530" data-min="0" data-max="67" data-angleOffset="0" data-thickness=".1" data-displayPrevious="true"&gt; </code></pre> <p>How could I do this? Hope you can help!</p>
javascript jquery
[3, 5]
2,270,353
2,270,354
While "<li>" <= 20 add empty "<li>"
<p>I'm trying to add a <code>&lt;li&gt;</code> inside an <code>&lt;ul&gt;</code> if the <code>&lt;li&gt;</code> count is less or equal to 20, but the code doesn't seem to be working...</p> <p>I'm using the following jQuery:</p> <pre><code>while ($(".mosaico &gt; li").length() &lt;= 20) { $('.mosaico').append('&lt;li&gt;test&lt;/li&gt;'); }; </code></pre> <p>And nothing seems to happen... The HTML is:</p> <pre><code>&lt;ul class="mosaico"&gt; &lt;li&gt; &lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;li&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
2,736,588
2,736,589
how to Copy images from iframe into textarea?
<p>i want to copy image from an iframe to div ot to textarea like this <a href="http://jsfiddle.net/purmou/xEtL9/" rel="nofollow">jsfiddle.net/purmou/xEtL9/</a></p> <pre><code>&lt;textarea rows="10" cols="40" id="content"&gt; &lt;/textarea&gt; &lt;div id="fake"&gt; &lt;iframe width="100%" height="400px" src="http://www.w3schools.com/"&gt;&lt;/iframe&gt; &lt;/div&gt; </code></pre> <p>And</p> <pre><code> $(function(){ $("#fake iframe").click(function(){ var update = $("&lt;div&gt;").append( $("&lt;iframe&gt;").attr("src", $(this).attr("src")) ).html(); $("#content").val(function( i, v ) { return v + update; }); }); }); </code></pre> <p>But for iframe it is not working..Any suggestion??</p>
jquery asp.net
[5, 9]
4,538,404
4,538,405
405 error not allowed whereas I have javascript error
<p>I have a really strange problem and I want to know how it's possible...</p> <p>I develop an app with ASP on the server side and some JS/Ajax on the client. And for several times already, when I have a JS error, the page change and I get a 405 error instead of seeing the error in the Chrome console...</p> <p>For example, my current error is to try to access a property on a null object... After this code, I'm sending a request but I have placed a lot of alert() to trace the execution of my code and the Ajax request code isn't reached...</p> <p>Any idea?</p>
javascript asp.net
[3, 9]
3,887,650
3,887,651
Adding variable to string in ASP.net
<p>Ok, so it's easy in VB, but I can't figure it out in C#:</p> <pre><code>SqlCommand cmd = new SqlCommand("SELECT COUNT(*) FROM tblUsers WHERE username = '" &amp; username &amp; "'", cn); </code></pre> <p>This throws</p> <pre><code> CS0019: Operator '&amp;' cannot be applied to operands of type 'string' and 'string' </code></pre> <p>Googled it and can't find an answer, help this newbie here please!</p>
c# asp.net
[0, 9]
4,973,194
4,973,195
Embedded If/Elses vs. Serialized And (&&) statements?
<p>Is this just a matter of preferences....the code below I'm considering moving to serialized &amp;&amp; statments...which is an effective if/else with embedded if/else ' s .</p> <pre><code>Is this a preference or is there a "best practice"? function invoke() { $obj=new validate($this-&gt;_protected_arr); if($obj-&gt;empty_user()) { if($obj-&gt;email()) { if($obj-&gt;pass()) { if(self::validate()) { self::activate_session(); $control=new controller_control(); $control-&gt;send('pass'); } else { new view_message('validate'); } } else { new view_message('pass'); } } else { new view_message('email'); } } else { new view_message('empty'); } } </code></pre>
php javascript c++
[2, 3, 6]
1,821,952
1,821,953
get all script files in asp.net page
<p>is there a way to find all script files added to a page in asp.net code behind? i am trying to add script dynamically but would like to check first if it already exist on the page.</p>
asp.net javascript
[9, 3]
2,655,730
2,655,731
parse_str for python?
<p>Is there a parse_str (used in php) alternative for python?</p> <p><a href="http://php.net/manual/en/function.parse-str.php" rel="nofollow">http://php.net/manual/en/function.parse-str.php</a><br /> parse_str — Parses the string into variables</p>
php python
[2, 7]
5,124,707
5,124,708
Call ajax load from a popup
<p>I'm trying to dynamically load html into a popup using ajax with this:</p> <p><code>$('body').load( new_url, function (responseText, textStatus, XMLHttpRequest ) { ... } );</code></p> <p>It works fine, but it doesn't load the html into the subwindow, it loads it into the opening window. If I have a reference to the subwindow "win", how can I do something like this:</p> <p><code>win.$( 'body' ).load...</code></p> <p>currently, that gives an error saying <code>win.$ is not a function</code>.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
4,698,753
4,698,754
Does JavaScript or jQuery have a function similar to Excel's VLOOKUP?
<p>Do JavaScript or jQuery have a function that returns the element of an array whose index equal to the position of a given value in another array? (I could write my own, but I don't want to reinvent the wheel.)</p> <p>Something like:</p> <pre><code>function vlookup(theElement, array1, array2) { $.each(array1, function(index, element) { if (element === theElement) return array2[index]; }); return null; } </code></pre> <p>But, um... in the standard library.</p>
javascript jquery
[3, 5]
1,809,794
1,809,795
How to make javascript run on all browser?
<p>I update my question by being abit more descriptive.</p> <pre><code>&lt;script type="text/javascript"&gt; function myPopup2() { var iMyWidth; var iMyHeight; //half the screen width minus half the new window width (plus 5 pixel borders). iMyWidth = (window.screen.width/2) - (75 + 10); //half the screen height minus half the new window height (plus title and status bars). iMyHeight = (window.screen.height/2) - (100 + 50); window.open( "xyz.php" ,Store Record" ,"status=yes,height=300,width=350,resizable=yes,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no"); } &lt;/script&gt; </code></pre> <p>is the javascript which does not work with IE8. when i try it with FF 3.6.16 on windows7 it behaves strangely. Sometimes it displays the code in the pop up window.</p> <p>Thanks,</p>
php javascript
[2, 3]
3,093,149
3,093,150
Confirm box doesnt work when i get a value from a form php and javascript
<p>This seems really odd to me, but my popup confirm box will work when i just call the function, but as soon as i try to get a value from a form in my php code, the popup box doesnt work at all! </p> <p>javascipt:</p> <pre><code>function ConfirmBox(){ cert = cValForm.elements["cVal"].value; answer = confirm("Are you sure you want to delete " + cert + " and all of its courses?"); if (answer){ alert("Entry Deleted"); } else{ alert("No action taken"); } } </code></pre> <p>PHP:</p> <pre><code>echo "&lt;form name='cValForm'&gt;"; echo "&lt;input type='hidden' name='cVal' value='TEST' /&gt; "; echo "&lt;input type='button' onclick='ConfirmBox()' value='Delete'/&gt;"; echo "&lt;/form&gt;"; </code></pre> <p>As soon as i comment out the line:</p> <pre><code>cert = cValForm.elements["cVal"].value; </code></pre> <p>As well as getting rid of the cert value in the string, the popup works completely fine. Am i getting the value from the form wrong? Or am i completely missing something here? Thanks!</p>
php javascript
[2, 3]
4,541,978
4,541,979
How to get Client Ip address in Javascript and Jqery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/391979/get-client-ip-using-just-javascript">Get Client IP using just Javascript?</a> </p> </blockquote> <p>i am developing a online chat application, for that i have a server with static ip. i want to give only small javascript to include in client website. here my requirement is obtain ip address and the location of the user of the website. websites my in in any language like php,jsp,html,asp....for any wesite my script is same please help me in this issue to solve.</p>
php javascript jquery
[2, 3, 5]
1,080,857
1,080,858
Auto Calculating for input field values
<p>My Html is like this:</p> <pre><code>&lt;input class="gbTransform" type="text" name="maxdl" value=""/&gt; </code></pre> <p>And javascript like this:</p> <pre><code>$('.gbTransform').change(function(){ var sz = $(this).val().match(/(\d+)gb/i); if(sz.length &gt; 1){ $(this).val(parseInt(sz[1])*1024); } }); </code></pre> <p>What this does is when a user types 1gb it will automatically calculate into mbs (1 * 1024 = 1024) and change the input fields value.</p> <p>This works fine but when user types <code>1.5gb</code> its calculates <code>5 * 1024</code> which is incorrect it should be <code>1.5 * 1024</code></p> <p>Thank You.</p>
javascript jquery
[3, 5]
90,323
90,324
How to check if an input box contains only numbers or commas?
<p>Given:</p> <pre><code> var input_val = $('#field').val(); </code></pre> <p>How do I check whether input_val contains only numbers or commas? The solution must work in the 4 main browers.</p>
javascript jquery
[3, 5]
2,105,120
2,105,121
simpleton javascript question - how do I fade this in
<p>I've read the docs but still a bit confused. I have the following:</p> <pre><code>$(document).ready(function(){ $('#trynow').click(function(){ $('#hiddenContent').dialog({ height: 700, width: 600, modal: true }); }); }); </code></pre> <p>that uses the jquery UI library to show a modal box with a form in it. I'd like both the background and modal box to fade in or fade out and I know there the options to do that with jquery and the UI plugin but I'm buggered if I can figure out what wraps what where and in what.</p>
javascript jquery
[3, 5]
2,404,323
2,404,324
Run and display code as text without repeating
<p>I want to store javascript code in an object, and then run parts of it when the user clicks a button. So far I have this:</p> <pre><code>var exampleCode = { test: "$('body').css('background: pink');" } $(document).ready(function(){ console.log(exampleCode.test); exampleCode.test; }); </code></pre> <p>I have two questions, the first is, how to I get the code to actually run?</p> <p>The second is, what do I do if I want to have some html in my javascript, say like the following line of code:</p> <pre><code>$('body').append('&lt;div class="whatever"&gt;&lt;/div&gt;'); </code></pre> <p>This wont play well with the double quotes around the object value.</p> <p>My goal with all of this is to be able to both run and display code as text on the same page without having the code written twice, so if you have other suggestions, that would be great.</p>
javascript jquery
[3, 5]
5,056,444
5,056,445
radio button check in java script
<p>this is my radio button , i want to get the value from the list through alert when i click the submit button , but value is not coming</p> <p><code>&lt;asp:RadioButtonList ID="Titlerbl" runat="server" CssClass="tit" RepeatDirection="Horizontal" ValidationGroup="grt"&gt; &lt;asp:ListItem&gt;MR&lt;/asp:ListItem&gt;&lt;asp:ListItem&gt;MS&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;DR&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt;</code></p> <p>this is the java script </p> <pre><code>var radio = document.getElementById("Titlerbl").value; for (var j = 0; j &lt; radio.length; j++) { if (radio[j].checked) alert(radio[j].value); } </code></pre>
javascript jquery
[3, 5]
881,004
881,005
Do something after tab is visible in jquery
<p>I'm trying to load a function in javascript (i'm using jquery) after that my tab is it showed. So this it he code that i'm testing:</p> <pre><code>$("#tabsL").html(data).tabs("destroy").tabs({ select:function(event, ui){ var section = $(ui.tab).attr("href"); var foo = section.split("-"); var looking_for = "#slideshow-carousel-"+foo[1]+"-"+foo[2]+" ul li img"; var imgangefd = $(looking_for)[0]; $(imgangefd).click(); } }); </code></pre> <p>but imgangefd need to be visible to get a click. So my question is what can i do something after the tab is clicked and loaded and visible?</p> <p>Thanks for any clue! Roberto</p>
javascript jquery
[3, 5]
3,016,277
3,016,278
Can I access asp.net server control in Ajax.AjaxMethod?
<p>How can i access asp.net server control in Ajax.AjaxMethod. My code is below.</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { Ajax.Utility.RegisterTypeForAjax(typeof(Default2)); } [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)] public void CreateModelPopupForRenameApplication() { Timer1.Enabled = true; } </code></pre> <p>I am getting error.......on Timer1 (object ref not set)</p>
c# javascript asp.net
[0, 3, 9]
5,422,317
5,422,318
jquery click event handling
<p>When i click TD the input element inside should be selected and vise-versa,</p> <p>I wrote the below code using jquery which is working fine but when i click on the checkbox it is not working the way a checkbox works, any ideas how to hadle this</p> <pre><code> &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function (){ $(".mainTable td").click(function (){ var obj = $(this).children('input[type=checkbox]'); var bool = obj.prop("checked"); if(obj.length &gt; 0){ obj.attr("checked",!bool); } }); }); &lt;/script&gt; &lt;table cellpadding=10 border=1 class='mainTable'&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;table&gt; </code></pre>
javascript jquery
[3, 5]
268,056
268,057
call java script function with argument from asp.net
<pre><code> &lt;div style="float: left"&gt; &lt;a href="javascript:void(0)" onclick="javascript:chatWith('Ankit')"&gt; &lt;asp:Label ID="NameLbl2" Text='&lt;%# Eval("Values") %&gt;' runat="server"&gt;&lt;/asp:Label&gt;&lt;/a&gt;&lt;/div&gt; </code></pre> <p>this is the code that I am using inside a repeater with a java script function <code>onclick="javascript:chatWith('userName')"</code> , I want to use another name at the place of "userName" with the help of "EVAL()".??????</p>
javascript asp.net
[3, 9]
1,763,873
1,763,874
Lightbox does not work on iphone
<p>Clicking on the login on the top right here opens a lightbox login on PC: <a href="http://dressabelle.com.sg/" rel="nofollow">http://dressabelle.com.sg/</a></p> <p>The same function does not work on iPhone.</p> <p>How do I go about debugging this?</p> <p>(I did not develop this site, just helping to fix the bugs)</p>
javascript iphone
[3, 8]
1,880,041
1,880,042
Javascript location reload without get perimeter
<p>How can I make "<code>location.reload()</code>" on php file without get perimeter ?</p> <p>Here is an example..</p> <p>Let's say I have PHP, and at the right top, I have logout button.</p> <p>When user press that button, PHP will automatically re-direct to "<code>index.php?logout</code>" and after that, i will logout (unset cookie and other) and return <code>( javascript location.reload() )</code> to main page (login page)</p> <p>Problem that I have is, when php return to login page after logout, then url is still "<code>index.php?logout</code>", so when user login back with "<code>index.php?logout</code>" page, it will automatically logout (because of ?logout perimeter on url)..</p> <p>So how can I tackle this problem ? Anybody got any idea ?</p> <p>I hope you all understand what i'm trying to tell you all about..</p> <p>Thanks for reading this.. </p>
php javascript
[2, 3]
2,440,046
2,440,047
Disable/Control current Incoming Call Dailog box Android app
<p>I want to override the default dialog box for incoming calls with java code. I want to create a service with my own theme. </p> <p>What class and/or service controls this option? </p> <p>I want to install this app and by able to use my theme with the incoming call dialog box. I know I will have to Broadcast Receiver in my app, but I don't know how it will conflict with the current service(s) in the background.</p> <p>Thank you</p>
java android
[1, 4]
2,319,175
2,319,176
mouseover an image and show another, using jQuery
<p>I have an image, and when I mouseover I want another image to 'slide' over the first image from the bottom up. On mouseout the image should disappear again, slide from top to bottom, showing the first image again.</p> <p>How to do this with jQuery? I tried <code>animate</code> and <code>slidetoggle</code>, but I can't get it working.</p> <p>EDIT: solution</p> <pre><code>&lt;div class="image" style="width:90px;height:67px;position:relative;overflow:hidden"&gt; &lt;a href="#"&gt; &lt;img style="position:absolute;top:0;left;0;z-index:1;" class="first" src="images/stories/logos/in-dialoog.gif" alt="logo" /&gt; &lt;img style="position:absolute;top:0;left:0;z-index:0;" class="second" src="images/stories/logos/c-riders.gif" alt="logo" /&gt; &lt;/a&gt; &lt;/div&gt; $('.image').mouseenter(function(){ $('.first').stop().animate({ top: '56px' }, 800, function() { // Animation complete. }); }); $('.image').mouseleave(function(){ $('.first').stop().animate({ top: '0' }, 800, function() { // Animation complete. }); }); </code></pre>
javascript jquery
[3, 5]
4,240,211
4,240,212
JavaScript test if date (in string format) is more than 30 days ago
<p>i have the date in a string format like so <code>'11/2/2009'</code> (m/d/yyyy)</p> <p>I need to test if that is greater than 30 days ago.</p> <p>Whats the easiest and least error-prone way to do this.</p>
javascript jquery
[3, 5]
1,800,386
1,800,387
wrong result in date difference in android
<p>Actually i have performing an date operation in my android app. What i want is to subtract two dates and get the result. But subtraction leads to wrong result whenever i change the time zone to central daylight time.</p> <p>I have use the following code to find the difference between the two dates.</p> <pre><code>Long lDateDiff = dtCycleDay.getTime() - m_dtHistory[0].getTime(); lDateDiff = lDateDiff / (1000 * 60 * 60 * 24); </code></pre> <p>Here in m_dtHistory[0], the date stored is <strong>Thu Mar 01 00:00:00 CST 2012</strong>. </p> <p>And in my dtCycleDay variable the date changes from <strong>Thu Mar 01 00:00:00 CST 2012</strong>, <strong>Thu Mar 02 00:00:00 CST 2012, Thu Mar 03 00:00:00 CST 2012</strong>...and so on</p> <p>Now upto <strong>Thu Mar 11 00:00:00 CST 2012</strong> the subtraction result is fine, but when date changes to <strong>Thu Mar 12 00:00:00 CDT 2012</strong>, the CST changes to CDT and it show wrong subtraction result.</p> <p>Why this happen and these happen only whent i change the time zone to central Daylight Time or pacific Daylight Time.</p>
java android
[1, 4]
4,409,815
4,409,816
How do I add more than one function in my $(document).ready function
<p>I have this and it works fine:</p> <pre><code>$(document).ready( highlightTableRow ); </code></pre> <p>but when I add a second function (see below) the second doesn't work.</p> <pre><code>$(document).ready( highlightTableRow, attachClickLinkHandlerForRowLink ); </code></pre> <p>What's the correnct syntax for adding a second function to my ready function? Thanks.</p> <p>edit: add syntax errors. (eclipse)</p> <pre><code>$(document).ready( highlightTableRow(); **// error:Syntax error, insert ")" to complete Arguments** attachClickHandlerForRowLink(); **//error: Missing semicolon** ); **// error: Syntax error on token ")", delete this token** var originalRowBackground; function highlightTableRow(){ $('[class^="contentRow"]:has(a)').live('mouseenter', enterRowFunction).live('mouseleave', exitRowFunction); } function enterRowFunction(){ originalRowBackground = $(this).css('background-color'); $(this).css({'background-color': "#EFE3FF", 'cursor': 'pointer'}); } function exitRowFunction(){ $(this).css({'background-color': originalRowBackground, 'cursor': 'pointer'}); } function attachClickHandlerForRowLink(){ $('[class^="contentRow"]:has(a)').live('click', clickRowLink); } function clickRowLink(){ window.location = $(this).find("a").attr("href"); } **//error: Missing semicolon** </code></pre>
javascript jquery
[3, 5]
5,083,554
5,083,555
Jquery onload each loop EASY
<p>I have an easy keyup function for class "keyup-an" for keyup validation on a form. There are about 10 fields with this class. However after post, I add fields to the form. But the background of green and red goes away because its not keyup. How do i do something like this each that will color the backgrounds based on this result on page load</p> <pre><code>jQuery(document).ready(function() { $('.keyup-an').each(function(index) { var inputVal = $(this).val(); var numericReg = /^[a-zA-Z0-9_ ]{2,30}$/; if(!numericReg.test(inputVal)) { $(this).css('background', '#FAC3C3'); $(this).after('&lt;span class="error error-keyup-1"&gt;Please use letters or numbers only&lt;/span&gt;'); } else { $(this).css('background', 'lightgreen'); } }); $('.keyup-an').keyup(function() { $('span.error-keyup-1').hide(); var inputVal = $(this).val(); var numericReg = /^[a-zA-Z0-9_ ]{2,30}$/; if(!numericReg.test(inputVal)) { $(this).css('background', '#FAC3C3'); $(this).after('&lt;span class="error error-keyup-1"&gt;Please use letters or numbers only&lt;/span&gt;'); } else { $(this).css('background', 'lightgreen'); } }); </code></pre>
javascript jquery
[3, 5]
2,432,270
2,432,271
When sortable is dropped fire an alert
<p>Is there a callback function which fires when a user moves a draggable into a new position ?</p> <p>So for fiddle : <a href="http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/" rel="nofollow">http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/</a> When "Hello 01" is dragged and dropped into a new area the alert is fired ?</p> <p>Do I need to use .droppable ?</p>
javascript jquery
[3, 5]
4,966,704
4,966,705
Avoid execution goes on in a .each loop
<p>I've got a code like this one to see whether some radio buttons have been checked or not. I'm using .each function of jquery to show an alert when I find a group of radio buttons with the same name value and none of them have been checked. When I find one I want to fire an alert and return false, but after the alert is shown the execution of the .each stops but the lines after .each function are executed (I mean true value is executed).</p> <pre><code>$(":radio").each(function(){ var name = $(this).attr('name'); var numAnswered = $(":radio").filter('[name='+name+']').filter(":checked").length; var notAnswered = numAnswered == 0; if(notAnswered){ alert("Must answer all questions"); return false; } }); console.log('still goes here even when alert is fired'); return true; </code></pre> <p>How can I avoid this situation?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,231,860
4,231,861
Dynamic Page - accessing elements in events
<p>How to create a dynamic page in pageload() event and how to call the values like textbox or radio button on an button click event or in any other events?</p> <p>Kindly give a small example. Thanks in advance!</p>
c# asp.net
[0, 9]
3,277,286
3,277,287
How to get a time stamp posted?
<p>Hi I am trying to get a time stamp in the format of "posted: ten minutes ago" or "posted yesterday" or "posted three days ago" etc. I want to have an activity with a button and when the button is clicked I want to open a new activity and display the time stamp in the format I explained in the new activity. This is what I have so far:</p> <pre><code>public class MainActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button b = (Button) findViewById(R.id.button1); b.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { long currentTime = System.currentTimeMillis(); Intent i = new Intent(MainActivity.this, Main2.class); i.putExtra("currentTime", currentTime); startActivity(i); } }); } } </code></pre> <p>And activity two which I want to display the time stamp in the above format:</p> <pre><code>public class Main2 extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main2); Bundle extras = getIntent().getExtras(); long currentTime = extras.getLong("currentTime"); } } </code></pre>
java android
[1, 4]
575,513
575,514
How to insert a img into rich text editor?
<p>I want to insert an image into Rich text editor where the images are referred from the local drive i.e. (C:/,D:/), is this possible in asp.net</p>
c# asp.net
[0, 9]
1,448,859
1,448,860
Can I somehow use C# code or C# library in java android project?
<p>I have some useful code written in C# and I want to use it in my android app. Can I use it directly, or it is nesessary to rewrite it on Java?</p>
c# java android
[0, 1, 4]
5,477,249
5,477,250
Reset html form after submitting form and use it again without page refresh
<p>I have html form in PHP page which offers image download in different sizes.</p> <pre><code>&lt;form action='download.php' method='post'&gt; &lt;select name='size'&gt; &lt;option value='1'&gt;Small&lt;/option&gt; &lt;option value='2'&gt;Medium&lt;/option&gt; &lt;option value='3'&gt;Large&lt;/option&gt; &lt;/select&gt; &lt;button type='submit'&gt;Download&lt;/button&gt; &lt;/form&gt; </code></pre> <p>And in "download.php" page there is code which generate image and start downloading automatically using header.</p> <pre><code>header('Content-type: image/jpeg'); header('Content-Disposition: attachment; filename="'.$filename.'"'); imagejpeg($image, null, 100); </code></pre> <p>When I click on download button, form submits successfully and image starts downloading. Because I am using header in download.php file, current page not redirects to download.php file, and form remains as it is. Everything works till now.</p> <p>Now if I click on download button again, form redirects to download.php file, with no image downloading.</p> <p>Is there any way to work download button more than one time, without refreshing my index page?</p> <p><strong>Notes:</strong></p> <p>1.) I am using jquery on index page.</p> <p>2.) Instead of <code>&lt;input type='submit' /&gt;</code>, I am using <code>&lt;button type='submit'&gt;&lt;/button&gt;</code> because I am using font-awesome jquery plugin to put icon in button. Which is not possible in input tag.</p>
php jquery
[2, 5]
1,503,917
1,503,918
ajax sql reload
<p>I have a "news" feed for internal staff that works similar to the facebook feed. When the facebook feed as new updates from mysql it looks as though the div reloads and pushes down and load the most recent updates.</p> <p>I'm not sure how to go about doing this in (jquery) or javascript. Any thoughts on pushing me in the right direction?</p>
javascript jquery
[3, 5]
971,053
971,054
How to place a mouse under a div (with jQuery)?
<p>Ok so let me explain. Lets say there is a small image and when you hover over it, there will be a new and much larger image (an enlarge version of the image). Thats easy, but wait! I want the larger image to be right on top of the smaller image and when you hover out of the smaller image, the div goes away. The problem is that when you display the larger image on top of the smaller image, the mouse is hovering over the larger image and not the smaller image. I want to make it so that the mouse stays hovering on the small image while having the larger image on top if it. And when you hover out of the smaller image the larger image disappears. The key is having the larger image on top of the smaller one (covering it up), but having the mouse under the larger image. Cant figure this out! Thanks guys</p>
javascript jquery
[3, 5]
2,772,736
2,772,737
jQuery Uploadify
<p>I have a simple question related to the jquery Uploadify plugin because I am not sure I understand the documentation.</p> <p>Please look here <a href="http://www.uploadify.com/documentation/" rel="nofollow">http://www.uploadify.com/documentation/</a> at the onComplete event. It says there are arguments sent to that function including the response argument.</p> <p>How can I access those arguments? If I do alert(response) that doesn't work. Here's a little snippet:</p> <pre><code>$('#photo').uploadify({ 'uploader' : '/flash-uploader/scripts/uploadify.swf', 'script' : '/flash-uploader/scripts/upload-public-photo.php', 'cancelImg' : '/flash-uploader/cancel.png', 'scriptData' : {'user_id' : 'USER_ID'}, 'queueID' : 'fileQueue', 'auto' : true, 'multi' : true, 'sizeLimit' : 2097152, 'fileExt' : '*.jpg;*.jpeg;*.gif;*.png', 'wmode' : 'transparent', 'onComplete' : function(response) { alert(response); // doesn't work // but docs say response argument is sent to this function... } }); </code></pre>
javascript jquery
[3, 5]
173,157
173,158
Passing a multidimensional PHP array to javascript
<p>I have an array($my_array) that looks something like:</p> <pre><code>array(2) { [25]=&gt;int(10) [30]=&gt;int(8) } </code></pre> <p>I'd like to assign it to a javascript array, but am having difficulties doing it. Any suggestions?</p> <p>Edit: At first, I thought I could just assign it like a string, but that isn't working:</p> <pre><code>var photo_limit = $my_array; </code></pre> <p>I tried also doing a var_dump into my js value.</p> <p>I'm currently trying to use something like:</p> <pre><code>for($i=0;$i&lt;count($my_array); $i++){ echo "a[$i]='".$a[$i]."';\n"; } </code></pre> <p>Thanks.</p>
php javascript
[2, 3]
2,040,839
2,040,840
Jquery and Java Script does not work an all pages
<p>My java script and jquery doesn't work on all of my pages. It works on the home page <a href="http://www.steadfastdesignfirm.com/rgw" rel="nofollow">http://www.steadfastdesignfirm.com/rgw</a> but not when I go to any other page like <a href="http://www.steadfastdesignfirm.com/rgw/#index.php" rel="nofollow">http://www.steadfastdesignfirm.com/rgw/#index.php</a> etc.</p> <p>I have a javascript function that loads content from another page into a div dynamically (the div is #ajax) and only the scripts run on items within that div are not working. For example, you'll see the text resize tool when you visit the main page and it works just fine, but when you click on another main tab, it's completely disabled. I think the ajax is causing the elements to become disabled because they only load on document.ready. What other approach can I take to keep these scripts working? </p>
javascript jquery
[3, 5]