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
1,269,430
1,269,431
create a copy of an ASP.NET Control object
<p>I have a cached control object form a UserControl in asp.net cache. I like to access my control and make a copy of it to freely change it without having any affect on the base cached control.</p>
c# asp.net
[0, 9]
3,779,965
3,779,966
how to know if someone is logged via javascript?
<p>in php i would do </p> <pre><code>if (isset($_COOKIE['user']) &amp;&amp; $_COOKIE['user'] == $valueFromDb) echo 'logged'; </code></pre> <p>But in javascript how can I check it?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,312,791
5,312,792
Multiple if() in one
<p>This:</p> <pre><code>if (A || B) { X; } if (C &amp;&amp; D) { X; } if (F != G &amp;&amp; H + I === J) { X; } </code></pre> <p>Can be replaced by:</p> <pre><code>if ((A || B) || (C &amp;&amp; D) || (F != G &amp;&amp; H + I === J)) { X; } </code></pre> <p>But can it be replaced by:</p> <pre><code>if (A || B || C &amp;&amp; D || F != G &amp;&amp; H + I === J) { X; } </code></pre> <p>? (Without parentheses)</p> <p>And is there any difference between languages?</p> <p>P.S: The answers shouldn't based on those examples.</p>
php javascript c++
[2, 3, 6]
149,180
149,181
Multidim json array javascript, how to grab values
<p>I have this data response from an AJAX call:</p> <pre><code>{"18:00":{"twopersons":1,"fourpersons":0}} </code></pre> <p>Which gets stored into a variable by <code>statsarray = data;</code></p> <p>Now how can i loop through statsarray and output the <code>twopersons</code> value?</p> <p>So I can alert:</p> <pre><code>18:00 - There's 2 x 2persons and 0 x 4persons </code></pre> <p>Here is the Ajax call:</p> <pre><code>var statsarray; var currentloopeddate = test_date.toString('yyyy-MM-dd') $.post("/home/sessions", { action: 'partner_calendar_checkseats', date: currentloopeddate }, function(data) { statsarray = data; } ); </code></pre>
javascript jquery
[3, 5]
3,620,406
3,620,407
How to simulate slow page load in ASP.NET?
<p>How to simulate slow page load in ASP.NET?</p>
c# asp.net
[0, 9]
4,868,834
4,868,835
How to extract Google search keyword using Request.UrlReferrer and c#
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1567695/how-to-get-keywords-used-from-a-search-engine">How to get Keywords used from a Search Engine</a> </p> </blockquote> <p>The question is clear..</p> <p>I want to extract the search keyword from the Url Reffere by google</p> <p>any help?</p>
c# asp.net
[0, 9]
5,802,718
5,802,719
How to connect javascript to mozilla sqlite stored file
<p>i have created a database using mozilla firefox add-on ,now i want to connect it to my android project using java script .Please let me know the code</p> <p>Any ideas appreciated... thanks!</p>
javascript android
[3, 4]
2,877,992
2,877,993
JQuery onclick condition stop link?
<p>I have a link:</p> <p>Link</p> <p>using::</p> <pre><code>$('#myID').click(function(){ if($("#myCheckbox").is(":checked")) { alert('Yes it is...'); //continue as normal } else { alert('Not checked'); //exit do not follow the link } ... </code></pre> <p>so is //exit do not follow the link possible?</p>
javascript jquery
[3, 5]
1,054,202
1,054,203
javascript or jquery : mouse events
<p>Need your help in understanding this code..Is this Javascript ( expression language ) or JQuery. I tried to understand but didn't get it.</p> <pre><code>var interval = 0, changed = false; ............... ............... var start = function () { $(document).on('mousedown mousemove scroll touchstart touchmove keydown', change); setInterval(check, 1000); }; var change = function () { changed = true; }; var check = function () { console.log("changed ....."); }; start(); </code></pre> <p>Basically I want to do something ( business logic ) if user had performed some events on browser.Got this code on net and felt like something this is doing the same what i want.</p>
javascript jquery
[3, 5]
4,203,256
4,203,257
Setting value for javascript variable from code behind (C#)
<p>I understand the difference between Client-side and Server-side scripting. I have a javascript function and variable in my <code>MasterPage</code>:</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; var needToConfirm = false; window.onbeforeunload = confirmExit; function confirmExit() { if (needToConfirm) { needToConfirm = false; return "Currently in edit mode. If you leave the page now then you will lose unsaved changes." } } &lt;/script&gt; </code></pre> <p>Given the fact that on my ASP.NET (Client-side) I can change the value of my <code>needToConfirm</code> variable to <code>true</code> <code>onClientClick</code> but by default it is false. Here's an example.</p> <pre><code> &lt;asp:Button ID="btnEdit" runat="server" Text=" Edit " onclick="btnEdit_Click" OnClientClick="needToConfirm = true;" /&gt; </code></pre> <p>Now the question here is when on the C# (Server-side) I have to set the <code>needToConfirm</code> to true under an <code>if-statement</code> but not necessarily on <code>Page_Load</code>:</p> <pre><code>private void SetDefault() if (Session[def.ID_CUST] != null) { //I want to change the variable value here } } </code></pre> <p>Thanks.</p> <p><strong>UPDATE</strong></p> <p>I'm using .NET 2.0 Classic and WebForms</p>
c# javascript asp.net
[0, 3, 9]
4,157,779
4,157,780
Is this functionality possible?
<p>Does anyone know if the following is possible please? (and the best way to do it)</p> <ul> <li><p>code that searches through a pages content</p></li> <li><p>finds any names that are defined in a seperate text file</p></li> <li><p>if it finds any matches it adds a hyperlink to the name</p></li> <li><p>the hyperlink opens a tooltip on hover, pulling in relevant data from the seperate text file</p></li> </ul> <p>Any ideas/help greatly appreciated. </p>
php javascript jquery
[2, 3, 5]
3,772,250
3,772,251
FilenameFilter, searching for folders
<p>I have this class that implements <code>FilenameFilter</code></p> <pre><code>package Logic; import java.io.File; import java.io.FilenameFilter; public class Filter implements FilenameFilter { String name; public Filter(String name) { this.name = name; } @Override public boolean accept(File dir, String filename) { return name.contains("bluetooth"); } } </code></pre> <p>I use this class in this method:</p> <pre><code>public String searchForBluetoothFolder() { String folderNameToSearchFor = "bluetooth"; File root = sdCard; FilenameFilter filter = new Filter(folderNameToSearchFor); String[] bluetoothFolder = root.list(filter); for(int i = 0; i &lt; bluetoothFolder.length; i++) { Log.i("Bluetooth: ", bluetoothFolder[i]); } return ""; } </code></pre> <p>Inside the for-loop, the ouput is just <strong>all</strong> of the files in the root directory, not those who have bluetooth as name. What am I doing wrong here? </p>
java android
[1, 4]
1,684,595
1,684,596
How to prevent OnSelectedIndexChanged to cause postback unless the user uses the mouse or the enter key?
<p>here's a dropdownlist that posts back on selected index changed. </p> <pre><code>&lt;asp:DropDownList ID="_ddlClientType" runat="server" AutoPostBack = "true" OnSelectedIndexChanged="ClientType_SelectedIndexChanged" &gt; &lt;asp:ListItem Value="-1" Text="CANCEL.."&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="11" Text="External"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="12" Text="Internal"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="13" Text="TOM"&gt;&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>When using the mouse, everything works perfectly. However, I want user to be able to press key to select different items either by by using up/down arrow key. Also when when user type a letter, then the first item starting with that letter gets highlighted.</p> <p>The problem is when a different item gets selected in the dropdownlist, the page posts back because of the "<strong>OnSelectedIndexChanged</strong>" event. </p> <p>Is there a way to prevent the postback to occur when key are being pressed (as opposed to mouse being clicked), until the <strong>enter key</strong> is pressed? </p> <h1>EDIT</h1> <p>I'm able to display the alert prompt when a key is pressed</p> <pre><code>$('select').keypress(function () { alert('A key was pressed') }); </code></pre> <p>Now, I need to know which key was pressed. Thus, I'll be able to make a decision.</p>
jquery asp.net
[5, 9]
1,337,689
1,337,690
How to get the response from a modal dialog?
<p>I currently have this:</p> <pre><code>Builder yesandno = new AlertDialog.Builder(this); yesandno.setTitle("QuickResponse"); yesandno.setMessage(message); yesandno.setPositiveButton("YES", null); yesandno.setNegativeButton("NO", null); yesandno.show(); </code></pre> <p>How should I go by setting an event listener that will capture if the user clicked YES or NO?</p>
java android
[1, 4]
1,302,607
1,302,608
JQuery or JavaScript: How determine if shift key being pressed while clicking anchor tag hyperlink?
<p>I have an anchor tag that calls a JavaScript function.</p> <p>With or without JQuery how do I determine if the shift key is down while the link is clicked?</p> <p>The following code does NOT work because keypress is only fired if a "real key" (not the shift key) is pressed. (I was hoping it would fire if just the shift key alone was pressed.)</p> <pre><code>var shifted = false; $(function() { $(document).keypress(function(e) { shifted = e.shiftKey; alert('shiftkey='+e.shiftkey); }); $(document).keyup(function(e) { shifted = false; }); } ... function myfunction() { //shift is always false b/c keypress not fired above } </code></pre>
javascript jquery
[3, 5]
5,482,066
5,482,067
Access to class attributes by using a variable in Python?
<p>In PHP i can access class attributes like this:</p> <pre><code>&lt;?php // very simple :) class TestClass {} $tc = new TestClass{}; $attribute = 'foo'; $tc-&gt;{$attribute} = 'bar'; echo $tc-&gt;foo // should echo 'bar' </code></pre> <p>How can i do this in Python?</p> <pre><code>class TestClass() tc = TestClass attribute = 'foo' # here comes the magic? print tc.foo # should echo 'bar' </code></pre>
php python
[2, 7]
495,172
495,173
DetailsView Preview mode?
<p>DetailsView1.DefaultMode = DetailsViewMode.Insert;</p> <p>After inserting how can i Preview Data before Submitting/Inserting data in the table?</p> <p>I know the code would be: DetailsView1.DefaultMode = DetailsViewMode.ReadOnly;</p> <p>Where do I put this code BEFORE submitting/inserting data in the table?</p>
c# asp.net
[0, 9]
1,099,065
1,099,066
Replacing characters using javascript replace and substring
<p>I have a string in js like this:</p> <pre><code>var frmSearch ="LoginID=:PersonName=:CallIDNumber=:NumberCalledTo=%2B92+3344038368:NumberCalledFrom=%2B92+3344038368:Notes=" </code></pre> <p>I want to remove space (%2B) and replace + with ~ from NumberCalledTo and NumberCalledFrom. numbers can be of different length and LoginID, Call ID number can have value or be empty. Notes can be empty or have value.</p> <p>I tried this but it is not working:</p> <pre><code> frmSearch = frmSearch.substr(0, frmSearch.length - s.length); var NumberCalledTo = frmSearch.substr(frmSearch.indexOf(":NumberCalledTo"), frmSearch.indexOf(":NumberCalledFrom")); NumberCalledTo = NumberCalledTo.replace('+', '').replace('%2B', '~'); var NumberCalledFrom = frmSearch.substr(frmSearch.indexOf(":NumberCalledFrom"), frmSearch.indexOf(":Notes")); NumberCalledFrom = NumberCalledFrom.replace('+', '').replace('%2B', '~'); </code></pre> <p>Please suggest how to do it ?</p>
javascript jquery
[3, 5]
3,790,178
3,790,179
get the value of hidden parameter present in a div using jquery
<p>I have a div whose id is "mainDiv" and a hidden field is in this div whose class name is "myHiddenField". Now I want to get the value of that hidden parameter using jquery.</p> <p>I have tried:</p> <pre><code>$("#mainDiv .myHiddenField").val() </code></pre> <p>and </p> <pre><code>$("#mainDiv .myHiddenField").attr('value') </code></pre>
javascript jquery
[3, 5]
4,531,931
4,531,932
Avoid iPhone reload page
<p>I've got a Wordpress site which has a registration wizard. When it comes to second step, when executing from iphone, the page reloads so data get lost and it can't continue.</p> <p>Searching I saw this reload thing is a <a href="http://www.google.es/search?q=wp+log+activity&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;rls=org.mozilla:es-ES:official&amp;client=firefox-a#pq=wordpress+log&amp;hl=es&amp;gs_nf=1&amp;cp=14&amp;gs_id=58&amp;xhr=t&amp;q=iphone+reloads+page+safari&amp;pf=p&amp;safe=off&amp;client=firefox-a&amp;rls=org.mozilla:es-ES%3Aofficial&amp;sclient=psy-ab&amp;pbx=1&amp;oq=iphone+reloads&amp;aq=0L&amp;aqi=g-L3g-vL1&amp;aql=&amp;gs_sm=&amp;gs_upl=&amp;bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&amp;fp=36988c40308b3cd5&amp;biw=1280&amp;bih=849" rel="nofollow">common thing</a> but didn't find the way to avoid it, plus, my circunstamces are different as I'm using an iPhone emulator.</p> <p>Have you heard about this before and know how to avoid it?</p> <p>Thank you</p>
php iphone
[2, 8]
1,159,863
1,159,864
setting checkbox value
<p>I have this code:</p> <pre><code>$('#chkBox').click(function() { $('#hiddenBox').val($('input').is(':checked')); }); </code></pre> <p>I want it to be where if i click on the checkbox, in my hidden field, I set the value to true else if it's not clicked, the value would be false. Can anyone help?</p>
javascript jquery
[3, 5]
2,456,446
2,456,447
How to get type of input object
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1940471/how-do-i-determine-an-html-input-element-type-upon-an-event-using-jquery">How do I determine an HTML input element type upon an event using jQuery?</a> </p> </blockquote> <p>I want to get type of input object but I alway got "undefined". <br/> What is missing it this code?</p> <pre><code>var c = $("input[name=\'lastName\']"); c.val("test"); alert(c.type); </code></pre> <p>My form</p> <pre><code>&lt;form action="formAction.jsp" method="post"&gt; FirstName &lt;input type="text" name="firstName" id="firstName"&gt;&lt;/input&gt;&lt;br/&gt; LastName &lt;input type="text" name="lastName"&gt;&lt;/input&gt;&lt;br/&gt; Address &lt;input type="text" name="address"&gt;&lt;/input&gt;&lt;br/&gt; Tel &lt;input type="text" name="tel"&gt;&lt;/input&gt;&lt;br/&gt; Email &lt;input type="text" name="email"&gt;&lt;/input&gt;&lt;br/&gt; &lt;/form&gt; </code></pre>
javascript jquery
[3, 5]
652,867
652,868
JQuery add class with name of closest label
<p>I have a table that needs some custom theming. It has a lot of text inputs and they all need custom widths. I figured it would be nice to simply add custom CSS classes based on the label name of each field. I am part of the way there but for some reason I am picking up all the label names for any given label in the table, not simply the closest one as I desire.</p> <p>Here is my JQuery:</p> <pre><code>$('td.label-text', this).each(function() { // add class with name of the label text $('td.input-text').addClass($(this).text().replace(/[^a-z]/gi,'').toLowerCase() + ' ').closest("td.label-text"); }); </code></pre> <p>Here is some sample HTML output:</p> <pre><code>&lt;tr&gt; &lt;td class="label-text"&gt;Rule Name*:&lt;/td&gt; &lt;td class="input-text effectivedate rulename employeeid createrulefor ipaddress active searchby"&gt; &lt;input type="text" name="ruleName" value=""&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="label-text"&gt;Employee ID:&lt;/td&gt; &lt;td class="input-text effectivedate rulename employeeid createrulefor ipaddress active searchby"&gt; &lt;input type="text" name="employeeId" value="" id="empnotext"&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>As you can see all label names get added to every td .input-text class, not the nearest (closest) one. I am sure I am doing something wrong but not sure what. </p> <p>I am also wondering if a class can be added based on the input name</p>
javascript jquery
[3, 5]
2,394,337
2,394,338
pragmatically add items to dropdownlist in detailsview update mode and bind the data
<p>i have a detailview with a dropdownlist</p> <pre><code>&lt;asp:TemplateField HeaderText="nid" SortExpression="nid"&gt; &lt;EditItemTemplate&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server" onclick="btnUpdate_Click"&gt; &lt;/asp:DropDownList&gt; &lt;/EditItemTemplate&gt; &lt;InsertItemTemplate&gt; &lt;asp:TextBox ID="TextBox1" runat="server" Text='&lt;%# Bind("nid") %&gt;'&gt;&lt;/asp:TextBox&gt; &lt;/InsertItemTemplate&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="Label1" runat="server" Text='&lt;%# Bind("nid") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>i want to add the items when using click the update button than bind the data to the dropdownlist </p> <p>here is the functions</p> <pre><code>protected void btnUpdate_Click(object sender, EventArgs e) { Response.Write("abc"); Node node = new Node(); node.buildTree("all", "arraylist"); al.Add(null); al = node.getArrayList(); node.flushContent(); DropDownList DropDownList1 = (DropDownList)DetailsView1.FindControl("DropDownList1"); //DetailsView1.DropDownList1.Items.Clear(); DropDownList1.Items.Add(new ListItem("ROOT", "")); foreach (pair item in al) { DropDownList1.Items.Add(new ListItem(item.getTitle(), item.getId())); } } </code></pre> <p>i don't know whether my direction is right, but above code is not work~ anyone can help?</p> <p>thanks</p>
c# asp.net
[0, 9]
4,738,528
4,738,529
How send C# DateTime object into Javascript?
<p>I want to send C# DateTime object into Javascript. How can I accomplish that?</p>
c# javascript
[0, 3]
4,219,742
4,219,743
Javascript addition query
<p>Don't feel foolishness in my question. Below is my scenario. Please advice</p> <p>var num = 02; var add = num + 1 ;</p> <p>Getting result is 3, but I need it as 03. Is it possible.</p>
javascript jquery
[3, 5]
4,463,325
4,463,326
Given a ISO 8601 weeknumber, how would you get the dates within that week
<p>I got a weeknumber from a jquery datepicker, when a user selects a date. But now I want to get all the days within that week.</p> <p>I could add a click event that loops through all the td's of the tr the selected date is in and graps it's value but I'm looking for a more reliable way.</p> <p>So my question is, given a certain date and a weeknumber (iso 8601 formatted), how can you derive the other dates within that week with javascript?</p>
javascript jquery
[3, 5]
741,250
741,251
Error mousemove event can't show button in other frame?
<p>I have a sample code:</p> <pre><code>&lt;div id="background-1" style="background: url('image1.png') no-repeat left center; width: 200px; height: 200px; float: left;"&gt; &lt;div id="button-wrapper" style="position: absolute; opacity: 1; z-index: 100;"&gt; &lt;input type="button" value="submit"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="background-2" style="background: url('image2.png') no-repeat right center; width: 200px; height: 200px; float: right;"&gt; &lt;div id="button-wrapper" style="position: absolute; opacity: 1; z-index: 100;"&gt; &lt;/div&gt; &lt;/div&gt;​ </code></pre> <p>And my script:</p> <pre><code>jQuery(document).ready(function(){ jQuery("div[id^=\'button-wrapper\']").parent().mousemove(function(e){ var _top = e.pageY - 5; var _left = e.pageX - 5; var _c = jQuery(this); var _p = _c.position();; if (_top &gt; (_p.top + _c.height())) _top = _p.top + _c.height(); if (_left &gt; (_p.left + _c.width())) _left = _p.left +_c.width(); jQuery("div[id^=\'button-wrapper\']").css({ top: _top, left: _left }); }); });​ </code></pre> <p>Error when I hover background-2 is event mousemove not run button submit, how to fix it? demo <a href="http://jsfiddle.net/4An3E/10/" rel="nofollow">here</a></p>
javascript jquery
[3, 5]
2,320,978
2,320,979
Jquery X,Y position send over ajax
<p>I need an example that uses jquery to send the current x,y position of a <code>&lt;div&gt;</code> (the top left pixel) to a php file using ajax where the position can then be processed.</p>
php jquery
[2, 5]
4,852,376
4,852,377
improve my jquery validation plugin code
<p>Just hoping soemone can help me to write better code than I can come up with on my own.</p> <p>I am using the jquery validation plugin. I have some fields that are mandatory ONLY if certain options are chosen.</p> <p>The below code works fine. But the thing is, is that that my list of 'OR's is much longer than I've put here. and it needs to be applied not just to 'directorsName' but a whole long list of inputs, selects etc.</p> <p>My question is.. how can I wrap up the code contained inside the RETURN? (so I dont have to keep repeating my 'OR's. I'm guessign I need a function but I'm unsure of the syntax) </p> <pre><code>$("#myForm").validate({ rules: { directorsName : { required: function(element) { return ( $('#account_for').val() == "Joint" || $('#directors_number').val() == "2" || $('#directors_number').val() == "3" ); } } } }); </code></pre> <p>Thanks in advance</p>
javascript jquery
[3, 5]
1,940,771
1,940,772
jquery: simple animate question
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/190560/jquery-animate-backgroundcolor">jQuery animate backgroundColor</a> </p> </blockquote> <p><a href="http://johanberntsson.se/dev/fysiosteo/" rel="nofollow">http://johanberntsson.se/dev/fysiosteo/</a></p> <p>If you hover the menu, i would like the main menu to fade out its backbgroundcolor to #fff over 1 second. But i cant get it to work. My code:</p> <pre><code> $('#menu-main-menu').children('li').mouseout(function () { $(this).css('background', '#AFFFAF').animate({ 'background' : '#fff' }, 1000); }); </code></pre> <p>I never use animate(), so ive probably missed something obvious. Thanks.</p>
javascript jquery
[3, 5]
2,080,337
2,080,338
Jquery traversing using prev()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5452917/jquery-prevselector-not-working">jQuery: prev(&lt;selector&gt;) not working?</a> </p> </blockquote> <p>Consider this markup:</p> <pre><code>&lt;tr class="store"&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;...&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;...&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;...&lt;/td&gt; &lt;td&gt;&lt;a href="#" class="link"&gt;link&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Then this Jquery code:</p> <pre><code>$('.link').live('click', function() { $(this).parents('tr').prev('.store').remove(); }); </code></pre> <p>What I want to do is when I try to click <code>&lt;a href="#" class=".store"</code>, the previous <code>&lt;tr class="store"&gt;</code> should be removed. The Jquery code I posted doesn't work. Any thoughts?</p>
javascript jquery
[3, 5]
1,584,529
1,584,530
how can i get all field when click on record
<p>I need to insert a value into the text input when a user selects a record, and I don't know if it's possible or not.</p> <p>Here is my code: </p> <pre><code> &lt;table border="2" cellspacing="3"&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" id="select" /&gt;&lt;/td&gt; &lt;td&gt;Hello&lt;/td&gt; &lt;td&gt;World&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" id="select" /&gt;&lt;/td&gt; &lt;td&gt;vvvv&lt;/td&gt; &lt;td&gt;vv&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="checkbox" id="select" /&gt;&lt;/td&gt; &lt;td&gt;vvv&lt;/td&gt; &lt;td&gt;Wvvvvorld&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;input type="text" name="kkk" id="kkk"/&gt; &lt;input type="text" name="kkk" id="kkk"/&gt; </code></pre> <p>and JavaScript shows:</p> <pre><code>$(document).ready(function(){ $("table tr td input").click(function(){ $("#kkk").html($(this).text()); }); }); </code></pre>
javascript jquery
[3, 5]
393,784
393,785
how to restart main activity while retaining some data
<p>This is my first app and I'm trying to write a simple Liar's Dice game. </p> <p>I wrote everything in the main activity class, rolls random dice, textedit boxes to enter bids and buttons to bid and call. </p> <p>So after the game runs, how do I get it to keep track of the score and run again? </p> <p>I've tried making another activity screen with a restart button and have it go there after the game ends so I can restart the main activity. However I am able to press back(phonekey) from that screen and get stuck at the end of the previous game. </p> <p>Also I am trying to use an array to keep track of the wins and losses but not sure how to go about bringing it back and forth from the activities.</p>
java android
[1, 4]
2,088,160
2,088,161
http://10.0.2.2 works on the android emulator but not on android device used as a emulator
<p>I connected my android device via USB to use it as a emulator, if I access the URL from eclipse emulator it works but the same if I access from device as emulator it gives connection time out error.</p> <p>is there any settings do I need to change for this? or is there any possible solution for this?</p> <p>Thanks</p>
java android
[1, 4]
876,543
876,544
How do I do the equivalent of "myClass[].class" with ArrayList<myClass>?
<p>I'm using the GSON library and calling the fromJson() method: <a href="http://google-gson.googlecode.com/svn/tags/1.2.3/docs/javadocs/com/google/gson/Gson.html" rel="nofollow">http://google-gson.googlecode.com/svn/tags/1.2.3/docs/javadocs/com/google/gson/Gson.html</a></p> <p>My old code:</p> <pre><code>String s = new GsonBuilder().create().fromJson(responseString,myClass[].class); </code></pre> <p>Works fine, but I'm moving the collection from an array to an ArrayList and I can't figure out the syntax to use to pass the type to this method. If I understand correctly the existing code is passing the type (an array of myClass objects) to the method, which it then creates from the JSON response.</p> <p>But I have tried all the syntax combinations I can think of and I'm stumped for how to do what I thought would look like this:</p> <pre><code>String s = new GsonBuilder().create().fromJson(responseString, ArrayList&lt;myClass&gt;.class ); </code></pre>
java android
[1, 4]
4,946,181
4,946,182
Android and java Association
<p>Can anybody please tell me that how closely Android Application Development is associated with Java. That is, is it possible for a person working in Android Development to work on Core Java or J2EE or J2SE ever?</p> <p>Let me make my question a bit more clear: " As Android is based on Java, but does it depends on Java so well that a person from the Android development side can work in Core Java or J2EE or in J2SE.?</p> <p>Seeking really to know this now.</p>
java android
[1, 4]
5,817,694
5,817,695
How to display the current page even after clicking browsers back button
<p>Is it possible to keep displaying the same page even after the user click's the browsers back button?</p> <p>Its like a multiple-step form which on submit makes a redirect to the resulting page and once the form has been submitted I don't want the user to be able to navigate back to any of the previous pages using browsers back button. So I would like to keep displaying the same resulting page to user on clicking the back button. Just the URL on clicking the back button could change to previous URLs from history but I would not want the user to go back to any of the previous pages.</p> <p>Could someone suggest me any ideas on how to achieve that if its possible to be done.</p> <p><strong>EDIT</strong>: Say there are 3 steps of some process and then the resulting page like <code>../step1</code>, <code>../step2</code>, <code>../step3</code>, <code>../resulting page</code>. User could play with those steps with back and forward button but once the step 3 has been submitted and user is at <code>../resulting page</code> I would like the user only to show the URL of the previous displayed page while keeping the result page on.</p>
javascript jquery
[3, 5]
5,773,739
5,773,740
JQuery Get current ID of Widget
<p>I have have the following</p> <pre><code>&lt;div id="dualList"&gt;&lt;/div&gt; </code></pre> <p>And I have written a plugin but for the sake of testing I have stripped it away. I am having problems with the plugin displaying the id of the div.</p> <pre><code>&lt;script&gt; (function($) { $.fn.DualList = function() { var thisControl = $(this); alert(thisControl.attr('id')); } })(jQuery); &lt;/script&gt; </code></pre> <p>And its bound on document on ready using <b>$("#dualList").DualList();</b></p> <p>Any ideas why the ID isnt echoing out?</p>
javascript jquery
[3, 5]
3,203,279
3,203,280
String is not replaced in CreateUserWizard Registration Email
<p>My website allows users to create accounts. </p> <p>Upon creating, an email verification with a URL will be send to the user's email. </p> <p>Problem: The sending of email worked but unfortunately the verification URL did not appear.</p> <p>And for </p> <pre><code>&lt;a href="&lt;%VerifyUrl%&gt;"&lt;%verifyUrl%&gt;&lt;/a&gt;&lt;/p&gt; </code></pre> <p>there is a green curly line beneath "&lt;%VerifyUrl%>", stating that this file could not be found. </p> <p>This is the source code of Login.aspx : </p> <pre><code>protected void CreateUserWizard1_SendingMail(object sender,MailMessageEventArgs e) { MembershipUser userInfo = Membership.GetUser(CreateUserWizard1.UserName); //Construct the verification URL string verifyUrl = Request.Url.GetLeftPart(UriPartial.Authority) + Page.ResolveUrl("~/Verify.aspx?ID=" + userInfo.ProviderUserKey.ToString()); // Replace &lt;%VerifyUrl%&gt; placeholder with verifyUrl value e.Message.Body = e.Message.Body.Replace("VerifyUrl", verifyUrl.ToString()); } </code></pre> <p>This is the html file that what user would see in their email: </p> <pre><code>&lt;h2&gt; Welcome to My Website!&lt;/h2&gt; &lt;p&gt; Hello, &lt;%UserName%&gt;. You are receiving this email because you recently created a new account at my site. Before you can login, however, you need to first visit the following link:&lt;/p&gt; &lt;p&gt; &lt;a href="&lt;%VerifyUrl%&gt;"&gt;&lt;%verifyUrl%&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt; After visiting the above link you can log into the site!&lt;/p&gt; &lt;p&gt; If you have any problems verifying your account, please reply to this email to get assistance.&lt;/p&gt; &lt;p&gt; Thanks!&lt;/p&gt; </code></pre>
c# asp.net
[0, 9]
6,025,770
6,025,771
Audio analyzer for finding songs pitch
<p>Is there anyway to analyze the audio pitches programmatically. For example, i know most of the players show a graph or bar &amp; if the songs pitch is high @ time t, the bar goes up at time t .. something like this. Is there any utility/tool/API to determine songs pitch so that we interpolate that to a bar which goes up &amp; down.</p> <p>Thanks for any help</p>
java c++ iphone
[1, 6, 8]
826,504
826,505
how to give gridview first column left margin from gridview?
<pre><code>&lt;asp:GridView ID="grdUploadedFiles" runat="server" AutoGenerateColumns="False" AllowPaging="True" PageSize="7" DataKeyNames="ID" OnRowEditing="grdUploadedFiles_RowEditing" OnRowUpdating="grdUploadedFiles_RowUpdating" OnRowCancelingEdit="grdUploadedFiles_RowCancelingEdit" OnRowDeleting="grdUploadedFiles_RowDeleting" ShowFooter="True" ForeColor="Black" GridLines="Vertical" Width="439px" BackColor="White" BorderColor="#999999" BorderStyle="Solid" Font-Size="Small" Font-Names="Arial" CellPadding="3" BorderWidth="1px"&gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Type" HeaderStyle-HorizontalAlign="Center" &gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="lblType" runat="server" Text='&lt;%# Bind("FileType") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;asp:CommandField ShowEditButton="True"&gt; &lt;ItemStyle/&gt; &lt;/asp:CommandField&gt;&lt;/column&gt;&lt;/gridview&gt; </code></pre> <p>I am using above code for my gridview.and i want to give padding to my 1st column.and also i want to give underline to my edit and delete link in my gridview.For that if i give textuderline='true" on editing it shows Update Delete both a single underline which looks ugly. Is there any other way?</p>
c# asp.net
[0, 9]
4,002,691
4,002,692
De-cluttering ASP.NET javascript
<p>I'm just getting into ASP.NET Been avoiding it for years as I'm a desktop application advocate.</p> <p>Anyway, I was wondering if there's a way to stop the generated html being so cluttered with javascript. Is there a way to make the generated script go into a referenced js file rather that inline with the page.</p>
asp.net javascript
[9, 3]
6,002,337
6,002,338
Inputing results to inArray from .html (or innerHtml) and making it work
<pre><code>$("form").submit(function () { if ($.inArray($("input:first").val().toUpperCase(), ["UNITED STATES", "USA", "AMERICA"]) &gt; -1) { //function here }); &lt;div class="answers"&gt;"UNITED STATES", "USA", "AMERICA"&lt;/div&gt; $("form").submit(function () { if ($.inArray($("input:first").val().toUpperCase(), [$(".answers").html()]) &gt; -1) { //function here }); </code></pre> <p>Within the div with the class answers I have the results I need to validate. When I use jquery function .html the results print out fine, but when it validates it needs to validate the whole sentence : "UNITED STATES", "USA", "AMERICA" not every answer on its own like it does on the first function. How can I make this work?</p>
javascript jquery
[3, 5]
3,064,979
3,064,980
Jquery detect input focus
<p>I am creating a conversion web app to teach myself Javascript. The user can input data with a number pad (basically a calculator without the operators). I also set up a function to detect keystrokes (1-9) which insert data just like the number pad. And also character 'c' which clears all data </p> <p>My problem is that I also have a search field (which uses auto complete to enable the user to search for other conversions). I dont' want the user to search for something using the 'c' or number keys, and have it enter data into both the number pad, and search field.</p> <p>My idea was to create a if statement to determine if the search field was active (focused), and if it was to change a variable (enabled) to false, thus disabling the keystroke detection.</p> <p>The problem I am having is that the function holding the if statement with the focus attribute is not working.</p> <p>If my rambling made no sense hopefully the code will clear things up.</p> <p><em>Here is the if statement with the focus attribute</em></p> <pre><code>$(document).ready(function(){ if($(':focus').attr('#searchInput') == 'input')){ enabled === false; } }); </code></pre> <p><em>Here is the code for key stroke detections (I omitted the redundant parts to save space</em></p> <pre><code>document.onkeydown = function(event){ var key = event.charCode || event.keyCode; if(enabled === true){ if(key === 67){ clearInput(input); //Clears form input (input is my form ID) }else if(key === 48){ writeInput(input, zero); //Zero is a var equaling 0 } ... }else{ return false; //if enabled is false don't detect keystrokes } }; </code></pre> <p>Any help would be greatly appreciated. If anything doesn't make sense I will be happy to explain (or edit the post.)</p>
javascript jquery
[3, 5]
2,691,919
2,691,920
send commands to a backgrounded jobs stdin
<p>I have a java server application that, when its running, you can interact with it sending commands via stdin. I want to write a web interface that can send these commands to it. </p> <p>In order to do that I need some way of getting commands from php to the stdin for this backgrounded job. Is there a way to do this from console? or possibly write some kind of wrapper that controls the server job and can access its stdin ? could this be done in python?</p>
php python
[2, 7]
1,715,371
1,715,372
Communicating with iFrame contents
<p>There is an iFrame that contains a whole document <code>(&lt;html&gt; to &lt;/html&gt;)</code>. This document contains some <code>script</code> tags too. My question is, can we call the functions of the scripts which are present in the iFrame?</p>
javascript jquery
[3, 5]
883,176
883,177
Use jQuery Media Plugin with audio/video stored in database
<p>I am using jQuery media plugin for making a media player. My media player should play audio/video. files stored in a sql server database that is retrieved by another aspx page with ContentType header equal to MIME Type.</p> <p>so i can reach a stored media with "abc.aspx?id=123" Url.</p> <p>the problem is jQuery media plugin is check file extension to play it, because my file extension is aspx it cannot understand the content of file. </p> <p>is there any solution for this situation ?</p>
jquery asp.net
[5, 9]
1,449,466
1,449,467
Start timer on web application start
<p>I would like to start a <code>System.Threading.Timer</code> in my application when it launches (maybe deploy is the correct word). I have seen that you can use <code>Application_Start()</code> but this is only <a href="http://stackoverflow.com/questions/1384131/configuring-asp-net-to-start-a-method-before-each-application-start-on-iis/1384144#1384144">fired once the first request comes to the application</a>. I need the timer to start as soon as the application is running so that it can check for work to process even if a user is not interacting with the site. How can I get the application to start the timer once it is up and running?</p>
c# asp.net
[0, 9]
254,155
254,156
sort divs by the number, no randomize
<p>I found this great script: <a href="http://jsfiddle.net/yomoore/RJMhT/119/" rel="nofollow">jsfiddle</a></p> <p>Over here: <a href="http://stackoverflow.com/questions/4205166/showing-random-divs-using-jquery">Showing random divs using Jquery</a></p> <p>The problem is that on reload the divs are randomized. I need the divs to show as they are sorted in the html, like 1,2,3,4 etc. And than of course cycle back starting over from div1.</p>
javascript jquery
[3, 5]
5,402,829
5,402,830
hide/show certain div according to links rel on hover
<p>got an easy question, using jquery, how do i create a menu, with links on the left and with content on the right, for example, if i hover the link with rel="link1", the content div on the right with id="link1" should be displayed, and when i hover another link with rel="link2", the content div with id="link2" will be displayed, BUT if i click one of the link, its content div should stay displayed, even if i hover another link :) i hope i was clear in explaining, here is my simple template to practice:</p> <pre><code>&lt;div id="ref_menu"&gt; &lt;a href="javascript://" class="ref_link" rel="link1"&gt; Link 1 &lt;/a&gt; &lt;a href="javascript://" class="ref_link" rel="link2"&gt; Link 2 &lt;/a&gt; &lt;/div&gt; &lt;div id="ref_content"&gt; &lt;div class="ref_text" id="link1"&gt; text1 &lt;/div&gt; &lt;div class="ref_text" id="link1"&gt; text2 &lt;/div&gt; &lt;/div&gt; </code></pre> <p>css styles:</p> <pre><code>#ref_menu { width:250px; text-align:right; position:absolute; left:0; } #ref_menu a { display:block; padding-right:10px; font-family:trebuchet ms; position:relative; font-style:italic; color:#0097c4; font-size:11pt; line-height:30px; letter-spacing:1px; border-bottom:1px solid #0097c4; } #ref_menu a:hover { color:red; border-bottom:1px solid red; } #ref_content { position:absolute; left:270px; } #ref_content div { display:none; position:absolute; top:0; } </code></pre> <p>and biiiig thanks to those who can spare some time with helping me, i really apreciate it!</p>
javascript jquery
[3, 5]
4,291,701
4,291,702
choppy animation issues
<p>i'm having some trouble with choppy jquery animation.</p> <p>My question is about the "Work" div that appears after the opening screen. I need the word "work" to move diagonally southeast. It moves, but the movement is very choppy (i'm using the latest version of firefox). Can anyone help me figure out why?</p> <p>Here is the fiddle: <a href="http://jsfiddle.net/KPPBM/" rel="nofollow">http://jsfiddle.net/KPPBM/</a></p>
javascript jquery
[3, 5]
2,799,064
2,799,065
make tooltip display on click and add a modal to it
<p>strangely, I find it difficult to bind jquery's onclick event handler to this fiddle. I don't even know what I'm doing wrong. The html is as follows:-</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a id="tooltip_1" href="#" class="tooltip" &gt;Trigger1&lt;/a&gt;&lt;li&gt; &lt;li&gt;&lt;a id="tooltip_2" href="#" class="tooltip" &gt;Trigger2&lt;/a&gt;&lt;li&gt; &lt;li&gt;&lt;a id="tooltip_3" href="#" class="tooltip" &gt;Trigger3&lt;/a&gt;&lt;li&gt; &lt;/ul&gt; &lt;div style="display: none;"&gt; &lt;div id="data_tooltip_1"&gt; data_tooltip_1: You can hover over and interacte with me &lt;/div&gt; &lt;div id="data_tooltip_2"&gt; data_tooltip_2: You can hover over and interacte with me &lt;/div&gt; &lt;div id="data_tooltip_3"&gt; data_tooltip_3: You can hover over and interacte with me &lt;/div&gt; &lt;/div&gt;​ </code></pre> <p>styled this way:-</p> <pre><code>li { padding: 20px 0px 0px 20px; }​ </code></pre> <p>with a jquery like this:-</p> <pre><code>$(document).ready(function() { $('.tooltip[id^="tooltip_"]').each (function(){ $(this).qtip({ content: $('#data_' + $(this).attr('id')), show: { }, hide: { fixed: true, delay: 180 } }); }); });​ </code></pre> <p>you check out the fiddle page I created:- <code>http://jsfiddle.net/UyZnb/339/.</code></p> <p>Again, how do I implement a jquery modal-like appearance to it so the tooltip becomes the focus?</p>
javascript jquery
[3, 5]
3,970,398
3,970,399
Global Variable in php and Javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8127988/passing-variable-between-pages">passing variable between pages</a> </p> </blockquote> <p>I need to create a variable that I can use in one PHP page to assign a category to this variable. When I've assigned a value, how I can pass that value to another PHP page?</p> <p>Do I have to use a global variable?</p>
php javascript
[2, 3]
1,892,858
1,892,859
Proper way to decode SecurityElement.Escape using Javascript
<p>I've tried several methods to decode encoded xml using javascript. For some reason all of them ignore &apos; which causes it to fail. I can do a string.replace to fix the issue, but wondering why this happens or if there is some other method I should be using.</p> <p>I've tried decodeURIComponent as well as another method I found on SO that puts the content in a div and then pulls it back out. Both ignore the &apos;. I also tried unescape which curiously did nothing whatsoever. It is an xml block I am decoding.</p>
c# javascript asp.net
[0, 3, 9]
603,670
603,671
JQuery live doesn't work
<p>I try to get .live content into a div when there is a keyup... I looked at the forumtopic here but I didn't find the answer...</p> <p>Why does my code not works? I use this JQuery:</p> <pre><code>&lt;script type="text/javascript" src="jquery-ui-1.7.1.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { // When the document is ready set up our sortable with it's inherant function(s) $(".atleetnaamlink").live('keyup', function(){ alert('test'); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,856,786
1,856,787
Writing python code on android
<p>I recently got a android tablet (nexus 7) and would like to be able to write python programs on it (not for it) without access to the internet or needing to access any other device to run the program. If somebody could suggest an app, or tell me how to set it up, it would be great. If however, someone could suggest an app that works with a different language, that would also be nice.</p>
android python
[4, 7]
2,717,329
2,717,330
radio button change style on checked
<p>i have a set of radio buttons. </p> <pre><code>&lt;ul class="ProductOptionList"&gt; &lt;li&gt; &lt;label&gt; &lt;input class="RadioButton" type="radio" value="157" name="variation[1]"/&gt; Lemon (200 ml) &lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;label&gt; &lt;input class="RadioButton chosen" type="radio" value="160" name="variation[1]"/&gt; Lemon and Herbs (200 ml) &lt;/label&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>i want to highlight the one that is selected. </p> <p>i used this code:</p> <pre><code>$('input.RadioButton').click(function() { var chkbox = $(this); chkbox.is(':checked') ? chkbox.addClass('chosen') : $chkbox.removeClass('chosen'); </code></pre> <p>but if a person clicks one variation it works and applies the class, then if they click a second it applies the class to the second but doesnt remove the class from the first. how do i remove the class? thanks!</p>
javascript jquery
[3, 5]
4,114,997
4,114,998
Function to return only date
<p>I have made a function to convert a textbox value to date. I want to store the converted date in a datetime field in my business object with only date and not time like in format(yyyy-MM-dd)</p> <p>My function is returning date along with time</p> <pre><code>public static DateTime ExtractDate(string myDate) { DateTime result = DateTime.MinValue; if (myDate != null) { try { result=DateTime.Parse(myDate, new System.Globalization.CultureInfo("en-CA", true), System.Globalization.DateTimeStyles.AdjustToUniversal).ToString("yyyy-MM-dd"); } catch (Exception) { throw new ApplicationException("DateTime conversion error"); } } return (result.Date); } </code></pre>
c# asp.net
[0, 9]
5,707,250
5,707,251
replace a textnode that has non-textnode siblings
<p>For this HTML</p> <blockquote> <p>&lt;label id="nameWrapper"&gt;&lt;input type="checkbox" name="name" /&gt;guest&lt;/label&gt;</p> </blockquote> <p>What's the shortest javascript code to replace <code>guest</code> with other text? What I can think of is,</p> <pre><code>$('#nameWrapper').contents().filter(function() { return this.nodeType == 3; }).replaceWith('other text'); </code></pre>
javascript jquery
[3, 5]
199,957
199,958
Create JS array from input field values
<p>I have x number of input fields with class='agency_field'. How can I create a JS array that contain the values of all fields with this class?</p> <p>Using jQuery, this gives a syntax error:</p> <blockquote> <p>$(".agency_field").each(function(index) { agencies[] = $(this).val(); });</p> </blockquote>
javascript jquery
[3, 5]
4,984,633
4,984,634
Correctly way to find some variable with 2 case
<p>I want to find some variable from 2 different element patterns.</p> <pre><code>var something = $('.class').attr('data-something'); if(typeof something === 'undefined') { var something = $('.class').attr('data-another'); } if(typeof something != 'undefined') { // do action... console.log(something); } </code></pre> <p>I just want to get some data from attr <code>data-someting="mydata"</code></p> <p>And if <code>data-someting="mydata"</code> not found so find a data form <code>data-another</code></p> <p>Then do action....</p> <p>Im doing right ? or another correctly way to do better ?</p> <p>Whats about <code>Try Catch</code> ?</p>
javascript jquery
[3, 5]
227,527
227,528
Any online tools for converting jQuery into good old fashion Javascript online?
<p>I'm fiddling around with various video resizing methods similar to Zurbs <a href="http://www.zurb.com/word/responsive-video" rel="nofollow">flex video</a> and found the easiest option, for me, on css-tricks site <a href="http://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php" rel="nofollow">here</a>, code is as follows (in jQuery):</p> <pre><code> var $allVideos = $("iframe[src^='http://player.vimeo.com'], iframe[src^='http://www.youtube.com']"), $fluidEl = $(".content"); $allVideos.each(function() { $(this).data('aspectRatio', this.height / this.width) .removeAttr('height').removeAttr('width'); }); $(window).resize(function() { var newWidth = $fluidEl.width(); $allVideos.each(function() { var $el = $(this); $el.width(newWidth).height(newWidth * $el.data('aspectRatio')); }); }).resize(); </code></pre> <p>jQuery API's are great an all, but, there is no other jQuery being used in this particular instance, so I find it hard to justify loading an entire jQuery library over a few lines of code... Are there any tools online for converting jQuery to 'old school' js? As I've ran into this issue on more than one occasion, I'm just starting to dig into learning Javascript as it seems to be require more as a prerequisite these days. So even a few reference sites that kinda dip into the subject would be a huge help.</p>
javascript jquery
[3, 5]
2,580,963
2,580,964
What's The Error In this code
<p>this code works fine in php to generate the custom scripts generators</p> <pre><code> &lt;?php $arrs = array("script.js","ui.js","jform.js"); foreach ($arrs as $var) { ?&gt; &lt;script type="text/javascript" src="&lt;?php echo $var ?&gt;" &gt; &lt;/script&gt; &lt;?php } ?&gt; </code></pre> <p>this not compiling even whts the probem in my code the aspx but its not working</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;% IList&lt;string&gt; list; list = new List&lt;string&gt;(); foreach (string lst in list) { %&gt; &lt;script type="text/javascript" src="&lt;% lst %&gt;" /&gt; &lt;% } %&gt; </code></pre>
c# asp.net
[0, 9]
3,976,668
3,976,669
How to find source of submit using javascript
<p>Please help me to solve this problem: I have a form in which i have written onSubmit calling a javascript function. please tell me in that javascript function how can i check that who was the event generater ( i mean on which button click this even raised).. Note: onsubmit function call is in form tag.. i am using javascript and asp.net My code is like this:</p> <pre><code> &lt;form id="form1" runat="server" onsubmit="return CheckForm()"&gt; &lt;script type="text/javascript" language="javascript"&gt; function CheckForm() { some code here } &lt;/script&gt; </code></pre> <p>i dont want to change any functionality.. i have got a dropdownlist which is causing postback.. i want that when this dropdownlist raise post back either i should know that its raised by dropdownlist or that function should not be called by dropdownlist's postback</p>
asp.net javascript
[9, 3]
2,966,658
2,966,659
Convert List to Structure Using Javascript or JQuery
<p>I've apologize if this is a trivial task, and I've also been googling and searching high and low for some solution I can get my head around but so far no dice. So anyways....</p> <p>I have this:</p> <pre><code>var myList = "key1,value1,key2,value2" </code></pre> <p>And I want to populate a struct with this string so I can reference it like this:</p> <pre><code>alert(myList.key1) // displays value1 </code></pre> <p>Thoughts? There's probably some way to do this with JQuery's <code>.each()</code> perhaps? I'm seriously lost either way! Maybe just because it's really late and I've been stumbling through familiarizing myself with JS and JQuery again after a long hiatus. Any help is appreciated!</p>
javascript jquery
[3, 5]
1,937,200
1,937,201
How to capitalize only the first letter of a string, while lowercasing the rest?
<p>My string is:</p> <blockquote> <p>1 STATE OF GOA THROUGH CHIEF</p> </blockquote> <p>I want the output to be like</p> <blockquote> <p>1 State of goa through chief</p> </blockquote> <p>How can I keep the first letter capital and convert other to small? I had used <code>.ToLower()</code>, but it converts all the letters to small.</p>
c# asp.net
[0, 9]
2,766,984
2,766,985
How do I out put the JSON format for other website?
<p>How do I out put the JSON format for other website? I wrote the code below. I've tried to retrieve the information from the JSON server but it didn't return anything back.</p> <p>JSON SERVER</p> <pre><code>&lt;%@ Page Language="C#" %&gt; &lt;%@ Import Namespace="System" %&gt; &lt;script runat="server"&gt; protected void Page_Load(object sender, EventArgs e) { //Response.ContentType = "application/json; charset=utf-8"; Response.ContentType = "application/x-javascript; charset=utf-8"; Response.AddHeader("Cache-Control", "no-cache"); //Response.Expires = 0; // Response.AddHeader("content-disposition", "attachment;filename=" + Guid.NewGuid().ToString("N") + ".js"); } &lt;/script&gt; ({ 'color': 'blue', 'animal': { 'dog': 'friendly' } }) </code></pre> <p><strong>calling JSON SERVER</strong></p> <pre><code> var testurl_a = "http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?" var testurl_b = "http://www.xxxxxx.com/myaccount/jsonserver.aspx?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?" $.getJSON(testurl_b, function (data) { alert("JSON Data from testurl_b"); //IS NOT WORKING }); $.getJSON(testurl_a,function (data) { alert("JSON Data from testurl_a Result---&gt;&gt;&gt;"+ data.title); //IS WORKING }); </code></pre>
c# jquery
[0, 5]
5,011,486
5,011,487
Jquery position method
<p>As per Jquery API documentation:</p> <p><strong>.position()Returns:</strong> <em>Object</em></p> <p><strong>Description:</strong> <em>Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.</em></p> <p>This method does not accept any arguments.Reference <a href="http://api.jquery.com/position/" rel="nofollow">here</a></p> <p>But somewhere i found using this:</p> <pre><code>$("#position1").position({ my: "center", at: "center", of: "#targetElement" }); </code></pre> <p>An object has been passed to position method .Isn't this against API documentation?It seems that the properties passed to an object above has some special meaning.What are those properties stating .What they do?I m a complete beginner to jquery.So may be i m wrong .</p>
javascript jquery
[3, 5]
5,990,276
5,990,277
Opening a window in aspx using javascript
<p>I am using the below code to open a new window while the function return the success message. At the same time i want to close the self window. Now am getting the error:</p> <blockquote> <p>newwindow is not defined</p> </blockquote> <pre><code> var value = getQueryStrings(); var cust_id = value["cust_id"]; try { PageMethods.add_plan_items(unescape(items), cust_id, device, OnGetMessageSuccess, OnGetMessageFailure); } catch (ex) { alert(ex); } function OnGetMessageSuccess(result, userContext, methodName) { try { var ret_array = result.toString().split(':'); if (ret_array[0] == "Success Alert ") { var left = (screen.width / 2) - 1015 / 2; var top = (screen.height / 2) - 550 / 2; self.close(); //Close the opened window //Enter here and self window is closed var newwindow = window.open('test.aspx?id=Y&amp;cust_id=' + cust_id, 'Add Items', 'height=550,width=1000,toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + ''); if (window.focus) { newwindow.focus() } return false; } else { self.close(); //Close the opened window alert('Error Alert : Error for adding plans in your specified device. Please try again later!'); } } catch (ex) { alert(ex); } } function OnGetMessageFailure(error, userContext, methodName) { alert(error.get_message()); } </code></pre>
javascript asp.net
[3, 9]
3,886,585
3,886,586
How to trigger a class-targeted method AFTER the class has been added to an element?
<p>In the below markup, the <code>#enable</code> button will add a class to the <code>#show</code> div. This class has a method attached to it that fades in/out the <code>#hidden</code> span.</p> <p>However, even though the class is added to the <code>#show</code> div, the method attached to the class isn't triggered.</p> <p><strong>HTML</strong></p> <pre><code>&lt;input type='button' id='enable' value='Enable' /&gt; &lt;div id='show'&gt; Testing.. &lt;span id='hidden'&gt;Testing, 1, 2, 3.&lt;/span&gt; &lt;/div&gt;​ </code></pre> <p><strong>JS</strong></p> <pre><code>$(function() { // Adds .testing class after the button is clicked. however.. $('#enable').click(function() { $('#show').addClass('testing') }); // It will not trigger after .testing class has been added to DIV? $('.testing').hover(function() { $('#hidden').fadeIn(); }, function() { $('#hidden').fadeOut(); }); });​ </code></pre> <p>Fiddle to work with: <a href="http://jsfiddle.net/jS3nM/" rel="nofollow">http://jsfiddle.net/jS3nM/</a></p> <p>It seems I am missing something conceptually. What is the correct way to handle this?</p>
javascript jquery
[3, 5]
1,882,964
1,882,965
show only Error message of asp validators by javascript
<p>i trying to pop up only error message's for validation's control not text. The code which i tried is showing null for error message's. </p> <pre><code>function fnOnUpdateValidators() { for (var i = 0; i &lt; Page_Validators.length; i++) { var val = Page_Validators[i]; var ctrl = document.getElementById(val.controltovalidate); if (ctrl != null &amp;&amp; ctrl.style != null) { if (!val.isvalid) { ctrl.style.background = '#FFD6AD'; var errMsg = document.getElementById(val.id).getAttribute('ErrorMessage'); alert(errMsg); } else ctrl.style.backgroundColor = ''; } } } </code></pre>
javascript asp.net
[3, 9]
2,006,662
2,006,663
Passing Vars from Jquery to PHP
<p>I was attempting to pass a variable from Jquery to PHP and then I am using that variable on my webpage. My jquery script is not failing as my alerts all come up, but I seem to have a problem grabbing the variable with my php page as I am getting an "Undefined index name on line 6 error" which is were I using my $_POST call. The Echo test is also working so the php is not hanging up completely. Here is the code, and thank you for any advice:</p> <p>edit: Looking in dev view I did notice that the variable is getting passed from the jquery to the php page, I am also testing this on a MAMP environment not sure if this makes a difference.</p> <pre><code>&lt;?php $SiteName = $_POST['name']; $_SESSION['selectedSite'] = $SiteName; echo $_SESSION['selectedSite']; print_r($_POST); ?&gt; </code></pre> <p>And the Jquery</p> <pre><code>$(document).ready(function(){ $('.siteButton').click(function(event) { var siteName = event.target.id; alert(siteName); $.ajax({ type: "post", url: "includes/functions.php", data: {'name':siteName}, success: function(){ alert("success WOOT"); } }) }); }); </code></pre>
php jquery
[2, 5]
2,422,060
2,422,061
Is there a way i can disable the information bar for ActiveX controls using JavaScript or XHTML?
<p>I save this file as test.html and when I opened this file in IE, I am getting Information Bar for ActiveX Controls, Is there any way we can disable this thing using javascript code or jQuery code?</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;h1&gt;My First Web Page&lt;/h1&gt; &lt;script type="text/javascript"&gt; if(navigator.appName == "Microsoft Internet Explorer") { window.location = "http://www.google.com/" } else { window.location = "http://www.yahoo.com/" } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And I just wanted to make sure, as I am running locally on my box so that is the reason it is showing ActiveX control Information bar? And Once I upload this file to a remote server and access it from there then this active x bar will not appear?? But is there any way programmatically to disable this information bar? Any suggestions will be appreciated.</p>
javascript jquery
[3, 5]
160,556
160,557
Submit JQuery array alongside PHP form data to PHP script
<p>I'm dabbling in JQuery, and have run up against an issue I'm not quite able yet to figure out. Here is the context:</p> <p>I have a HTML form, utilising MySQL &amp; PHP, used to edit a CMS post. This post would have a list of attachments (eg. images for a gallery, or downloadable files). Using JQuery, the user can click on these list item elements and edit the details of each attachment in a revealed div (eg. delete image, add capton, etc).</p> <p>Currently when the user opts to delete an attachment, I simply fade its opacity and provide a new option to the user to 'undo' the delete. Upon submission of the complete parent form (the CMS post), I want to gather all the attachments still marked for deletion, and submit their GUID's to the PHP script that is doing all the rest of the post updating for me.</p> <p>Option A:</p> <p><em>Is it possible to submit a JQuery array to a PHP script alongside the data being sent naturally to the action script by the form inputs?</em></p> <p>Option B:</p> <p><em>Is it possible to fill / empty a (hidden) form input array dynamically with JQuery, which could then be submitted naturally to the action script with everything else?</em></p> <p>I am currently at the stage where I am filling a Javascript array with the necessary GUIDs, but now don't know what to do with it.</p> <pre><code>//populate deleted attachments array $(document).ready(function() { $('#post-editor').submit(function() { var arrDeleted = []; $('.deleted-att').each(function(){ arrDeleted.push({guid: $(this).attr("data-guid")}); }); //do something with array }); }); </code></pre>
php jquery
[2, 5]
913,686
913,687
$("#form").attr("method", "post") is In java Script ASP.NET
<p>I have a Grid view where I have a hyper link button which displays ID, by clicking on it I make a Ajax call to the server and get the specific URL to navigate against of the ID. After the Ajax call complete I call the following Codes to open the respective page in New Tab/Window.</p> <pre><code>function RedirectPageUrl(rqstID) { $("#formMain").attr("action", rqstID); $("#formMain").attr("method", "post"); $("#formMain").attr('target', '_blank'); $("#formMain").submit(); return false; } </code></pre> <p>Here my problem is after clicking on the First hyperlink button things are working perfectly but then onwards whenever I click on any control (say Button)the previous opened form opens up. How to get rid of it any idea??</p>
javascript jquery asp.net
[3, 5, 9]
5,680,198
5,680,199
setInterval started with a button or started alone
<p>How can i active/fire/trigger the setInterval with a button? and if the button is not clicked how to make it auto fire on 3 second, but if i click on the button it fire it on 0.1 second and restart evrything. please help me out guys</p> <pre><code>$('button').click(function(){ setInterval(function(){ updateStats("updateStats"); }, 100); }); else setInterval(function(){ updateStats("updateStats"); }, 3000); </code></pre> <p><em>Edit</em></p> <p>Only everytime the button is clicked 100ms, if not clicked then it most do it auto on 3000ms, unless you click it ofc</p> <p>Part :</p> <pre><code>function updateStats(stat) { var stat = ["GAME","USERS"]; var url = "NET.php"; $.each(stat, function(i, key){ $.post(url, {stats: key}, function(data) { // stats to stat $("#" + key).html(data); $('.s').emoticonize({ //delay: 800, //animate: false }); }); }); } </code></pre>
javascript jquery
[3, 5]
868,810
868,811
Parse variables from querystring in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values">How can I get query string values?</a> </p> </blockquote> <p>I have the following querystring:</p> <pre><code>"active_tab=delivered&amp;active_tab=all&amp;active_tab=delivered&amp;active_tab=outstanding &amp;active_tab=delivered&amp;active_tab=outstanding&amp;active_tab=all&amp;active_tab=delivered&amp;active_tab=outstanding&amp;title_filter=conformance&amp;title_filter=delivering&amp;title_filter=packaging &amp;title_filter=delivering&amp;title_filter=all&amp;title_filter=delivering&amp;title_filter=all&amp;title_filter=packaging&amp;title_filter=conformance&amp;title_filter=packaging &amp;title_filter=delivering&amp;title_filter=packaging&amp;title_filter=ordered" </code></pre> <p>How would I parse the final <code>title_filter</code> ("ordered") and <code>active_tab</code> ("delivered") from the above querystring? Also, if that querystring variable doesn't exist, have it = <code>""</code></p>
javascript jquery
[3, 5]
1,284,577
1,284,578
How to access a server side variable in the databound event of the formview
<pre><code> protected void dvUserMaster_DataBound(object sender,EventArgs e) { string CustCreatedBy = DataBinder.Eval(e.ToString(),"strcustomer_name").ToString(); string EmpCreatedBy = DataBinder.Eval(e.ToString(), "stremployee_name").ToString();} </code></pre> <p>strcustomer_name is the string which i want to evaluated to certain condition. How to access the value of the string from the cs file at the databound event of the formview</p> <p>Thanks,</p>
c# asp.net
[0, 9]
2,283,603
2,283,604
Shadow builder in android
<p>I am working on a dragdrop game, but I have small problem, that when I click in a view the shadow builder appears first at the right-top-corner and then it moves with the touch place.</p> <p>Also the shadow builder is smaller than the initial view. How can I make it as the initial view?</p> <pre><code>private final class MyTouchListener implements OnTouchListener { public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { ClipData data = ClipData.newPlainText("", ""); DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view); view.startDrag(data, shadowBuilder, view, 0); view.setVisibility(View.INVISIBLE); return true; } else { return false; } } } </code></pre>
java android
[1, 4]
4,247,234
4,247,235
Confirmation box javascript
<p>Problem:</p> <p>I have a confirmation box which pops up whenever I click on the save button. It saves the data fine when I click on OK. But when I click on cancel it does not cancel changes. It saves them instead. Could you please help me solve this issue:</p> <p>Here is the JavaScript for it:</p> <pre><code>/ &lt;asp:Button ID="view_btn_save" Text="Save" ValidationGroup="view" OnClick="view_btn_save_click" OnClientClick="Validate_view()" runat="server" /&gt; &lt;/td&gt; &lt;script type="text/javascript"&gt; function Validate_view() { var value = document.getElementById('&lt;%=view_txt_name.ClientID%&gt;').value; var value2 = document.getElementById('&lt;%=view_txt_title.ClientID%&gt;').value; var value3 = document.getElementById('&lt;%=view_txt_description.ClientID%&gt;').value; var value4 = document.getElementById('&lt;%=view_txt_pixelwidth.ClientID%&gt;').value; var value5 = document.getElementById('&lt;%=view_txt_pixelheight.ClientID%&gt;').value; if (value == '' || value2 == '' || value3 == '' || value4 == '' || value5 == '') { return alert('Please enter the missing fields'); } else { return confirm('Confirm changes?'); } } </code></pre>
c# javascript asp.net
[0, 3, 9]
5,649,168
5,649,169
jQuery hidden value not being sent
<p>Is there a certain or special of dealing with hidden fields in jQuery? I am using a hidden input field and am not receiving a value. Obviously, my code is incorrect and would be grateful if someone could show me the error. many thanks</p> <pre><code>&lt;input id="customer" name="customer" type="hidden" value="&lt;?php echo $_SESSION['kt_idcode_usr']; ?&gt;" /&gt; $('#submit').click(function () { var name = $('.uname').val(); var customer = $('.customer').val(); var department = $('#department').val(); var email = $('.email').val(); var position = $('.position').val(); var feedback = $('.feedbacknew').val(); var data = 'uname=' + name + '&amp;customer=' + customer + '&amp;department=' + department + '&amp;email=' + email + '&amp;position=' + position + '&amp;feedbacknew=' + feedback; $.ajax({ type: "POST", url: "feedback.php", data: data, success: function (data) { $("#feedback").get(0).reset(); $('#message').html(data); //$("#form").dialog('close'); $("#flex1").flexReload(); } }); return false; }); </code></pre>
javascript jquery
[3, 5]
2,985,002
2,985,003
Problem With Custom Control on Page Using a MasterPage
<p>I have a content page which has a related master page. I register a prefix &lt;%@ TagPrefix ..... and can load other custom controls at that namespace. However, one particualar control at the same namespace, when added to the aspx page, breaks it. The control in question inherits from asp:Panel, has a parameterless constructor, defines a few public accessors, and creates some standard child controls, and nothing much else.</p> <p>Are there some fundamental restrictions to creating custom asp controls that I am breaking unknowingly?</p>
c# asp.net
[0, 9]
1,868,962
1,868,963
Elegant way to combine ASP.NET validation with JQuery
<p>How can I best combine JQuery with ASP.NET client side validation model?</p> <p>I've generally avoided implementing ASP.NET validation model because it always seems overkill for what I was doing. For the site I'm working on now I'm just collecting non critical user data and only need somewhat basic validation. I dont want messages appearing in the DOM or anything like that. I've always found it hard to get that to look right anyway.</p> <p>But I need now to implement something a little more elegant. What I want to take advantage of in JQuery is clever search expressions like 'tell me if at least one of these checkboxes is checked'. I'm new to JQuery, but I think this is about 1 line of JQuery and a lot more complicated in the traditional ASP.NET model.</p> <p>So I want to take full advantage of JQuery's abilities but not completely undemine ASP.NET's validation model.</p> <p>My best approach so far is this (which pretty much goes behind the back of ASP.NET):</p> <pre><code>$('#&lt;%=btnJoinMailingList.ClientID %&gt;').bind('click', function(event) { if (...) { alert("You must enter a name"); return false; } return true; }); </code></pre> <p>What's a better approach here? Are there any recommended plugins for JQuery ?</p> <p>PS. I don't want to use MVC model. I'm trying to create a very 'RAD' site and dont have time to delve into that fun new stuff yet.</p>
asp.net jquery
[9, 5]
5,134,037
5,134,038
Android ignores javascript prompt
<p>I'm simply asking the user to answer two questions. On most browsers the answers are displayed in the test1 and test2 divs respectively. Except on the native browser of Android v2.3.4 (HTC Sensation) where test2 remains 'unknown'. Any help much appreciated.</p> <pre><code>&lt;html&gt; &lt;head &gt; &lt;script src="../scripts/jquery-1.6.2.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function testInput() { var tmpVal1 = prompt("Driver name", ""); $("#test1").text(tmpVal1); var tmpVal2 = prompt("Inspector name", ""); $("#test2").text(tmpVal2); } $(document).ready(function () { $("#test1").text("Unknown"); $("#test2").text("Unknown"); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="test1"&gt;&lt;/div&gt; &lt;div id="test2"&gt;&lt;/div&gt; &lt;button onclick="testInput()" &gt;set names&lt;/button&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript android
[3, 4]
2,758,651
2,758,652
To read an image from Android Emulator
<p>This is my code to convert image file into byte array.</p> <pre><code> public String GetQRCode() throws FileNotFoundException, IOException { /* * In this function the first part shows how to convert an image file to * byte array. The second part of the code shows how to change byte array * back to a image. */ AssetManager mgr = mAppView.getContext().getAssets(); InputStream in = mgr.open("www/Siemens_QR.jpg"); InputStreamReader isr = new InputStreamReader(in); char[] buf = new char[20]; isr.read(buf, 0, 20); isr.close(); // byte[] bytes = bos.toByteArray(); String abc = buf.toString(); return abc; } </code></pre> <p>Here I am converting an image file into byte array. I am able to do this. But when try to read this image file using the path ("sdcard/Download/Siemens_QR.jpg") stored in emulator then I am getting VM aborting error. Please suggest me the correct path to read the image file stored in the emulator. </p>
java android
[1, 4]
2,401,296
2,401,297
uploading app problem in developers site
<p>hi i have posted one of my app in market.android.com when i am trying to post second app it shows "You have another application on Market with the same package name. Go to that other application, and click upgrade" I dont want to upgrade it but i want my second app to be posted. When i tried to change the package name it showed lots of errors, so i decided to create the app once again in a new package and project name, it seems to be a very lengthy process.... pls help me to solve the issue bcoz i have created all my app in same package name unknowingly....... </p>
java android
[1, 4]
3,908,640
3,908,641
How do I use Android's Handler.PostDelayed to make an event happen at a specified time?
<p>I want to have my application execute code at a point in the future.</p> <p>I want to do:</p> <pre><code> Date now = new Date(); for (Date beep : scheduledBeeps) { if (beep.after(now)) { Logger.i("adding beep"); m_beepTimer.postAtTime(beepNow, beep.getTime()); } } </code></pre> <p>In the log I can see 4 beeps added, however they never fire. I'm assuming it has something to do with <a href="http://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis%28%29" rel="nofollow">uptimeMillis</a>, but I'm not sure what to do.</p>
java android
[1, 4]
3,973,632
3,973,633
jQuery function when one list item has the active class, I want all other list items to automatically not have the active class ?
<p>My webpage is at <a href="http://www.sarahjanetrading.com/js/status" rel="nofollow">http://www.sarahjanetrading.com/js/status</a></p> <p>All the HTML, CSS and jQuery code + images are available there for anyone to access.</p> <p>My issue is that currently the jQuery code I have only makes the active states toggle in the list items. What I want is that one list item becomes active(active class) when clicked, all others must have the active class removed.</p> <p>Thanks</p>
javascript jquery
[3, 5]
861,629
861,630
Fire event at a certain time of the day
<p>Is it possible with javascript (jQuery solutions are fine too) to fire an event/call a function at certain times of the day e.g.</p> <p>call myFunctionA at 10:00</p> <p>call myFunctionB at 14:00 etc..</p> <p>Thanks</p> <p>Mark</p>
javascript jquery
[3, 5]
4,624,600
4,624,601
Mouse Click curser effect throughout site
<p>I think it would be cool to set a custom cursor click effect with jQuery. Something similar to Android Incredible 2 browser where it highlights click-able items in green when selected. Except mine would be the cursor with a box around it something like 1px width, very subtle, and it would kind of float/toggle until you point over a clickable item - and then it would kind of 'lock' in. </p> <p>I've found something like this that was done that fired a bunch of squares on clicks, but I can't relocate where I found it - and it was a huge amount of JavaScript, is this possible with jQuery - and would this be a bad idea for the users experience?</p>
javascript jquery
[3, 5]
4,108,224
4,108,225
A field initializer cannot reference the nonstatic field, method, or property
<p>Using C# and asp.net I receive the error below. I'm note sure what could be the problem. Could you point me out in the right direction? Thansk</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace MySite { public class Reminders { public Dictionary&lt;TimeSpan, string&gt; TimeSpanText { get; set; } // We are setting the default values using the Costructor public Reminders() { TimeSpanText.Add(TimeSpan.Zero, "None"); TimeSpanText.Add(new TimeSpan(0, 0, 5, 0), "5 minutes before"); TimeSpanText.Add(new TimeSpan(0, 0, 15, 0), "15 minutes before"); TimeSpanText.Add(new TimeSpan(0, 0, 30, 0), "30 minutes before"); TimeSpanText.Add(new TimeSpan(0, 1, 0, 0), "1 hour before"); TimeSpanText.Add(new TimeSpan(0, 2, 0, 0), "2 hours before"); TimeSpanText.Add(new TimeSpan(1, 0, 0, 0), "1 day before"); TimeSpanText.Add(new TimeSpan(2, 0, 0, 0), "2 day before"); } } } </code></pre> <p>Using the class</p> <pre><code>private Reminders reminder = new Reminders(); private dynamic defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)]; </code></pre> <p>Error</p> <pre><code>A field initializer cannot reference the nonstatic field, method, or property </code></pre>
c# asp.net
[0, 9]
4,514,535
4,514,536
Best approach for learning Java after C++?
<p>I've been using C++ for about 6 or 7 years now, and I consider myself fluent in it. I've never bothered with Java until now, but I find myself out of the job (company went under) and I need to expand my skill set. Someone recommended Java, so I am wondering if there is any advice for where somebody like me might start. I am also interested to know what the key aspects of Java are that are most likely to come up in an interview.</p>
java c++
[1, 6]
2,792,326
2,792,327
Any shorter way to add attributes to specified elements using jQuery?
<p>Assuming I have a wide table with many columns, and I want to add <code>colspan=2</code> to:</p> <p><strike><code>td#2, td#10, td#15</code></strike></p> <p><code>td#3, td#11, td#16</code></p> <p>Do I have to do it specifically: </p> <pre><code>$("table td").eq(2).attr('colspan','2') $("table td").eq(10).attr('colspan','2') $("table td").eq(15).attr('colspan','2') </code></pre> <p>Or should I use <code>filter()</code>?</p> <p>Is there any shorter way?</p>
javascript jquery
[3, 5]
1,582,020
1,582,021
Eval() in ASP. How to pass values on redirect throught session
<p>I have this image button inside a grid view which redirects the groupname to the send message.aspx. </p> <pre><code> &lt;asp:ImageButton ID="img_Send" ImageUrl="Styles/Images/Message.jpg" Enabled="True" Width="" runat="server" PostBackUrl='&lt;%# Eval("GroupName", "SendMessage.aspx?GroupName={0}") %&gt;'&gt;&lt;/asp:ImageButton&gt; </code></pre> <p><a href="http://localhost:48996/SurelyK/SendMessage.aspx?GroupName=Jobs" rel="nofollow">http://localhost:48996/SurelyK/SendMessage.aspx?GroupName=Jobs</a> this is the url</p> <p>Is it possible to store the value in a session in the client side so that i can use it in server side coding.</p> <p>i dont want to pass the value in the URL. How can i do it without passing it in URL. </p> <p>2nd q: I am also doing the same in user page where I pass the user id. </p> <p><a href="http://localhost:48996/SurelyK/SendMessage.aspx?UserID=3" rel="nofollow">http://localhost:48996/SurelyK/SendMessage.aspx?UserID=3</a></p> <p>In my sendmessage server side code i have to save the message in the message table and then save the username and the message id in usermessage table. </p> <p>the code for inserting in userdetails usermessage table and code for inserting groupdetails in grouptable is different. I have to do both in send button click. How to check which page redirected to send message page, is it group or user page..</p>
c# javascript asp.net
[0, 3, 9]
5,675,213
5,675,214
is it possible to make duble include in javascript and php?
<p>I am using the following code to check if the user liked my facebook page or not ?</p> <pre><code> &lt;style&gt;xxxxxxxxxxxxxxxxx&lt;/style&gt; &lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt;&lt;script&gt;google.load("jquery", "1");&lt;/script&gt; &lt;script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; Username="gagsallday", Title="Join Our Facebook!", Skin="01", Time="30", Wait="0", Lang="en" &lt;/script&gt; &lt;script type="text/javascript" src="likeboxfbfanpro.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt;$(document).ready(function(){$().popupbox({ closeable: false });});&lt;/script&gt; &lt;? echo'&lt;Center&gt;&lt;Font Face="Tahoma"&gt;&lt;Font size="10"&gt;Your Content Here!'; </code></pre> <p>the last piece of code is where I should have my page contents on which is this one :</p> <pre><code> &lt;? echo'&lt;Center&gt;&lt;Font Face="Tahoma"&gt;&lt;Font size="10"&gt;Your Content Here!'; </code></pre> <p>my question is how can add this code to my page ? just like this ? it did not work because I can not include a file whiat already has include function inside it ? what I want is something like this, but how can I do it ?</p> <pre><code>&lt;?php include('the-ablve-code-goes-here.php');?&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; stuff goes here... &lt;/body&gt; &lt;/html&gt; </code></pre>
php javascript
[2, 3]
4,645,588
4,645,589
IE8 window.opener problems
<p>Having problems with IE8...</p> <p>I have a button that onclick fires the <code>showImageBrowser()</code> function.</p> <pre><code>function showImageBrowser(params) { var open = window.open('http://localhost/admin/browse?'+params,'newwin','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=950,height=500'); if (!open) { alert('Could not open the image browser, please disable your popup blocker.'); } } </code></pre> <p>Now in the image browser when you click on an image it calls this function:</p> <pre><code>function selectFile(url, el) { window.opener.replaceImage('Test_Image', url); window.close(); } </code></pre> <p>Which is calling the <code>replaceImage()</code> function in the parent window, as expeted.</p> <p>This is the code:</p> <pre><code>function replaceImage(el, url) { $('#'+el).html('&lt;a href="'+url+'" target="_blank" class="image"&gt;'+basename(url)+'&lt;/a&gt;'); $("input[name='"+el+"']").val(url); } </code></pre> <p>Now if you click on the original <code>showImageBrowser()</code> button for the second time, IE will bring up the window but this time it freezes for a few seconds and then you get the alert "Could not open the image browser, please disable your popup blocker."</p> <p>This works fine in Firefox (obviously) but not in IE. I haven't even tried it in IE7/6 because if it doesn't work in 8 then I know I'm going to have problems.</p> <p>Any advice?</p>
javascript jquery
[3, 5]
925,882
925,883
(jQuery) How do I find the first link which has a specific class?
<p>If I have a link <strong>somewhere</strong> (not predetermined) down the tree like this:</p> <pre><code>&lt;div id="foo"&gt; &lt;div&gt; &lt;div&gt; &lt;a href="asdf.com"&gt;link&lt;/a&gt; &lt;a href="#bar" class="specialLink"&gt;link&lt;/a&gt; &lt;a href="#bar2" class="specialLink"&gt;link&lt;/a&gt; &lt;a href="#bar3" class="specialLink"&gt;link&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>How would I go about selecting the first link with the class "specialLink" using .find()?</p> <p>My non working guess is:</p> <pre><code>$("#foo").find(".specialLink a:first") </code></pre>
javascript jquery
[3, 5]
5,868,703
5,868,704
Integrating audio player which support both mozilla and IE
<p>I want to integrate (php) a audio player which supports both mozilla and internet explorer, with a player image on the webpage that should contain all the functionalities forward, rewind, pause, volume...</p>
php javascript
[2, 3]
2,709,183
2,709,184
unable to remove the validation classes while clicking the cancel option in dialog box
<p>hello i'm using <a href="http://www.position-relative.net/creation/formValidator/demos/demoValidators.html" rel="nofollow">these validation</a> for my application. these works fine, when i'm using these in dialog box it works but after showing validations and pressing cancel the validations remains appear in the back-end page. Suggest some alternative like removeClass() on clicking the cancel option in my dialog box.</p>
javascript jquery
[3, 5]