Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
3,312,016
3,312,017
Check if element exists
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jquery">Is there an &ldquo;exists&rdquo; function for jQuery</a><br> <a href="http://stackoverflow.com/questions/4257906/jquery-determining-if-element-exists-on-page">jQuery determining if element exists on page</a> </p> </blockquote> <p><code>if(tr)</code> is returning true when tr is not an element, how do I check whether it's an element that exists?</p> <pre><code>var tr = $('#parts-table .no-data').parent(); $('.delete', row).bind('click', function (e) { that.delete(e.currentTarget); }); console.log(tr); if (tr) //returns true when it shouldn't </code></pre>
javascript jquery
[3, 5]
941,483
941,484
Jquery - hover event disappears after mousedown event is triggered.
<p>Have an issue with a jquery script. Page loads with the script below. The hover event works fine. However, if the mousedown event fires, the hover event functionality subsequently disappears and I don't get any rollovers. Any ideas as to why and how to keep the hover event firing off each and every time? Viewing the page in IE.</p> <pre><code>// Rollover effect for sign. $("#sign").hover(function () { $("#sign").css('background', 'url(img/default/signinon.png) no-repeat 0 0'); }, function () { $("#sign").css('background', 'url(img/default/signin.png) no-repeat 0 0'); }); //Mousedown function... $(document).mousedown(function (event) { var $target = $(event.target); // A click outside of the sign in panel or a click on the sign in button when the body panel is visible, hides the display. if ((!$target.is('#sign') &amp;&amp; !$target.is('#sign-in-panel') &amp;&amp; !$target.parents().is('#sign-in-panel') &amp;&amp; !$target.parents().is('#sign')) || ($target.is('#sign') &amp;&amp; $("#sign-in-panel").css('visibility') == 'visible')) { $("#sign-in-panel").css('visibility', 'hidden'); $("#sign").css('background', 'url(img/default/signin.png) no-repeat 0 0'); } else { // Show the panel $("#sign-in-panel").css('visibility', 'visible'); } }); </code></pre>
javascript jquery
[3, 5]
457,496
457,497
Efficiently read binary data into int[]
<p>I have binary data in a file (a list of 32-bit integer values) that I need to get into an int array efficiently. I can't see any way to do this other than loading the data into a byte[] and then converting it into an int[] one element at a time. This is too slow for the amount of data I need to load. It takes about 3 seconds to do the conversion on an actual phone. Reading the data from the file in the byte[] is pretty much instantaneous.</p> <p>Are there any libraries that use native methods for reading an int[] from a file, or for converting a byte[] to int[]?</p>
java android
[1, 4]
4,718,584
4,718,585
jquery animation issue in IE
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6139924/jquery-not-proceeding-to-next-page">jquery not proceeding to next page</a> </p> </blockquote> <p>I have jquery, it works fine in FF, but issue is with IE, image is loading but animation is not happening.</p> <p>html source code:</p> <pre><code>&lt;SCRIPT type="text/javascript"&gt; var $ = jQuery.noConflict(); $('#toHide').show().doTimeout(100,function() { $('#toHide').find('safeForma3').submit();}); &lt;/SCRIPT&gt; </code></pre> <p>html code: </p> <pre><code>&lt;div id="toHide" class="pb-text-align-center"&gt; &lt;img style="display: inline" src="img/load.gif" /&gt; &lt;form wicket:id="safeForm" class="clearfix"&gt; &lt;input type="hidden" wicket:id="submitted" value="false" /&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>goto this link <a href="https://admit.belgacom.be/WCE/ESW/selectBundle/productId/hbs_pstn_int_comf" rel="nofollow">https://admit.belgacom.be/WCE/ESW/selectBundle/productId/hbs_pstn_int_comf</a> and click new customer, street as rue maes, no as 7, postcode as 1000. click continue, in FF iamge with animation is happening, but in IE only images are shown but no animation is happening.</p>
javascript jquery
[3, 5]
3,969,527
3,969,528
Adding cells in GridView
<p>How can i add cell in specific column for each row in gridview,i want to use <strong><em>RowCreated</em></strong> Events.</p> <p>i have gridview that has 3 columns (ProductName, Price, Count) i get (ProductName, Price) from database, and i want to add value for (count), ex: (Kitkat, 2$ ) i want to add number 5 to (count) column, i want to handle this operation when each row created.</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,351,505
5,351,506
java.lang.RuntimeException: java.net.UnknownHostException: Host is unresolved:
<p>I am having a problem while parsing XML file,i used newsRSS parser as a reference.but i am getting this error in the real device.how to display an error message like alert for the user and let him stay on the app without crashing?</p> <p>this is the peace of the code that do the connection and parsing:</p> <pre><code>protected Config_Parser(String feedUrlString,Context context){ this.context = context; try { this.feedUrl = new URL(feedUrlString); } catch (MalformedURLException e) { throw new RuntimeException(e); } } protected InputStream getInputStream() { try { return feedUrl.openConnection().getInputStream(); } catch (IOException e) { Log.e("Error", "error happned"); return null; //throw new RuntimeException(e); } } </code></pre> <p>how may i handle this error with sending alert to the user without crashing or exiting the application?</p> <p>Thanks for help :)</p>
java android
[1, 4]
2,438,928
2,438,929
ValidatorCalloutExtender not showing when validated control resides in jQuery dialog
<p>I have a form which is displayed in a jQuery dialog box. This form contains an ASP.Net RequiredFieldValidator and uses the AjaxToolkit's ValidatorCalloutExtender to display the error message.</p> <p>If the form is displayed outside of the Dialog box then the ValidatorCalloutExtender works fine, but when used inside the dialog box the ValidatorCalloutExtender does not show on the screen. Is it possible that the Dialog's Z-Order is causing the callout to be hidden behind the dialog?</p>
jquery asp.net
[5, 9]
397,630
397,631
How to check if it has class in jQuery?
<p>How can I check if a the <code>#load</code> div has a class also?</p> <pre><code>if (cap &gt; 20) { $(".p" + (cap-9)).slideto({ slide_duration : 'slow' }); } </code></pre>
javascript jquery
[3, 5]
3,765,372
3,765,373
.click() event when 'Open in new tab/window'
<p>When I use <code>.click()</code> on an <code>&lt;a&gt;</code> tag, the event only works when I click on the element. Otherwise, if the user does a Right Click > Open in new window or Open in new tab, it doesn't trigger the <code>click()</code> event.</p> <p>So, my question is...how do I trigger the <code>click()</code> event when user does right click > open in new tab/window?</p> <p>Here is the HTML:</p> <pre><code>&lt;a href="url"&gt;Click Me&lt;/a&gt; </code></pre> <p>Here is the Js:</p> <pre><code>$("a").click(function(){ alert('You clicked me!'); }); </code></pre>
javascript jquery
[3, 5]
3,080,751
3,080,752
Check a table row cell for contents
<p>I want to use jQuery to check if the 2nd cell in each table row of a table contains any text, if the 2nd cell doesn't contain any text then set the table row to display: none;</p> <p>Whats the best way to go about this?</p> <p>HTML:</p> <pre><code>&lt;table id="results"&gt; &lt;tr&gt; &lt;td&gt;Results&lt;/td&gt; &lt;td&gt;1000&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Description&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;!-- This cell is empty so hide row --&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Time/Date&lt;/td&gt; &lt;td&gt;14:03 22/01/12&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
708,044
708,045
How to retrieve domain name from a webview?
<p>I want to be able to retrieve the domain name in a webview in which the user is able to enter in the URL. I want to post the domain name instead of the URL if this is possible. Any help is greatly appreciated.</p>
java android
[1, 4]
2,840,809
2,840,810
Execute code within window.load if content takes longer than 7s to load
<p>As it says in the title I've got a window.load line:</p> <pre><code>$(window).load(function() { //Some Code }); </code></pre> <p>So once everything is loaded I execute <code>//Some Code</code>, however I want to make it so if content is not loaded, lets say within 7 seconds (maybe large image file, or missing file occurs etc..) than execute <code>//Some Code</code> even if content is not fully loaded. How can I achieve this task?</p>
javascript jquery
[3, 5]
3,239,965
3,239,966
ASP.NET ID Placeholder Name
<p>When I moved some of my pages to a different server, the ASP.NET started rendering the controls ID without the master page placeholder. So, before it used to be rendered like this <code>ctl00_MainContent_control1</code> and now it is <code>MainContent_control1</code>. What could of caused this change and if there's a way to control it?</p>
c# asp.net
[0, 9]
2,673,494
2,673,495
How to 'grep' one portion of a line out by php script?
<p>I have a little problem. I have written php script and javascript that allows me to 'grep' line using function of the 'date', but is it possible to just grep one portion of the line out only? </p> <p>For example, I have taken out this line from report.txt(Which is simply a log file) using the date's function(2010-11-06) and put it in a new text file(Testing.txt): </p> <p><code>ToHoneynet 2010-11-06 10:51:48.0 ICMP PING 3 url www.snort.org/pub-bin/sigs.cgi?sid=384 134.25.234.23 8 1 115.42.150.38 0 1</code></p> <p>From here, I would like to 'grep' and write the IP address: 134.25.234.23 out only. How am I going to do it? </p> <p>Below are my PHP script and javascript. Thanks! </p> <p>//Read date value </p> <pre><code>function checkDate(Date) { var date = /^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/; if (date.test(Date)) { var dates = "y=" + Date; $.post("date.php", dates, function(data) { alert("Searching for Date... "); }); } else { alert("Invalid Date"); } } </code></pre> <p>//date.php <pre><code>foreach ($lines as $line_num =&gt; $line) { $pos = strpos($line,$Date1); if($pos === false) { echo "Cannot grab line"; } else { $myFile = "Testing.txt"; $fh = fopen($myFile, 'w') or exit ("Cannot open File"); fwrite($fh, $line); fclose($fh); } } </code></pre> <p>?></p>
php javascript
[2, 3]
300,233
300,234
Javascript / jquery ScrollLeft build up
<p>I've been trying to build a timeline / tube line widget. The idea being that the user is presented with something which looks like a train line on the london underground - but will be populated with dates. Anyhow, this is what I've produced so far. It sort of works...</p> <p><a href="http://jsfiddle.net/allegris/GCyVN/" rel="nofollow">http://jsfiddle.net/allegris/GCyVN/</a></p> <ol> <li><p>Build out track, and ensure that on page load, we're at the beginning of the track.</p></li> <li><p>When hovering right Scroll right, if not scrolling, and not at the end of the scrollable area. On mouseOut, test to see if we're at a station. If we're not at a station, keep scrolling until we are, and then stop.</p></li> <li><p>When hovering left Scroll right, if not scrolling, and not at the beginning of the scrollable area. On mouseOut, test to see if we're at a station. If we're not at a station, keep scrolling until we are, and then stop.</p></li> <li><p>Figure out a way to switch direction when required.</p></li> </ol> <p>I'm still trying to learn javascript (bought the excellent eloquent javascript), but sort of get by in jquery... so I dare say that there is a far more elegant, and cleaner way to do this.</p> <p>I opted to use scrollLeft because it was less juddery than animating (found info about this at jquery for designer) - however, I'm having the occasional issue when flicking back and fourth between the left and right scroll.... the scroll appears to accelerate... it builds up and gets faster and faster. I stuck in some variables to test if its scrolling or not etc, but this seems a bit hit or miss. I've re-written it 4 times, in a variety of ways...</p> <p>I'm stumped... so if anyone can point me in the right direction (even if it means I've got to rewrite the lot) that would be great :)</p> <p>Kind regards, Rob</p>
javascript jquery
[3, 5]
3,655,071
3,655,072
Why Java could have many Main that you can decide which java file you want to run, but for C++ you are only one Main?
<p>Every time I write C++, I need put different code in to main, is there any way make it simple, like a1.cpp has main, a2.cpp has another main, like in a1.cpp</p> <pre><code>int main() { printf("a1"); } </code></pre> <p>and in a2.cpp</p> <pre><code>int main() { printf("a2"); } </code></pre> <p>when you run a1.cpp you get <code>a1</code> printout, when you run <code>a2</code>, you get string <code>a2</code>, how can i do it?</p>
java c++
[1, 6]
3,932,414
3,932,415
Use Custom View In XML Layout
<p>I have a custom view:</p> <pre><code>public class Loading extends View { private long movieStart; private Movie movie; public Loading(Context context, InputStream inputStream) { super(context); movie = Movie.decodeStream(inputStream); } @Override protected void onDraw(Canvas canvas) { canvas.drawColor(Color.WHITE); super.onDraw(canvas); final long now = SystemClock.uptimeMillis(); if(movieStart == 0) movieStart = now; final int relTime = (int)((now - movieStart) % movie.duration()); movie.setTime(relTime); movie.draw(canvas, 0, 0); this.invalidate(); } } </code></pre> <p>How can I use this view in XML layout? How can I pass the parameters (Context, InputStream) in XML layout?</p>
java android
[1, 4]
1,276,747
1,276,748
Implementing BluetoothChat in emulator
<p>I want to implement the bluetooth chat in my Emulator while application running in Eclipse. Plz help me. . . </p> <p>Same way i also want to implement the Online chat threw the Emulator. Is it possible ? And if it is then plz give me the Sollution for it.</p> <p>Thanks.</p>
java php android
[1, 2, 4]
1,741,128
1,741,129
Change text inside dynamic div when on select change is made jquery
<p>I have a title for my drop down that is dynamically given and I can currently change it when the page loads. But once I select an item from the drop down it changes back. I am looking for a simple jquery js solution that can help keep the name when an item is selected.</p> <p>I need to change the text in: #shippingStateSpan from Destination State -> Destination Province and leave that way even after something is selected.</p> <p>Here is my html:</p> <pre><code>&lt;div class="shippingStateDiv"&gt; &lt;span id="shippingStateSpan"&gt;Destination State&lt;br /&gt; &lt;/span&gt; &lt;select name="shippingState" id="shippingState" class="shippingDropDown" onchange="ApplyTaxRate(this.value,4040828,1,1,0);"&gt; &lt;option value="-1" selected="selected"&gt;Please Select&lt;/option&gt; &lt;option value="129654"&gt;AB&lt;/option&gt; &lt;option value="129653"&gt;BC&lt;/option&gt; &lt;option value="129652"&gt;MB&lt;/option&gt; &lt;option value="129647"&gt;NB&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; </code></pre> <p>Here is my js I use to make the change on initially (But it changes back after I select something) I assume a jquery .on function may be possible but I an not sure how to do it. Thanks for the help.</p> <pre><code>&lt;script type="text/javascript"&gt; $("#shippingStateSpan").text("Destination Province"); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,076,026
3,076,027
What is the cleanest way to disable postback controls until the page has fully loaded?
<p>I have a website that has some intense graphics, and people with slow connections might require download time. While their browser is downloading, they have form options. And a lot of times they will fill the form out and hit submit.</p> <p>This causes an event validation issue, because the page wasn't fully loaded. I can think of a lot of ways off the top of my head to fix this. I could go back and disable every single control, and then write javascript to enable these controls clientside when the page is loaded.</p> <p>I also looked into blockui, but it will block the whole page or just a div. I am looking for something I can stick in my masterpage and forget about it.</p> <p>Any ideas?</p>
javascript asp.net
[3, 9]
2,360,462
2,360,463
Writing to a file
<p>I am extracting content from a web page using JS/JQuery and want to write the data to a comma separated file. I know javascript doesn't really support file io and I'm trying to avoid setting up a local apache server just to process the content to a file. Is there an easier way to do this?</p>
javascript jquery
[3, 5]
3,912,249
3,912,250
How to get correct table format ? Jquery ques
<p>This code prints output as given below... <strong>code</strong>:</p> <pre><code>$('#calendar').append('&lt;table&gt;&lt;thead&gt;&lt;tr&gt;'); var i; for(i=0;i&lt;=6;i++) { $('#calendar').append('&lt;td&gt;'+week[i]+'&lt;/td&gt;'); } $('#calendar').append('&lt;/tr&gt;&lt;/thead&gt;'); $('#calendar').append('&lt;/table&gt;'); </code></pre> <p><strong>output</strong>:</p> <pre><code>&lt;section id="calendar"&gt;&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;/table&gt;&lt;td&gt;Sunday&lt;/td&gt;&lt;td&gt;Monday&lt;/td&gt;&lt;td&gt;Tuesday&lt;/td&gt;&lt;td&gt;Wednesday&lt;/td&gt;&lt;td&gt;Thursday&lt;/td&gt;&lt;td&gt;Friday&lt;/td&gt;&lt;td&gt;Saturday&lt;/td&gt;&lt;/section&gt; </code></pre> <p>But i expect something in this structure..</p> <pre><code>&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;td&gt;...&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;/table&gt; </code></pre>
jquery javascript
[5, 3]
4,720,794
4,720,795
Android vibration intensity and damage
<p>I realize this is not strictly a code question, but I guess it belongs here anyway. If not, my apologies in advance.</p> <p>Being as there's no inbuilt way to change the vibration intensity for the droid in code I'm using a kind of PWM control (switching the vibrator on and off at high frequency gives me a kind of control over vibration intensity). Right now I'm using a 20ms period (for example, with a 50% duty cycle the vibrator is on for 10ms and off for 10ms and it kind of feels like half power).</p> <p>My question is, can some damage occurr to the vibrator motor using this kind of control?</p>
java android
[1, 4]
2,070,323
2,070,324
Implementing "Donate" functionality
<p>I have created a free Android app, and i want to implement "donate" functionality, but have no idea how to do it? Can someone help me with that? Some tutorial or something like that? How to implement it for countries not supported bu PayPal?</p>
java android
[1, 4]
5,729,949
5,729,950
How to make such a structure?
<p>What type of structure is this, and how to I make such using a loop?</p> <pre><code>var movies = [ { Name: "The Red Violin", ReleaseYear: "1998" }, { Name: "Eyes Wide Shut", ReleaseYear: "1999" }, { Name: "The Inheritance", ReleaseYear: "1976" } ]; </code></pre> <p>I am using <code>each</code> for the loop</p> <pre><code>$.each(result, function(key, value){ movies??? = this.name; movies??? = this.year; }); </code></pre>
javascript jquery
[3, 5]
50,741
50,742
Is there a way to receive broadcast each time any activity is launched?
<p>for android developers</p> <p>my goal is to saved when any activity is launched...</p> <p>For instant is there is three activity launched during the last hour, I want to save it into a database.</p> <p>Of course I could launch a service and check every seconds what activity is launched but it would use phone battery!</p> <p>thanks for your answers.</p>
java android
[1, 4]
4,773,698
4,773,699
Swap Divs onmouseover of table rows
<p>I'm looking for a way that I can swap between divs when I hover over table rows and the only solution I've found is that effect when hovering over a list. I really don't understand jquery fully yet so I'm hoping its just a simple change that can be made.</p> <p>This is the code that I came across for hovering over a list, the only change that I want is for the list to be a table.</p> <pre><code>script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $("#switches li").mouseover(function () { var $this = $(this); $("#slides div").hide(); $("#slide" + $this.attr("id").replace(/switch/, "")).show(); $("#switches li").css("font-weight", "normal"); $this.css("font-weight", "bold"); }); }); &lt;/script&gt; &lt;ul id="switches"&gt; &lt;li id="switch1" style="font-weight:bold;"&gt;First slide&lt;/li&gt; &lt;li id="switch2"&gt;Second slide&lt;/li&gt; &lt;li id="switch3"&gt;Third slide&lt;/li&gt; &lt;li id="switch4"&gt;Fourth slide&lt;/li&gt; &lt;/ul&gt; &lt;div id="slides"&gt; &lt;div id="slide1"&gt;Well well.&lt;/div&gt; &lt;div id="slide2" style="display:none;"&gt;Oh no!&lt;/div&gt; &lt;div id="slide3" style="display:none;"&gt;You again?&lt;/div&gt; &lt;div id="slide4" style="display:none;"&gt;I'm gone!&lt;/div&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
1,264,163
1,264,164
How to Select All Div's which have a children image with some specfic src?
<p>Let's say I have,</p> <pre><code>&lt;div&gt; &lt;img src='aaBB_a.png' /&gt; &lt;/div&gt; &lt;div&gt; &lt;img src='aaa_a.png' /&gt; &lt;/div&gt; &lt;div&gt; &lt;img src='aaBB_a.png' /&gt; &lt;/div&gt; </code></pre> <p>I need to select all div's (not images) which contain a img child which src contain BB_. In above example, I need to select first and third(not second). I have tried this, </p> <pre><code>'div img[src*="BB_"]', </code></pre> <p>But it is selecting images not div.</p> <p><strong>Update</strong>: I need to pass this to jquery delegate,</p> <p>$('#container').delegate('div img[src*="BB_"]','mouseover',function(){ })</p>
javascript jquery
[3, 5]
328,556
328,557
javascript execution order
<p>I am starting to learn Javascript and jQuery. I wanted to make a simple slide show with jQuery which displays list unordered list items one by one.</p> <p>My code is here: <a href="http://jsfiddle.net/aganhuyag/wZQGq/" rel="nofollow">on jsfiddle</a></p> <p>I thought that I'd make the slideshow by iterating over list items in a for loop and display them with fadeIn and fadeOut effects like below:</p> <pre><code>for(var i = 0; i &lt; 3; i++) { $('#slider li:nth-child('+ i +')') .fadeIn() .delay(1000) .fadeOut(); } </code></pre> <p>But it only shows the last item in the list.</p> <p>I read that I need to close the value of <code>i</code> variable in a separate function because of the Javascript scope that it sees the value of <code>i</code> is being increased to 2 in the loop. So, I made a separate function which closes the value of <code>i</code> and called the function. But it was still same, displaying the last item of the list.</p> <p>So, I just wanted to try without the loop by making two separate effects on list items like below:</p> <pre><code>$('#slider li:first-child') .fadeIn() .delay(1000) .fadeOut(); $('#slider li:nth-child(2)') .fadeIn() .delay(1000) .fadeOut(); </code></pre> <p>But it doesn't display the list items sequentially like written above. When you run the code, it seems like the first item is shown really fast and the last item is displayed as intended.</p> <p>I have written it like a C or Java code, thinking that it would execute from top to bottom. But it seems like Javascript is different and I didn't understand a key concept of Javascript.</p> <p>So, my question is why it is not displaying the list items in order and only displaying the last item, and what should I need to know to make it work as intented.</p> <p>Thank you.</p>
javascript jquery
[3, 5]
2,156,309
2,156,310
Get last ID of dynamic div
<p>Couldn't find an answer, but Im trying to get the last ID of the last div that was created on the page. The code I'm using doesn't seem to work using .last(). My syntax is probably wrong but I can't get it to show the ID.</p> <pre><code> jQuery(document).ready(function() {jQuery("a.more_posts").live('click', function(event){ jQuery("div[id^='statuscontainer_']").last(); var id = parseInt(this.id.replace("statuscontainer_", "")); alert(id); }); }); </code></pre> <p>I figured out to do it this way and this worked.</p> <pre><code>jQuery(document).ready(function(){ jQuery("a.more_posts").live('click', function(event){ jQuery("div[id^='statuscontainer_']:last").each(function(){ var id = parseInt(this.id.replace("statuscontainer_", "")); alert(id); }); }); }); </code></pre>
javascript jquery
[3, 5]
3,260,633
3,260,634
Can I cancel postback when user presses return in a textbox?
<p>I have a <code>textbox</code> whose input is being handled by jQuery.</p> <pre><code>$('input.Search').bind("keyup", updateSearchTextbox); </code></pre> <p>When I press <code>Enter</code> in the textbox, I get a postback, which messes everything up. How can I trap that Enter and ignore it?</p> <p>(Just to preempt one possible suggestion: The textbox has to be an <code>&lt;asp:textbox ... /&gt;</code> - I can't replace it with an <code>&lt;input ... /&gt;</code>.)</p>
asp.net jquery
[9, 5]
788,271
788,272
SelectedValue is invalid - doesn't exist in list - C#/ASP.NET
<p>Exception is: 'Country' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value</p> <pre><code>UserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, "Country"); Country.DataSource = dsCountry.tblDropDownValues; Country.DataTextField = "AttrValue"; Country.DataValueField = "Id"; Country.DataBind(); </code></pre> <p>The values held within dsCountry.tblDropDownValues are:</p> <pre><code>Id AttrValue AttrName aefa28e0-a118-11dd-ad8b-080c210c9a66 PLEASE SELECT Country 213a743e-ea0b-419c-bd44-03b1c35241b3 USA Country eefa1387-8dc0-11d8-975f-13da67a41a5d CANADA Country </code></pre>
c# asp.net
[0, 9]
559,495
559,496
How to change the <font size> of SC Editor?
<p>I've been using SC Editor, but for font size it uses <code>&lt;font size="number"&gt;&lt;/font&gt;</code>. Is there anyway to change it to <code>&lt;span class="font+number"&gt;&lt;/span&gt;</code>?</p> <p>I've been looking in the plugin JS, but couldn't find anything. Can anyone help?</p> <p>Thanks in advance.</p>
php jquery
[2, 5]
446,734
446,735
How to give connection string as a key value?
<p>I want to give connection string as a key. So I write in web.config this code.</p> <p></p> <pre><code> &lt;add key="connectstring" value="Data Source=USER-PC;Initial Catalog=DBName; Integrated Security=False; providerName=System.Data.SqlClient"/&gt; &lt;/appSettings&gt; </code></pre> <p>but there is error and it says</p> <pre><code>Keyword not supported: 'providername'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Keyword not supported: 'providername'. Source Error: Line 28: SqlConnection conn; Line 29: conn = new SqlConnection(ConfigurationManager.AppSettings["connectstring"].ToString()); Line 30: Line 31: </code></pre> <p>How can I solve it??</p>
c# asp.net
[0, 9]
462,391
462,392
Interfering jQuery scripts
<p>This DID work fine for a long time, then when i was tidying up some code today it stopped working and i can't see why...</p> <p>This code currently works:</p> <pre><code>&lt;script type="text/javascript" src="/sideswap/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/sideswap/jquery.sideswap.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(window).load(function() { $('#rotating-elements').sideswap({ next : '&lt;img src="/sideswap/next.png" /&gt;', previous : '&lt;img src="/sideswap/prev.png" /&gt;', transition_speed : 100, auto_run : true }); }); &lt;/script&gt; </code></pre> <p>This code used to work:</p> <pre><code>&lt;script src="/quotator/jquery-1.3.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/quotator/quotator.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#quotes").quotator({ speed : 10000, json : "/quotator/quotator_quotes.js" }); }); &lt;/script&gt; &lt;div id="quotes"&gt; &lt;/div&gt; </code></pre> <p>The second script only works when placed lower down the page than the first, however it needs to be (and was before) in the sidebar higher up the page.</p> <p>I have no idea how i caused this!!</p>
php javascript jquery
[2, 3, 5]
4,627,075
4,627,076
Dataset Sorting using C# on a column with Datetime datatype
<p>I am having a dataset (Dataset ds) and below you can find the field with demo data inside the dataset. In my Dataset , their is column with name Date (Datatype- DateTime) and i want to sort this column.I cant do the sorting from SQl because the Dataset is a merge of 2 Different Dataset. Please help me that how i do the sorting in dataset. </p> <pre><code>Date Volume 07/19/201211:30AM 12 07/18/201201:30PM 13 07/17/201203:30PM 22 </code></pre>
c# asp.net
[0, 9]
267,488
267,489
jQuery: Carrying input text from tab to another tab
<p>I have an html with few tabs. In all of tabs there's an input type=text. If i type something in the input on tab1, how can it be typed to the rest of the inputs in the other tabs too?</p> <p>I would guess its something similar here in stackoverflow when you ask a question and you get a preview box underneath but instead that would be an input too.</p> <p>If input id's are input1, input2 and input3 can someone show me a quick way if possible?</p> <p>Thanks alot</p>
javascript jquery
[3, 5]
4,816,699
4,816,700
Android - ACTION_UP not detected
<p>I am unable to figure out why the ACTION_UP event is not being fired when I move my finger away from contact in the following code.</p> <pre><code>public boolean onTouch(View v, MotionEvent event) { switch(event.getActionIndex()){ case MotionEvent.ACTION_UP: Utils.log("Touch Up"); break; case MotionEvent.ACTION_DOWN: Utils.log("Touch Down"); break; } return true; } </code></pre>
java android
[1, 4]
3,121,458
3,121,459
Run trough one rgba to another based on percentage
<p>Let's say i have this both rgba codes:</p> <p><strong>rgba(150, 160, 255, 1)</strong> and <strong>rgba(195, 0, 0, 1)</strong></p> <p>I want to pass from one to another by a 0/100 percentage.</p> <p>0% will be <strong>rgba(150, 160, 255, 1)</strong></p> <p>100% will be <strong>rgba(195, 0, 0, 1)</strong></p> <p>I'm trying to make a HeatMap with this.</p> <p>How can i determinate what rgba will be at let say... 30%!?</p>
javascript jquery
[3, 5]
995,712
995,713
Android dev - TextView won't show up
<p>I just started experimenting with Android app development and so I decided to give Android's own tutorials a go (this one: <a href="http://developer.android.com/training/basics/firstapp/starting-activity.html" rel="nofollow">http://developer.android.com/training/basics/firstapp/starting-activity.html</a> ) </p> <p>The textview in my new activity just won't show. Here's my code:</p> <pre><code>public class DisplayMessageActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* Get the intent and the message sent with it */ Intent intent = getIntent(); String message = intent.getStringExtra(GoogleTutActivity.EXTRA_MESSAGE); /* Create a new textview where we can show the message the user sent */ TextView textView = new TextView(this); textView.setTextSize(40); textView.setText(message); setContentView(R.layout.activity_display_message); } } </code></pre>
java android
[1, 4]
4,843,003
4,843,004
Loading an image dynamically works only in Chrome
<pre><code>image = document.createElement("image"); image.src ="http://jsfiddle.net/img/logo.png"; e = document.getElementById('id'); $(image).load(function() { $(image).hide(); e.appendChild(image); $(image).fadeIn(1000); }); </code></pre> <p>What makes this code to run only in Chrome? <a href="http://jsfiddle.net/QLFf3/1/" rel="nofollow">http://jsfiddle.net/QLFf3/1/</a></p>
javascript jquery
[3, 5]
3,195,258
3,195,259
Writing a string to textfile in Android
<p>How Can I write a String to a text file,I should be able to specify the location of the file(or some how open and see its content,It is not necessary that it should be located in Computers memory), please provide me with the code snippet. Thank you in advance for all the responses.</p>
java android
[1, 4]
975,255
975,256
Plus sign in query string
<p>I have a webapp created using C# and asp.net. I placed a parameter value in the querystring with a plus(+) sign. But the plus sign disappear.</p> <p>How can I include the plus sign(+) in the query string without disappearing?</p> <p>Please advise.</p> <p>Thanks.</p> <p>Edit: added code with UrlEncode</p> <pre><code>string str = Server.UrlEncode(Requery.QueryString["new"]); </code></pre>
c# javascript asp.net
[0, 3, 9]
2,131,615
2,131,616
How do I use multiple selectors in jQuery?
<p>I am using the following code to apply a hover effect to a set of images within a div called toolbar:</p> <pre><code>$("#toolbar img").hover( function() { this.src = this.src.replace("_off", "_on"); }, function() { this.src = this.src.replace("_on", "_off"); } ); </code></pre> <p>But I also want to apply the same effect to a div called tabs without repeating the same code. cant I do something along these lines:</p> <pre><code>$("#toolbar, #tabs img").hover( function() { this.src = this.src.replace("_off", "_on"); }, function() { this.src = this.src.replace("_on", "_off"); } ); </code></pre> <p>The problem is the above only applies to the "tabs" div, while the toolbar stops working. I think I am just getting the jQuery syntax wrong, still sorta new to jQuery</p>
javascript jquery
[3, 5]
1,738,333
1,738,334
Does PHP allow *.properties file as in Java?
<p>Is there a way to use a *.properties file in PHP as you do in Java? I'd like to store some application-level constants in a properties or XML file and easily call them from throughout my code. Your guidance is much appreciated. Thanks.</p>
java php
[1, 2]
1,076,186
1,076,187
how to call to javascript function in the same file using php?
<p>I have php file called "PhpCallJavascript".</p> <p>I try to call to function <code>CreateSVG()</code> from php code.</p> <p>it is not working should I need here ajax?</p> <p>or somthing else?</p> <p>thx for any help.</p> <p>the php file:</p> <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;?php echo '&lt;script type="text/javascript"&gt;', 'CreateSVG();', '&lt;/script&gt;'; ?&gt; &lt;script&gt; $(document).ready(function() { function CreateSVG(){ var xmlns = "http://www.w3.org/2000/svg"; alert(xmlns); } }); &lt;/script&gt; </code></pre>
php javascript jquery
[2, 3, 5]
1,144,853
1,144,854
Adding items to select (list box) of html/php through jQuery or javascript
<p>Is it possible to add items to a select (list box) of html/php through jQuery or javascript when a specific action is triggered by another control in jQuery/javascript? <em>(edited by <a href="http://stackoverflow.com/users/611306/alex-thomas">Alex Thomas</a>)</em></p>
php javascript jquery
[2, 3, 5]
2,160,149
2,160,150
Why is jquery progressbar giving the following error: Object [object Object] has no method 'progressbar'?
<p>Im trying to add a progressBar to my site. I have looked at <a href="http://docs.jquery.com/UI/Progressbar" rel="nofollow">http://docs.jquery.com/UI/Progressbar</a> and written the following code:</p> <pre><code>&lt;div&gt; &lt;h2&gt;@Model.First().Category.category_name&lt;/h2&gt; &lt;div id="progressBar"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>And</p> <pre><code>$(document).ready(function () { $("#progressBar").progressbar({ value: 37 }); } </code></pre> <p>But Chrome displays the following error:</p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'progressbar' </code></pre> <p>I am using</p> <pre><code>&lt;script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>How can i fix this? Thanks</p>
javascript jquery
[3, 5]
436,249
436,250
What is the best way to identify logged user?
<p>I was looking for the efficient way to track the logged users when using <code>asp.net</code> <code>login control</code></p> <pre><code> if (!IsPostBack) { if (Membership.GetUser() != null) { var user = Membership.GetUser(); Session["user"] = user; } else { Session["user"] = ""; } } </code></pre> <p>Any suggestions will be appreciated </p>
c# asp.net
[0, 9]
5,603,613
5,603,614
Div created from code doesn't load classes
<p>I have div container and inside couple div with class demo and gravity like</p> <pre><code>&lt;div id="container" style="position:relative;width=400px;height=400px;"&gt; &lt;div class="demo gravity" &gt;&lt;/div&gt; &lt;div class="demo gravity"&gt;&lt;/div&gt; &lt;div class="demo gravity"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>and I add new div from code like </p> <pre><code> var temp = $('&lt;div/&gt;'); temp.attr('id', 'foo'); temp.css( { position : 'absolute', top : '0px', left : '0px', width : '200px', height : '40px' }); temp.addClass("gravity"); temp.addClass("demo"); $('#container').append(temp); </code></pre> <p>in onReady function I have code something like </p> <pre><code>$(.demo).resizable().draggable().droppable() ; </code></pre> <p>and it works for divs inside but it doesn't work for div which I added from code. Div from code shows inside div with id="container" but is not resizable/draggable/droppable. Does anybody knows what is the problem ?</p>
javascript jquery
[3, 5]
2,338,830
2,338,831
Wait/Pause/Sleep in jQuery Each Loop between Iterations
<p>I simply want to add a pause after each iteration of a jQuery each loop, I can't seem to figure it out.</p> <pre><code>$(".item").each(function(i){ var el = this; var timer = setTimeout(function(){ $(el).trigger("click"); }, 500); }); </code></pre> <p>This is not firing every 1/2 second, but rather triggering click on all items at once.</p> <p>I want something like this (pseudocode):</p> <pre><code>$(".item").each(function(i){ $(this).trigger("click"); wait(500); // wait a half second before the next iteration }); </code></pre> <p>Any working method of this?</p>
javascript jquery
[3, 5]
3,436,120
3,436,121
to Swap elemnts(with className too) when Draged & Dropped
<p><em><strong>Swapping two elements whenever one element dragged and dropped over another element. I used <a href="http://www.eslinstructor.net/demo/swappable/swappable_grid.html" rel="nofollow">Vadim's JQuery plugin</a> and it's working but i have an issue with height,Width,position &amp; float of swapped elements.</em></strong> </p> <p><em>Swapped elements doesn't fit if the className &amp; it's attributes were different. Should i swap the className too OR just swap only certain attributes.</em></p> <p><strong>* <a href="http://jsfiddle.net/bibhaw/vtBVR/47/" rel="nofollow">for better understanding please check my demo</a>*</strong></p>
javascript jquery
[3, 5]
5,848,229
5,848,230
Interop Best Practices: Should I use Static Class, or Normal Classes
<p>I have a front end C# that needs to call a C++ back end. So interop is needed. </p> <p>I have an "interop layer", that converts the C# data structure into C++ structure, and do all the memory freeing grunt work. </p> <p>My question is, should I write this interop layer as a <em>static</em> class, or should I wrap it in a normal class and instantiate it as an object when I need to use it?</p>
c# c++
[0, 6]
577,605
577,606
jQuery ready function
<p>Can anyone tell me why the document ready function needs a call to function first please? I've been told that the setTimeout in the first below example (which does not work) would be evaluated and passed to ready, but I don't see what the difference would be for the function call in the second example (which works)?</p> <pre><code>$(document).ready( setTimeout( function(){ $('#set_3').innerfade({ animationtype: 'fade', speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '180' }); }, 2000); ); $(document).ready( function(){ setTimeout( function(){ $('#set_3').innerfade({ animationtype: 'fade', speed: 'slow', timeout: 3000, type: 'sequence', containerheight: '180' }); }, 2000); } ); ​ </code></pre>
javascript jquery
[3, 5]
3,744,974
3,744,975
Update panel and jQuery
<p>I have a paged data-source in an update panel. I have it set up that when i click a next button the next page is returned via a partial post-back. The problem is that i am using the dreaded moo-tools lightface's / update-panel combo. Using this, the update panel and moo-tools wont work.</p> <p>Is there some way around using the update panel, like some sort of jQuery Ajax paged data source?</p> <p>I hope i have been clear and someone can help.</p> <p>Thanks</p>
jquery asp.net
[5, 9]
5,271,461
5,271,462
Is there a way to compare 2 colors in JS, like 'If Color A is darker than #202020'
<p>The background color for one of my pages is set pulled from the background color the users set as their twitter background color. I have a page that has a rounded box with a black border. The border doesnt look good if the background color is dark, so i'd like to remove the border of the background is darker than an arbitrary hex color. </p> <p>The way I was thinking about doing this was using a regex to pull the 3 RGB values and summing them, and comparing that to my reference color. Is there a better, way to accomplish this?</p>
javascript jquery
[3, 5]
2,127,026
2,127,027
How can you implement android apps without android?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1994703/which-programming-languages-can-i-use-on-android-dalvik">Which programming languages can I use on Android Dalvik?</a><br> <a href="http://stackoverflow.com/questions/3316801/which-programming-languages-can-be-used-to-develop-in-android">Which programming languages can be used to develop in Android?</a> </p> </blockquote> <p>Are there any alternatives for building apps for Android devices without programming in android? Maybe Python or something like that?</p>
java android
[1, 4]
741,796
741,797
Inserting variable into array item
<p>I have an array of elements from my webpage which I am trying to then insert some html, stored as a variable into a matching array item. For example</p> <pre><code>&lt;div class="play"&gt; &lt;div&gt; &lt;p&gt;Item to be inserted after this p tag&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; var elements = $('.play'); //elements length = 4; var item = '&lt;p&gt;HTML to be inserted&lt;/p&gt;' $(item).appendTo(elements[1]); </code></pre> <p>In the above code I am trying to insert 'item' into the second value in the array within the child div shown in the html, however I am unsure how to insert it into the child div. At present this inserts 'item' after the parent html tag containing .play.</p> <p>Any help would be greatly appreciated.</p>
javascript jquery
[3, 5]
4,065,780
4,065,781
Jquery dragging tab
<p>the below is a nice dragging tab, which I would like to implement in my project. Is there any jquery plugin for this.</p> <p><a href="http://www.blitzagency.com/our-people/#meet-the-blitizens" rel="nofollow">http://www.blitzagency.com/our-people/#meet-the-blitizens</a> </p>
javascript jquery
[3, 5]
3,389,417
3,389,418
Pass parameters to function call in event trigger
<p>Right now I have this</p> <pre><code>jQuery('.widget-prop').keyup(function() { var prop = jQuery(this).attr('id'); var val = jQuery(this).val(); stuff; } </code></pre> <p>and </p> <pre><code>jQuery('.widget-prop').click(function() { var prop = jQuery(this).attr('id'); var val = jQuery(this).val(); stuff; } </code></pre> <p>two functions are the same, so I'd like to simplify it by defining external function and calling it with </p> <pre><code>jQuery('.widget-prop').click('myFunction'); </code></pre> <p>but how would I pass parameters to myFunction?</p> <pre><code>function myFunction(element) { stuff; } </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
3,667,855
3,667,856
setInterval and function
<p>I have written this simple function:</p> <p>HTML:</p> <pre><code>&lt;div class="mhead"&gt; &lt;div class="mTop"&gt; &lt;a class="headline" title="" href=""&gt; &lt;img alt="" src=""&gt; &lt;span&gt; &lt;/span&gt; &lt;/a&gt; &lt;/div&gt; &lt;div class="tNav"&gt; &lt;ul id="topt" class="tUl"&gt; &lt;li title="http://www.site.com/761028497.jpg"&gt; &lt;a title="" href=""&gt;1&lt;/a&gt; &lt;/li&gt; &lt;li title="http://www.site.com/761028497.jpg"&gt; &lt;a title="" href=""&gt;2&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p></p> <p>Function:</p> <pre><code>$.fn.inters = function (target) { this.find('li').hover(function () { var head = $(this).find('a').attr('title'); var image = $(this).attr('title'); var href = $(this).find('a').attr('href'); $(target).find('img').attr('src', image); $(target).find('img').attr('alt', head); $(target).attr('href', href); $(target).attr('title', head); $(target).find('span').html(head); }).eq(0).hover();} $("#topt").inters('.headline'); </code></pre> <p>I want to add <code>setInterval</code> to this script:</p> <pre><code>$(function() { setInterval( "inters()", 3000 ); }); </code></pre> <p>But the headline items doesnt change. How can I make change in <code>inters</code> function every 3000 ms?</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
796,625
796,626
jquery with index based radio button selected value help
<p>I have following generated code and tried to retrive the radio button value or checked from below html generated code </p> <p>HTML code generated ::: </p> <pre><code> &lt;input type="radio" name="mergedServiceSets[0].cdaQuestionnaireresponses[0].questionnaire.value" id="SetUpTest_mergedServiceSets_0__cdaQuestionnaireresponses_0__questionnaire_valueY" value="Y" class="mergedServiceSets[0].cdaQuestionnaireresponses[0].questionInputRadio" onchange="javascript:dataModified();"/&gt;&amp;nbsp;Yes&lt;br /&gt; &lt;input type="radio" name="mergedServiceSets[0].cdaQuestionnaireresponses[0].questionnaire.value" id="SetUpTest_mergedServiceSets_0__cdaQuestionnaireresponses_0__questionnaire_valueN" value="N" class="mergedServiceSets[0].cdaQuestionnaireresponses[0].questionInputRadio" onchange="javascript:dataModified();"/&gt;&amp;nbsp;No&lt;br /&gt; </code></pre> <h2>Jquery1.6.1 used :</h2> <pre><code>var questionInputRadio = $(".mergedServiceSets[" + i + "].cdaQuestionnaireresponses[" + j + "].questionInputRadio"); </code></pre> <p>where i and j are passed dynamically . or </p> <pre><code>alert("questionInputRadio===" + $(".mergedServiceSets[0].cdaQuestionnaireresponses[0].questionInputRadio").val()); </code></pre> <p>Actual results ::: undefined is displaying when i see in alert box .</p> <p>It never works for index based classes or ids in jquery . please help </p>
javascript jquery
[3, 5]
2,925,097
2,925,098
Combobox Add item problem
<p>I want to add new item in combobox. But this item should be top in combobox.</p> <p>For Example;</p> <p>In my combobox items like; a,b,c,d I want to add e but e is the top.</p> <p>After adding new item shoukld be -> e,a,b,c,d</p> <p>How can I do this?</p> <p>Thanks John</p>
c# asp.net
[0, 9]
6,009,799
6,009,800
accessing the data from the jQuery source array?
<p>I have been given this code by the ui designer and I dont know how to post the selected source array data to a php script so I can query it with MySQL, I am sorry I a beginner with JQuery, I would like to query the array like in a form option select style, or would it be better to use an associative array?</p> <pre><code>&lt;div id='content'&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { var source = [ "Select Your location", "North London", "South London", "West London", "East London", "City of London", ]; // Create a jqxDropDownList $("#jqxDropDownList").jqxDropDownList({ source: source, selectedIndex: 0, width: '250px', height: '35px', theme: 'summer' }); }); &lt;/script&gt; &lt;div id='jqxDropDownList'&gt; </code></pre>
php javascript jquery
[2, 3, 5]
4,523,820
4,523,821
Close popup (div) jquery
<p>I have a div which appears when a textbox gets focus. DIV has <em>n</em> number of textboxes. I want to say display:none when a user Clicks anywhere in the window. Div should not close if the user is switching between textboxes. </p> <p>All these jquery plugins, say the calendar control closes if user clicks outside. How is that happening? Any idea?</p>
c# jquery
[0, 5]
1,234,578
1,234,579
How to toggle size of responsive images, with a twist
<p>I have set up a fiddle with the functionality I am after, however I cannot figure out how to achieve the same result when the images have a percentage-based width.</p> <p><a href="http://jsfiddle.net/bs8Tw/" rel="nofollow">http://jsfiddle.net/bs8Tw/</a></p> <pre><code>$('img').click(function() { var toggleWidth = $(this).width() == 350 ? '700px' : '350px'; $('img').animate({ width: '350px' }); $(this).animate({ width: toggleWidth }); }); </code></pre> <p>As you can see, when an image is clicked, it doubles in width. When it is clicked again, it returns to its normal size. The key here, however, is that if one image is clicked, then another, the first image returns to its normal size before the second image increases. </p> <p>Basically, I am looking for this exact functionality, but I would like the image to toggle between a 50% and 100% width.</p>
javascript jquery
[3, 5]
2,977,662
2,977,663
Use jQuery to navigate away from page
<p>I will only have a relative link available to me but I want to use jQuery to navigate to this rel link. I only see AJAX functionality in jQuery. How can I do this using jQuery or just pure HTML/JavaScript?</p>
javascript jquery
[3, 5]
3,677,255
3,677,256
How I can fix MAC error in asp.net application?
<p>I have an ASP.NET application all things are working fine but after some minutes when I click on a button it gives me this error :</p> <blockquote> <p><strong>Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</strong></p> <p>Exception Details: System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.</p> </blockquote> <p>How I can resolve this ?</p>
c# asp.net
[0, 9]
242,285
242,286
Is storing an array of objects in ASP.NET viewstate the best solution for this?
<p>I'm wondering if storing the data in viewstate is a good idea for this given problem. He's a simplified example of what I am trying to achieve, firstly we have a Repeater control:</p> <pre><code>&lt;asp:Repeater id="Repeater1" runat="server"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox id="Name" runat="server" /&gt; &lt;asp:TextBox id="Age" runat="server" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;asp:TextBox id="NewPersonName" runat="server" /&gt; &lt;asp:TextBox id="NewPersonAge" runat="server" /&gt; &lt;asp:Buttin id="Button1" runat="server" Text="Add" OnClick"Button1_Click"/&gt; </code></pre> <p>To keep things simple I'll forego the databinding code, as this is working it loads in the current list of people and ages and binds perfectly.</p> <p>The problem is with the bottom 3 controls, what I want is for the user to be able to type in a new entry, click the add button and this would then be added to the Repeater, but not persisted to the database.</p> <p>The user should be able to add multiple names to the list and then click a Save button to commit all the new names in one click rather than committing for each entry.</p>
c# asp.net
[0, 9]
2,533,902
2,533,903
i want to generate payperiod for each month
<p>On the first time I created pay period schedule, which is the type is Monthly, for example , Start, End, Transaction, and Functions of pay period is like below:</p> <ol> <li>01-Jan-12 12:00 AM, 30-Jan-08 11:59 AM, 31-Jan-08 12:00 PM</li> </ol> <p>The above one is first month payperiod. next month it ill create like this automatically and inserted into database what i do?</p> <ol> <li>01-Feb-12 12:00 AM,28-Feb-12 11:59 PM,29-Feb-12 12:00 PM</li> </ol> <p>please help me.. </p>
c# asp.net
[0, 9]
5,813,453
5,813,454
Jquery .html() and .attr() to populate P tags
<p>I'm trying to use jquery to populate <code>&lt;p&gt;</code> tags with content based on their class. Here's my code:</p> <pre><code>&lt;p class="header"&gt;&lt;/p&gt; &lt;p class="desc"&gt;&lt;/p&gt; </code></pre> <pre class="lang-javascript prettyprint-override"><code>var header = 'header content here'; var desc = 'description content here'; var id = $("p").attr("class"); $("p." + id).html(id); </code></pre> <p>By using <code>.html(id)</code>, I'm trying to call the content stored in the variables with the same name as the <code>class</code> of the <code>&lt;p&gt;</code> tag. However, this method only returns</p> <pre><code>&lt;p&gt;header&lt;/p&gt; </code></pre> <p>and</p> <pre><code>&lt;p&gt;desc&lt;/p&gt; </code></pre> <p>as opposed to pulling the content from the variables.</p> <p>A point in the right direction would be much appreciated.</p>
javascript jquery
[3, 5]
4,033,104
4,033,105
ASP.NET Replace a double quote with html number
<p>Basically I am trying to do that following</p> <pre><code>InputString = InputString.Replace(""", "&amp;#34;"); </code></pre> <p>But getting an error</p>
c# asp.net
[0, 9]
2,241,050
2,241,051
Invisible listview item row
<p>i want to implement a search Text to listView,</p> <p>i load the listView items from server.</p> <p>Currently, everytime that user enters something to the searchText i remove all items in the listView and add them again to the listView (if they contain the user entered string)</p> <p>However it takes alot of time, to remove the whole listView and then start reload all items to list again</p> <p>Therefore i want to loop all over the listView and to invisible the un-matched rows, is it possible? (something like View.GONE)</p> <p>for example, i want to invisible the k-th item row in listView.</p> <p>Also, i will want to change this item row to visible again.</p> <p>thanks alot</p>
java android
[1, 4]
219,044
219,045
Sending POST data from Android application to PHP script
<p>I'm trying to send some POST data to a PHP script from an android application. How should the PHP script look like? This is what I tried but it doesn't work;</p> <p>Android code:</p> <pre><code>class SendPostReqAsyncTask extends AsyncTask&lt;String, Void, String&gt; { @Override protected String doInBackground(String... params) { // Create a new HttpClient and Post Header HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.alex26.0fees.net/script.php"); try { // Add your data List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair("id", "12345")); nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!")); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); } catch (ClientProtocolException e) { // TODO Auto-generated catch block } catch (IOException e) { // TODO Auto-generated catch block } return null; } @Override protected void onPostExecute(String result) { } } </code></pre> <p>PHP script:</p> <pre><code>&lt;?php if(isset($_POST['id'])) echo $_POST['id']; if(isset($_POST['stringdata'])) echo $_POST['stringdata']; ?&gt; </code></pre>
php android
[2, 4]
1,829,117
1,829,118
select all html elements based on rel value
<p>I have some html elements in my code like this</p> <pre><code>&lt;div rel="test1"&gt;item1&lt;/div&gt; &lt;div rel="test1"&gt;item2&lt;/div&gt; &lt;div rel="test1"&gt;item3&lt;/div&gt; &lt;div rel="test2"&gt;item4&lt;/div&gt; &lt;div rel="test2"&gt;item5&lt;/div&gt; </code></pre> <p>and I need a way to select all the divs that use <code>rel="test1"</code> and add a class to them how can I do this with <code>jQuery</code>?</p>
javascript jquery
[3, 5]
2,435,018
2,435,019
How to get the value of a multiple option dropdown?
<p>Say I have this dropdown:</p> <pre><code>&lt;select name="color" multiple="multiple"&gt; &lt;option value="red"&gt;Red&lt;/option&gt; &lt;option value="green"&gt;Green&lt;/option&gt; &lt;option value="blue"&gt;Blue&lt;/option&gt; &lt;/select&gt; </code></pre> <p>So basically more than 1 color can be selected. What I'd like is that if a user selects red, and then clicks green, i'd like a function to be called each time which pops up a message box saying the color which was most recently clicked.</p> <p>I've tried this:</p> <pre><code>&lt;option value="red" onclick="alert('red');"&gt;Red&lt;/option&gt; &lt;option value="green" onclick="alert('green');"&gt;Green&lt;/option&gt; &lt;option value="blue" onclick="alert('blue');"&gt;Blue&lt;/option&gt; </code></pre> <p>This works in firefox and chrome, but not in IE.</p> <p>Any ideas?</p>
javascript jquery
[3, 5]
2,662,192
2,662,193
How to load other web page in ASP.NET
<p>I want to load some fixed part from other website to my web application. How to accomplish this? Thanks.</p>
c# asp.net
[0, 9]
4,678,910
4,678,911
Create an array variable for a class in Javascript
<p>The following is a Javascript class that I have created. </p> <pre><code>(function(window){ function Project(name,description){ this.name = name; this.description = description; } window.Project = Project; }(window)); </code></pre> <p>I know to create variables inside the class using the 'this' keyword. But can someone help as how to create an array as member of the class. In this situation I need to create an array variable 'projectMemebers'</p>
javascript jquery
[3, 5]
2,179,580
2,179,581
How to load picture images via click on a picture?
<p>At the moment i load default images for every picture in my app. I want to load the real picture of all images in div 5 if i click on any picture of div 5. At the moment i use the onclick event of the img tag with: </p> <pre><code>switchImg(this, "LINK_FOR_PICTURE") </code></pre> <p>my js snippet:</p> <pre><code>function switchImg(img, url){ $(img).attr("src", url); } </code></pre> <p>At the moment it only loads the picture that i clicked on.</p> <p>here the HTML snippet:</p> <pre><code>&lt;div id="1"&gt; &lt;/div&gt; &lt;div id="2"&gt; &lt;/div&gt; .. &lt;div id="5"&gt; &lt;img src="DEFAULT_IMG" onclick="switchImg(this, "LINK_FOR_PICTURE_1")" alt="No_picture"&gt; &lt;/div&gt; &lt;img src="DEFAULT_IMG" onclick="switchImg(this, "LINK_FOR_PICTURE_2")" alt="No_picture"&gt; &lt;/div&gt; &lt;img src="DEFAULT_IMG" onclick="switchImg(this, "LINK_FOR_PICTURE_3")" alt="No_picture"&gt; &lt;/div&gt; ..... &lt;/div&gt; </code></pre> <p>How do i need to change my code that following condition is true:</p> <ul> <li>i click on any picture in div id=5 and all this pictures gets the correct picture link (LINK_FOR_PICTURE_1, LINK_FOR_PICTURE_2, etc) as src. The other pictures in the other divs don`t change and still display the default img. (Div id 5 is an example the same procedure should be possible for other divs with pictures).</li> </ul> <p>Please keep in mind that the img link changes for every picture.</p>
javascript jquery
[3, 5]
539,611
539,612
How do I parse xml with jQuery?
<p>What is the jQuery alternative to the following JavaScript code?</p> <pre><code>var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml"); </code></pre> <p>I believe a jQuery alternative would be more cross-browser compatible?</p>
javascript jquery
[3, 5]
3,053,538
3,053,539
Gridview PageIndex not changing on page_Load event
<p>I'm trying to change pageindex on page_Load event but its not working. I can change page by clicking links in the page after page loaded. If this info necessary GridView in UpdatePanel.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { /*...Some Codes...*/ //I'm trying to change page like this. GridView1.PageIndex = Index; GridViewPageEventArgs ea = new GridViewPageEventArgs(GridView1.PageIndex); GridView1_PageIndexChanging(sender, ea); } protected void GridView1_PageIndexChanging(object sender,GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; } </code></pre>
c# asp.net
[0, 9]
2,876,963
2,876,964
Accessing custom HTTP Response Header via C#
<p>I've created an HTTP Response Header in IIS 7. I can see it in Fiddler but I can't get its value in C#. Response.Headers.ToString() doesn't show the custom HTTP Response Headers.</p> <p>How can I access its value?</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
3,781,168
3,781,169
jquery show/hide two divs on click and hide link
<p>Im using the following JS</p> <pre><code>&lt;a href=# onClick="if($(this).next('div').css('display') == 'none') { $(this).next('div').show('fast'); } else { $(this).next('div').hide('fast'); } return false;"&gt;Add a Street Address&lt;/a&gt; </code></pre> <p>and the following html</p> <pre><code>&lt;div id=entry&gt; &lt;div id=label&gt;Street&lt;/div&gt; &lt;div id=input&gt;&lt;input name="" type="text" class="longtext" /&gt;&lt;/div&gt;&lt;/div&gt; &lt;div id=entry&gt; &lt;div id=label&gt;City/Town&lt;/div&gt; &lt;div id=input&gt;&lt;input name="" type="text" class="longtext" /&gt;&lt;/div&gt;&lt;/div&gt; </code></pre> <p>How would i modify the JS to show/hide both of those divs at once, and then make the link disappear?</p>
javascript jquery
[3, 5]
3,179,998
3,179,999
How can I handle upgrades of the database in later versions gracefully?
<p>So I have my app almost ready to go. I have just been wondering about when I update it how the upgrading of the database will work.</p> <p>Basically it is a quiz and I will be adding and removing questions and the users personal data needs to be kept for instance. How many correct and incorrect answers and for which questions etc.</p> <p>This gets a bit more complex when you think I may want to remove or add new questions, and even worse when changing structure.</p> <p>But do I have to worry about this code now? I am thinking that the second release of my app could contain the update code. This would allow me to release the initial app earlier and worry about the upgrade in the background.</p> <p>Is this possible? Or must you have the upgrade code as it were <em>on standby</em>?</p>
java android
[1, 4]
5,269,754
5,269,755
Sending/receiving .txt file from Android to PC, not whole file is sent
<p>I'm trying to make an Android app that sends a .txt file to a Windows Forms application on my computer. The problem is that not the whole file gets sent (I haven't been able to find out whether the problem is on the sending or receiving side). I only get a random part from somewhere in the middle of the .txt file to the receiving side. What am I doing wrong? The strange thing is that it has worked perfectly a few times, but now I'm never getting the beginning or the end of the file.</p> <p>The Android app is written in Java, and the Windows Forms app is written in C#. filepath is the name of my file. What is the problem here?</p> <p><strong>Code for Android app (sending file)</strong></p> <pre><code>//create new byte array with the same length as the file that is to be sent byte[] array = new byte[(int) filepath.length()]; FileInputStream fileInputStream = new FileInputStream(filepath); BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream); //use bufferedInputStream to read to end of file bufferedInputStream.read(array, 0, array.length); //create objects for InputStream and OutputStream //and send the data in array to the server via socket OutputStream outputStream = socket.getOutputStream(); outputStream.write(array, 0, array.length); </code></pre> <p><strong>Code for Windows Forms app (receiving file)</strong></p> <pre><code>TcpClient tcpClient = (TcpClient)client; NetworkStream clientStream = tcpClient.GetStream(); byte[] message = new byte[65535]; int bytesRead; clientStream.Read(message, 0, message.Length); System.IO.FileStream fs = System.IO.File.Create(path + dt); //message has been received ASCIIEncoding encoder = new ASCIIEncoding(); System.Diagnostics.Debug.WriteLine(encoder.GetString(message, 0, bytesRead)); fs.Write(message, 0, bytesRead); fs.Close(); </code></pre>
c# java
[0, 1]
3,135,616
3,135,617
Is it possible to take C++ libraries from a future Android release (2.3.3) and use them on a previous release (2.1)?
<p>More specifics: I specifically need the BitmapRegionDecoder that was introduced in 2.3.3, but our company is currently designing for Andriod 2.1. Would it be possible, using the NDK, or some other method to package <a href="https://github.com/android/platform_frameworks_base/blob/master/core/jni/android/graphics/BitmapRegionDecoder.cpp" rel="nofollow">BitmapRegionDecoder.cpp</a>, which is what the Java class is all about, and the minimal amount of dependencies to use with my 2.1 application?</p> <p>Thanks</p>
java android c++
[1, 4, 6]
1,684,600
1,684,601
How to change selected menu option using jquery
<p>Hi I am using jquery chosen plugin. I want to selected menu value by selected value from other select menu. But my code working with simple selected menu. I want it to work with jquery chosen plugin. Example <a href="http://jsfiddle.net/7vkLv/13/" rel="nofollow">code</a> </p> <pre><code>$(".chzn-select").chosen() $('[id*=second]').change(function(){ var val = $(this).find('option:selected').val() if(val.toLowerCase()=='mr'){ $('[id*=gender]').find('option').eq(0).attr('selected', 'selected'); } else{ $('[id*=gender]').find('option').eq(1).attr('selected', 'selected') } }) ​ </code></pre>
javascript jquery
[3, 5]
720,143
720,144
jQuery closest() function doesn't work in IE
<p>Trying to insert a row after clicking a link inside a table row. This line below:</p> <pre><code>$('&lt;tr&gt;&lt;td&gt;abc&lt;/td&gt;&lt;/tr&gt;').insertAfter(self.closest('tr')); </code></pre> <p>is returning </p> <pre><code>Error: Object doesn't support property or method 'closest' </code></pre> <p>in IE. Works fine in Chrome/FF.</p> <p>Any suggestions?</p>
javascript jquery
[3, 5]
4,861,288
4,861,289
Bugs with "Pop Images like Google Images" post made earlier
<p>Please check this post:</p> <p><a href="http://stackoverflow.com/questions/7411393/pop-images-like-google-images#answer-7412302">Pop Images like Google Images</a></p> <p>I was working with the codes in this post by "Roko", but I am getting a bug in the same. When you arrange the code to display your gallery, all the images of the gallery are arranged nicely but the link added with the image will be same for all.</p> <p>For example, according to the algorithm below (not using any html or css formatting...) if there are some images in your album is such a order such that</p> <pre><code>for($i=0;$i&lt;10;$i++) { echo "&lt;a href='image_url' &gt;" . "&lt;img src='image_url' /&gt;" . "&lt;br/&gt;&lt;span&gt; Image Name &lt;/span&gt; &lt;/a&gt;" // image_url = next_image_url : I will change the image url for displaying the next url. } </code></pre> <p>But, in this case the text in the &lt;span&gt; gives the correct url where as all the images on the page will give you the url of the first image. Is it a bug or something else. I am using MySql database to fetch the images of the gallery.</p>
php jquery
[2, 5]
2,897,636
2,897,637
How to reuse a dropdownlist each row of a table instead of rebuilding it
<p>I have a table the uses the same dropdown list in each row. I thought that I could just create one dropdown list and then reuse it in each new row, but the table only ends up with one row unless I create "new" dropdownlist. Am I approaching this all wrong? </p> <p>In the interest of efficiency, is there a way to build the list once and then reuse it by creating another instance of it or something? I was trying to avoid rebuilding that list umpteen times. </p> <p>Thanks</p> <pre><code>private void UserRoles() { Table table = MakeTable(); Ewo.sqlDataStore.Administrator sql = new Ewo.sqlDataStore.Administrator(); DataSet dataset =sql.SiteUserRoleList(); DropDownList sel = RoleList(dataset.Tables[0]); if(tools.validDataSet(dataset)) { if (dataset.Tables.Count &gt; 1)//existing roles are #2, show the roles the user is part of { foreach (DataRow dRow in dataset.Tables[1].Rows) { table.Rows.Add(CreateRoleRow(Convert.ToString(dRow["SitePageGroupName"]), sel));//add a row with data } } table.Rows.Add(CreateRoleRow(sel));//add a blank row on the bottom } AdminSiteUerRoles.Controls.Add(table);//add it all to the page } </code></pre>
c# asp.net
[0, 9]
2,957,808
2,957,809
Need to initialize a byte[] array with ascii blank (i.e. 0x20 OR " ")
<p>Hello all Ol' Guy Newbie here ... I've defined a string=> final static String Blank = " " ; and a byte array static byte[] LU62_Partner = new byte[8] ;</p> <p>Further down in my logic I want to initialize the byte[] array with blanks</p> <pre><code> // Prep LU6.2 Session for ( ndx=0 ; ndx &lt; 8 ; ++ndx) { LU62_Partner[ndx] = Blank.getBytes() ; // initialize the the LU6.2 partner name byte array w/blanks } LU62_Partner = APPC_Partner.getBytes() ; // convert string array to byte array // if the appc-partner name &lt; 8 bytes, rightmost bytes // will be padded with blanks </code></pre> <p>However upon compilation I get the following error src\LU62XnsCvr.java:199: incompatible types found : byte[] required: byte LU62_Partner[ndx] = Blank.getBytes() ; </p> <p>Again I'm confused... I was under the impression that the method getBytes() would convert a string into a byte. Thanks very much again </p> <p>Guy </p>
java android
[1, 4]
2,995,074
2,995,075
What does (button) mean?
<p>I am a beginner at Java, and have come across this line of code:</p> <pre><code>Button orderButton = (Button)findViewById(R.id.order); </code></pre> <p>What does the <code>(Button)</code> mean when it is inside the parenthesis? </p> <p>What is the term for putting it inside like that? </p>
java android
[1, 4]
5,905,582
5,905,583
trace an asp.net website in production
<p>Is there a way that I can trace every method, basically a line trace, in an asp.net web site in production environment?</p> <p>I don't want to go about creating db logging for every line - i see an intermittent error and would like to see every line called and performed by the website per user.</p>
c# asp.net
[0, 9]
1,057,055
1,057,056
How to convert string to Date object?
<p>How to convert date string to Date object ?</p> <pre><code>2011-09-19T19:49:21+04:00 </code></pre>
javascript jquery
[3, 5]
2,929,096
2,929,097
ASP .NET - Save copy of existing data before updating in GridView
<p>I want to ensure that the websites users don't mess up the primary data table so before each update the non-updated data should be stored into a history table.</p> <p>I am thinking of using the 'RowUpdating' event on the GridView to do this. </p> <p>How do I manually run a insert query using my existing SQLDataSource?</p> <p>Overall flow would work like this:</p> <ol> <li>gridview shows field1 field2 test 1234</li> <li>user edits gridview values field1 field2 test 3333 3a. user selects 'update' button 3b. system records that data was test,1234</li> </ol>
c# asp.net
[0, 9]
3,791,431
3,791,432
JQuery .ajax() on username validation
<p>I was trying to validate username whether exist or not with the following code. But it somehow don't work to prevent the existing username. **NOTE: checkusr2.php is a simple php to check wheter the username in database. </p> <pre><code>function verifyUser() { var usr = $("#username").val(); $.ajax( { type: "POST", url: "checkusr2.php", data: "username="+ usr, success: function(msg) { $("#txtHint").ajaxComplete(function(event, request, settings){ FormErrors = false; if(msg == 'OK') { FormErrors = true; $('#formElem').data('username',FormErrors); } else { $('#formElem').data('username',FormErrors); } }); } }); } </code></pre> <p>/** calling the function to check. **/</p> <pre><code>verifyUser(); if($('#formElem').data('username')){ alert('Username exist, please try another username.'); return false; } </code></pre>
php javascript jquery
[2, 3, 5]
4,494,291
4,494,292
How to organize Javascript and AJAX with PHP?
<p>My javascript is getting out of hand for my PHP application. I have 20 tags that link to various javascript files in a javascript folder. Each javascript file basically controls one element on the DOM. And, if the javascript file uses AJAX, then it will have a corresponding PHP file that the AJAX will call.</p> <p>For example, a js file might control a button on the page:</p> <pre><code>$(document).ready(function () { $("#button").live('click', function() { $.ajax({ type: "POST", data: ... url: "button_click.php", }); }); }); </code></pre> <p>As you can see, this gets out of hand. What is the best way to organize all of the javascript?</p>
php javascript jquery
[2, 3, 5]
5,357,063
5,357,064
Retrieve existing objects from Parse API
<p>I've been trying to use Parse lately in order to develop apps. Problem is, I can't seem to retrieve an object previously created by another user. Since Parse labels each object with a random String there is no posible way to retrieve it without knowing the String in advance; and even if I hardcode the ParseObject's ID into my app I can't retrieve it.</p>
java android
[1, 4]
1,470,564
1,470,565
Use JQuery/JS to eagerly load a bunch of MIDI file URls and cache them to be played on demand
<p>Is it possible to have a webpage where on buttonClick, JQuery goes fetches a certain few URLs to MIDI files, and instead of them playing automatically, they are played on demand ?</p> <pre><code>&lt;a href="bach.mid"&gt;Bach&lt;/a&gt; &lt;a href="beethoven.mid"&gt;Beethoven&lt;/a&gt; </code></pre> <p>I want to be able to eagerly fetch them into an array of objects and play them on demand.</p> <pre><code> midis[0].play// or something like that </code></pre>
javascript jquery
[3, 5]
5,398,623
5,398,624
JQuery: Binding the .validate plugin to .live
<p>I need to bind the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/" rel="nofollow">jQuery validate plugin</a> to forms that I generate on the fly. As far as I know <code>.live()</code> is the only way to do this in jQuery. It doesn't seem to work, at least the way I'm trying. I think this is do'able and it's just eebkac! </p> <p>This works Fine:</p> <pre><code>$("form#form_CreateUser").validate({ submitHandler: function(form) { // do other stuff for a valid form UserSubmit(); } }); </code></pre> <p>This generates syntax errors:</p> <pre><code>$("form#form_CreateUser").live('validate', function() { submitHandler: function(form) { // do other stuff for a valid form UserSubmit(); } }); </code></pre>
javascript jquery
[3, 5]