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
176,462
176,463
how to get the short codes?
<p>how to get the short codes from a service providers? I want to create a app that could receve these sms sent to the short codes by the user and the app should return the response to the client. </p>
java android
[1, 4]
4,983,429
4,983,430
Cannot load CSS and JS dynamically with this function
<p>I am trying to load Plugins based on the condition as in the below function. But i am unable to do it. Please have a look at the code and let me know the errors in the code..</p> <pre><code> function loadPlugin(choic) { var plugin=choic*1; if(plugin &gt;= 1 &amp;&amp; plugin &lt;= 3) { $("head").append("&lt;link&gt;"); css = $("head").children(":last"); css.attr( { rel: "stylesheet", type: "text/css", href: "/cloud-zoom/cloud-zoom.css" }); alert('CSS Loaded'); alert($("head").html()); $.getScript('/cloud-zoom/cloud-zoom.1.0.2.min.js', function() { alert($("head").html()); $('.cloud-zoom').CloudZoom(); $('a.cloud-zoom').live('click',function(e) { e.preventDefault(); }); }); } } </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
654,824
654,825
setting connection parameters in web config
<p>I want to know if it's possible to set a connection in a web config of my web project that depends of a dll and not from the connection String.</p> <p><strong>UPDATE</strong></p> <p>Ok I have a dll, that make's a connection with my database, i want to know if it's possible to configure my web.config to get the connection from the dll and not from the string connection. </p>
c# asp.net
[0, 9]
5,574,275
5,574,276
Scan PDF files and upload it through php
<p>How can I upload pdf files after scanning it through scanner feeder ? I am using <a href="http://www.chestysoft.com/ximage/default.asp" rel="nofollow">OCX</a> plugin to upload images to server, but in the application I am working on, I have to upload PDF document to server. Can you suggest me plugin or library even if is not free, I will be very thankful.</p>
php javascript
[2, 3]
5,325,363
5,325,364
Problem: Alert value of dynamically created select tags
<p>I have an external Javascript file and i am trying to alert the value of select tags which are being generated dynamically through php.</p> <p>the problem is, that it selectes the value of only the first select tag. What should i do, so that the javascript is able to independently identify each select tags value. </p> <p>My <code>&lt;select&gt;</code> code looks like this:</p> <pre><code>&lt;select id="vote"&gt; &lt;option value="1"&gt;1&lt;/option&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;option value="3"&gt;3&lt;/option&gt; &lt;option value="4"&gt;4&lt;/option&gt; &lt;option value="5"&gt;5&lt;/option&gt; &lt;/select&gt;&lt;input type="button" value="vote" onclick="castvote();"&gt; </code></pre> <p>and the Javascript (which is external):</p> <pre><code>function castvote() { var sel=document.getElementById("vote"); alert(sel.options[sel.selectedIndex].value);} </code></pre> <p>The javascript just alerts the value of first select tag. even if i change value of some other select tag and click on the corresponding button.</p> <p>I hope i am able to explain my issue. Can someone help me with this. </p> <p>Best Zeeshan</p>
php javascript
[2, 3]
2,868,150
2,868,151
jquery each for all text boxes
<p>I am using following script to bind a keypress event on each textbox so that on reaching the maxlength, focus will switch to next input field. Passing classname as the prarameters to the function.</p> <pre><code>function autoFocusPhoneFields(txtbox1ID,txtbox2ID) { $('input.'+txtbox1ID+', input.'+txtbox2ID+'').each(function() { $(this).bind('keypress', function(){ if(this.value.length == $(this).attr('maxlength')) { $(this).next('input').focus(); } }); }); } $(document).ready(function(){ autoFocusPhoneFields('mobileprefix','mobilecode'); }); </code></pre> <p>As i have mentioned two different input ..it is runnign fine. Butis there any way around so that it will get the classnames and runs through each input box to attach keypress event.</p>
javascript jquery
[3, 5]
3,901,249
3,901,250
How to tell what is passed when no value exists
<p>For this code, how do you know that null is returned if there is no value in the querystring?</p> <pre><code>HttpContext context = HttpContext.Current; string strValue = context.Request[name]; </code></pre> <p>I'm asking because I never know what's being returned in many cases in the .NET framework when you don't get the value expected when it does not exist.</p> <p>so if <code>context.Request[name];</code> is called and the name doesn't exist in the querystring, how do you know it returns null or an empty string so that I can properly handle the case where it does not exist?</p>
c# asp.net
[0, 9]
5,550,909
5,550,910
if (foo !== null) evaluates to true, even when foo is null
<p>In javascript I have an option for log output that allows an element/selector to be used to specify where to output log/error messages. The output is formatted upon initialization like so:</p> <pre><code>var $messageOutput = options.messageOutputElement ? $(options.messageOutputElement) : null; </code></pre> <p>and it is used later on through a log function:</p> <pre><code>function outputMessage(msg) { if ($messageOutput !== null) { messageNum++; var $messageOutput = $(options.messageOutputElement); var html = $messageOutput.html(); html += '&lt;b&gt;' + messageNum + '&lt;/b&gt;&lt;br/&gt;' + msg + '&lt;br/&gt;'; $messageOutput.html(html); $messageOutput.scrollTop($messageOutput[0].scrollHeight); } } </code></pre> <p>The problem is that even when $messageOutput === null, the if statement inside outputMessage() falls through. I've verified with Chome's debugger that $messageOutput indeed equals null. And indeed it steps into the if statement anyway.</p> <p>Can anyone give me any insight as to why this might be happening? Thanks in advance for any input on this matter.</p>
javascript jquery
[3, 5]
3,625,427
3,625,428
jQuery Extension and Stopping a setInterval()
<p>I have the following jQuery extension:</p> <pre><code>var particleTimer = 0; jQuery.fn.particleEmitter = function (num, wid, hei, rad, tme, rep) { particleTimer = setInterval(function() { //appends elements... }, 500); }; jQuery.stopParticleEmitter = function () { clearInterval(particleTimer); //this doesn't stop it... } </code></pre> <p>But the <code>clearInterval()</code> doesn't seem to work... </p> <p>Here is a Fiddle of my complete code: <a href="http://jsfiddle.net/neuroflux/wtJFj/3/" rel="nofollow">http://jsfiddle.net/neuroflux/wtJFj/3/</a></p> <p>Note that the "particles" won't actually move as it requires the document width...</p> <p>But the timer should clear onMouseout... and doesn't...</p>
javascript jquery
[3, 5]
4,044,266
4,044,267
jQuery BxSlider not working on ie7
<p>I'm trying to get the bxslider to work on this page in ie7 <a href="http://redbarn.blackdogstaging.com/" rel="nofollow">http://redbarn.blackdogstaging.com/</a> it works fine in ie8 and newer browsers. It seems as if the script isn't loading. I'm not too good with js / jquery so anything will help. Heres the code I'm using:</p> <pre><code>&lt;script src="&lt;?php bloginfo('template_url'); ?&gt;/js/jquery.bxSlider.min.js" type="text/javascript" /&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#slider1').bxSlider({ auto: true, pager: true, controls: true, infiniteLoop: false, captions: false, pause: 6000 }); }); &lt;/script&gt; </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
2,464,680
2,464,681
java: PDF417 barcode containing english and non english unicode
<p>I want to decode a stream of bytes from dePDF417 barcode decoder containing english and non english unicode characters. Please give me any help it's urgent.</p>
java android
[1, 4]
95,245
95,246
Pass Value of clicked button from one page to another page Input field
<p>Weird question this, going round in circles.</p> <p>I have 2 pages.</p> <p>Page 1. Has a button on it. Like</p> <pre><code>&lt;form action="goto_page_2.php"&gt;&lt;p class="longdesc"&gt;&lt;span class="spanBold"&gt;Scrap Collections in North Lakes:&lt;/span&gt;&lt;br /&gt; &lt;button class="readViewMoreBtn" value="North Lakes"&gt;Book a Collection in North Lakes&lt;/button&gt; &lt;/p&gt;&lt;/form&gt; </code></pre> <p>The above is a simple mockup. But what I want to do is, onclick of the button, parse the Value to ...</p> <p>Page 2. Which has a form built in.</p> <p>One of the fields is Suburb.</p> <pre><code>&lt;!-- EMAIL SUBURB --&gt; &lt;span class="commonControlLabel"&gt;Suburb:&lt;/span&gt;&amp;nbsp; &lt;span class="commonControlLabelItalic"&gt;(required)&lt;/span&gt; &lt;span id="contactSuburbErrorMsg" class="commonControlErrorMsg"&gt;&lt;/span&gt;&lt;br /&gt; &lt;input class="commonInput" type="text" id="inputSuburb" value=""/&gt;&lt;br /&gt; </code></pre> <p>So what I want to do, is grab the VALUE of the button on PAGE 1, and add it to the Value in the input element on Page 2.</p> <p>To complicate matters, Page 1. Has quite a few buttons, with different values, all unique, which we would like to pass, to the input element. Obviously onlcick of the button on page 1 we go direct to page 2.</p>
php javascript
[2, 3]
4,711,410
4,711,411
How to improve my codes to implement 'return false'?
<p>I am trying to return false after a conditional statement fail.</p> <p>I have</p> <pre><code>$('#btn').click(function() { $('.title').each(function() { if (id == $(this).attr('id')) { alert('The name already exists.') return false; //I hope my codes would stop here if condition is true } }) // my codes still call the doSomething function even if the conditional //statement is true doSomething(); })​ </code></pre> <p>I want do call the <code>doSomething</code> function ONLY if <code>id != $(this).attr('id).</code> </p> <p>The codes below gave me what I want but it seems ugly. </p> <pre><code>$('#btn').click(function() { var nameExist = false $('.title').each(function() { if (id == $(this).attr('id')) { alert('The name already exists.') nameExist = true; return false; //I hope my codes would stop here if condition is true } }) if (!nameExist) { doSomething(); } })​ </code></pre> <p>Anyone has a better approach for this? Thanks a lot!</p>
javascript jquery
[3, 5]
3,135,458
3,135,459
Writing to a label from a static function
<p>I'm trying to do something that I thought would be easy but can't figure out how to write to a label inside my stating function.</p> <pre><code>public static void StartProcessing(object data) { lblError.Text = "Blah Blah" } </code></pre> <p>I get the error "An object reference is required for the non-static field, method, or property..."</p> <p>So I tried creating a new instance of the label and adding it to a new instance of a control (Panel) but the lblError isn't getting displayed</p> <pre><code> public static void StartProcessing(object data) { Panel Panel1 = new Panel(); Label lblError= new Label(); Panel1.Controls.Add(lblError); lblError.Visible = true; lblError.Text = "Blah Blah"; } </code></pre> <p>there must be an easy way to do this? Which i've overlooked..</p> <p>The function is getting called as follows: If I change the above to not be static I get an error message on the second line below saying the same "An object reference is required for the non-static field, method, or property..." When this function isn't static?</p> <pre><code>public object LaunchNewProcess(object data) { ThreadPool.QueueUserWorkItem( new WaitCallback(ProcessStatuses.StartProcessing), new object[] {newProcess, allProcesses} ); </code></pre>
c# asp.net
[0, 9]
2,871,359
2,871,360
Library thrown exceptions
<p>I have project as a "library" which does HttpCommunication. I post data into it and receive response. Lib's method can throw several exceptions which I want catch in the hosted app, but somehow I can catch only general Exception instead of specific once.</p> <p>Library method code:</p> <pre><code> public byte[] execute(String entityStr) throws UnsupportedEncodingException, ClientProtocolException, IOException { ... // some code that can throw mentioned exceptions } </code></pre> <p>Hosted class:</p> <pre><code>try { byte[] response = httpClient.execute(profile); } catch (Exception e) { e.printStackTrace(); } </code></pre> <p>code above compiles, but code below does not. </p> <pre><code>try { byte[] response = httpClient.execute(profile); } catch (UnsupportedEncodingException e) { } catch (ClientProtocolException e) { } </code></pre> <p>Exception objects marked as errors, messages say</p> <p>Unreachable catch block for UnsupportedEncodingException. This exception is never thrown from the try statement body.</p> <p>Hosted class is an Activity. Communication done in AsyncTask class. If anybody knows what's wrong with it, explain me please.</p>
java android
[1, 4]
1,416,300
1,416,301
How can I Execute a code in background?
<p>On a click event I have some codes that takes about 4 seconds before the user can be redirected.</p> <p>Is there a way that I can redirect the user, and the code will still be executed on the server? I </p>
c# asp.net
[0, 9]
5,445,947
5,445,948
ToolTip Question
<p>OK, so I have a checkboxlist (which is databounded) and I'm displaying a tooltip icon next to each checkbox. This code displays a css tooltip on hove rfor the icon. I want to pass a different message for each icon: project duration, customer involvement, etc. Atm, the same message is displayed when I hover over each of the icons. How can I fix this? Thanks!</p> <pre><code>protected void agilefactors_DataBound(object sender, EventArgs e) { var checkBox = sender as CheckBoxList; if (checkBox != null) { foreach (ListItem listItem in checkBox.Items) { listItem.Text = string.Format("{0} &lt;span class='link'&gt;&lt;a href='javascript: void(0)'&gt;&lt;font face='verdana,arial,helvetica' size='2'&gt;&lt;img src='{1}' Height='20' Width='20' /&gt;&lt;/font&gt;&lt;span&gt;&lt;b&gt;Project Duration:&lt;/b&gt;&lt;br/&gt;Ideally, the project should be close to 6 months: much shorter means less iterations, and much longer tends towards long term planning.&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;", listItem.Text, GetImageFor(listItem.Text)); } } } private string GetImageFor(string text) { // return image url for check box based on text. switch (text) { case "Project Duration": return "images/info.png"; case "Customer Involvement": return "images/info.png"; case "Acceptance of Change": return "images/info.png"; case "Team Size": return "images/info.png"; case "Skill of Team": return "images/info.png"; case "Organisational and Reporting Structure": return "images/info.png"; case "Process": return "images/info.png"; case "Documentation Requirements": return "images/info.png"; case "Layout of Workspace": return "images/info.png"; case "Empowered Team": return "images/info.png"; default: return null; } } </code></pre>
c# asp.net
[0, 9]
2,425,423
2,425,424
How to Check if ListBox is Empty on Client-Side
<p>I created a <code>javascript confirm</code> as below.</p> <pre><code>&lt;script Type="Text/Javascript"&gt; function CheckListBox(lvi) { if(lvi == "") { if(confirm("Are you sure?")) { return true; } else { return false; } } } &lt;/script&gt; </code></pre> <p>I need to test if the <code>ListBox.Items</code> control is empty... I already made reference on my aspx page</p> <pre><code>&lt;script language="javascript" type="text/javascript" src="/JS/confirm.js"&gt;&lt;/script&gt; </code></pre> <p>I want to know how to call it on my <code>aspx.cs</code> page . . . So I can pass the <code>parameter</code>:</p> <pre><code>string oi = Listbox_Clubes.Items.Count.ToString();//Its the parameter I want to pass </code></pre>
c# javascript asp.net
[0, 3, 9]
2,180,989
2,180,990
jQuery objects as elements
<p>I see this syntax in some advanced jQuery:</p> <pre><code>$container </code></pre> <p>as in:</p> <pre><code>$input = $container.find('.fn_this_timeline') </code></pre> <p>EDIT: based on some of the comments below, just to clarify the first instance of '$container' that I can see is created right at the beginning:</p> <pre><code>init: function($container){ var myThing = this, $input = $container.find('.fn_do_some_calc'), $submit = $container.find('.fn_do_some_other_calc'), defaultValue = parseInt($input.val(), 10); myThing.$container = $container; </code></pre> <p>The line above confuses me even more :/</p> <p>I'm used to using jQuery selectors like this: $('#mySelector').method('etc');</p> <p>Can someone let me know what the difference is and when it's appropriate or applicable to use the 'shorthand' style?</p>
javascript jquery
[3, 5]
1,064,875
1,064,876
Remove/hide browser address bar or toolbar web page
<p>I am creating web page using asp.net. Is it possible to remove/hide the browsers address bar or toolbar using Javascript for IE.</p> <p>Nathiya.</p>
asp.net javascript jquery
[9, 3, 5]
851,731
851,732
can't upload file on server
<p>I am trying use this example <a href="http://www.sajithmr.me/jrecorder/example2.html" rel="nofollow">http://www.sajithmr.me/jrecorder/example2.html</a> for recording audio and send it to my localhost server, but I have issue here. My code describe below</p> <pre><code>&lt;script&gt; $.jRecorder( { host : 'http://localhost/Jrec/html/acceptfile.php?filename=hello.wav', callback_started_recording: function(){callback_started(); }, callback_stopped_recording: function(){callback_stopped(); }, callback_activityLevel: function(level){callback_activityLevel(level); }, callback_activityTime: function(time){callback_activityTime(time); }, callback_finished_sending: function(time){ callback_finished_sending() }, swf_path : 'jRecorder.swf', } ); &lt;/script&gt; </code></pre> <p>this my acceptfile.php</p> <pre><code> if(!isset($_REQUEST['filename'])) { exit('No file'); } $upload_path = dirname(__FILE__). '/'; $filename = $_REQUEST['filename']; $fp = fopen($upload_path."/".$filename.".wav", "wb"); fwrite($fp, file_get_contents('php://input')); fclose($fp); exit('done'); </code></pre> <p>whalt should I do with $upload_path = dirname(<strong>FILE</strong>). '/;?<br> when I press send data button the file doesn't upload into following directory ("files"). What is the problem here, Any help will be apriciated </p>
php javascript jquery
[2, 3, 5]
5,588,662
5,588,663
Analog to $.map that loops over an object's properties
<p>Does jQuery offer an analog to <code>$.map</code> that loops over an object's properties?</p>
javascript jquery
[3, 5]
4,279,412
4,279,413
Trying to setup binding to a callback with different values
<p>I am trying to build a jquery function that builds a series of buttons and binds them to the callback with different argument values. The issue I am having is that the callback is always called with the argument value of the last buttons[] value "cancel" no matter which button is clicked. </p> <pre><code>var buttons = ["OK|ok", "Cancel|cancel"]; buildButtons(buttons, function(response){ alert(response); }); function buildButtons(buttons){ for (i = 0; i &lt; buttons.length; i++){ var btnTitle = buttons[i].split("|")[0]; var btnName = buttons[i].split("|")[1].toString(); var btnElem = $('&lt;button/&gt;', { type: 'button', id: 'btn_' + btnName, html: btnTitle, }) $(btnElem).on('click', function () { //..some other code fnResponse(btnName); //&lt;&lt;------- Issue Should return 'ok' or 'cancel' }); } } </code></pre> <p>The problem is that the callback is always called with the value [btnName] of the last element.. no matter which button is clicked.</p>
javascript jquery
[3, 5]
3,461,366
3,461,367
Click link when clicking LI
<p>Ok, I have this list layout that I use, and I want the list row to highlight when I hover it. Now, that's not a problem really, since I can use javascript to change classes for example, but I want the cursor to change to a pointer when hovering and when clicked, I want to follow the link within.</p> <p>Example code can be found here:</p> <p><a href="http://sandman.net/test/hover_links.html" rel="nofollow">http://sandman.net/test/hover_links.html</a></p> <p>I also want to highlight the LI only when there is an eligible link inside it. Preferably using jQuery... Any ideas?</p> <p>--</p> <p>I've edited the code to incorporate the suggestion below, and the problem is that the click() action fires when I click other items inside the LI...</p> <p>--</p> <p>Right, so now I've edited the code. I've added a class to the link(s) that SHOULD be followed on click, and then a event.stopPropagation() on the links that does NOT have this class, so they are handeled by the browser accordingly.</p> <p>Thanks again!</p>
javascript jquery
[3, 5]
1,839,412
1,839,413
how to activate loaddata() from another class
<p>i have this code in the Main extends Activity</p> <pre><code> public void loaddata() { Toast.makeText(Main.this, ("Working"),Toast.LENGTH_LONG).show(); } </code></pre> <p>i use this in the second extends Activity</p> <pre><code> public void turnon() { Main dp = new Main(); dp.loaddata(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.second); okbutton = (Button) findViewById(R.id.okbutton); okbutton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { turnon(); } }); } </code></pre> <p>but it give force close any idea</p>
java android
[1, 4]
3,365,895
3,365,896
How to avoid returnURL getting appended automatically in server?
<p>I am using Forms authentication in <code>web.config</code> and when I am redirecting my page to some specific pages, returnUrl gets appended automatically and system redirects to Login page. These specific pages should be opened irrespective of the fact that the user is Logged in or not. </p> <p>This works fine when I debug it in Local machine but is giving such behaviors when I am deploying the build on Server.</p> <p>Please help me as I am stuck badly on this.</p>
c# asp.net
[0, 9]
2,539,369
2,539,370
Mutex could not be created. ASP.NET
<p>I have got problem with creation Mutex. I don't know why because server is using new NET Framework. Can you help me?</p> <p>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272</p> <p>There is my website and this error: <a href="http://www.rafaljaworowski.somee.com/" rel="nofollow">http://www.rafaljaworowski.somee.com/</a></p> <p>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. </p> <p>Exception Details: System.InvalidOperationException: Mutex could not be create</p>
c# asp.net
[0, 9]
1,969,684
1,969,685
ASP:Login - call Javascript function on wrong password/username
<p>I am using the ASP.net <code>ASP:Login</code>, and i want to call a javascript function if login fails.</p> <p>How can I accomplish this? </p>
c# asp.net
[0, 9]
4,133,319
4,133,320
c# convert `List<string>` to comma-separated string
<p>Is there a fast way to convert <code>List&lt;string&gt;</code> to a comma-separated <code>string</code> in C#?</p> <p>I do it like this but Maybe there is a faster or more efficient way?</p> <pre><code>List&lt;string&gt; ls = new List&lt;string&gt;(); ls.Add("one"); ls.Add("two"); string type = string.Join(",", ls.ToArray()); </code></pre> <p>Thanks</p> <p>PS: Searched on this site but most solutions are for Java or Python</p>
c# asp.net
[0, 9]
873,321
873,322
strange behaviour of php
<p>Today I noticed an ambiguity in php. I ran this code</p> <pre><code>$i = 5; $i = $i ++; var_dump($i); //output 5 instead of 6 </code></pre> <p>Let us assume the initial value of <code>$i is 5</code>. Now the new value should be 6 but it in fact turns out to be <code>5</code>. When I did the same thing in <code>C++</code> I got <code>6</code> as expected. Is it some bug in php which went unnoticed for so many years or is it some thing else. Can some one please explain it?</p>
php c++
[2, 6]
5,073,696
5,073,697
What's the preferred way to write this code when both achieve the same thing?
<p>I have a function here that loops through two wrappers and then loops through it's respective children and throws it a number to list out items in numerical order. Instead of using a for loop, I've decided to use the each jQuery function. Here is my question: </p> <p>Which way is better to achieve this and what are the advantages/disadvantages by going one way or the other?? Is it better to use a for loop?? </p> <p>This:</p> <pre><code>$(".articleContentWrapper").each( function () { var i = 1; $(this).find(".howToStepNumber").each(function () { var b = i++; $(this).html(b); }); }); </code></pre> <p>Or this: </p> <pre><code>$(".articleContentWrapper").each( function () { var i = 1; $(this).find(".howToStepNumber").each(function () { $(this).html(i++); }); }); </code></pre>
javascript jquery
[3, 5]
1,492,159
1,492,160
Android How to Sync Two Async tasks?
<p>I need to combine two lists each of which is returned after its own separate Async Call. How does one best coordinate Async calls like these. Are there any standard SDK methods for waiting until another async task has completed?</p>
java android
[1, 4]
2,415,118
2,415,119
JQuery: How to switch image back and forth?
<p>I have the following HTML:</p> <pre><code>&lt;div class="listing ref_1"&gt; ... &lt;div&gt;&lt;img src="toggleON.png" /&gt;&lt;/div&gt; ... &lt;/div&gt; &lt;div class="listing ref_2"&gt; ... &lt;div&gt;&lt;img src="toggleON.png" /&gt;&lt;/div&gt; ... &lt;/div&gt; &lt;div class="listing ref_3"&gt; ... &lt;div&gt;&lt;img src="toggleON.png" /&gt;&lt;/div&gt; ... &lt;/div&gt; </code></pre> <p>What I want to do is programmatically change the <code>toggleON.png</code> image to <code>toggleOFF.png</code>.</p> <p>I'm trying to use the following code to do so but it's not working:</p> <pre><code>$('.ref_2').src("toggleOFF.png"); </code></pre> <p>Anyone know what I'm doing wrong because the code above doesn't work.</p> <p>Also, is there a better way to handle this?</p>
javascript jquery
[3, 5]
4,575,425
4,575,426
Beginner question about e.Item.ItemIndex
<p>There's this line of code inside of some repeater's ItemDataBound event that includes e.Item.ItemIndex..Now I get it that ItemIndex is the index of the item in the list..</p> <p>What's "e" and "Item" here ? Actually I do have an idea. Just want to be more clear. Could someone please tell me in simple terms ? Thanks.</p>
c# asp.net
[0, 9]
2,724,707
2,724,708
Load (Lazy Loading) a Div whenever the DIV gets visible for the first time
<p>I want to enable a lazy loading for the contents of my website.</p> <p>Just like Jquery Image loading <a href="http://www.appelsiini.net/projects/lazyload" rel="nofollow">http://www.appelsiini.net/projects/lazyload</a> that is valid only for images.</p> <p>I want to do it for the content (DIV's).</p> <p>Suppose we have a long page then i want to download the div as they becomes visible.</p> <p>I will download the content using JSON or PageMethods. But i want the code that will execute the function for loading contents.</p> <p>So whether we can somehow find this that div is visible only scrolling down.</p> <p>Means i need to use some scroll events but dont know how.</p> <p>ANy help is appreciated.</p>
javascript jquery
[3, 5]
1,080,795
1,080,796
Setting label text in listview control in loggedin template
<p>I need to set a label text which is listview and the listview is in Logged in template. I am unable to set the value of the label. Here is the below code.</p> <pre><code>ListView ListView1 = (ListView)LoginView.FindControl("ListView1"); for (int i = 0; i &lt; ListView1.Controls.Count; i++) { Label someLabel = (Label)ListView1.Controls[i].FindControl("nItemsId"); if (someLabel != null) someLabel.Text = dt.Rows.Count.ToString(); } </code></pre>
c# asp.net
[0, 9]
4,082,513
4,082,514
How to show 6 instead of 3 slides for slideshow using a plugin
<p>How can I show more 3 slides ( =6) for <a href="http://www.jquerytools.org/demos/tabs/slideshow.html" rel="nofollow">slide show </a>plugin for the tabs? The default setting gives me only 3 slides, but I need 6.</p> <p>My Codes is:</p> <pre><code>$(function () { $(".slidetabs").tabs(".images &gt; div", { // enable "cross-fading" effect effect: 'fade', fadeOutSpeed: "slow", // start from the beginning after the last tab rotate: true, // use the slideshow plugin. It accepts its own configuration }).slideshow({ clickable: false }); }); </code></pre> <p><br/>Thanks.</p>
jquery asp.net
[5, 9]
4,280,926
4,280,927
how to dynamically create elements in a child window from a parent window
<p>im trying to dynamically create elements in the child window based on the values i have in the the parent window but no success.The child window is opening but not with the elements.Here is the code i've written,could some one please have a loot at it ? is this possible at all using javascript/jquery></p> <pre><code>function fnOpenPrint(){ openPrint = window.open('print.htm'); childWin = openPrint.document; var newDiv = childWin.createElement("&lt;div id='para'&gt;") newDiv.innerHTML = document.forms[0].txtBranch.value; } </code></pre>
javascript jquery
[3, 5]
3,392,972
3,392,973
search and count entries in a table jquery
<p>I have the following table:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;th&gt;Alarm&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;OK&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Missing&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;OK&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I want to count the rows in this table like this<br> OK = 2<br> Missing = 1</p> <p>But I have no idea how to do it with jQuery, the selector should be specified just for alarm columns because I have other columns contains ok and missing</p> <p><strong>Note:</strong> I want to count the rows for specific column in the table just for alarms column alaram columns contains 2 ok and 1 missing.</p>
javascript jquery
[3, 5]
4,980,996
4,980,997
How to read and write data to COM/Serial ports in Android?
<p>I have to read and write data to the COM ports of the device using android, I am using javax.comm package for that but when I installed the apk file, it is not displaying any ports of the device so is there any permission which I need to add in the manifest file? </p>
java android
[1, 4]
1,357,732
1,357,733
Jquery Problem Sort of Auto Slideshow
<p>I'm having some problems, I'd like to have a sort of slideshow where users have 4 buttons, and when they click one div appears and the others disappear. The div's are all in the same place with the same size. I'd also like to put this automatic</p> <pre><code>var Idx = 1; var IntervalKey = setInterval = (auto, 5000); var auto = function() { $("#MainImage").eq(Idx).fadeIn(1000); while(Idx &lt;3) { Idx++; $("#MainImage").eq(Idx).hide(); } Idx++; if(Idx&gt;3) { Idx = 0; } }; $(".botao-imagem").click(function(){ Idx = $(".botao-imagem").index(this); auto(); }); </code></pre>
javascript jquery
[3, 5]
1,985,086
1,985,087
How can I get opener's element with jQuery?
<p>Just like in <a href="http://en.wikipedia.org/wiki/JavaScript" rel="nofollow">JavaScript</a>:</p> <pre><code>opener.document.getElementByName </code></pre> <p>jQuery: ??</p> <p>Is there any way to get <code>opener</code>'s element with <a href="http://en.wikipedia.org/wiki/JQuery" rel="nofollow">jQuery</a>?</p>
javascript jquery
[3, 5]
3,483,143
3,483,144
To find Control in Other page
<p>I'm creating a web application using C#.net My webpage contains a Hidden Field Control. I need to use this control's value in another page. I declared a method and inside this method i passed the entire page as a parameter. In another classfile i defined this method. Inside the method i tried to access the Controls that was in the page created. I tried but i can't get the control.</p> <p><strong>Code:</strong></p> <pre><code>HiddenField hdnTotal = page.FindControl("hdnTotal") as HiddenField; </code></pre> <p>Is anyother option to find this control in other class file. </p> <p>Thanks In Advance!</p>
c# asp.net
[0, 9]
198,990
198,991
How do I find this JQuery element?
<pre><code>&lt;input type="text" class="the_name" data-num="1" value="Choose a Font."&gt; </code></pre> <p>Find all elements that have "input.the_name" <strong>AND</strong> data-num = 1. How do I do both of those attributes?</p>
javascript jquery
[3, 5]
2,975,017
2,975,018
facebook share a page in c#
<p>When I click 'Share', then it opens facebook share page in a new tab. I want to show temp.jpg in left bar in this page. How to do this?</p> <p>test.aspx</p> <pre><code>&lt;div id="page-wrap"&gt; &lt;!-- AnythingSlider #1 --&gt; &lt;ul id="slider1" style="width: 778px; height: 452px; background:#fff;"&gt; &lt;li&gt; &lt;div style="float: left; padding-right: 35px; padding-left:50px;"&gt; &lt;img src="../../img/temp.jpg" style="width: 264px; height: 377px; border: none;" /&gt; &lt;uc:DownloadControl ID="DownloadControl1" runat="server" PageParameters="1" /&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;uc:DownloadControl ID="DownloadControl2" runat="server" PageParameters="2" /&gt; ... </code></pre> <p>DownloadControl.ascx</p> <pre><code>&lt;div style="float: left"&gt; &lt;a class="icerik" id="facebookShare" runat="server" target="_blank"&gt; &lt;img border="0" src="images/facebook.jpg" alt="Resorts" title="Hotels &amp; Resortss" /&gt; Share &lt;/a&gt; </code></pre> <p></p> <p>DownloadControl.ascx.cs</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { facebookShare.HRef = "http://www.facebook.com/sharer.php?u=http://www.test.com/test.aspx"; } </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
2,470,183
2,470,184
How to stop looping if the value is same (have double values)?
<p>How to stop looping if the value is same (have double values)? For example, result:</p> <pre><code>1. Value = 1 2. Value = 5 3. Value = 5 4. Value = 7 5. Value = 9 </code></pre> <p>There's double values, in looping number two and three. The condition if in looping have double values(same) it will stop with using alert('Do not enter with same value'), something like that. How to?</p> <p>Thanks.</p>
php javascript
[2, 3]
3,482,406
3,482,407
ObjectDataSource not showing up Data Objects in Configure Data Source
<p>I am using visual studio 2008, i included a class in the AppCode folder and wated to use its functions in ObjectDataSource.</p>
c# asp.net
[0, 9]
956,586
956,587
using jquery - 2 different links that open the same window but display the appropriate content?
<p>I'm trying to work out how this can be achieved using jQuery, I have page 1 which has 2 links namely link 1 and link 2, what I want to achieve is when I click link 1 a new browser window is opened displaying the content for link 1 and when I click link 2 the same window is displayed but with the content for link 2.</p> <p>Is this a matter of creating a page and hiding both sets of content then displaying the content when the appropriate link is clicked?</p> <p>Has anyone any tutorials that are similar to this?</p>
javascript jquery
[3, 5]
2,033,042
2,033,043
Javascript MVC + listening and dispatching events with jQuery
<p>I'm learning javascript and have a question about listening and dispatching events with jQuery. </p> <p>In my Model, I have a function that triggers a change event: </p> <pre><code>Model.prototype.setCurrentID = function(currentID) { this.currentID = currentID; $('body').trigger('change'); } </code></pre> <p>The trigger event requires an element, so I bound it to the 'body'. Is this good practice or bad practice? </p> <p>In AS3, which I'm more familiar, I would simply dispatch a global event from the model, passing in a const value, listening for this event with an instance of the Model:</p> <pre><code>var model:Model = new Model(); model.addEventListener(CONST_VALUE, handlerFunction); </code></pre> <p>In jQuery, within my View object, I need to attach an element to the listener as well, so I bound it to the 'body' once again:</p> <pre><code>var View = function(model, controller) { var model; var controller; this.model = model; this.controller = controller; $('body').change(function(evt) { updateSomething(evt); }); function updateSomething(evt){console.log('updating...')}; } </code></pre> <p>It's working, but I'm interested in your take on the subject.</p>
javascript jquery
[3, 5]
3,312,906
3,312,907
question regarding serializeArray and passing into url
<p>I am not totally familiar with javascript, jquery.</p> <p>I am trying to do the following. Note a-f are names for the dropdown menus. Can someone help clarify? thanks</p> <pre><code> var a_params = $("#a").serializeArray(); var b_params = $("#b").serializeArray(); var c_params = $("#c").serializeArray(); var d_params = $("#d").serializeArray(); var e_params = $("#e").serializeArray(); var f_params = $("#f").serializeArray(); params.push({ name: 'menu_mode', value: '2-1' }); $.get("./scripts/model.cgi", a_params,b_params,c_params,d_params,e_params,f_params, function(data){ $("#grapharea").html(data); $("#prog").html(" "); }); </code></pre> <p>More Comments: in the cgi script i am dumping the inputs to see if i am receiving the values from the a-f_params but this isn't the case. Any ideas why?</p>
javascript jquery
[3, 5]
2,331,807
2,331,808
append li into an existing ul inside another html file
<p>I like to append an li into an existing ul like here: <a href="http://stackoverflow.com/questions/1145208/jquery-how-to-add-li-in-an-existing-ul">jQuery: how to add &lt;li&gt; in an existing &lt;ul&gt;?</a></p> <p>But in my code the li is an existing li from another html file. So 'm having the products.html with an ul. In this html file I like to append the li</p> <pre><code>&lt;li class="first-li" id="hotel_belle"&gt; &lt;h2&gt;Hotel Belle&lt;/h2&gt; &lt;div&gt; &lt;img class="sub-img" alt="picture from hotel" src="pic/products/HotelBelle.png" /&gt; &lt;p&gt;Lorem Ipsum&lt;/p&gt; &lt;a href="#"&gt;&lt;img class="btn-cart" alt="add this product to cart" src="pic/book/cart.png" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;/li&gt; </code></pre> <p>into the cart.html:</p> <pre><code> &lt;div id="inner-cart-content"&gt; &lt;ul id="content-cart"&gt; &lt;li&gt; //The new li element from products.html </code></pre> <p>in the JavaScript I wrote this:</p> <pre><code>$(".btn-cart").click(function(){ var cart = $(this).parents("li").eq(0); //$("#inner-cart-content ul").append('cart'); &lt;--this is not working }); </code></pre> <p>So what do I have to do?</p>
javascript jquery
[3, 5]
3,147,909
3,147,910
Make an HTTP request to get a redirect URL?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2659000/java-how-to-find-the-redirected-url-of-a-url">Java - How to find the redirected url of a url?</a> </p> </blockquote> <p>I need to request a URL (URL1). That URL responds with a redirect, to the actual, eventual destination URL (ULRL2). When I use the DefaultHttpClient to make the HTTP call it "helpfully" follows the redirect and delivers the response from URL2, which is not what I want. I want to acquire the URL for URL2, the one being redirected to, without getting its response.</p> <p>Can I do it with DefaultHttpClient, or is another class required?</p> <p>==== SOLUTION ========</p> <pre><code>httpclient.getParams().setBooleanParameter("http.protocol.handle-redirects", false); </code></pre>
java android
[1, 4]
4,486,167
4,486,168
Want to add element. What's wrong?
<p>In <a href="http://jsfiddle.net/littlesandra88/w5nAr/5/" rel="nofollow">this</a> JSfiddle have I a checkbox, a label and a submit button.</p> <p>When the checkbox is checked, and submit is clicked a 'x' should appear, like to does now.</p> <p>When the checkbox is unchecked, and submit is clicked a 'x' should disappear, like to does now.</p> <p>The problem is that the 'x' doesn't appear again, if the checkbox is checked, and submit is clicked.</p> <p>This is my code</p> <pre><code>$('form').submit(function() { if( $("input[type=checkbox]").is(':checked')){ $("label").add(); }else{ $("label").detach(); } return false; }); &lt;form action="" method="post"&gt; &lt;input id="element" signed" type="checkbox" checked&gt; &lt;label for="element"&gt;x&lt;/label&gt; &lt;button type="submit"&gt;Submit&lt;/button&gt; &lt;/form&gt; </code></pre> <p>Any idea what's wrong?</p>
javascript jquery
[3, 5]
5,713,671
5,713,672
How good is Kivy for android?
<p>Very little is written about kivy, can you please tell me how good is kivy cross platform framework for Android? </p>
android python
[4, 7]
2,395,853
2,395,854
Vector-Java equivalent in PHP?
<p>Is there a:</p> <p>1> Vector(Java) class<br> 2> ListIterator<br> 3> Single Linkedlist </p> <p>equivalent available in PHP?</p>
java php
[1, 2]
2,191,732
2,191,733
Gridview Datakeys problem
<p>I am trying to get the LocationID for the row in the gridview. grdFavoriteMerchant is the gridID. I am new to using gridview. </p> <p>I am using this part of code to get LocationID but it gets MerchantID when row.RowIndex = 0. </p> <pre><code>int LocationID = Convert.ToInt32(grdFavoriteMerchant.DataKeys[row.RowIndex].Value); </code></pre> <p>In the aspx, i have <code>DataKeyNames="Merchant_id, zipcode, Location_id"</code></p> <p>I am wondering how i can give hardcoded "LocationID" in the above code to get LocationID back. </p> <p>I hope i am clear :)</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
1,700,157
1,700,158
c# and checkboxes in asp.net
<p>Hy all,</p> <p>I want an idea from you.I have 2 tables.From table1 I want to populate a checkboxlist and from table2 I want to also populate a checkboxlist but depending on the first checkboxlist.So if I have 5 rows in table1 then 5 checkbox. I want if I check the first checkbox some others checkbox appear with data from table2.So check a checkbox from table1 let's say for exemple 3 other checkboxes appear.So if I have a checkbox with country America when i check it 3 other checkboxes with California,Hawaii and Chicago to appear.Can you give me a point from where I can start? the tables are hooked up with ids that depend one another but I don't know how to make the checkboxes.</p>
c# asp.net
[0, 9]
89,048
89,049
destroy $_SESSION after cliking 'Cancel' button
<p>I would like to destroy $_SESSION['userList'] after cliking 'Cancel' button. However, the $_SESSION['userList'] is destroied when page load.</p> <p>Below is my code:</p> <pre><code>&lt;a href='#' class="btn" onClick="resetForm()"&gt;&lt;span&gt;Cancel&lt;/span&gt;&lt;/a&gt; &lt;script type="text/javascript"&gt; function resetForm() { &lt;?php unset($_SESSION['userList']); ?&gt; } &lt;/script&gt; </code></pre> <p>Really appreciate for any help.</p>
php javascript
[2, 3]
1,310,038
1,310,039
Android Check If Sim is Locked
<p>I have this running at the moment. It keeps outputting the value 5 which means SIM_READY</p> <pre><code>TelephonyManager telMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); int sim = telMgr.getSimState(); String sim2 = Integer.toString(sim); Log.d("SIM STATE", sim2); </code></pre> <p>I have run this on a few phones some that I know are locked and some that are not.</p> <p>Is there something that I am missing as I thought this approach would output if the sim was locked by the network.</p> <p>Cheers</p>
java android
[1, 4]
4,243,775
4,243,776
What was the first available version of a Java IDE
<p>A bit of a strange question, I have done quite a bit of research on this (about 5 hours now) and can't seem to come up with an answer: What was the first available Java IDE (as in an IDE for Java, not an IDE made with Java).</p> <p>If anyone happens to know the same information for one for Javascript (ECMAScript) that would be great.</p> <p>If they also happen to have references, even better!</p> <p>Thanks in advance.</p>
java javascript
[1, 3]
4,882,534
4,882,535
Why does a textbox lose its disabled attribute on postback but not its value attribute?
<p>This is my program</p> <pre><code>&lt;script src="Scripts/jquery-1.6.4.js" type="text/javascript" language="javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" language="javascript"&gt; function one() { $(document).ready(function () { $('#&lt;%= textbox.ClientID %&gt;').attr('disabled', 'disabled'); }); } function two() { $(document).ready(function () { $('#&lt;%= textbox.ClientID %&gt;').attr('value', 'hello stackoverflow.com!'); }); } &lt;/script&gt; &lt;input type="button" value="one" onclick="one();" /&gt; &lt;input type="button" value="two" onclick="two();" /&gt; &lt;asp:TextBox ID="textbox" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="postbackButton" runat="server" Text="post back" /&gt; </code></pre> <ol> <li><p>When I click on 'button one', the textbox switches to disabled. Then I click on 'postback button' and the textbox switches to enabled (It loses what I set!).</p></li> <li><p>When I click on 'button two', the textbox changes its value. Then I click on 'postback button' and the textbox doesn't lose its value.</p></li> </ol> <p>How could I do to keep the disabled state of the button? If I could do this on client-side it would be better..</p> <p>Thanks a lot, Luciano.</p>
jquery asp.net
[5, 9]
4,993,086
4,993,087
Javascript/jQuery - Timezone Change Script with Multiple Fields
<p>I have written a javascript for changing the "timezone" of a field on my website using a dropdown select menu.</p> <p>You can see the script here: <a href="http://jsfiddle.net/dTb76/14/" rel="nofollow">http://jsfiddle.net/dTb76/14/</a></p> <p>However, I have reached the limits of what I know how to do - I need the script to modify several "time" fields, however, at the moment it can only work with one field.</p> <p>I've been trying to figure out what changes to make for days, however I have not been having much luck. Best I can tell, I need some kind of "foreach" statement, telling it to store the original time for each field and then modify it by whatever is selected in the select, however I am not sure how to implement that in jQuery/javascript.</p> <p>Would appreciate help.</p>
javascript jquery
[3, 5]
2,921,108
2,921,109
Get content of an iframe after it loads with
<p>I want to achieve the fallowing goal.I want by the click of a button to get the domain name entered in one input and load it into an iframe. What i have trouble with is after i load the specific site in the iframe how can i get the DOM of the loaded site in the iframe ? I need to save the exact path of an element of my choosing from the newly loaded site in the iframe by clicking on it. Any help would be much appreciated. Thank you.</p>
javascript jquery
[3, 5]
1,578,867
1,578,868
Strange behaviour jquery
<p>Ok, I've seen this in some topics but haven't fixed my script.</p> <p>I have a piece of jquery that doesn't work because of I use it to manage (validate ) a piece of html (form ) that is loaded using a jquery fucntion load() after loading the page.</p> <p>But if I put for example an <code>alert("Something")</code> in the script outside the functions, it works.</p> <p>I've tried putting the validation script inside these beginnings but it doesn't work...</p> <pre><code>$(window).bind("load", function() { $(document).ready(function () { </code></pre> <p>it is very strange... do have you a solution?</p> <p>Update: working now, check the first answer's solution!</p>
javascript jquery
[3, 5]
940,926
940,927
jquery: How to know if a page is not in focus?
<p>For example, if user is doing other things but not viewing this page, jquery/javascript can know?</p> <p>I don't need to be very accurate, just roughly.</p>
javascript jquery
[3, 5]
400,669
400,670
Mobile (Smart phone application) architecture
<p>I am into iPhone development, and would like to know more about Smart phone application architectures in general. Is there are any reusuable architectures which would be applicable for both iPhone and Driod platforms?</p> <p>Would appreciate if you can point me to any ebooks or URL.</p> <p>Thanks for your time,</p>
iphone android
[8, 4]
4,178,123
4,178,124
porting screen shot java app on android
<p>i want your help very badly..bcz i am seeking an answer for this from couple of day's but did not find a bit...</p> <p>my query is i have a screen shot app written in java...i just want to port it on android emulator and run it..i know i have to rewrite some android specific code but can anyone tell me what changes i should make to the screen shot java app to make it run on android platform.. here is my java screen shot app: (i know for this the device should be rooted i am okay for that)</p> <pre><code>import java.awt.AWTException; import java.awt.Robot; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; class ScreenCapture { public static void main(String args[]) throws AWTException, IOException { // capture the whole screen BufferedImage screencapture = new Robot().createScreenCapture( new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()) ); // Save as JPEG File file = new File("screencapture.jpg"); ImageIO.write(screencapture, "jpg", file); // Save as PNG // File file = new File("screencapture.png"); // ImageIO.write(screencapture, "png", file); } } </code></pre>
java android
[1, 4]
4,266,019
4,266,020
How to show popup message box in ASP.NET?
<p>Work on C# VS 2005 AJAX enabled web. I want to show a pop up message on my web page. In my desktop application I write the following code to show a message:</p> <pre><code>MessageBox.Show("Data Saved Successfully.", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); </code></pre> <p>I want this kind of message. Where i can set message icon, Message Header, Message text....I write a code for web :</p> <pre><code>s = "&lt;script type=\"text/javascript\"&gt;alert('InCorrect DateFormat. Check Required.');&lt;/script&gt;"; ClientScript.RegisterStartupScript(GetType(), "Alert", s); </code></pre> <p>Why it's not work ....And how to get message like desktop application.</p> <p>my button under the ajax update panel.After click data save but message is not show....if i put button out the update panel it's work show pop up message ....but i want button must stay on update panel</p>
asp.net javascript
[9, 3]
2,280,901
2,280,902
Facebook-like JavaScript popup help
<p>If you look at the following screenshot:</p> <p><img src="http://i.stack.imgur.com/xLrIx.png" alt=""> You will see a popup box <strong>(NOT THE MODAL)</strong> with some content that says 'Security Check' which is basically some helpful information that the user can invoke by clicking a link. I know how to create similar things using jQuery and simple HTML/CSS but looking at the Facebook example I have noticed that the help box <strong>IS NOT</strong> in the source...</p> <p>Therefore it is being loaded in from somewhere else and then displayed to the user in the DOM... how would I create something similar?</p> <p>Thanks</p>
javascript jquery
[3, 5]
221,791
221,792
fade a gallery of 9 thumbnails in randomly 1 at a time using jquery
<p>I have 9 thumbnail images (3 x 3), on page load I want to fade these images in randomly so maybe maybe image #4 fades in then 8 then 3...</p> <p>At the moment Im trying to work out how this can be done, does a random number have to be generated for each image and then loop through each element adding the number to the .data attribute?</p> <p>So far Ive managed to create a variable that generates a random number but not sure how I integrate the loop, <a href="http://jsfiddle.net/kyllle/MGW8k/" rel="nofollow">http://jsfiddle.net/kyllle/MGW8k/</a></p> <p>Kyle</p>
javascript jquery
[3, 5]
4,257,520
4,257,521
Resizing a cropped image using jQuery and no server side code
<p>I'm using a bit of jquery to search Flickr, produce a set of thumbnails, select a thumbnail, load the fullsize image and then crop the image by setting it as the background image of a DIV. An example of the final genrated DIV containing an image is below:</p> <pre><code>&lt;div class="imgwrapper2" style="background-image: url(&amp;quot;http://farm6.static.flickr.com/5094/5425332847_2c4ab1a53a.jpg&amp;quot;); width: 257px; height: 271px; background-position: -69px -77px;"&gt; &amp;nbsp; &lt;/div&gt; </code></pre> <p>I'd now like to look at resizing the image, well resizing the DIV which contains the background image and stretching the background image.</p> <p>Is this possible using the above HTML and jQuery? If so can anyone suggest any jQuery plugins that might help?</p> <p>If you dont think this is possible using the above output, might it be easier if the div wraps an IMG tag with overflow set to invisible?</p>
javascript jquery
[3, 5]
4,338,010
4,338,011
Detecting NON mobile browsers
<p>So I'd like to redirect mobile users to a different page. But instead of trying to detect any number of mobile browsers, I'd just like to see if the user is using IE, Firefox, Safari, Chrome, or Opera; all other users go to the mobile site.</p> <p>My biggest problem is detecting regular Safari from mobile Safari.</p> <p>Any good way to do this?</p>
c# asp.net
[0, 9]
4,215,960
4,215,961
How to determine whether the user has switched to another tab of the current browser
<p>I wish to determine using jquery or javascript that is the user has switched tab standing on the same browser?</p> <p>I.e. if the user is currently standing on browser say mozilla-firefox tab no.1 , now he has opened another tab say tab no.2 , at that point a popup should appear , with the message "tab changed"</p>
javascript jquery
[3, 5]
2,654,347
2,654,348
Animating a div in with jQuery and pushing down content below it
<p>I am animating in divs in a specific order. I start them all at the top with absolute positioning and <code>display: none</code> so they are on top of each other in the same space and invisible. In a specific order determined by something else, I want to fade them in individually and slide down the ones that have already been faded in. </p> <p>I'm using code that loops through the comments and checks if one is ready to go (by the other metric that is not important). If it is, that is when I want to do this fade in/slide down others thing. Here's how I'm (unsuccessfully) trying to do this: </p> <pre><code>$('#item' + i).fadeIn("slow"); $('#item_' + i).animate({ top: '0px' }, 500); $('#item_' + i).css('position', 'relative'); </code></pre>
javascript jquery
[3, 5]
2,463,797
2,463,798
Android ViewGroup Remove Views?
<p>I have a tabhost. One of the tab's activity is a ViewGroup. This viewgroup manages two different activities. I do this so I can navigate between activities within a tab. I add the activities like so:</p> <pre><code>if (videoViewLive == null) videoViewLive = getLocalActivityManager().startActivity("VideoPlayerLive", new Intent(this,VideoPlayerLive.class). addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)).getDecorView(); videoViewLive.setVisibility(View.VISIBLE); this.addContentView(videoViewLive, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT)); </code></pre> <p>Each of my content view activities receives asynchronous notifications. What I would like to do is somehow remove the activity/content view that is not being used. So in essence, I load content view A, B dies, becomes null, or whatever, and vice versa. I want to do this because the way I am managing these views seems problematic. (errors when loading a view, loading the other view, then loading the first again, etc.)</p>
java android
[1, 4]
4,674,013
4,674,014
javascript url validation help
<p>If user enters a URL, as soon as they have completed the URL and hit enter the URL will appear below the text box and the text box will be emptied again. </p> <p>It will only do this if it is a validly formed URL. For example if someone writes <code>blahbla.243</code>, this will not do anything as it is not a valid URL. </p> <p>It will, however, accept any variations that are valid such as <code>http://www.url.com</code> or <code>www.url.co.uk</code> and <code>url.com.au</code>. </p> <p>And it will remove anything after the end of the country code for example if the person types <code>www.abc.net/dlkjfk</code> then only <code>www.abc.net</code> will be accepted.</p> <p>Thank you!</p>
php javascript
[2, 3]
5,398,872
5,398,873
Animating div waterfall in javascript/jquery
<p>I'm trying to animate a waterfall of divs like in duitang.com . i tried the following scripts:</p> <p><a href="http://jsfiddle.net/XKdKt/3/" rel="nofollow">http://jsfiddle.net/XKdKt/3/</a><br> <a href="http://jsfiddle.net/NFPKc/" rel="nofollow">http://jsfiddle.net/NFPKc/</a></p> <p>The second link seems like it's closest to what I want because the div appears from bottom to top unlike the first and second link, but the div under doesnt scroll with the new div.</p> <p>Can anyone lead me to the right direction to make it look similar to duitang's?</p> <p>Your help would be greatly appreciated. Thanks.</p>
javascript jquery
[3, 5]
2,875,752
2,875,753
Javascript function not being called onblur
<pre><code>function close() { console.log('close'); $("#display").hide(); } </code></pre> <p>I am trying to call a closefunction when the user clicks out of the input box, but it doesn't seem to be working.</p> <p>Doesn't work:</p> <pre><code>&lt;input type="text" name="searchQuery" id="searchQuery" onblur="javascript: close();" onkeyup="javascript: getSuggest(); "/&gt; </code></pre> <p>Works:</p> <pre><code>&lt;input type="text" name="searchQuery" id="searchQuery" onblur="javascript: alert('msg');" onkeyup="javascript: getSuggest(); "/&gt; </code></pre> <p>getSuggest returns false if that's relevant.</p>
javascript jquery
[3, 5]
3,804,529
3,804,530
window.open() not working in firefox to open new popup window using javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/726761/javascript-open-in-a-new-window-not-tab">JavaScript open in a new window, not tab</a> </p> </blockquote> <p>Code</p> <pre><code>&lt;asp:Button ID="btnPopupWindow" runat="server" Text="Popup Window" OnClientClick="PopupWindow();" /&gt; </code></pre> <p>JavaScript</p> <pre><code>function PopupWindow() { testwindow = window.open("http://google.com", "Google", "menubar=0,addressbar=0, width=500, height=500"); testwindow.focus(); } </code></pre> <p>Using above code i can open new popup window in IE, but this code is not working in the firefox.<br> What is the problem with my code?</p>
javascript asp.net
[3, 9]
1,278,742
1,278,743
assign a value from a foreach loop to an asp:button CommandArgument
<p>The code behind file creates a list of employees and the asp.net page loops through list. Now, How do I assign the employeedID to the commandArgument of an asp:button?</p> <pre><code> &lt;%foreach(var employee in employeesList){%&gt; &lt;tr&gt; &lt;td&gt;&lt;%=employee.firstName%&gt;&lt;/td&gt; &lt;td&gt;&lt;%=employee.lastName%&gt;&lt;/td&gt; /*How to access employee.Id in the commandArgument? */ &lt;td&gt;&lt;asp:Button ID="btnDeleteEmployee" runat="server" CommandArgument='' Text="Delete" OnCommand="btnDeleteEmployee_Click" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;%}%&gt; </code></pre>
c# asp.net
[0, 9]
2,302,570
2,302,571
how to change the date format to another?
<p>From a database I am getting a date which's format is like this</p> <p>2012-7-8</p> <p>but I want to convert this to look something like this</p> <p>2012 July 8th</p> <p>but I am unable to do this, is there any way?</p>
java android
[1, 4]
138,244
138,245
.animate to one element
<p>I´m doing an animation hover using this function:</p> <pre><code> function lookbookhover(){ var lookbook = $('.lookbook_info') lookbook.bind({ 'mouseenter' : function(){ lookbook_animate(200) }, 'mouseleave' : function(){ lookbook_animate(30) } }) } function lookbook_animate(h){ $('.lookbook_info').animate({ height: h }, 300 ); } </code></pre> <p>The problem I have is that when the user hovers one item (.lookbook_info) it animates all the others .lookbook_info that are on the page, how can I point to just animate just one element?</p> <p>I know it´s using $(this) but I haven´t get the result.</p>
javascript jquery
[3, 5]
3,055,933
3,055,934
Load First 20 Images then Show Page
<p>I am using the jQuery Booklet Plugin and have a booklet that works great. However I have one hangup. The booklet is fairly large and has many images (about 50) and the first time you visit the page it is slow to load. What I would like to do is take the script I currently have and load the first 20 images (roughly) then show the booklet while the rest of the images load in the background. Here is the script I am using and would like to modify it: </p> <p><em><strong>JS</em></strong></p> <pre><code>$(function() { var $mybook = $('#mybook'); var $bttn_next = $('#next_page_button'); var $bttn_prev = $('#prev_page_button'); var $loading = $('#loading'); var $mybook_images = $mybook.find('img'); var cnt_images = $mybook_images.length; var loaded = 0; //preload all the images in the book, //and then call the booklet plugin $mybook_images.each(function(){ var $img = $(this); var source = $img.attr('src'); $('&lt;img/&gt;').load(function(){ ++loaded; if(loaded == cnt_images){ $loading.hide(); $bttn_next.show(); $bttn_prev.show(); $mybook.show().booklet({ //Booklet Options }); } }).attr('src',source); }); }); </code></pre> <p>How would I modify this code to load the first 20 images and then show the booklet? Please provide examples. </p>
javascript jquery
[3, 5]
6,025,110
6,025,111
Select by next instance of class with jQuery
<p>I'm looking to convert a function that selects by id to select the next instance of a given class. </p> <p>Here is the code.</p> <pre><code>function swap3(oldDivId, newDivId) { var oldDiv = document.getElementById(oldDivId); var newDiv = document.getElementById(newDivId); oldDiv.style.display = "none"; newDiv.style.display = "block"; } </code></pre>
javascript jquery
[3, 5]
5,345,213
5,345,214
jquery - positioning of cloned object
<p>If the user hits return while in one of the given text input fields, I'm trying to insert a new, blank text input field right below it - and before the other existing ones. The code below works fine in appending it to the bottom of the container, but I'm struggling with how to place it directly below the selected input field. </p> <p>Any suggestions?</p> <p>JS</p> <pre><code> if (event.keyCode == 13) { $(this).clone(true).val('').appendTo('#item_container').focus(); return false; } </code></pre> <p>HTML</p> <pre><code>&lt;div id="item_container"&gt; &lt;input type="text" class="list_item"&gt; &lt;input type="text" class="list_item"&gt; &lt;input type="text" class="list_item"&gt; &lt;input type="text" class="list_item"&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
2,848,349
2,848,350
JQuery create a list based on another list
<p>what I am trying to do is generate an html list based from another list on the page. I have a list along the lines of below:</p> <pre><code>&lt;ul&gt; &lt;li class="chosen"&gt;content&lt;/li&gt; &lt;li class="something"&gt;content&lt;/li&gt; &lt;li class="something"&gt;content&lt;/li&gt; &lt;li class="something"&gt;content&lt;/li&gt; &lt;li class="something"&gt;content&lt;/li&gt; &lt;li class="chosen"&gt;content&lt;/li&gt; &lt;li class="chosen"&gt;content&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Whats the best plan of action to create a jquery function which will find the list items with the class of "chosen" and create another list with just these.</p> <p>Any help would be great. Thank you.</p>
javascript jquery
[3, 5]
4,384,514
4,384,515
Passing a parameter to jQuery function?
<p>This looks very simple but I have little experience with jQuery and I can't wrap my head around it.</p> <p>Let's say I have a dynamically generated HTML table, and in each row of this table is a link:</p> <pre><code>&lt;a id='edit'&gt;Edit User&lt;/a&gt; </code></pre> <p>Now, the link should call a function with each user's ID as a parameter. I could do that inline liek this:</p> <pre><code>&lt;a id='edit' onClick='editUser(&lt;?php echo $row['id']; ?&gt;)'&gt;Edit User&lt;/a&gt; </code></pre> <p>But how do I do this in jQuery?</p> <p>I can call the function like this:</p> <pre><code>$('a#edit').click(function () { editUser() return false; }); </code></pre> <p>But how do I pass the ID to this function? I know I could first stick it into a hidden field and then get it from there by element id, but surely there's a better way?</p> <p>I realize all the links would have the same id this way, so should I dynamically create the link ids by appending the user id? But then how do I call the jQuery?</p>
php javascript jquery
[2, 3, 5]
1,798,089
1,798,090
get the 100px area where the mouse is clicked
<p>I have graph on web page so i want to add the zoom in/zoom out functionality. my graph is inside the jquery tab. so when user want to zoom particular area of page inside the tab that should be zoom. For ex: when user double click on page and inside the tab to zoom 100px by 100px area shoud be zoom. Double click zoom in and single click zoom out</p> <p>Please guide me how to do this.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
3,903,465
3,903,466
How Bind clickable events for shapes on canvas?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3213877/click-on-given-element-in-canvas">Click on given element in canvas</a> </p> </blockquote> <p>I am creating a bar chart With Canvas. when click on bar it has to display its X-axis and Y-axis values.</p>
c# jquery
[0, 5]
2,641,522
2,641,523
Question regarding benifits of using one over other regarding function syntax
<p>I was reading the difference between Function Declaration and Function Expression at here </p> <p><a href="http://stackoverflow.com/questions/1013385/what-is-the-difference-between-a-function-expression-vs-declaration-in-javascript">What is the difference between a function expression vs declaration in Javascript?</a></p> <p><a href="http://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname">Javascript: var functionName = function() {} vs function functionName() {}</a></p> <p>I came to know about the difference that one is defined at parse time and the other one at run time. But my curiosity is regarding which to use and which not to use and why one will be preffered over other.</p>
javascript jquery
[3, 5]
1,514,567
1,514,568
password generator in c#
<p>I want to create a random password generator in my ASP.NET C# web application.</p> <p>I have created that but it is applicable only for the integer format. If I give any characters it shows the debugging error as "my input format is wrong".</p> <p>But i want to enter both string and integer. For example my textbox field may be </p> <blockquote> <p>dft-001</p> </blockquote> <p>I want a random password for this value and also my length should be restricted to 8 digits or characters only.</p> <p>My current code:</p> <pre><code>public static string CreateRandomPassword(int PasswordLength) { string _allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789-"; Random randNum = new Random(); char[] chars = new char[PasswordLength]; int allowedCharCount = _allowedChars.Length; for (int i = 0; i &lt; PasswordLength; i++) { chars[i] = _allowedChars[(int)((_allowedChars.Length) * randNum.NextDouble())]; } return new string(chars); } protected void Button1_Click(object sender, EventArgs e) { userid.Text = "Your id is: " + id.Text; if(id .Text!="") { string myInt = id.Text.ToString(); password.Text = "Your password is: " + CreateRandomPassword(int.Parse(myInt)); } } </code></pre>
c# asp.net
[0, 9]
1,926,824
1,926,825
jQuery get values of checked checkboxes into array
<p>I am trying to get values of all checkboxes that are currently checked and store them into an array. Here is my code so far:</p> <pre><code> $("#merge_button").click(function(event){ event.preventDefault(); var searchIDs = $("#find-table input:checkbox:checked").map(function(){ return $(this).val(); }); console.log(searchIDs); }); </code></pre> <p>However this outputs more than I need. I not only get the values, but some other stuff I don't want.</p> <blockquote> <p>["51729b62c9f2673e4c000004", "517299e7c9f26782a7000003", "51729975c9f267f3b5000002", prevObject: jQuery.fn.jQuery.init[3], context: document, jquery: "1.9.1", constructor: function, init: function…]</p> </blockquote> <p>I would like just ID's (first 3 items in this case).</p> <p>By using <code>$.each</code> and pushing values to an array I get desired output:</p> <pre><code>$("#find-table input:checkbox:checked").each(function(){ myArray.push($(this).val()); }) </code></pre> <blockquote> <p>["51729b62c9f2673e4c000004", "517299e7c9f26782a7000003", "51729975c9f267f3b5000002"]</p> </blockquote> <p>However I'd like to use <code>$.map</code>, since it saves me a line of code and is prettier.</p> <p>Thanks</p>
javascript jquery
[3, 5]
783,837
783,838
How to display month number on selecting month name
<p>I am having list of Months displayed in drop down on selecting particular month i would like to display the number of the month in a text box</p> <p>For example if i select <code>January</code> i would like to display as <code>01</code> like wise for all the other too</p> <p>This is the sample code i have written</p> <pre><code>string mnthname="january"; int i=DateTime.ParseExact(mnthname, "MMMM", CultureInfo.CurrentCulture).Month; </code></pre>
c# asp.net
[0, 9]
5,367,855
5,367,856
Change all CSS property at run time
<p>I have page which has several Button &amp; images inside the <code>&lt;div&gt;</code>. I have such requirement :</p> <p>On clicking over any image or button a div/page appears which contains all the css property and gives option to change the CSS property of concern element. eg. color, value, font size etc.... </p> <p>Is there any plugin available for that or do i need to create by own. I'd appreciate your suggestion</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,263,644
5,263,645
Can't access public member of public static class inside public class (all in a separate jar)
<p>Well, that's a mouthful of a title. It gets my point across, though. Here's the gist of my code, inside the jar:</p> <pre><code>public class NetworkShared { public static class LoginRequest { public String Username; //... </code></pre> <p>Then, to access it, I'm doing something like this:</p> <pre><code>NetworkShared.LoginRequest request = new NetworkShared.LoginRequest(); request.Username = "example"; //this is the problem line </code></pre> <p>It's when I try to access request.Username that I have a problem. Eclipse says the field NetworkShared.LoginRequest.Username is not visible. I'm puzzled because it's public all the way down. Java's not my main language, so I might be missing something. Does anyone know?</p> <p>EDIT: I might add that this on Android. NetworkShared is in its own JAR and I've added it to the build path. Nothing else is wrong except for accessing request.Username.</p>
java android
[1, 4]
4,241,072
4,241,073
multiple submit button
<p>i've a form POST with multiple submit buttons. i understand to get this to work i must have them with different name.</p> <p>however, i wanna keep the name to be the same because i wanna handle the POST using a single script.</p> <p>im not sure if there is other way but i know javascript can be used. however, how do i get the value of the hidden value associated to the button since now they have only a single ??</p> <p>my example is as follows:</p> <pre><code>&lt;form method="Post" action="file.php"&gt; &lt;input type="hidden" name="removeid" value="1" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;input type="hidden" name="removeid" value="2" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;input type="hidden" name="removeid" value="2" /&gt; &lt;input type="submit" id="btnremove" name="btnremove" value="Remove" inputbutton/&gt; &lt;/form&gt; </code></pre>
php javascript
[2, 3]
4,691,276
4,691,277
How to check if the cursor is over an element?
<p>how can I check whether the cursor is over some div at the html page with JQuery/Javascript?</p> <p>I'm trying to get cursor coordinates and look if they are in the rectangle of my element. Maybe there are predefined methods?</p> <p>UPD, don't say anything about <strong>hover</strong> events, etc. I need some method which will return true/false for some element at the page, like:</p> <pre><code>var result = underElement('#someDiv'); // true/false </code></pre>
javascript jquery
[3, 5]
4,102,280
4,102,281
Open a new browser window on close of current window if user confirms to close current window
<p>I have a scenario where if the user tries to close the current browser window then he should be displayed a confirm box. If he confirms to close the window then this window should close and opening the new window with different url.</p> <p>I tried use the following code by which I'm able to show the confirm box but I'm unable to figure out how to open the new window if user confirms to close the current.</p> <pre><code>var preventUnloadPrompt; $('a').live('click', function () { preventUnloadPrompt = true; }); $('form').live('submit', function () { preventUnloadPrompt = true; }); $(window).bind("beforeunload", function () { if (preventUnloadPrompt) { return; } else { return confirm("quit??"); } }); </code></pre> <p>Any type of help is appreciated. Thanks.</p>
javascript jquery
[3, 5]
4,564,135
4,564,136
How to implement SQLDependency caching in Asp.Net?
<p>HI Can any one explain me how to implement SQL Dependency Caching in Asp.Net?</p>
c# asp.net
[0, 9]
4,875,587
4,875,588
Javascript SyntaxError: Unexpected identifier
<p>I wrote some small script, but since I did it with Google help I need some advice. After putting this into Chrome console, I'm getting this error:</p> <blockquote> <p>SyntaxError: Unexpected identifier </p> </blockquote> <p>Here is my code: </p> <pre><code>jQuery(document).ready(function(){ if jQuery("#colorbox").css("display", "none");) { jQuery("#close-news").css("display", "none"); } else { jQuery("#close-news").css("display", "visible"); } }); </code></pre> <p>Any ideas what's wrong?</p>
javascript jquery
[3, 5]