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,592,097
4,592,098
How to pass arguments inside function?
<p>I started to learn Jquery and but I am having trouble understanding function parameters:( If you look my <b>first</b> code and run it: my script <b>WILL work</b> <i>(WITHOUT parameters)</i>. And if you look my <b>second</b> code <br/><i>(WITH parameters)</i> and run it: <b>second script</b> <i>WILL ALSO WORK!!</i><br/> <br/>My first question: Did I correctly <b>set</b> parameter in my <b>second script?</b><br/>Second question: How can I <b>check</b> is my parameter <b><i>set</i></b> or being <b><i>passed correctly</i></b> to my function? <br/>P.S. Sorry for being NOOB and <b>THANK YOU!!</b> </p> <pre><code> //First code (WITHOUT PARAMETERS!!!) $(document).ready(function () { var addclass = $('p:first'); function AddClass() { addclass.addClass('first'); if (addclass.is($('.first'))) { alert('here'); } else { alert('not here'); } } $('.button').click(function () { AddClass(addclass); }); }); //Second code (WITH PARAMETERS) $(document).ready(function () { var addclass = $('p:first'); function AddClass(addclass) { addclass.addClass('first'); if (addclass.is($('.first'))) { alert('here'); } else { alert('not here'); } } $('.button').click(function () { AddClass(addclass); }); }); </code></pre>
javascript jquery
[3, 5]
1,226,515
1,226,516
ASP.NET button and Jquery works together?
<p>I have an <code>ASP button</code>, when I click this button, first I want to run code behind progress such as data delete, update.. </p> <p>After this progress, I want to run<code>Jquery</code> function related this button.</p> <p>How can I do that?</p>
asp.net jquery
[9, 5]
1,840,015
1,840,016
How do I override a javascript function that is inside another file?
<p>I am having a problem with the asp:Menu control.<br> A menu control 2 levels deep does not play well with internet explorer on https.<br> I continually get an annoying popup.</p> <p>I think in order to fix this I need to override a function in an automatically included script file.</p> <p>change this</p> <pre><code>function PopOut_Show(panelId, hideScrollers, data) { ... childFrame.src = (data.iframeUrl ? data.iframeUrl : "about:blank"); ... } </code></pre> <p>to this</p> <pre><code>function PopOut_Show(panelId, hideScrollers, data) { ... if(data.iframeUrl) childFrame.src = data.iframeUrl; ... } </code></pre> <p>however I have no clue how I would hack apart the asp:menu control to fix microsoft's javascript in their control.</p> <p>Is there a way I can just override the function to what I need it to be?</p>
javascript asp.net
[3, 9]
2,380,064
2,380,065
Unexpected JS/jQuery Loop Behavior
<p>I have the following loop. The goal is to automatically show text boxes when a user chooses certain options in a dropdown list.</p> <p>For some reason, in the following code, the loop assigns the "sponsor" field to the associated array for "blurb". I cannot figure out why. How can I make this work?</p> <p>Thanks so much.</p> <pre><code>function add_fields_on_change () { var map = { "sponsor" : Array("New Sponsor", "new_sponsor"), "blurb" : Array("New Blurb Suggestion", "new_blurb") }; for (field in map) { alert($('.bound[name='+field+']').val()); //alerts as expected $('.bound[name='+field+']').change(function() { alert(map[field][0]); //alerts "New Blurb Suggestion" for both "sponsor" and "blurb" fields if ($(this).val() == map[field][0]) { $('.hidden[name='+map[field][1]+']').show(); } }); } } </code></pre>
javascript jquery
[3, 5]
5,530,215
5,530,216
not redirecting to handler page
<p>My java script which i had given in aspx page. the info should be redirect to handler page is not working..</p> <pre><code>&lt;script type="text/javascript"&gt; var Name; var Age; var Mobile; var Email; var Center; function getdata() { alert('Adding'); Name=document.getElementById("txtname").value; alert(Name); Age=document.getElementById("Txtage").value; alert(Age); Mobile=document.getElementById("Txtmobile").value; alert(Mobile); Email=document.getElementById("TxtEmail").value; alert(Email); Center=document.getElementById("Ddlcenter").value; alert(Center); sendinfo(); } </code></pre> <p>below query only not redirected to handler page </p> <pre><code>function sendinfo() { $(document).ready(function(sendinfo){ var url='Handler/Appoinment.ashx?Name='+Name+'&amp;Age='+Age+'&amp;Mobile='+Mobile+'&amp;Email='+Email+'&amp;Center='+Center+''; alert(url); $.getJSON(url,function(json) { $.each(json,function(i,weed) { }); }); </code></pre> <p>});</p>
javascript asp.net
[3, 9]
2,902,844
2,902,845
Variable cannot be resolved
<p>I am trying to create an item list, diffrent for each i and j variable. My code is:</p> <pre><code>if (i == 0) { if (j == 0) { final CharSequence[] items = {"4:45", "5:00"} } else if (j == 1) { final CharSequence[] items = {"4:43", "4:58"} } else if (j == 2) { final CharSequence[] items = {"4:41", "4:56"} } else { final CharSequence[] items = {"4:38", "4:53"} } </code></pre> <p>...</p> <pre><code>new AlertDialog.Builder(this) .setTitle("Hours") .setItems(items, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialoginterface, int i) { // getStation(i); } }) .show(); } </code></pre> <p>I get an error in the line <code>.setItems(items,</code>:</p> <pre><code>items cannot be resolved </code></pre> <p>I think that the compiler thinks that the <code>CharSequence[] items</code> may not be initialised or something... How can I make this programme run?</p>
java android
[1, 4]
1,454,303
1,454,304
Decoding a file resource for scanning in Android
<p>I'm new to Stack Overflow, but I have a question about writing some Java code for an Android program.</p> <p>I'm building a game for the Android phone, and when we are building levels we are aiming to scan them from text files that are stored in the res/raw for our project. My problem is that I can't figure out how to decode the resource in such a way that it can be interpreted by the Scanner. Right now my line of code just looks like:</p> <pre><code>Scanner input = new Scanner(new File((R.raw.level1)); </code></pre> <p>This is pretty much just a reinterpretation of the equivalent Java code, which would take a string with the level name. I'm guessing that I'm supposed to be using something like decodeResource for BitmapFactory, but I'm not sure where to look! Perhaps I shouldn't be approaching it as a File at all?</p> <p>Thank you in advance for your help!</p>
java android
[1, 4]
5,816,733
5,816,734
Javascript: Acceptable way to referencing `this` from given two snippets
<pre><code>var me = null; var testFn = (function() { me = this; return { me1: me, fn1 : function() { me = this; return { me2 : me, fn2 : function() { me = this; return { me3: me } } } } } })(); </code></pre> <p><strong>OR:</strong></p> <pre><code>var testFn = (function() { var me = this; return { me1: me, fn1 : function() { var me = this; return { me2 : me, fn2 : function() { var me = this; return { me3: me } } } } } })(); </code></pre> <p>Between two segments given above, which one is best way to referencing <code>this</code>. Is there any other way best, please suggest.</p> <p>Thanks.....</p>
javascript jquery
[3, 5]
2,100,786
2,100,787
How to convert this string to some array?
<p>I am using one 3rd party plugin which uses stringify and gives me something like:</p> <pre><code>["ProjectB","ProjectA","Paris"] </code></pre> <p>It was an array but it used stringify and serialized into this format.How do I get back my array from this? Now I could very well use split and then remove 1st and last character from every string and get it but I don't want to do that manually. Is that any built in utility that can do that for me?</p>
javascript jquery
[3, 5]
1,357,491
1,357,492
jQuery.extend default action with only one input
<p>Given:</p> <pre><code>jQuery.extend({ fooBar: function(){ return 'baz'; } }); </code></pre> <p>does it modify the base jQuery object? so afterwards you can call <code>jQuery.fooBar(); // 'baz'</code></p> <p>There's nothing in the documentation, but that's what the source does as far as I can tell.</p>
javascript jquery
[3, 5]
5,870,124
5,870,125
How to change the data in ALL the textfields in a page to uppercase on click of a button
<p>I have a page with some 13 textfields. I want to change the case of data in all the textfields to uppercase on click of a button. I can either user Jquery/javascript. I definitely don't want to use CSS-Text-transform property since it does not convert the case actually but just virtually.</p> <p>Any suggestions as of how can I achieve this task using a single function ?</p> <p>Thanks, Yeshwanth</p>
javascript jquery
[3, 5]
1,254,779
1,254,780
Microsoft JScript runtime error: ASPx is undefined
<p>I'm getting this error all over the place in my web application and trying to figure out why. </p> <p>The error is always for some control, ASPxClientTextBox for example. So far the only thing I've found as a potential fix is to check the httphandlers section of the .net web.config (the one in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config) and make sure an entry for "WebResource.axd" exists, which it does.</p> <p>Any idea's what's going on or where I should look?</p>
javascript asp.net
[3, 9]
4,660,927
4,660,928
error in path using JUST BOIL ME plug in for TINYMCE -- php
<p>Hope you can help me solve my issue. I am using <strong>JUSTBOILME</strong> as an image uploader for <strong>TINYMCE</strong> text editor. I am incorporating it to PHP. My question is I am having an error when i am trying to upload an image to the text editor of tinymce using the just boil me plug in. I am having the error... "<strong>The upload path does not appear to be valid</strong>." I have set the is_allowed to true. I am using LOCALHOST. Are there any issues on using localhost for this? Thanking you in advanced..</p>
php jquery
[2, 5]
3,386,446
3,386,447
how to skip table using HtmlAgilityPack
<p>i wrote an app that take values from a table and manipulat them, my problem is that there is 2 tables before the table i want(without id,class) . i want to skip them and go to the third table . my code: </p> <pre><code> HtmlNodeCollection tables = doc.DocumentNode.SelectNodes("//table"); HtmlNodeCollection rows = tables[2].SelectNodes(".//tr"); foreach (HtmlNode item in rows) { /// my code// } </code></pre> <p>i thought the code: table[2] means go to the third table but infact it mean take 3 tables, is there a way to define spacific table or from to tables? (without id or class name in the table)</p>
c# asp.net
[0, 9]
662,819
662,820
How to determine given file is a class file?
<p>I need to determine that whether a given file is a class file or not. Suppose I change the extension to .exe/.xml or some other, I need to determine whether that given file, if a class file will be parsed differently and if it would be some other, it'll be parsed in that manner.</p> <p>How can I read the class file format?</p>
c# java
[0, 1]
215,233
215,234
Adapting Library for Android
<p>The library given consists of several parts:</p> <ul> <li>a network module</li> <li>a storage module</li> <li>a 'controller' module</li> </ul> <p>They all rely on the former module (storage relies on network, controller relies on storage). Most of the functionality is exposed in controller module.</p> <p>My first plan was to wrap the whole library in a Service that serves as a Adapter for the Android world. But I found out that Services do not have a way to get a result back. So there is no (reasonable) way to call some of the 'getStuff'-Methods in the Controller Module.</p> <p>What is the 'Android Way' of doing this?</p> <h2>Edit</h2> <p>The network module has to run continuously in the background cause it handles some ongoing network stuff. (so this should be a service, right?) The storage module listens for events from the network and updates itself. As these are <em>POJOs</em> the storage module is registered at the network module.</p> <p>In the Android Part of the Application i have several Activities. All of these need to access the storage module. But there is no way to get a reference to it cause it is in the Service part of the application.</p> <p>I would wrap all required methods in Intent responses, but afaik Service Intents can not be called with a result.</p> <p>So ... how do i get my data from the service into activities?</p>
java android
[1, 4]
5,814,246
5,814,247
Working with multiple key press events (windows key)
<p>While working with the multiple keypress events i found this code which worke fine</p> <pre><code>$(document).bind('keypress', function(event) { if( event.which === 65 &amp;&amp; event.shiftKey ) { alert('you pressed SHIFT+A'); } }); </code></pre> <p>But to make it to work wth combinig with windows key... like</p> <pre><code>event.which === 65 &amp;&amp; event.windowsKey </code></pre> <p>it failed...</p> <p>Is there any option to make it work with windows key?</p> <p>if it is a mac machine there is no key as windows..so what could be the alternate option for windows key in mac</p>
javascript jquery
[3, 5]
476,810
476,811
Can I change the ID of a asp.net control programatically - ASP.NET
<p>I've a control</p> <pre><code>&lt;asp:Button ID="btnAjax" runat="server" Text="Ajaxified" OnClick="btnAjax_Click" /&gt; </code></pre> <p>Now from the code behind I want to change the ID of the button</p> <pre><code>btnAjax.ID = "newButtonID"; </code></pre> <p>But it is now working. Is it possible at the first place?</p> <p><strong>EDIT</strong></p> <p>I've created the control in the HTML mark up and not through code.</p>
c# asp.net
[0, 9]
4,579,966
4,579,967
navigate away alert without saving modifications
<p>I'm developing a website in php.</p> <p>I want to show a message something like javascript alert, when a user tries to edit or add something in a form and tries to navigate to some other section without saving the modification, i want to show a message to them,</p> <p>that you are about to navigate about from this page, your modifications are not saved, do you want to continue?</p> <p>how can i do this??</p> <p>any one have an idea ???please share it with me..</p> <p>Thanks</p>
php javascript
[2, 3]
1,449,781
1,449,782
Getting Out of memory on a 3001616-byte allocation error for bitmap decoding
<p>I'm actually getting this error on method Load image inside it i'm doing<br> i set options size to </p> <p>bmOptions.inSampleSize = 1;</p> <p>the method in which the error points line decodeStream()..</p> <pre><code>private Bitmap LoadImage(String URL, BitmapFactory.Options options) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpConnection(URL); bitmap = BitmapFactory.decodeStream(in, null, options); in.close(); } catch (IOException e1) { return null; } return bitmap; } </code></pre> <p>E/dalvikvm-heap(8627): Out of memory on a 3001616-byte allocation. at decodeStream() at loadImage()</p>
java android
[1, 4]
3,507,534
3,507,535
How to organise jquery code to be more cleaner and more readable
<p>I discoverd my jquery code is a mess, right now it doesnt follow any type of logic build up. I have lots of ajax calls, nested functions, dom manipulations, plugin calls in my main js file.</p> <p>Lot of calls are fired on every page, what is a no-no, and get the undefined error on a few pages because some functions or calls fire on every page, and thats not supose to.</p> <p>How to organize the code? I have read a lot of articles about prototypical and pseudo classical inheritance but they just explain how things works, like how you can inherit 'Person' from 'Human' or something like this. How can I actually use it in real life?</p>
javascript jquery
[3, 5]
5,062,624
5,062,625
Easy alternative to HttpWebRequest for POST requests?
<p>I need to trigger an action on a remote server using an http <code>POST</code> request. The server sends a response, either <code>Y</code> or <code>N</code>, to inform me if the action suceeded or not.</p> <p>I am looking at using <code>HttpWebRequest</code> to do this, but this seems too complex. To use this class you have to set all the headers, such as content type and content length.</p> <p>Is there a quicker way to send a <code>POST</code> request that doesn't require setting lower level properties such as this?</p>
c# asp.net
[0, 9]
1,975,204
1,975,205
Do we have any api's or web services avialable for monster or naukri to integrate in asp.net website?
<p>Can anyone please help me out suggesting any documentations/blogs available for the above subject.</p>
c# asp.net
[0, 9]
2,251,934
2,251,935
Nested Javascript Functions and jQuery
<p>I am learning javascript and jquery and wondered whether it is good or bad practice to nest all my functions within <code>$(document).ready(function)</code>. Is there any difference between this:</p> <pre><code>function someFunction() { return someThing; } $(document).ready(function() { // some code ... someFunction(); }); </code></pre> <p>and this:</p> <pre><code>$(document).ready(function() { // some code ... function someFunction() { return someThing; } someFunction(); }); </code></pre> <p>Be gentle - I'm pretty new to this!</p>
javascript jquery
[3, 5]
5,285,888
5,285,889
clientvalidation in asp.net
<p>I am trying to create a required field validation with a customvalidator. However when the field is empty it still does a postback?</p> <pre><code>&lt;body&gt; &lt;form id="Form1" runat="server"&gt; &lt;h3&gt; CustomValidator ServerValidate Example&lt;/h3&gt; &lt;asp:Label ID="Message" Font-Name="Verdana" Font-Size="10pt" runat="server" /&gt; &lt;p&gt; &lt;asp:TextBox ID="Text1" runat="server" Text="[Name:required]" /&gt; &amp;nbsp;&amp;nbsp; &lt;asp:CustomValidator ID="CustomValidator1" ControlToValidate="Text1" ClientValidationFunction="ClientValidate" Display="Static" ErrorMessage="" ForeColor="green" Font-Name="verdana" Font-Size="10pt" runat="server" /&gt; &lt;p&gt; &lt;asp:Button ID="Button1" Text="Validate" OnClick="ValidateBtn_OnClick" runat="server" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &lt;script language="javascript"&gt; function ClientValidate(source, arguments) { alert(arguments.Value.length); if (arguments.Value != "[Name:required]" &amp;&amp; arguments.Value.length &gt; 0) { arguments.IsValid = true; } else { arguments.IsValid = false; } } &lt;/script&gt; </code></pre>
c# asp.net
[0, 9]
4,798,955
4,798,956
How to test if users has made any changes to a form if they haven't saved it
<p>Basically the same functionality as stackoverflow when posting a question, if you start writing a post then try to reload the page. You get a javascript alert box warning message. </p> <p>I understand how to check if the form has been changed, although how do I do the next step. </p> <p>I.E: How to I check this when leaving the page, on here you get "This page is asking you to confirm that you want to leave - data you have entered may not be saved."? </p> <p>EDIT: found correct answer here to another question <a href="http://stackoverflow.com/a/2366024/560287">http://stackoverflow.com/a/2366024/560287</a></p>
javascript jquery
[3, 5]
5,471,724
5,471,725
Determine OS using the Environment.OSVersion object - C#
<p>What is the best to determine the Microsoft OS that is hosting your ASP.NET application using the <code>System.Environment.OSVersion</code> namespace </p> <p>I need an example for Windows XP, Windows Server 2003 and Windows Vista</p> <p>Here is what I am trying to accomplish using pseudocode</p> <pre><code>switch(/* Condition for determining OS */) { case "WindowsXP": //Do Windows XP stuff break; case "Windows Server 2003": //Do Windows Server 2003 stuff break; case "Windows Vista": //Do Windows Vista stuff break; } </code></pre>
c# asp.net
[0, 9]
2,453,280
2,453,281
C# - asp.net - Couple questions on this coding
<p>1) It loads extremely slow, takes over 20 seconds, but it does load the DataBase. Is that normal?</p> <p>2) I put the hello and bye response to test if it connected well. It writes hello and bye numerous of times like hellohellohellohello...byebyebyebye... is this normal? I was thinking this has something to do with question 3.</p> <p>3) When I comment out the catch(exception) I get an error saying InvalidOperationException "timeout expired." I think catch was good for catching those occasional errors, not the same error over and over. I think that means something is wrong?</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { SqlConnection Conn = new SqlConnection("Data Source=aserver;Initial Catalog=KennyCust;Persist Security Info=True;user id=sa;pwd=qwerty01"); SqlDataReader rdr = null; string commandString = "SELECT * FROM MainDB"; string commandString2 = "SELECT * From DetailDB"; try { Conn.Open(); SqlCommand Cmd = new SqlCommand(commandString, Conn); SqlDataAdapter sdp = new SqlDataAdapter(Cmd); DataSet ds = new DataSet(); if (Conn != null) { Response.Write("Hello"); } ds.Clear(); sdp.Fill(ds); MasterCust.DataSource = ds.Tables[0]; MasterCust.DataBind(); } catch (Exception) { } finally { if (rdr != null) { rdr.Close(); } if (Conn != null) { Conn.Close(); if (Conn != null) { Response.Write("Bye"); } } } </code></pre>
c# asp.net
[0, 9]
4,077,064
4,077,065
What is the difference between Extends Application and Extends Activity in Android?
<p>I am confused as to the difference between the two. In my application I have just used Extends Activity and the application is working perfectly, so what is the purpose of Extends Application?. </p> <p>Would you use it on the first class you create in the Android application?</p> <p>Thanks.</p>
java android
[1, 4]
5,615,754
5,615,755
How to make tool tip or popupwindow if i click or mouse over on text
<p>In my Asp Application, I've to make one tool-tip or popup window if i mouse-over or click specific text respectively . message(tool-tip or popup window) is get from database table . Please help me to make it . </p> <p><img src="http://i.stack.imgur.com/323vp.jpg" alt="image"></p> <p>you can see the red circle in above image. if i mouse-over to that '4', have to see tooltip or popupwindow value get from table. </p>
c# asp.net
[0, 9]
4,220,424
4,220,425
Jquery Is this the correct way?
<pre><code>&lt;script type="text/javascript"&gt; if (SOMECONDITION) { $("#scriptD").attr("src", "../../Scripts/A.js"); } else { $("#scriptD").attr("src", "../../Scripts/B.js"); } &lt;/script&gt; &lt;script id="scriptD" src="" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>I am trying to insert a <code>.js</code> file dynamically ( on the condition basis). But this is not working . Can anybody tell me whats the problem here? </p>
javascript jquery
[3, 5]
3,855,612
3,855,613
Mimic CMYK plates offset with jQuery
<p>I would like to make a visual disturbance effect on certain words in the text of my page, to mimic on-screen the calibration / offset errors that can occur when printing posters, magazines…</p> <p>The idea is to randomly select a target word in the text, then wrap it in a <code>&lt;span class="cmyk intensity-max"&gt;</code>. Then I would wrap the adjacent words in <code>&lt;span class="cmyk intensity-medium"&gt;</code> and following in <code>&lt;span class="cmyk intensity-min"&gt;</code>. The goal is to disturb a zone in the text and not a single word (I’m not really satisfied with my idea to atteign progressivity in the disturbance).</p> <p>Then, I got a function that clones the content of the span three times, affects a relative position to the initial span, and absolute position and c/m/y colors to the other.</p> <p>My question is about the best way to achieve this effect, in terms of performance, and about how to deal with the internal markup of the text (links, strongs, ems).</p>
javascript jquery
[3, 5]
5,128,899
5,128,900
Dealing with expandable jQuery content if javascript disabled
<p>I have a messaging tool within the website I am currently working on. The idea is to have a header div and a details div (display="none") for each message. </p> <p>Ideally, if javascript enabled, I have just the header showing and when the user clicks on it, the details div slide open.</p> <p>This is fine but how should I work it if javascript is disabled? I was thinking of expanding all messages if disabled, but I don't want a flicker briefly when the page loads of all images open and, if javascript enabled, they collapse.</p> <p>I'm using ASP.NET and was thinking of checking javascript status of the browser server side but i found out that it can't be done cleanly.</p> <p>Any suggestions on how to achieve this?</p>
asp.net javascript jquery
[9, 3, 5]
3,437,938
3,437,939
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]
4,763,712
4,763,713
can a web page be manipulated through ajax from new window?
<p>Hi... I want to know that when a user posts a comment to my site ... to open a web page (in new window, with a fixed width and height like <code>window.open</code> ) which contains the form and after submit, I want to close that windows and show that comment in the parent page through ajax ... (or i guess after closing that window, to auto reload the parent page ... I don't know ) ... </p> <p>Is there any solution to this .. ? Or what is the best way to open a pop-up which contains the form (not a new window) ? </p> <p>Thank you very much.</p>
php jquery
[2, 5]
36,295
36,296
How to fill a Jquery multicolumn selectbox from code behind ASP.NET?
<p>I want to use something like <a href="http://code.google.com/p/jquerymulticolumnselectbox/" rel="nofollow">jquerymulticolumn</a>. But i can't use it from code behind. How can i do it or anyone suggest me another multicolumn selectbox ?</p> <p>aspx:</p> <pre><code>. . &lt;td&gt; &lt;div id="datatable"&gt; &lt;table cellspacing="0" width="100%"&gt; &lt;tr&gt; &lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Action Name&lt;/th&gt;&lt;th&gt;Action ID&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;asp:repeater id="rep" runat="server"&gt; &lt;itemtemplate&gt; &lt;tr&gt; &lt;td&gt;&lt;%#Eval("AKSIYON_ID")%&gt;&lt;/td&gt;&lt;td&gt;&lt;%#Eval("AKSIYON_ADI")%&gt;&lt;/td&gt;&lt;td&gt;&lt;%#Eval("AKSIYON_ID")%&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/itemtemplate&gt; &lt;/asp:repeater&gt; &lt;/table&gt; &lt;/div&gt; &lt;/td&gt; . . &lt;script type="text/javascript"&gt; $("#datatable").multicolselect({ buttonImage: "../Images/selectbutton.gif", valueCol: 1, hideCol: 0 }); &lt;/script&gt; </code></pre>
jquery asp.net
[5, 9]
4,060,870
4,060,871
Ttrigger extra parameter
<p>According to the jQuery manual you can send extra parameters (as an array) when calling a trigger. I am using this at the moment:</p> <pre><code>$('#page0').trigger('click', [true]); </code></pre> <p>How would I pick up whether the paramter has come through or not when using this?</p> <pre><code>$('ul.pages li a').click(function() { // Do stuff if true has been passed as an extra parameter }); </code></pre>
javascript jquery
[3, 5]
5,556,172
5,556,173
Maximum Length of a filename on Win7
<p>I have a web application which allows users to download a file. In doing so it asks users to provide the name to it in textbox. The upper limit of this text box is 200 characters. When i try to download a file on my Win7 system while accessing this application i do not get the whole 200 characters, instead i get only 158. I went through some articles that suggest that the max character length of a filename for Win7 is 256 characters and also the location (whole path) of the download gets accounted for in this. Also this 158 characters includes the location where this file is chosen to save, in the browser. </p> <p>Please suggest..</p>
c# asp.net
[0, 9]
1,794,570
1,794,571
Implementing lazy loading in homepage posts instead of pagination
<p>I have lots of posts in <a href="http://blog.kushaljoshi.com.np" rel="nofollow">my website</a>. I have used <code>default pagination</code> function for paging the post list in <em>homepage</em>. But I wanted to implement <code>lazy loading</code> instead of pagination just like in <em>twitter</em>. I don't have any idea about it's implementation in <em>Wordpress</em>.</p> <p>Please help me with this.</p>
jquery javascript
[5, 3]
4,499,927
4,499,928
Jquery watch certain fields for certain values
<p>I have some test code here</p> <pre><code>&lt;input type="radio" name="group1"&gt;1 &lt;input type="radio" name="group1"&gt;2 &lt;input type="radio" name="group1"&gt;3 &lt;br&gt; &lt;input type="text" name="text1"&gt; &lt;br&gt; &lt;input type="radio" name="group2"&gt;1 &lt;input type="radio" name="group2"&gt;2 &lt;input type="radio" name="group2"&gt;3 &lt;br&gt; &lt;input disabled type="submit"&gt; </code></pre> <p>Please can you tell me if there is a way to watch multiple fields so that if their values changes i can enable a button..</p> <p>So in short instead of having 3 .change rules watching each other... can't i do one piece of code that watches all 3 and if the values equals a particular something it enables the submit button ?</p> <p>Thanks</p> <p>Lee</p>
javascript jquery
[3, 5]
4,852,750
4,852,751
Splitting text file in android
<p>I am developing an android app and i need it to read a text file. Once it has read the text file I need to <code>save certain parts</code> to a database. The text file contains the following:</p> <pre><code>Title - Hello Date - 03/02/1982 Info - Information blablabla Title - New title Date - 04/05/1993 Info - New Info </code></pre> <p>I thought that I need to split the text file in two by using the blank line as a <code>separator</code>. Then I need to get the individual info like the Title and save it into the database as a title. Is there some way to do this? I know how to read all of the text file. I am using this to read the <code>complete</code> text file. </p> <pre><code> TextView helloTxt = (TextView) findViewById(R.id.hellotxt); helloTxt.setText(readTxt()); } private String readTxt() { InputStream inputStream = getResources().openRawResource(R.raw.hello); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int i; try { i = inputStream.read(); while (i != -1) { byteArrayOutputStream.write(i); i = inputStream.read(); } inputStream.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return byteArrayOutputStream.toString(); } </code></pre> <p>I was just wondering about the splitting event of this. Thank you </p>
java android
[1, 4]
3,116,070
3,116,071
Call a method when another one finishes
<p>I have a function in javascript which consists of an ajax call. Let's call it search();</p> <p>Then I have an event onKeyUp.</p> <p>In the onKeyUp event, I have an enterPressed() function.</p> <p>I want to call this function AFTER search() finishes.</p> <p>I think callbacks won't help here.</p> <p>Here's my code:</p> <pre><code>function search () { ... } ed.onKeyUp.add(function (ed, e) { if (e.keyCode == 13) enterPressed(); } function enterPressed() { ... } </code></pre>
javascript jquery
[3, 5]
5,860,207
5,860,208
ASP.NET website logs out on postback in IE 8 but works fine with IE 9. Why?
<p>My ASP.NET website logs out on postback in IE 8 but works fine with IE 9.</p> <p>This happens when drop down selection changes, the link button is clicked or any other postback event occurs or even if we directly change the url.</p> <p>Works fine with Mozilla, Chrome, IE9, and Safari.</p> <p>How can I resolve this?</p> <p>The above <strong>does not</strong> work in ie8, it keeps logging out</p>
c# asp.net
[0, 9]
5,279,339
5,279,340
Python for C++ Developers
<p>I'm a long time C++/Java developer trying to get into Python and am looking for the stereotypical "Python for C++ Developers" article, but coming up blank. I've seen these sort of things for C#, Java, etc, and they're incredibly useful for getting up to speed on language features and noteworthy differences. Anyone have any references?</p> <p>As a secondary bonus question, what open source Python program would you suggest looking at for clean design, commenting, and use of the language as a point of reference for study?</p> <p>Thanks in advance.</p>
c++ python
[6, 7]
2,591,241
2,591,242
Append an input's value in included form..PHP
<p>I have several landing pages and the only difference in them is a hidden input's (referred_by_text) value. I would like to just make one form and include it in all the landing pages....<strong>how would I go about setting the value for the input on each landing page for that value?</strong></p> <p>In the landing page this:</p> <pre><code>&lt;?php include("includes/lp_form.php");?&gt; </code></pre> <p>In the included form:</p> <pre><code>&lt;input type="hidden" name="referred_by_text" value="" /&gt; </code></pre> <p>I would like to set the value for "referred_by_text" in each landing page...not sure where to start, any help is much appreciated. Would it be best to do it as an variable or possibly in JS?</p>
php javascript
[2, 3]
5,218,452
5,218,453
jRecorder not working above 50 seconds
<p>any of you know why jRecorder does not work above 50 seconds. the file uploaded to server is 0KB. if the recording is shorter, it works perfectly.</p> <p>Thanks in advance. </p>
php javascript jquery
[2, 3, 5]
3,695,264
3,695,265
Android unregisterReceiver with onPause
<p>I have something like this in my manifest file - I need one receiver for the situation that a power source was connected and the other receiver for unplugged source.</p> <pre><code>&lt;receiver android:name=".PowerConnectionOnReceiver" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.ACTION_POWER_CONNECTED" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; &lt;receiver android:name=".PowerConnectionOffReceiver" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /&gt; &lt;/intent-filter&gt; &lt;/receiver&gt; </code></pre> <p>But I want to unregisterReceiver, when onPause is called in my MainActivity. How to do it?</p>
java android
[1, 4]
1,018,598
1,018,599
auto tab with exception
<p>I have a form where I primarily input single digit numbers. I want to auto tab to each input field, however, sometimes, there is a need for a two digit number. The two digit number will always start with "1". So I would like to auto tab on all single digit numbers except 1 and if a 1 is entered the auto tab is disabled so that a second digit can be entered. I will manually tab to the next field where auto tab would then resume.</p> <p>I can find plenty of code for auto tabbing but none with this type of exception. I am new to javascript.</p>
javascript jquery
[3, 5]
5,441,521
5,441,522
Correctly replacing a string with another string
<p>I am work a site that was coded in c# and uses a ssl cert "secure.mydomain.com To switch from http to https it uses the following code</p> <pre><code> if (useSsl) { if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings["SharedSSL"])) { //shared SSL result = ConfigurationManager.AppSettings["SharedSSL"]; } else { //SSL **result = result.Replace("http:/", "https://");** } </code></pre> <p>This will switch from "http://mydoman.com" to "https://mydomain.com", but I need "https://secure.mydomin.com". If I change the code to <strong>result = result.Replace("http:/", "https://secure");</strong> it takes me to an error page because it is trying to go to "https://secure".</p> <p>I have been searching for 3 weeks to find a solution and tried so of them but none worked. Any suggestions on how to correct this?</p>
c# asp.net
[0, 9]
2,279,575
2,279,576
Get php url variable for use in jquery
<p>Okay so I have an html5 audio player that i built with jquery however i need to get the track url from the variable in the url with a get request so that it can then be used in the jquery script. Not sure how to do it. I have the jquery in a seperate file to the markup for easy embedding for users. The url will look like www.mysite.co.uk/player/player.html?url=testing123.mp3.</p> <p>I can easily get the variable for use in the markup to show the name of the artist etc with PHP but not sure how to do it for the jquery script. I have had a look around but no luck.</p> <p>Heres the relevent jquery</p> <pre><code>song = new Audio('THIS IS WHERE THE GET VARIABLE NEEDS TO BE'); </code></pre> <p>I shouldnt think anymore code is needed but if it is just ask.</p> <p>head</p> <pre><code>&lt;script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;?php $url = $_GET['url']; ?&gt; &lt;script&gt; // Before jQuery var song = new Audio(`&lt;?php echo($url); ?&gt;`); &lt;/script&gt;` &lt;script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/js.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://newbornsounds.co.uk/player/src/js/html5slider.js"&gt;&lt;/script&gt; </code></pre>
php jquery
[2, 5]
5,850,978
5,850,979
How to select option in jQuery using text of option tag
<p>I'm trying to select a certain option in a select box, but it's not working:</p> <pre><code>var category = $(row + 'td:nth-child(4)').text(); $('#category_id', theCloned).load('/webadmin/video/get_categories',function(){ $('#category_id', theCloned).val(category); }); </code></pre> <p>There's no error thrown, but it doesn't change the select box. What am I doing wrong here?</p> <p>Here is an example of the options loaded by the load() call:</p> <pre><code>&lt;option value="1"&gt;Capabilities&lt;/option&gt; &lt;option value="2"&gt;Application Focus&lt;/option&gt; &lt;option value="5"&gt;Fun&lt;/option&gt; </code></pre> <p>The value of the category variable is "Fun" or "Capabilities", etc.</p>
javascript jquery
[3, 5]
1,077,384
1,077,385
How can I remove "(?) " from a variable in jQuery?
<p>I am trying to write some code that will look a the contents of a variable and remove "(?) " if it is in the variable. The "?" could be any number, but I want to remove the parentheses, the content between them, and the space after.</p>
javascript jquery
[3, 5]
1,829,282
1,829,283
ASP.NET & C# - Two values in a listbox?
<p>I'm adding ListItems to a ListBox from two controls, both are DropDownLists.</p> <p>The ListItem has the properties ListItem.SelectedItem and ListItem.SelectedValue, but I also want the ListBox to keep track of which DropDownList the ListItem came from.</p> <p>What would be the best way to do this?</p>
c# asp.net
[0, 9]
300,812
300,813
Using Trulia API in an Android app
<p>I have a question about pulling data from Trulia api, and display it on an android app I am developing. Essentially all I need is to be able to get the Home value and the Tax evaluation values. The app will then be able to take these values and do what it's supposed to do. I have the apikey (trulia apikey), but I don't know how to communicate with the api so I can get the information I need.</p> <p>Any help will be highly appreciated!</p> <p>Thanks.</p>
java android
[1, 4]
3,746,582
3,746,583
dynamically generated html buttons: source of onclick event caller
<p>I have a DataTable which has a column like such:</p> <pre><code>string temp = row["date"].ToString(); rowDetail[0] = "&lt;input type='button' onclick='showArchive(this)' value='" + temp + "'/&gt;"; myTbl.Rows.Add(rowDetail); </code></pre> <p>So, when I bind myTbl to a datagrid.datasource, these column cells appear as buttons display "date" data. However, in my javascript function where the onclick event takes place, how would I know button/row made the call, so I can grab the rest of the data in that row for processing? I hope that's not lacking too much detail. Thanks all</p> <p><strong>Edit:</strong> Here's my js event:</p> <pre><code>function showArchive(btn) { __doPostBack('btnShowDates', '/*btn.gridRowIndex*/'); } </code></pre> <p>Something like this would be ideal lol.</p>
c# javascript asp.net
[0, 3, 9]
5,221,358
5,221,359
Strange javascript chrome issue with menu
<p>Visit the following site in chrom and teh first time the page loads the top nav displays on two lines, if you click to another page then home again the top nav displays correctly (all on one line), why is this?</p> <p>I thinkit may be javascript related but can't get to the bottom of it.</p> <p>Any ideas?</p> <p><a href="http://berrisford.gumpshen.com" rel="nofollow">http://berrisford.gumpshen.com</a></p>
javascript jquery
[3, 5]
4,097,270
4,097,271
How to convert the Username column in the GridView an email hyperlink (mailto) and to be clickable using GridView1_DataBound?
<p>I developed a web-based training matrix that shows the training record for each employee in each division in my department in the company. The matrix will show many columns such as the employee name, username, job title... etc. what I want now is to make the username for each employee to be clickable which means when the admin clicks on it, the outlook will be opened with his email and the admin will be able to send him a message. In my company, this is possible because each employee email is mainly as: [email protected] so how to do that?</p> <p>By the way, the username of the employee will be retrieved from the database using a storedprocedure, so how I will be able to convert the username to an email and to be clickable at the same time using the Code-Behind?</p> <p>The user column is the 4th column in the GridView</p> <p><em><strong>Code-Behind:</em></strong></p> <pre><code>protected void GridView1_DataBound(object sender, GridViewRowEventArgs e) { HyperLinkField hlink = GridView1.Columns[3] as HyperLink; hLink.DataNavigateUrlFormatString = } </code></pre>
c# asp.net
[0, 9]
864,188
864,189
How pass null from code behind with textboxes
<p>I have two textboxes and a drop down.User has a option that he should select drop down and enter value in any one of the texbox . </p> <p>My procedure accepts null values . only problem is how to pass tht from code behind tht the any text box value submitted it shud return the data.</p> <p>Can any one help me on this .</p> <p>Thanks Smartdev</p>
c# asp.net
[0, 9]
2,845,335
2,845,336
togglebutton error not working correct
<p>i am using togglebutton so i can do tow function one when it is check and one when it is not check the first function (when it is check ) is working fine but the second is not it said in logcat</p>
java android
[1, 4]
2,341,705
2,341,706
jQuery question: what does it really mean?
<pre><code>(function($, window, undefined){ ... jquery code... })(jQuery, window); </code></pre> <p>What does it really mean? Does it also mean <code>$(document).ready()</code>? Or just two different things?</p>
javascript jquery
[3, 5]
2,203,508
2,203,509
In JQuery where does the 'load' method's relative path start when its referencing an html file within the project?
<p>I have a JEE project that uses lots of html, javascript, java etc. I'm looking to use JQuery to load up an html template into a div tag however I'm unsure of where the relative path of the load method starts from. The html file I'm trying to load is within the project but in a different directory. Would I have to back down and go back up to get to the path? And if there is an easy way to find out by some type of debugging methods of what the correct path is .... that would be BONUS! The javascript (JQuery) that its using is loaded in, the line below is also in another file. I have something like the following</p> <pre><code>$("&lt;div id=\"eventMaintDialog\"&gt;&lt;/div&gt;").appendTo($("body")); $("eventMaintDialog").load("src\main\webapp\resources\js\template\Event\EventMaintTemplate.html"); </code></pre> <p>I hope I explained this clearly. I feel like I keep changing the path but get nothing. I'm taking stabs in the dark. Thanks in advance.</p>
javascript jquery
[3, 5]
1,470,836
1,470,837
Use session inside script tag
<p>my code is</p> <pre><code> $(document).ready(function () { var control_btn21 = $('.mine'), interval21; $.ajax_upload(control_btn21, { action: 'FileHandler.ashx', name: 'control21', onSubmit: function (file, ext) { $('#uploadResume').addClass("Uploading"); disableBtn = true; this.disable(); interval21 = window.setInterval(function () { if (control_btn21.text().length &lt; 13) { // control_btn21.text(control_btn21.text() + '.'); } else { // control_btn21.text('Uploading'); } }, 200); }, onComplete: function (file, response) { $('#uploadResume').removeClass("Uploading"); disableBtn = false; window.clearInterval(interval21); this.enable(); var file_added = file; var path = response; path = strip(path); alert(path); **&lt;%# Session["path"].ToString() %&gt; = path;** $('.pathing').text(path); $('.testing').attr("src", "temp/" + path); } }); }); </code></pre> <p>in this i want to use the session to store the value of variable <strong>path</strong> but i am not able to do that please help and find what's the actual problem</p> <p>thanks</p>
jquery asp.net
[5, 9]
3,281,476
3,281,477
How do I loop through elements and use the index number to present the relative array object properties?
<p>I have created an array object with some dummy properties, I have have also dynamically created some list items that I would like to attach a click handler to. When a list item is clicked I would like to present the appropriate data inside #container using the template Ive set up. Im assuming I can use the index from the for loop of dynamic list items and some how use this to show the correct object properties? If you could advise me where I have gone wrong with this that would be great, sorry but Ive lost my way a little with this.</p> <pre><code>$(document).ready(function () { var data = [ { name: 'kyle', age: 23, sex: 'male' }, { name: 'james', age: 19, sex: 'male' }, { name: 'catrina', age: 28, sex: 'female' }]; var template = $('#template').html(); // Links created dynamically for (var i = 0; i &lt; 3; i++) { var link = '&lt;li&gt;Link ' + i + '&lt;/li&gt;'; $('#links').append(link); } // When li is clicked show related data properties, li[0] = data[0], li[1] = data[1] ... $('li', '#links').live('click', function (e) { $.each(data, function (index, value) { $('#container').append(data.name[i], data.age[i], data.sex[i]); }); $('#container').html(data); }); }); </code></pre> <p>Code can be found here <a href="http://jsbin.com/otirax/6/edit" rel="nofollow">http://jsbin.com/otirax/6/edit</a></p>
javascript jquery
[3, 5]
2,403,093
2,403,094
how to disable Design and enable true Toolbar at Preview at RadEditor?
<p>how to disable Design and enable true Toolbar at Preview at RadEditor. Thank u. Please Help me .</p>
c# asp.net
[0, 9]
2,879,853
2,879,854
jQuery check click for each link
<pre><code>$("#showKey").each( $(this).click(function(){ alert($(this).attr("value")); }) ); </code></pre> <p>And</p> <pre><code>&lt;a id="showKey" href="#" value="{{ customer.key }}"&gt; &lt;span class="icons icon-key"&gt;&lt;/span&gt; Show key &lt;/a&gt; </code></pre> <p>The alert gives and undefined output, just 'undefined'. I have a list of customers and a click on #showKey should reveal the key for the clicked customer.</p> <p>Whats wrong with my code?</p>
javascript jquery
[3, 5]
4,410,229
4,410,230
Hiding Linkbutton controls in a Formview using page index events
<p>I want to be able to hide some item controls on a <code>Formview</code>. I have defined a method so that when a certain requirement is met, the <code>Add</code>, <code>Update</code> and <code>Delete</code> linkbuttons that I have set won't be displayed in my Formview. The code that I use to achieve this is the same as that shown below. This works correctly on initial display. </p> <p>However, when the paging controls are used, and when another item is displayed in the Formview, the linkbuttons are made visible again.</p> <p>I have tried using both <code>FormView1_PageIndexChanging</code> and <code>_PageIndexChanged</code> events to re-hide the linkbuttons, in the following manner:</p> <pre><code> protected void FormView1_PageIndexChanged(object sender, EventArgs e) { // Check to see if PDP requirement has been removed if (txtStatusMessages.Text == "PDP Required has been set to False for this User so PDP cannot be updated or signed off.") { Control lb_n = FormView1.FindControl("LinkButton_New"); lb_n.Visible = false; Control lb_e = FormView1.FindControl("LinkButton_Edit"); lb_e.Visible = false; Control lb_d = FormView1.FindControl("LinkButton_Delete"); lb_d.Visible = false; } } </code></pre> <p>I realise that the idea of checking the contents of a textbox in order to hide controls is far from ideal; but at this point I just want to ensure that I can hide the item controls using this method.</p> <p>When using the debugger to run through this code, the event is fired on the use of a pager button. The visible properties are correctly changed from true to false. However, the linkbuttons are still visible.</p> <p>Does anyone know why this is not working as anticipated?</p> <p>Thanks in advance, Gary.</p>
c# asp.net
[0, 9]
1,525,834
1,525,835
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,293,087
2,293,088
How to programmatically hide a button within Android SDK using NFC
<p>I have two buttons within my Android application. It currently shows the two buttons when you open the application. What I would like to do is to hide these buttons from the user until they have interacted with an NFC tag so if they were to open the application independently they would not be able to see them but if the application was opened by interaction with a tag they would be visible. I have programmed the application as default interaction with NFC so the application is called once the device has interacted with the phone like this:</p> <pre><code> NfcAdapter mAdapter = NfcAdapter.getDefaultAdapter(this); final Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent();intent.setAction(android.content.Intent.ACTION_VIEW); File file = new File("sdcard/Download/disdat.pdf"); intent.setDataAndType(Uri.fromFile(file), "application/pdf"); startActivity(intent); } </code></pre> <p>I was just wondering if anyone had any ideas on how to hide and show the buttons?</p>
java android
[1, 4]
869,252
869,253
Problem with two JavaScript codes
<p>I have these two codes - </p> <pre><code>new function($) { $.fn.getCursorPosition = function() { var pos = 0; var el = $(this).get(0); // IE Support if (document.selection) { el.focus(); var Sel = document.selection.createRange(); var SelLength = document.selection.createRange().text.length; Sel.moveStart('character', -el.value.length); pos = Sel.text.length - SelLength; } // Firefox support else if (el.selectionStart || el.selectionStart == '0') pos = el.selectionStart; return pos; } } (jQuery); </code></pre> <p>And</p> <pre><code>var element = document.getElementById('txtarr'); if( document.selection ){ // The current selection var range = document.selection.createRange(); // We'll use this as a 'dummy' var stored_range = range.duplicate(); // Select all text stored_range.moveToElementText( element ); // Now move 'dummy' end point to end point of original range stored_range.setEndPoint( 'EndToEnd', range ); // Now we can calculate start and end points element.selectionStart = stored_range.text.length - range.text.length; element.selectionEnd = element.selectionStart + range.text.length; } </code></pre> <p>The first one is for getting the cursor position in a textarea and the second one is for determining the end of a textarea ,but they give the same result? Where's the mistake?</p>
javascript jquery
[3, 5]
3,065,778
3,065,779
On the server, player movement is not rendered
<p>This code renders the motion of the player, changing the picture. Locally it works fine on the server change picture is not visible. But if you uncomment the alert ("right1"); and alert ("right2"); will be seen as an image change. How do I make the server was also seen pictures change?</p> <pre><code>var timer; function GoRight(toPosition, level, mines) { clearInterval(timer); var left = $("#man").position().left; var top = $("#man").position().top; $("#man").attr('style', 'position:absolute;display:block;left:' + left + 'px;top:' + top + 'px;') $("#man").attr("class", ""); var tempi = 0; timer = setInterval( function () { if (left &gt;= toPosition) { left = toPosition; $("#man").attr('style', 'position:absolute;display:block;left:' + left + 'px;top:' + top + 'px;') clearInterval(timer); $("#man").attr('src', '/content/games/kamikaze2/right0.gif'); return; } tempi += 8; left += 8; $("#man").attr('style', 'position:absolute;display:block;left:' + left + 'px;top:' + top + 'px;') if (tempi % 16 == 0) { // alert("right1"); $("#man").attr('src', '/content/games/kamikaze2/right1.gif'); } else { // alert("right2"); $("#man").attr('src', '/content/games/kamikaze2/right2.gif'); } }, 70); } </code></pre>
javascript jquery
[3, 5]
4,398,700
4,398,701
Return values of checked checkboxes as CSV - jQuery
<p>I have a form and I have check-boxes inside like;</p> <pre><code>&lt;form id="testid"&gt; &lt;input class="chkbx" type="checkbox" value="option 1" /&gt;option 1 &lt;input class="chkbx" type="checkbox" value="option 2" /&gt;option 2 &lt;br/&gt;&lt;br/&gt;&lt;a id="test"&gt;test&lt;/a&gt; &lt;/form&gt; </code></pre> <p>I need the value of checked check-boxes returned when i click some element. Say, I need to alert;</p> <ol> <li><code>option1,option2</code> if both boxes are checked, </li> <li><code>option1</code> if only option 1 is checked,</li> <li>alert an empty box if none is selected.</li> </ol> <p>How can I achieve this? <strong><a href="http://jsfiddle.net/H8HNm/" rel="nofollow">Here</a></strong> is the fiddle.</p> <p>thanks in advance...<code>:)</code></p>
javascript jquery
[3, 5]
4,135,136
4,135,137
unable to start a new project eclipse
<p>I am a new android developer. </p> <p>I was trying to install eclipse in my system and after installation when I was to open a new project the column of build target is been empty. </p> <p>So i can't create or start a project... please help me in rectifying this problem.</p>
java android
[1, 4]
5,267,920
5,267,921
Javascript loader
<p>I have an image carousel on my page with some fairly small images. the issue is not with the images but with the script itself. I want to display a javascript loader image while the entire plugin is loaded and is ready for action. </p> <p>when i launch the page, the carousel <code>&lt;li&gt;</code> first display like a normal list, then get formed into the carousel. i want to avoid that and display a loader image while the entire thing is loaded. </p>
javascript jquery
[3, 5]
3,156,061
3,156,062
Messagebox asp.net c#
<pre><code>int approvalcount; if (approvalcount &gt; 0) { string script = @"confirm('Click OK or Cancel to Continue') ;"; ScriptManager.RegisterStartupScript(this, this.GetType(), "confirm_entry", script, true); } else { return true; } </code></pre> <p>I need help for the above code. If click ok need to return true or click cancel need to return false. How can I get the return value ? Are there any other ways to shows the message box in asp.net and c# ? </p> <p>approvalcount is int typed variable. </p>
c# asp.net
[0, 9]
2,262,448
2,262,449
Make a sliding div stop when reaches end of post div
<p>i have a floating box on the side of my post. This is the code of the post div</p> <pre><code> &lt;div class="post-entry&gt; &lt;div class="float-div"&gt; data &lt;/div&gt; divs and text &lt;/div&gt; </code></pre> <p>And this is the javascript code that make it to move with a nice effect</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { var offset = $(".float-div").offset(); var topPadding = 100; $(window).scroll(function() { if ($(window).scrollTop() &gt; offset.top) { $(".float-div").stop().animate({ marginTop: $(window).scrollTop() - offset.top + topPadding }); } else { $(".float-div").stop().animate({ marginTop: 7 }); }; }); }); &lt;/script&gt; </code></pre> <p>The problem is that it moves thorough the whole page all the way until the footer. But it needs to stop at the end of the div "post-entry". Any ideas on how to make it stop?</p>
javascript jquery
[3, 5]
194,694
194,695
Delay each iteration of loop by a certain time
<p><strong>JSFiddle:</strong> <a href="http://jsfiddle.net/KH8Gf/27/">http://jsfiddle.net/KH8Gf/27/</a></p> <p><strong>Code:</strong></p> <pre><code>$(document).ready(function() { $('#expand').click(function() { var qty= $('#qty').val(); for (var counter = 0; counter &lt; qty; counter++) { $('#child').html($('#child').html() + '&lt;br/&gt;new text'); } }); }); </code></pre> <p>How can I delay each iteration of the loop by a certain time?</p> <p>I tried the following unsuccessfully:</p> <pre><code>setTimeout(function(){ $('#child').html($('#child').html() + '&lt;br/&gt;new text'); },500); </code></pre> <p>and</p> <pre><code>$('#child').delay(500).html($('#child').html() + '&lt;br/&gt;new text'); </code></pre>
javascript jquery
[3, 5]
4,273,122
4,273,123
assistance using array in android
<p>I am developing a basic android app which must handle several different things typically adding data and deleting an entry, must make use of an array.</p> <p>at the moment I have a class that deals with adding a product this makes use of 2 edit texts fields and 4 spinners, when the user clicks on add product it will get the 2 textfields and 4 selected items from the spinner and add these all too the array.</p> <p>deleting an item which just display all products held the user will then select the item they wish to delete and click the delete button.</p> <p>I need some help with creating an array, will it be best to have a different class that deals with the array i.e creating the array when the app is ran and has methods for adding and deleting product.</p> <p>I just want to know how it would possible to set this array up an array will need to hold the following:</p> <pre><code>product name (edit tect field) category (edit text field) price (spinner) day (spinner) month (spinner) year (spinner) </code></pre>
java android
[1, 4]
2,194,018
2,194,019
Timer not working
<p>My problem is that timer doesn't pause correctly. When I hit pause it looks like it has stopped but actually it continues to cycle, and when I hit start it doesn't continue from where I paused, but from the location it had reached.</p> <pre><code>&lt;div class="stopwatch"&gt; &lt;span&gt;00:00:00,000&lt;/span&gt;&lt;br /&gt; &lt;div class="btn start"&gt;play&lt;/div&gt; &lt;div class="btn pause"&gt;pause&lt;/div&gt; &lt;div class="btn reset"&gt;reset&lt;/div&gt; &lt;/div&gt; </code></pre> <pre class="lang-js prettyprint-override"><code>$(function (){ var reload = 1000/60; var timer = null; var startTime = 0; var btn = $('.stopwatch a'); var count = $('.stopwatch span'); var pause = false; $('.pause').click(function (){ pause = true; }); $('.start').click(function (){ pause = false; }); $('.reset').click(function (){ return ( (count.text('00:00:00,000')) &amp;&amp; (timer = 0) ); }); function zero(num, length) { if ( typeof(length) == 'undefined' ) length = 2; while ( num.toString().length &lt; length ) { num = '0' + num; } return num; } function zero_format(time){ return zero(time.getUTCHours()) + ':' + zero(time.getMinutes()) + ':' + zero(time.getSeconds()) + ',' + zero(time.getMilliseconds()); } $('.start').click( function (){ if ( !timer ){ startTime = new Date(); timer = setInterval( function (){ if ( pause ){ return; } var currentTime = new Date(new Date() - startTime); count.text(zero_format(currentTime)); }, reload); } return false; }); }); </code></pre>
javascript jquery
[3, 5]
1,275,230
1,275,231
Setting up Android code for different runtimes
<p>I am working on an Android application that is supposed to run on Android 1.5 and later devices. I am using <code>RawContacts.CONTENT_URI</code> enumeration for registering a <code>ContentObserver</code> in my application subclass. Now, RawContacts was introduced in Eclair and running this code on Android devices having runtime less than 2.0, gives java.lang.VerifyError. For older devices, I have to use <code>Contacts.CONTENT_URI</code>.</p> <p>So to fix this, I've put something like the following in my code:</p> <pre><code>if(Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.ECLAIR){ uri = android.provider.ContactsContract.RawContacts.CONTENT_URI; } else{ uri = android.provider.Contacts.CONTENT_URI; } </code></pre> <p>I am still getting java.lang.VerifiyErrors.</p> <p>How do I setup my code for different runtimes?</p>
java android
[1, 4]
1,644,322
1,644,323
How to set an alarm for a selected date and time?
<p>I have this code from where I can set a time and date from date picker and time picker at once:</p> <pre><code> private void dialoguetime() { final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.custom_dialogue); dialog.setCancelable(true); dialog.setTitle("This is Dialog 1"); dialog.show(); TimePicker time_picker = (TimePicker) dialog .findViewById(R.id.timePicker1); hours = time_picker.getCurrentHour(); minute = time_picker.getCurrentMinute(); time_picker.setOnTimeChangedListener(new OnTimeChangedListener() { public void onTimeChanged(TimePicker view, int hourOfDay, int minutes) { // TODO Auto-generated method stub // Toast.makeText(CustomDialog.this, // "hourOfDay = "+hourOfDay+"minute = "+minute , 1000).show(); hours = hourOfDay; minute = minutes; } }); final DatePicker date_picker = (DatePicker) dialog .findViewById(R.id.datePicker1); Button btn = (Button) dialog.findViewById(R.id.button2); btn.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // TODO Auto-generated method stub xDate = date_picker.getYear() + "-"+ (date_picker.getMonth() + 1) + "-"+ date_picker.getDayOfMonth() + " " + hours+ ":" + minute + ":00"; Toast.makeText( getApplicationContext(), xDate, Toast.LENGTH_LONG) .show(); dialog.cancel(); } } ); } </code></pre> <p>From this I can get a string as a date format like this <code>yyyy-mm-dd hh:mm:ss</code>, now I want to give an alert (as alarm) to the user of that selected time. I have used alarm manager for this but it didn't allow me to select that date?</p> <p>How can I do this?</p>
java android
[1, 4]
775,881
775,882
how to get the return value from a JS dialog box in asp.net without tying it to a button
<p>How can one display a confirmation box &amp; get the return value in C# code in ASP.NET without tying it to a button? I need to display the confirmation box from inside the event handler of a button if a certain condition is filled.</p> <p>Situation:</p> <pre><code>protected void okBtn_Click(object sender, EventArgs e) { if (blah) { bool answer = DisplayConfirmationBox(); } } </code></pre> <p>Displaying it using JS is not really an issue, but getting the return value from it is. </p>
c# javascript asp.net
[0, 3, 9]
2,603,543
2,603,544
output buffer empty until tcpdump is killed
<p>I am running the tcpdump on my android emulator and since the tcpdump is running in the background there isnt any data in the buffer and hence the application is stuck at this point. here is the part of the code:</p> <pre><code>else if (tcpdumpButton.isChecked()) { try { Process process1 = Runtime.getRuntime().exec("tcpdump"); DataOutputStream os = new DataOutputStream(process1.getOutputStream()); BufferedReader osRes = new BufferedReader(new InputStreamReader(process1.getInputStream())); //ByteArrayInputStream osRes = (ByteArrayInputStream) process1.getInputStream(); // os.writeBytes("tcpdump -l port 80"); os.flush(); StringBuffer output = new StringBuffer(); try { while ((osRes.readLine()) != null) { output.append(osRes.readLine()); output.append("\n"); } } catch (Exception e) { throw e; } process1.waitFor(); tv.setText(output); setContentView(tv); } catch (Exception e) { throw e; } </code></pre> <p>any help?</p>
java android
[1, 4]
4,223,326
4,223,327
in Jquery, how can I alert one part of a JSON object? I get "undefined"
<p>I have a an array: </p> <pre><code>$result = array('statusAlert' =&gt; 'Your input was validated' 'input' =&gt; $input); // $input is a string json_encode($result); </code></pre> <p>in jQuery, I want to alert 'statusAlert' and 'input' separately? How do I access them?</p> <p>I tried <code>alert(result.statusAlert)</code>, <code>alert(result[0])</code>, <code>alert(result.statusAlert[0])</code> but none of them has worked. Thanks for your help. Regards.</p> <p>EDIT: I am trying to do that within the "success" callback function of <code>ajax()</code> in jQuery</p> <p>When I alert(result), I get:</p> <pre><code>{"statusAlert":"Your input was validated","input":"this is the string input"} </code></pre>
php javascript jquery
[2, 3, 5]
3,649,685
3,649,686
Python faster than C++? How does this happen?
<p>I'm using Windows7 using CPython for python3.22 and MinGW's g++.exe for C++ (which means I use the libstdc++ as the runtime library). I wrote two simple programs to compare their speed.</p> <p>Python:</p> <pre><code>x=0 while x!=1000000: x+=1 print(x) </code></pre> <p>C++:</p> <pre><code>#include &lt;iostream&gt; int main() { int x=0; while(x!=1000000) { x++; std::cout&lt;&lt;x&lt;&lt;std::endl; } return 0; } </code></pre> <p>Both not optimized.</p> <p>I ran c++ first, then i ran python through the interactive command line, which is much slower than directly starting a .py file.</p> <p>However, python outran c++ and turned out to be more than twice as fast. Python took 53 seconds, c++ took 1 minute and 54 seconds. </p> <p>Is it because python has some special optimization done to the interpreter or is it because C++ has to refer to and std which slows it down and makes it take up ram?<br> Or is it some other reason?</p> <p><strong>Edit:</strong> I tried again, with <code>\n</code> instead of <code>std::endl</code>, and compiling with the <code>-O3</code> flag, this time it took 1 min to reach 500,000.</p>
c++ python
[6, 7]
4,273,642
4,273,643
jQuery ajax POST params with ">" symbol problem
<p>I'm trying to get a textbox value which contains ">" symbol using jQuery ajax with POST method, but I'm not getting the textbox value with ">" symbol. I'm tired of find a solution, please could anyone help me to fix this problem.</p> <pre><code>&lt;div id="subi"&gt;&lt;input type="textbox" id="test"&gt;&lt;button onClick="sub()"&gt;Submit&lt;/button&gt;&lt;/div&gt; &lt;script type="text/javascript" src="js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function sub() { var result = { content : $('#test').val() }; alert(result); $.ajax({ url: 'subi.php', type: 'POST', contentType: "application/x-www-form-urlencoded;charset=UTF-8", data: result, dataType: 'text', success: function(html) { $('#subi').html(html); } }); } &lt;/script&gt; </code></pre>
php jquery
[2, 5]
4,572,098
4,572,099
Wait for function to finish before executing the rest
<p>When the user refreshes the page, <code>defaultView()</code> is called, which loads some UI elements. <code>$.address.change()</code> should execute when <code>defaultView()</code> has finished, but this doesn't happen all the time. <code>$.address.change()</code> cannot be in the <code>success:</code> callback, as it's used by the application to track URL changes.</p> <pre><code>defaultView(); function defaultView() { $('#tout').fadeOut('normal', function() { $.ajax({ url: "functions.php", type: "GET", data: "defaultview=true", async: false, success: function (response) { $('#tout').html(response).fadeIn('normal'); } }); }); } $.address.change(function(hash) { hash = hash.value; getPage(hash); }); </code></pre> <p>I'm at a loss as to how to make <code>$.address.change()</code> wait for <code>defaultView()</code> to finish. Any help would be appreciated.</p>
javascript jquery
[3, 5]
5,785,116
5,785,117
JQuery ASP.Net Performance Question
<p>The ASP.Net app (not MVC) is slow, someone heard that Jquery can speed things up by offloading work to the client. Due to security reasons Jquery/Client can't make Web Service calls so squirrely ways of having the code behind making Web Sevices calls and passing data back to the client are being done to Jquery popups, Jquery gidviews, Jquery (fill in blank of existing server side control). We've got Jquery AJAX going on along with Microsoft AJAX Update panels, which I'm worried about.</p> <p>Question is: Are we really going to get a performance boost (which my gut says No) or are we on our way to a slower, more painful app performance?</p>
asp.net jquery
[9, 5]
3,140,681
3,140,682
Check if checkbox is ALREADY checked on load using jQuery
<p>I am currently using</p> <pre><code> $("#some-box").click(function(){ $("#main-box").toggle(); }); </code></pre> <p>Which works well, except for when the checkbox is part of a page that saves the checkboxes status. If a checkbox is saved as ticked, the main-box (which is revealed when the checkbox is clicked) is hidden on reload, and is only visible if the checkbox is clicked, which in now would mean "unticked" checkbox (as expected with the toggle).</p> <p>How can I check on page load if the checkbox is already ticked, in which case to trigger the toggle automatically?</p> <p>Thanks guys.</p>
javascript jquery
[3, 5]
73,294
73,295
Problem with concat string in jquery animate
<pre><code>count = 0; total = 2; jQuery("#slide").everyTime(5000,function(i){ if(count == total-1) { count = 0; jQuery(this).stop().animate({backgroundPosition: "0px 0"}, {duration:1000}); } else{ jQuery(this).stop().animate({backgroundPosition: "-"+950*count+"px 0"}, {duration:1000}); count++; } }); </code></pre> <p>Hi all, i am trying to work on this. there are some problem with the "950*count". When ever i put an operator into this, it wont' work, but if i remove the *count, it work just fine.</p> <p>Can someone point out what the problem is?</p> <p>Thank you</p>
javascript jquery
[3, 5]
1,663,315
1,663,316
jQuery: Define multiple variables with a single chain?
<p>Is it possible to define multiple variables with a single jQuery chain?</p> <pre><code>var sectionTable = jQuery("#sectionsTable") var sectionTableRows = sectionTable.find("tr"); var sectionTableColumns = sectionTableRows.find("td"); </code></pre> <p>I don't know what the syntax would be if it is possible but if you took the 3 variables above how could you chain them and would it be considered good practice?</p> <p>Many thanks</p> <p>Chris</p> <p>EDIT:: Wow - thanks for all the comments. Sorry for being vague, what I was after was a better way if one exists of defining child variables from a parent. Thats why I thought of using the chain and wondered if a away existed. Thanks for the great advice.</p>
javascript jquery
[3, 5]
4,862,634
4,862,635
'Refire' jQuery every second?
<p>The following code adds a class to the last div:</p> <pre><code>$(".mydivs:last").addClass('added'); </code></pre> <p>This works on page load but the divs are in an animation, so the order changes. Is there a way to make the code run every second, so the class is added to the last div each time? </p> <p>For me I dont think it matters that eventually every div will have the new class. </p> <p>Thanks </p>
javascript jquery
[3, 5]
528,855
528,856
Disable checkbox based on text value
<p>I need to disable a checkbox when a user enters text into a text area, otherwise it would be active. I have tried most relevant events but I can't get it to work. onkeydown disables for the first press and onchange will work if the user enters something then deletes it. Nothing seems to disable it after they leave the text area.</p> <pre><code>&lt;script type="text/javascript"&gt; function enable_cb(textarea) { if ($(textarea).val() != "" ) { $("input.cmb").removeAttr("disabled"); } else { $("input.cmb").attr("disabled", true); } } &lt;/script&gt; Comments:&lt;br /&gt; &lt;p&gt;&lt;textarea name="issue" id="issue_ta" cols="50" rows="10" class="help" tabindex="2" title="Enter Detailed Description" onchange="enable_cb(this);"&gt;&lt;/textarea&gt;&lt;/p&gt; &lt;p&gt;&lt;input name="no_issue" type="checkbox" id="no_issue" class="cmb" /&gt;No Issues to Report&lt;/p&gt; &lt;p class="label"&gt;Enter Current Vehicle Mileage:&lt;/p&gt; &lt;p&gt;&lt;input type="tel" name="record_mileage" class="required" tabindex="3" title="&amp;nbsp;Enter Current Mileage&amp;nbsp;" size="25"/&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="submit" name="Submit" value="Send"/&gt;&lt;/p&gt; &lt;/form&gt; </code></pre>
javascript jquery
[3, 5]
2,037,723
2,037,724
Apply Jquery to generated content
<p>Hoping someone can point me in the right direction.</p> <p>I've got this code:</p> <pre><code>//nextButton processing $('.nextButton').on("click", function(){ //$('.nextButton').click(function(){ var querystring = $("#formStep").serialize() + "&amp;step=" + step + "&amp;session=" + session; // Ajax Call $.ajax({ type: "POST", data: querystring, url: "includes/processnext.php", dataType: 'json', success: function(msg){ $('.result').append(msg.answerRow); } }); // End Ajax Call }); </code></pre> <p>Now this works for the first .nextbutton on there, but the ajax result replaces it with a next next button.</p> <p>To fix this i tried using the Jquery .on() (old code commented out) but that doesn't seem to have solved it either.</p> <p>Any suggestions?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,853,008
2,853,009
Highlighting divs while scrolling with arrows
<p>So i've been stuck on this problem for a little while. Here is what im working with right now (a quick mock up). <a href="http://jsfiddle.net/coconnor/2UALk/2/" rel="nofollow">jsFiddle link</a></p> <p>I can get the thing to scroll and highlight the selected notes (and click on them), but the scroll bar is faster than the arrow scrolling. Does anyone know how to slow it down, or speed up the arrows. Or am i going about this the wrong way.</p> <p>Thanks for any help in advance</p>
javascript jquery
[3, 5]
2,456,704
2,456,705
change button background in an function on android sdk 15 and below
<p>on SDK 16 and above I can change button background by </p> <pre><code>messagesButton.setBackground(swapDrawable); </code></pre> <p>but this function does not work on sdk 15 and below. Is there a different way to change button background programmatically ?</p>
java android
[1, 4]
192,685
192,686
Parsing using mrss
<p>I'm trying to parse an mrss feed using jquery but am having some difficulty targeting the child element.</p> <p>Code:</p> <pre><code>$(xml).find("item").each(function(){ var $item = $(this); alert($item.find("media\\:thumbnail").text(); }); </code></pre> <p>MRSS Structure:</p> <pre><code>&lt;media:thumbnail url="http://somewebsite.com/someimage.jpg" /&gt; </code></pre> <p>UPDATE The solution $item.find("media\:thumbnail").attr("url") works very well in Firefox but running the code in Chrome reveals an undefined value. Can someone suggest a workaround.</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,157,528
4,157,529
How to get All Files Name Of Particular Folder From Server in Android without webservices
<p>How to get All Files Name Of Particular Folder From Server without webservices ? Suppose my folder is Located On LAn And its Address is <strong>http://192.168.93.23/DATA</strong></p> <p>Data Folder Contains Many Files So I want to Get All Files Name From Data Folder ? How i get all Files Names in Android Or Java ?</p> <p>Please Help Me</p>
java android
[1, 4]
2,785,192
2,785,193
Why can I not access the data attribute of an element with jQuery.
<p>I have the following HTML:</p> <pre><code> &lt;div class="button disabled dialogLink" id="edit" data-action="Edit" &gt; &lt;div class="sprite-blank" &gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>This javascript</p> <pre><code>$('.dialogLink') .click(function () { adminDialog(this); return false; }); function adminDialog($link) { "use strict"; link = { action: $link.data('action') || '' </code></pre> <p>I get an error saying </p> <pre><code>Uncaught TypeError: Object #&lt;HTMLDivElement&gt; has no method 'data' </code></pre> <p>Does anyone have an idea what I am doing wrong. It seems very simple code so I can't understand what's wrong.</p>
javascript jquery
[3, 5]
2,167,805
2,167,806
need help with jQuery when not hovering over a particular element
<p>I am having a navigation div (the id is navigation) i am thinking of writing a code that executes when i am not hovering over the navigation. Can somebody explain me how can that be possible with jQuery.</p> <pre><code> &lt;ul id='navigation'&gt; &lt;li&gt;a&lt;/li&gt; &lt;li&gt;b&lt;/li&gt; &lt;li&gt;c&lt;/li&gt; &lt;li&gt;d&lt;/li&gt; &lt;/ul&gt; </code></pre> <pre><code> #navigation li{ display:inline; float:left; width:50px; border-right:1px solid black; padding:2px; }</code></pre> <pre><code>jQuery("#navigation").mouseout(function(){ alert("hi"); });</code></pre> <p>Now with this code even when i am moving from one li to another mouseout function is called. However i am expecting it to be called everytime out of this navigation. </p>
javascript jquery
[3, 5]
710,619
710,620
Using System Exception
<p>I have a project I am creating and I am adding a reference to a class that generates an email where the exception happened and lots of good stuff. </p> <p>My question is. If I was to put this in a method and call it in the <code>Catch{}</code> how would i do this for the whole project so i could just name the method in the catch and it would know on every page of the project.</p> <pre><code>var exceptionUtility = new genericExceptions(); exceptionUtility.genericSystemException( ex, Server.MachineName, Page.TemplateSourceDirectory.Remove(0, 1) + Page.AppRelativeVirtualPath.Remove(0, 1), ConfigurationManager.AppSettings["emailSupport"], ConfigurationManager.AppSettings["emailFrom"], string.Empty); </code></pre>
c# asp.net
[0, 9]