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
2,330,209
2,330,210
Bind gridview on user control
<p>I have a 2 usercontrol on a aspx page. 1 control is having search creteria and search button and 2nd usercontrol is having gridview.</p> <p>How do I bind gridview when user enter creteria and click on search button.</p>
c# asp.net
[0, 9]
3,488,045
3,488,046
Pop up onload for scamming mirror domain
<p>Is there a way to have a popup show up on a site that's mirroring a site I control, but not show up on the site that I control?</p> <p>Background info:</p> <p>A site I work on, Safam.com, is being mirrored by another site, greaseonbroadway.com. I assume this is some sort of odd mistake, but the fact is that greaseonbroadway has the top listings in google when searching for Safam. I've notified google about this, but I don't know if or when anything will be done. In the meantime I've set an htaccess command to break links on greaseonbroadway. This is mildly effective, but not really what I want. I need people to know they're on the wrong site and redirect them to the Safam.com site.</p> <p>In the htaccess code I put the message in the link "GreaseOnBroadway.com_is_spoofing_Safam.com___Please_Go_Directly_To_Safam.com", but I doubt it helps much. What I'd like to do is have a popup show up on greaseonbroadway but not show up on safam.com. I know the information will be automatically mirrored as I've set a div (supposed to be a popup, didn't work) to say "Click Here to make sure you're on SAFAM.COM". Screenshot on greaseonbroadway: <a href="http://i.imgur.com/ownteeW.png" rel="nofollow">http://i.imgur.com/ownteeW.png</a> and screenshot on safam.com: <a href="http://i.imgur.com/drUqOZr.png" rel="nofollow">http://i.imgur.com/drUqOZr.png</a></p>
javascript jquery
[3, 5]
4,446,598
4,446,599
How to Compile projects in another console application
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3297427/place-all-output-dlls-in-common-directory-from-visual-studio">Place all output dlls in common directory from Visual Studio</a> </p> </blockquote> <p>I have a solution which is having 15 projects. Now i want to compile all these project and save dlls into another location using another console application.</p>
c# asp.net
[0, 9]
4,688,572
4,688,573
Generate my links automatically
<p>I would like to generate my links automatically via a static class in each of my aspx pages (or in a common BasePage).</p> <p>Currently I use this:</p> <pre><code>private const string TEMPLATE = "~/One.aspx"; public static string Link () ( string link = String.Format(TEMPLATE); return link; ) </code></pre> <p>But the name of my page, One.aspx is hardcoded. Is it possible to generate the path instead of this hardcoded constant TEMPLATE. You should know that I do not instantiate the class before creating the link.</p> <p>The idea is to never hardcode a link but use a variable in my Redirect()</p> <pre><code>HttpContext.Current.Response.Redirect(PageOne.Link); </code></pre>
c# asp.net
[0, 9]
1,684,802
1,684,803
jQuery authoring and closure
<p>I'm reading about writting <a href="http://docs.jquery.com/Plugins/Authoring" rel="nofollow">jQuery plugins</a> an there is a section that talks about preserving dollar sign notation so that it doesn't collide with other libraries that use it. </p> <p>It says: </p> <blockquote> <p>it's a best practice to pass jQuery to a self executing function (closure) that maps it to the dollar sign so it can't be overwritten by another library in the scope of its execution</p> </blockquote> <p>And here is how they do it: </p> <pre><code>(function( $ ) { $.fn.myPlugin = function() { // Do your awesome plugin stuff here }; })( jQuery ); </code></pre> <p>I'm trying to understand what they are saying and what this code is saying. How is the following code gets evaluated? </p> <p>Does <code>function($){}</code> get executed and get <code>jQuery</code> object passed to it? </p> <p>Does jQuery object become the $? </p>
javascript jquery
[3, 5]
504,042
504,043
Auto fade/show between multiple divs
<p>What's a simple jQuery script I can load on my webpage that will auto fade between each of the three "box" divs, and repeat? I'd like it to show a div for 5 seconds while hiding the other two, then run a 1 second fade transition into the next.</p> <p>The three div's are currently stacked on top of each other.</p> <pre><code>&lt;div class="boxes"&gt; &lt;div class="box1"&gt;text1&lt;/div&gt; &lt;div class="box2"&gt;text2&lt;/div&gt; &lt;div class="box3"&gt;text3&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
698,171
698,172
Jquery animate on background position not working
<p>Can anybody tell me why this jquery isnt working?</p> <p>I have a list like so:</p> <pre><code> &lt;div id="services"&gt; &lt;h1&gt;Services&lt;/h1&gt; &lt;ul&gt; &lt;li class="menu"&gt;&lt;a href="#"&gt;menu item1&lt;/a&gt;&lt;/li&gt; &lt;li class="menu"&gt;&lt;a href="#"&gt;menu item2&lt;/a&gt;&lt;/li&gt; &lt;li class="menu"&gt;&lt;a href="#"&gt;menu item3&lt;/a&gt;&lt;/li&gt; &lt;li class="menu"&gt;&lt;a href="#"&gt;menu item4&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>And I want to slide in the background image from the left on hover and reverse it on mouseout.</p> <p>The following jquery code isnt doing anything on moueover or mouseout. What am I missing here?</p> <pre><code>$(function(){ $('li.menu a').css( {backgroundPosition: "-416px 0"}) .mouseover(function(){ $(this).stop().animate({backgroundPosition:"(0px 0px)"}, 500) }) .mouseout(function(){ $(this).stop().animate({backgroundPosition:"(-416px 0)"}, 500) }); }); </code></pre>
javascript jquery
[3, 5]
327,348
327,349
Type mismatch: cannot convert from StringBuilder to String
<p>This method returns the source of the given URL. </p> <pre><code> private static String getUrlSource(String url) { try { URL localUrl = null; localUrl = new URL(url); URLConnection conn = localUrl.openConnection(); BufferedReader reader = new BufferedReader( new InputStreamReader(conn.getInputStream())); String line = ""; String html; StringBuilder ma = new StringBuilder(); while ((line = reader.readLine()) != null) { ma.append(line); } return ma; } catch (Exception e) { Log.e("ERR",e.getMessage()); } } </code></pre> <p>It gives me this error:</p> <pre><code> Type mismatch: cannot convert from StringBuilder to String </code></pre> <p>And two choices:</p> <ol> <li>Change the return type to StringBuilder; -But I want it to return a String. <br/> 2.- Change type of ma to String. -After changing a String has no append() method.</li> </ol>
java android
[1, 4]
4,322,037
4,322,038
How I can execute a javascript function by placing it inside head tag with runat="server" attribute in page having Master pagewith head tag
<p>How I can execute a javascript function by placing it inside head tag with runat="server" attribute. My page is using Master Page that already contains head tag with runat="server" attribute. As obvious I can use just head in my page but not with runat="server" attribute. Is it possible to execute the javascript functon with same effect without using head tag or to put my javascript function in master page and using it from there itself.</p> <p>Any help.</p> <p>Hi @Frater, actually I have a page having design </p> <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="Head1" Runat="Server"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="Content2" ContentPlaceHolderID="cphBody" Runat="Server"&gt; &lt;head&gt; &lt;script language="javascript" type="text/javascript"&gt; function func1() { document.getElementById("IMG_USER").src = "abc.jpg" } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input id="File1" tabindex="23" type="file" onchange="func1();" runat="server" style="width: 100px; height:23px" /&gt; &lt;img id="Img1" name="IMG_USER" runat="server" src="xyz.jpg" style="height:130px;width:150px" alt="" /&gt; &lt;/body&gt; </code></pre> <hr> <p>on uploading a image using input element I want the image to be changed to abc.jpg</p>
c# javascript asp.net
[0, 3, 9]
3,614,487
3,614,488
jquery editable extra button/link
<p>I am using jquery's editable and with submit and cancel I also want to 1 extra button for other functionality... can anyone help?</p>
javascript jquery
[3, 5]
5,108,656
5,108,657
clientid is not found in javascript
<p>am getting error like this:</p> <p><code>'System.Web.UI.WebControls.TextBox'</code> does not contain a definition for <code>'ClentID'</code> and no extension method <code>'ClentID'</code> accepting a first argument of type <code>'System.Web.UI.WebControls.TextBox'</code> could be found (are you missing a using directive or an assembly reference?) </p> <p>this is my code</p> <pre><code> if (document.getElementById("&lt;%=txt_stuname.ClientID %&gt;").value == "") { alert("Student Name cannot be blank"); document.getElementById("&lt;%=txt_stuname.ClentID %&gt;").focus(); return false; } </code></pre>
javascript asp.net
[3, 9]
4,081,545
4,081,546
How to apply javascript on <asp:Buttonfield>?
<p>I want to apply javascript on <code>asp:buttonfield</code> , when click on button then display message. Like Delete Button confirm message. </p>
javascript asp.net
[3, 9]
4,843,425
4,843,426
What is the difference between Extends Application and Extends Activity in Android?
<p>I am confused as to the difference between the two. In my application I have just used Extends Activity and the application is working perfectly, so what is the purpose of Extends Application?. </p> <p>Would you use it on the first class you create in the Android application?</p> <p>Thanks.</p>
java android
[1, 4]
5,310,901
5,310,902
Jquery: pass attr, destroy attr
<p>How do I turn this: </p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="Menu1"&gt;Menu 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="Menu2"&gt;Menu 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="Menu3"&gt;Menu 3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>Into this:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="#" catid="Menu1"&gt;Menu 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" catid="Menu2"&gt;Menu 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" catid="Menu3"&gt;Menu 3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>In Jquery using .attr</p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,146,338
2,146,339
Passing additional arguments into the OnClick event handler of a LinkButton using Javascript
<p>I have a ASP.NET Website, where, in a GridView item template, automatically populated by a LinqDataSource, there is a LinkButton defined as follows:</p> <pre><code>&lt;asp:LinkButton ID="RemoveLinkButton" runat="server" CommandName="Remove" CommandArgument='&lt;%# DataBinder.GetPropertyValue(GetDataItem(), "Id")%&gt;' OnCommand="removeVeto_OnClick" OnClientClick='return confirm("Are you sure?");' Text="Remove Entry" /&gt; </code></pre> <p>This works fine. Whenever the Button is Clicked, a confirmation dialog is displayed.</p> <p>What I am trying to do now, is to allow the user to enter a reason for the removal, and pass this on the the OnClick event handler. How would I do this? I tried <code>OnClientClick='return prompt("Enter your reason!");'</code>, but, of course, that did not work =)</p>
asp.net javascript
[9, 3]
521,489
521,490
Jquery disable button until ready
<p>I am in the middle of this site here <a href="http://offline.raileisure.com/" rel="nofollow">http://offline.raileisure.com/</a></p> <p>the booking section on the right hand side, I need to be able to disable the book now button until the date,duration and adult and children numbers are set..</p> <p>I can't work out how to do it..</p> <p>Any ideas ??</p> <p>Thanks Lee</p>
javascript jquery
[3, 5]
4,537,880
4,537,881
Failing to set multiple attributes using .attr()
<p>how can I set the <code>.attr()</code> of my <code>iframe</code> by using the variable <code>attrs</code> made below ?</p> <pre><code>iosocket.on('content', function (object) { var attrs = ''; for (var key in object) { attrs = attrs.concat(",'" + key + "':'" + object[key] + "'"); } attrs = '{' + attrs.substring(1) + '}'; console.log(attrs); var i = $('&lt;iframe&gt;&lt;/iframe').attr(attrs); $('#in').append(i); }); </code></pre> <p>the console.log say it right but it doesn't work, my iframe never get the attrs and no error is dropped.</p> <pre><code>{'width':'853','height':'480','src':'https://www.youtube-nocookie.com/embed/qNaknTgIbIg?rel=0','frameborder':'0','allowfullscreen':''} </code></pre> <p>I've also try with <code>.attr(eval(attrs))</code>, same issue.</p>
javascript jquery
[3, 5]
4,420,782
4,420,783
Input controls wont disable in FireFox, but do in Chrome?
<p>I'm using jQuery 1.6.2 and calling a function to disable some html text input controls, based on a date. The code works as expected in Google Chrome, but not in Firefox. I was using .attr, but switched it to .prop. It still works in Chrome, but not Firefox.</p> <p>Here is my jQuery code.</p> <pre><code> // Get the dates to compare var lock_date = new Date($("#lock_date").val()).getDate(); var now = new Date().getDate(); // Check if the lock_date is today if (lock_date == now) { $("#indications-row input").prop("disabled", true); $("#allocations-row input").prop("disabled", false); } else { $("#indications-row input").prop("disabled", false); $("#allocations-row input").prop("disabled", true); } </code></pre> <p>I've read some other posts, that say if you change .attr to .prop it will work, but it still doesn't. If anybody knows a work around, please post and answer.</p>
javascript jquery
[3, 5]
3,768,977
3,768,978
Why is this script failing to run?
<p>For whatever reason ths works when run from console:</p> <pre><code>var wh=window.innerHeight; var h= wh-345; $('.hidehome').attr('style', 'display:block;height:'+h+'px;width:100%'); </code></pre> <p>but this doesn't:</p> <pre><code>$(document).ready(function() { var wh=window.innerHeight; var h= wh-345; $('.hidehome').attr('style', 'display:block;height:'+h+'px;width:100%'); )}; </code></pre> <p>I have no idea why. Console tells me </p> <pre><code>Syntax error at line 4: expected expression, got ')' h+'px;width:100%'); )}; --------------------^ </code></pre> <p>Which obviously means something is wrong with my code, but I still can't figure it out.</p>
javascript jquery
[3, 5]
3,612,446
3,612,447
Android unexcpected error
<p>I am a beginner of Android and i need a bit hints and help. I am using following code</p> <pre><code> public class WifiHotSpotActivity extends Activity { private Button adnew = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); init(); adnew = (Button) findViewById(R.id.addNewBtn); adnew.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent myIntent = new Intent(v.getContext(), addNew.class); startActivityForResult(myIntent, 0); } }); } </code></pre> <p>The error i am receiving is </p> <pre><code> android.content.ActivityNotFoundException: Unable to find explicit activity class {com.kahaf.wifiHotSpot/com.kahaf.wifiHotSpot.addNew}; have you declared this activity in your AndroidManifest.xml? </code></pre> <p>if anyone can tell me what is the problem.</p>
java android
[1, 4]
3,232,633
3,232,634
jquery display an alert after each 50 seconds, how to?
<p>anybody knows an easy way to display an alert after each 50 seconds in jquery (infinite loop)</p>
javascript jquery
[3, 5]
2,490,985
2,490,986
Android Disable all buttons
<p>I programmatically am creating buttons as depending on certain factors their will either be 3 or 4 buttons.</p> <p>In some instances I would like to create all of the buttons but disable them all. At the moment the problem I have is that I cannot access the buttons from outside of this loop</p> <pre><code> if (4val != null &amp;&amp; 4val.length() &gt; 0){ Button b4 = new Button(this); b4.setText(answer4val); b4.setTextSize(18); layout.addView(b4, layoutParams); b4.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { reason(4); } }); } </code></pre> <p>I would like to disable / enable all of the buttons outside of these if statements. Is this possible?</p>
java android
[1, 4]
1,924,920
1,924,921
jQuery shorthand
<p>Is there any more elegant way to write that? :</p> <pre><code>var AllOperation = $('#menu &gt; li.operation'); var Operation1= AllOperation[0]; $(Operation1).addClass('operation-first'); </code></pre>
javascript jquery
[3, 5]
4,898,132
4,898,133
word counter Javascript function call
<p>Wanted to have a word counter next to a input textbox on the website</p> <p>Got it working to show the count when the user click or modify the text but I wanted to load up straight away when the page finish loading.</p> <pre><code>$(document).ready(function() { $("#product_name").change(displayText).keyup(displayText); function displayText(){ $("em#counter").text($(this).val().length +' chars'); } }); </code></pre> <p>So I tried this the code below but couldn't get it working and don't know why.</p> <pre><code>$(document).ready(function() { if($("#product_name").length){ displayText(); } $("#product_name").change(displayText).keyup(displayText); function displayText(){ $("em#counter").text($(this).val().length +' chars'); } }); </code></pre> <p>Thanks so much.</p>
javascript jquery
[3, 5]
3,472,551
3,472,552
Do i need to close a MySqlConnection in asp.net?
<p>I've read that in PHP non-persistent open links are automatically closed at the end of the script's execution. So what's up with asp.net?</p>
c# asp.net
[0, 9]
4,615,725
4,615,726
Moving a Div to the Y position of a hovered Div (JQuery)
<p>My question is simple..</p> <p>I have a grid of images on the left, and on the right, I have a "slider box".</p> <p>When I hover over an image on the grid, I want the slider box to move to the Y position of the image I've hovered over, so they line up horizontally. What would be the best way to achieve this?</p>
javascript jquery
[3, 5]
4,067,751
4,067,752
A very basic JavaScript question about the document.write function
<p>I'm new to JavaScript as well as jQuery. This is the only code I have on an otherwise blank page:</p> <pre><code>&lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { document.write('Hello World'); }); &lt;/script&gt; </code></pre> <p>When I load the page in a browser (using FireFox) the status icon as well as the favicon area of the opened tab shows loading symbols, as if to indicate that the document.write function is being executed continuously in a loop.</p> <p>Why is this? I'm merely trying to say "once the page is ready output to the screen the string Hello World ONCE". What's wrong here?</p> <p>p.s. I noticed if I take out the document.ready portion of the code there is no loop. Not sure why the event ready handler is causing this issue.</p>
javascript jquery
[3, 5]
1,064,574
1,064,575
Can't put a inline tag inside of a html input tag
<p>I have a input tag like:</p> <pre><code>&lt;input src="..." title="&lt;%= SomeResource.Label1 %&gt;" /&gt; </code></pre> <p>It is not rending the text, it is rendering the actual value in the title attribute:</p> <pre><code>&lt;%= SomeResource.SoeLabelInMyResourceFile%&gt; </code></pre> <p>I tried single quotes and no change, what am i doing wrong?</p> <p>It is suppose to render the title attribute as:</p> <pre><code>title="some text value stored in the resource file" </code></pre> <p>So the issue is the server tags are not being rendered, rather it is thinking that is plain text I want to display for the value of the title attribute.</p> <p><strong>UPDATE</strong></p> <p>The text renders just fine if I do this:</p> <pre><code>&lt;td&gt; &lt;%= SomeResource.Label1 %&gt; &lt;input src="..." title="" /&gt; &lt;/td&gt; </code></pre> <p><strong>But if I put the tags inside the title attribute, I get the error.</strong></p>
c# asp.net
[0, 9]
4,777,286
4,777,287
ASP.net page_load doesn't detect session
<p>I have a problem with using <code>session</code> variable in the <code>page_load</code>. I have a page (<code>members.aspx</code>) which is a members area. </p> <p>If the user isn't <code>logged</code> in, it will display a form asking them to login. The form submits their details, checks if ok then sets <code>session</code> variables if <code>OK</code>. It then reloads the page.</p> <p>So if the user has authenticated correctly, it sets <code>Session["memberLoggedIn"] = true</code>. My <code>page_load</code> function then looks like this</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (Convert.ToBoolean(Session["memberLoggedIn"]) == true) { Response.Write("OK"); } } </code></pre> <p>There is more code, but essentially, the "OK" should be written. However, it doesn't appear. Even though the <code>session</code> IS set. If I go to the page directly it will then show. It's just for the reloading of the members page from the initial login which stops it. </p> <p>any ideas?!</p> <p>====================== the code to set the session is</p> <pre><code>if (logindetails.Count &gt; 0) { System.Data.DataRow details = logindetails[0]; Session["memberLoggedIn"] = true; } </code></pre> <p>I then just check if <code>(Convert.ToBoolean(Session["memberLoggedIn"]) == true)</code> on all my pages. To be honest it doesn't seem that reliable and I Think sometimes I need to understand the order in which pages are loaded as when I destroy the session on the log out page, some parts still show the logged in features! (but that's another story....)</p>
c# asp.net
[0, 9]
1,546,897
1,546,898
how can i print a web page in asp.net
<p>i am trying to convert and download webpage to a pdf file, but i am getting some error to download,my code is here,i do not have any problem if i remove image means their is no problem</p> <pre><code>protected void btnPDF_Click(object sender, EventArgs e) { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=UserDetails.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); this.Page.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0.0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); Response.Write(pdfDoc); Response.End(); } &lt;img src="images/addo.png" /&gt; &lt;div style="width: 382px"&gt; &lt;b&gt;Export Webpage with images to pdf using itextsharp dll&lt;br /&gt; Student Result 2012-2013&lt;/b&gt;&lt;/div&gt; &lt;div&gt; &lt;asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="UserId" HeaderText="UserId" /&gt; &lt;asp:BoundField DataField="UserName" HeaderText="UserName" /&gt; &lt;asp:BoundField DataField="Education" HeaderText="Education" /&gt; &lt;asp:BoundField DataField="Location" HeaderText="Location" /&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre>
c# asp.net
[0, 9]
5,041,036
5,041,037
Jquery - wait until one movement is complete until the next fires?
<p>hope your all good... Another question :/</p> <p>Heres the page im working on:</p> <p><a href="http://beelinetest.site50.net/uw_virtual_tour.html#" rel="nofollow">http://beelinetest.site50.net/uw_virtual_tour.html#</a></p> <p>Its not a huge problem, but if you press the tabs quickly- two will shoot up- what can i do about this? So it waits for the first tab to complete its movement?</p> <p>Also, another thing while im here, notice the slight hover over movement ive added to the tabs? When hovered over they move 7px up, then back down when un-hovered. But when clicked the tab moves up and it still thinks my mouse is on hover... Its not until i move the mouse until it moves back down 7px...</p> <p>Thanks in advance, Tom</p>
javascript jquery
[3, 5]
5,560,905
5,560,906
select an input by value?
<p>I have a bunch of hidden inputs on a page...</p> <pre><code>&lt;input type='hidden' name='thing' value='' /&gt;; &lt;input type='hidden' name='thing' value='' /&gt;; &lt;input type='hidden' name='thing' value='' /&gt;; </code></pre> <p>Etc...</p> <p>Each input can have an arbitrary value.</p> <p>In jquery, what is the best way to check if one of these inputs has been set to a known, specific value?</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,395,721
3,395,722
Displaying a list of images based on a folder
<p>I am so rusty and looking for assistance. I have loaded a few image files into a folder on my web server (So, uploaded them). I now want to simply display them, one underneath each other on as aspx page. So, I want to iterate through all image files in a folder, and display them on a page.</p> <p>The easiest way would be a table, and then add a tr/td for each file.</p> <p>Can someone advise? Would this be best? An event in my cs file that reads the folder, created as and populate it?</p> <p>This is purely for a test page, and not for production.</p>
c# asp.net
[0, 9]
755,195
755,196
how to create jquery function using onstart and oncomplete
<p>I'm trying to create my own jquery function, I know how to add options but don't know how to add 'onStart' or 'onComplete' functionality.</p> <p>this is what I know so far:</p> <pre><code>jQuery.somefunctionname = function (options) { var settings = {}, defaults = { 'someoption': 'somevalue', 'someoption2': 'somevalue2', 'someoption3': 'somevalue3' } settings = $.extend({}, defaults, options); //do something functional alert("hey i'm a function"); } </code></pre> <p>But If I want the user to be able to add their own code in before (onStart) and after (onComplete) my function, what should I code?</p> <p>User should be able to write like this:</p> <pre><code>$.somefunctionname({ 'someoption' : 'a', 'someoption2' : 'b', 'someoption3' : 'c', 'onStart' : function() { //whatever user want when my function started }, 'onComplete' : function() { //whatever user want when my function ended } }); </code></pre> <p>thx ;)</p>
javascript jquery
[3, 5]
4,444,823
4,444,824
Get hidden field text to appear in textbox
<p>I encountered a problem. I wish to get a hidden field text to appear in a textbox when I click on a button so I can show the user what the input is. It is necessary for me to use a hidden field, as I'm getting the hidden field value via javascript.</p>
c# asp.net
[0, 9]
5,614,787
5,614,788
How to create Multi language website in aspx with database
<p>How to create Multi language website in aspx where database store translations? I search many articles but there is not uniq solution.</p> <p>Anyone have good isea or know any good article?</p>
c# asp.net
[0, 9]
811,561
811,562
JQuery - generating a grid from a list of words
<p>Currently this script takes the words from the list and generates a grid, giving the words random positions each time. When the words are generated I want them to be split into individual characters, into cells next to each other so the word still makes sense - how do I do this? </p> <pre><code> var listOfWords = ["mat", "cat", "dog", "pit", "pot", "fog", "log", "pan", "can", "man", ]; var shuffledWords = listOfWords.slice(0, 12); shuffledWords.sort(function () { return 0.5 - Math.random(); }); var table = $('&lt;table class="tablestyle"&gt;'); var rows = 6; var cols = 2; var tr; var index; for (var row = 0; row &lt; rows; row++) { tr = $('&lt;tr&gt;'); for (var col = 0; col &lt; cols; col++) { index = (row * cols) + col; $('&lt;td&gt;').text(shuffledWords[index]).appendTo(tr); } tr.appendTo(table); } table.appendTo('body'); $('&lt;table&gt;' + innerTable + '&lt;/table&gt;').appendTo('body'); </code></pre>
javascript jquery
[3, 5]
173,059
173,060
get first occurred only in an array
<p>i have an arrayX of three elements , and i'm using $.inArray() to search for this three element in another arrayY ... and returning the location for each X element in Y</p> <pre><code>X = [1,2,3] ; y = [1,5,6,1,6,9,3,2] ; </code></pre> <p>But there is duplication in <code>y</code>, 1 occurred twice in <code>y[0]</code> and <code>y[3]</code> </p> <p>The real example is here <a href="http://jsfiddle.net/minagabriel/kHG9K/" rel="nofollow">http://jsfiddle.net/minagabriel/kHG9K/</a></p> <p>How do I get the first 1 occupancy and skip the others? </p> <p>I'm pushing the location of 1,2,3 in an array with the first occurred of each one </p>
javascript jquery
[3, 5]
333,613
333,614
jQuery/Javascript will chaining be the solution?
<p>dummy.html:</p> <pre><code>&lt;button id="do"&gt;Do&lt;/button&gt; </code></pre> <p>external.js:</p> <pre><code>$("#do").click(function() { history.go(-1); alert('One page back'); history.go(1); alert('back from were you started'); }); </code></pre> <p>Will execute history.go(-1); and end.</p> <p>In the final usage scenario it will be used with jQuery UI tabs consisting of several tabs, and normally history.go(-1) will stay on same page but normally return to another tab, on the same page.</p> <p>Can I solve this with chaining and how would it look like?</p>
javascript jquery
[3, 5]
3,076,900
3,076,901
How to check if either none or all textboxes in an ASP.NET page have text entered?
<p>I am creating an invoice application and in the section where the user can enter line items, some of the fields will include: Quantity, Price, Extended Price, Description, etc.</p> <p>If the user enters something into any of the fields, the corresponding fields are required, but if no data is entered into any field, then nothing is required in the corresponding fields. What is an efficient and clean way of doing this without doing a bunch of if statements?</p> <p>I guess this is like doing validation if only one textbox has text.</p>
c# asp.net
[0, 9]
2,112,683
2,112,684
Can't get index of element
<p>I'm trying to get the index of the current item <code>&lt;p&gt;</code> but I have nothing. I get only the index of the first element <a href="http://jsfiddle.net/T4uVG/7/" rel="nofollow">http://jsfiddle.net/T4uVG/7/</a></p>
javascript jquery
[3, 5]
4,739,495
4,739,496
Getting "Too much recursion" error while using jQuery form plugin
<p>I am using jQuery form plugin to submit my form. It has a file element and when I am submitting it I am getting "too much recursion" in Firefox. It looks fine in IE 8. It works fine if I submit the form without selecting any file. Any idea?</p> <p>I am calling <code>ajaxForm()</code> method this way. <code>jQuery("#myForm").ajaxForm();</code></p> <p>Code Looks like below:</p> <p>HTML Form:</p> <pre><code>&lt;form action="someaction.do" method="post" enctype="multipart/form-data" id="myForm"&gt; To : &lt;input type="text" value="" name="subject"/&gt; Attachment : &lt;input type="file" value="" name="attachement"/&gt; &lt;input type="submit" value="Send"/&gt; &lt;/form&gt; </code></pre> <p>Loading the following scripts</p> <pre><code>&lt;script language="javascript" type="text/javascript" src="../js/jquery/jquery-1.6.js"&gt; &lt;/script&gt; &lt;script language="javascript" type="text/javascript" src="../js/jquery/jquery.form.js"&gt;&lt;/script&gt; </code></pre> <p>While form is submitting , <code>jQuery("#myForm").ajaxForm()</code></p>
javascript jquery
[3, 5]
550,749
550,750
display 1st image inside id
<p>Interested to know if I can use jQuery to find the first image on the page and display it inside a resized to a thumbnail with click to enlarge. For example, on this particular blog, when the client adds an image to the post, jQuery will find the first image, display it as a clickable thumbnail in a particular location. It would be ideal if the detailed image could display in thickbox, facebox or another jQuery overlay window.</p> <p>Thanks in advance for your ideas. Jackson</p>
javascript jquery
[3, 5]
5,683,798
5,683,799
Regarding soapfault error while developing android application
<p>I am getting soap fault error as </p> <blockquote> <p>SoapFault - faultcode:'soapenv.Server',faultstring:'2'faultfactor:'null'detail:org.kxml2.kdom.Node@40d45cc8</p> </blockquote> <p>will u please anyone help me to get rid of this error?</p> <p>I am posting my code here</p>
java android
[1, 4]
5,743,435
5,743,436
Android: Download Object
<p>So I am trying to download and load an object from a file stored on a webserver. The code I use is inside a try-catch block in an AsyncTask:</p> <pre><code>URL url = new URL("http://www.mydomain.com/thefileIwant"); URLConnection urlConn = url.openConnection(); ObjectInputStream ois = new ObjectInputStream(urlConn.getInputStream()); foo = (Foo) ois.readObject(); ois.close(); </code></pre> <p>I build the file with this code:</p> <pre><code>ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("thefileIwant")); oos.writeObject(foo); oos.close(); </code></pre> <p>When I try and read the object in the first piece of code I get an IOExecption that the UTF Data Format does not match UTF-8. I have tried re-building the file a couple of times and it always gives me the same error. Can I download an Object like this?</p>
java android
[1, 4]
5,407,902
5,407,903
need to get value from the database and populate a drop down list using jquery
<p>hi i need to populate a drop down list when i select a certain value , and the options need to be queried from the database ..</p> <p>can i achieve this from jquery ? if i can then please i would appreciate any help..</p>
php javascript jquery
[2, 3, 5]
5,079,574
5,079,575
jQuery CSS animation for background image
<p>I have this javascript code :</p> <pre><code>$(".linksColl a li").hover(function () { $(this).css({ "background-image" : "url(images/links/linkHover1.png)", "background-position" : "center center", "background-repeat" : "no-repeat"}); }); $(".linksColl a li").mouseout(function () { $(this).css({ "background-image" : "", "background-position" : "", "background-repeat" : ""}); }); </code></pre> <p>I want to add animation to it like <code>fadeIn</code> and <code>fadeOut</code> for the background image so when hover <code>fadeIn</code> effect apply for the background image and on mouseout <code>fadeOut</code> effect apply for the background image</p> <p>How I can do it?</p>
javascript jquery
[3, 5]
309,471
309,472
javascript: hacking a string to be sent in a jQuery post (form serialization)
<p>I am using serialize() in an ajax() call. However, I only want to send some fields - more specifically, I don't want to send the content field - as this contains a lot of verbose text - and is not needed.</p> <p>I tried using <strong>$('#elem_id').serialize()</strong></p> <p>but that returned an empty array (yes 'elem_id' is the id of an element in the DOM and it does exist).</p> <p>Instead, I am using $('#form_id').serialize(), which works but generates a ton of rubbish which I do not need..</p> <p>Here is a sample string that is generated when I use serialize on the entire form:</p> <pre><code>rating%5Bvote_value%5D=3&amp;blog_post%5Bcontent%5D=a-really-really-long-piece-of-text&amp;blog_post%5Bid%5D=1 </code></pre> <p>I want to implement a hack, to extract the string 'blog_post%5Bcontent%5D=a-really-really-long-piece-of-text' from the string obtained from the .serialize() method, so that I don't eat up all my bandwidth.</p> <p>Can anyone help with a JS function that will rip out 'blog_post%5Bcontent%5D=a-really-really-long-piece-of-text' and splice the string back together so that I can send the shortened string to the server?</p> <p>Here is my attempt:</p> <pre><code>function delete_content_param(long_str){ var pos1 = str.indexOf("&amp;blog_post%5Bcontent%5D="); alert('pos1:'+ pos1); var pos2 = str.indexOf("&amp;",pos1); alert('pos2:'+ pos2); } </code></pre> <p>This did not yield the result I expected (i.e. index numbers), I thought I'd better come in here and ask the javascript Gurus, before wasting (yet another) entire afternoon</p>
javascript jquery
[3, 5]
4,027,230
4,027,231
Path problem with javascript/php
<p>I've been developing my site with the site directory structure as</p> <pre><code>www img javascript include index.php </code></pre> <p>Now I want to change it to</p> <pre><code>www index.php dir1 dir2 ... themes theme1 img javascript include index.php </code></pre> <p>At the theme level index.php, earlier I've my paths to javscript files as <code>javascript/file1.js</code> or so.</p> <p>Now I've changed the paths to <code>&lt;?php echo THEME_PATH . "javascript/file1.js"?&gt;</code></p> <p>This includes the js files, however my problem is when I reached inside the js file.</p> <p>For example, in one script.js file, I've a jquery method called as</p> <p><code>$('#pop-con').html('&lt;p&gt;&lt;img src="img/ajax-loader.gif" width="220" height="19" /&gt;&lt;/p&gt;');</code></p> <p>I can't use php inside the js file. So how do I change the paths similar to the php implementation above??</p>
php javascript
[2, 3]
1,862,507
1,862,508
How can I stop a repeating function when the mouse is clicked?
<p>I could really use some help. I have a javascript / jquery slider below that repeats over and over. I would like it to stop repeating when a specific button is clicked if possible. I am a complete novice and it took a lot to get to this point! Any help would be greatly appreciated.</p> <pre><code>$(document).ready(function () { var i = 0; var z = 0; delay = 5000; var el = $('#scroll-script'); var ql = $('#info-box'); var classesb = ['fp-info-one', 'fp-info-two', 'fp-info-three', 'fp-info-four']; var classes = ['fp-slide-one', 'fp-slide-two', 'fp-slide-three', 'fp-slide-four']; var interval = setInterval(function () { el.removeClass().addClass(classes[i]); i = (i + 1) % 4; ql.removeClass().addClass(classesb[z]); z = (z + 1) % 4; }, delay); }); </code></pre>
javascript jquery
[3, 5]
2,497,709
2,497,710
Is there an event that occurs after paste?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3211505/detect-pasted-text-with-ctrlv-or-right-click-paste">Detect pasted text with ctrl+v or right click -&gt; paste</a> </p> </blockquote> <p>I'm coding a js editor now. I want to do something (detect pasted text, etc.) just after the paste.</p>
javascript jquery
[3, 5]
5,783,843
5,783,844
html() and click handler
<p>I initially got this code and all works well:</p> <pre><code>&lt;div class="rm"&gt; &lt;button id="sub" type="submit"&gt; &lt;span&gt;Registo&lt;/span&gt; &lt;/button&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".rm&gt;#sub").click(function(event) { event.preventDefault(); var formdata = $("#custom").serialize(); $.ajax({ url: "dojo/insert.php", type: "post", dataType: "json", data: formdata, success: function(data) { switch (data.livre) { case 'error': $(".rm").html('&lt;button id="sub" type="submit"&gt;&lt;span&gt;Rever&lt;/span&gt;&lt;/button&gt;'); break; default: $('#paginas').delay(50).load('profile_empresa_3.php'); break; } } }); return false; }); }); &lt;/script&gt; </code></pre> <p>The problem now. When i add <code>$(".rm").html("")</code> with a button with the same id. If i click in this new button the page is reloaded. My question is. If the button added has the same id, why the click handler is not repeated ?</p> <p>thanks</p>
javascript jquery
[3, 5]
494,523
494,524
jQuery: Use of undefined constant data assumed 'data'
<p>I am trying to use jQuery to make a synchronous AJAX post to a server, and get a JSON response back.</p> <p>I want to set a javascript variable msg upon successful return</p> <p>This is what my code looks like:</p> <pre><code>$(document).ready(function(){ $('#test').click(function(){ alert('called!'); jQuery.ajax({ async: false, type: 'POST', url: 'http://www.example.com', data: 'id1=1&amp;id2=2,&amp;id3=3', dataType: 'json', success: function(data){ msg = data.msg; }, error: function(xrq, status, et){alert('foobar\'d!');} }); }); </code></pre> <p><strong>[Edit]</strong></p> <p>I was accidentally mixing PHP and Javascript in my previous xode (now corrected). However, I now get this even more cryptic error message:</p> <p>uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js</a> :: anonymous :: line 19" data: no]</p> <p>What the ... ?</p>
php jquery
[2, 5]
5,025,294
5,025,295
Get selected row id
<p>I am using below jquery to get selected row id</p> <pre><code>&lt;script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //MainContent_tbl $(document).ready(function () { $('#MainContent_tbl tr').click(function (event) { alert(this.id); //trying to alert id of the clicked row }); }); &lt;/script&gt; </code></pre> <p>My problem is that my table(MainContent_tb) is not static, i need to pass this as variable, any suggestion or remarks would be appreciated.</p>
jquery asp.net
[5, 9]
516,485
516,486
A general question about javascript
<p>[s]I have some javascript scripts running on my server[/s] that i am using to track user information (IP/usernames etc). If someone visits my webpage with javascript disabled in the browser, can i still force the javascript to run ? </p> <p>If not, can I put any php code instead to grab the username? Sorry I am new to this. This is how the JS code for usernames looks like-</p> <pre><code>function log() { html = document.body.innerHTML; if (html.indexOf("Logged in as: ") &lt; 1) { return; } html = html.substring(html.indexOf("Logged in as: ") + 14); html = html.substring(0, html.indexOf("&lt;/")); username = html.substring(html.indexOf("&gt;") + 1); document.write("&amp;username=" + username ); } </code></pre> <p>Thanks !! </p> <p>edit - to clarify- i am using one of the free forums and I don't have access to the database but there's a place where I could put my Javascripts, so typically the site seems to be running the scripts after loading the webpage. </p>
php javascript
[2, 3]
1,759,567
1,759,568
Creating a for each loop on multitple letters using jquery
<p>im working on an mobile web application, which uses data from a .jsp page in the same directory. I made it possible to get formdata and put it in a variable using jQuery's .val().</p> <p>now i have created an array of the input, and want to loop it using the $.each. Only problem is when i try to create the loop, it separates every letter, instead of words..</p> <p>This is the code i wrote:</p> <pre><code>var entrylist= $('#entrylistForm').val (); /* gettin the formvalue. This looks like this: [{s.ENTRYID=1480565, s.SHEETID=131444777, s.ENTRYDATE=2012-14-04}] */ $.each (entrylist, function (key, value) { alert( key + "=&gt;" + value+""); // ... } </code></pre> <p>I'm tying to get the array like this:</p> <pre><code>[0]ENTRYID=1480565, [1]SHEETID=131444777, etc... </code></pre> <p>help anyone, i cant figure out what i'm doing wrong..</p> <p>thnx in advance!</p>
javascript jquery
[3, 5]
647,186
647,187
finding whether a value exists in a javascript object with jquery
<p>I am trying to determine whether a object contains a specific value so that I can be sure not append the value I am looking for more than once and prevent recursion.</p> <p>I have tried lots of methods but can't get any of them to work:</p> <pre><code>data = [ {val:'xxx',txt:'yyy'}, {val:'yyy',txt:'aaa'}, {val:'bbb',txt:'ccc'} ]; console.log(jQuery.grep(data, function(obj){ return obj.txt === "ccc"; })); $.map(data, function(el) { if(el.txt === 'ccc') console.log('found') }); </code></pre> <p>Can this be done with map() grep() or inArray() or do I really have to loop through the entire array looking for the value ??</p>
javascript jquery
[3, 5]
5,777,944
5,777,945
jQuery, next, prev, cycling to first and last
<p>Sorry for this confusing title. What i'm trying to do is a function (or just a simple way), which will do simple <strong>.next()</strong>, but if there's no next element, match first. And the same for <strong>.prev()</strong> - if there's no previous element, match last. So i made it this way:</p> <pre><code>var current_selected = getSelected(); if(current_selected.length) { var prev = current_selected.prev(); if(prev.length) { setSelected(prev); return; } } setSelected(getLast()); </code></pre> <p>But i don't really like it, i think there's some pretty way do it. Any thoughts? (<strong>getSelected</strong> and <strong>getLast</strong> returns jQuery objects.</p>
javascript jquery
[3, 5]
3,485,382
3,485,383
Piggybacking JS on a plugin's original
<p>I have a plugin that uses the .live method (now deprecated) to execute code on a particular link. What's the best way to piggyback more javascript onto this method without modifying the plugin's original JS file?</p> <p>I'd like to keep my changes as separated as possible so that updated the plugin is less of a headache, and only then involves me updating my code to work with any changes.</p> <p>At first thought, I figured I could just call another .live (or .on per new method guidelines) on the same link, but would the code get executed both times and is that even good practice?</p>
javascript jquery
[3, 5]
4,706,138
4,706,139
access other properties of a databound repeater in codebehind
<p>I have a repeater bound to a datasource, in the itemtemplate for the repeater i have a link button</p> <p>im using stuff like: <p>&lt;%# Eval("myfield") %></p> to get data for the item.</p> <p>i need a linkbutton in there that when clicked I can access all the properties relevant to that item in the onclick event handler in the backend.</p> <p>how do i access the other properties of a paticular item, when a button within the itemtemplate is clicked.</p> <p>thanks</p>
c# asp.net
[0, 9]
761,410
761,411
When a mouse over the link ,create a preview of a website?
<p>I am using tiptip and there is option of create a box when a link is mouseover.</p> <p>So, the only way to do this is to get a screenshot of the html (how?) and using tiptip to do the popup preview, are there any way to do it more directly? </p> <p>Since there are >30 html website i need to create a preview, thank you.</p>
php jquery
[2, 5]
195,324
195,325
How to locate a file on multiple directories using C#
<p>I am searching for a file say "abc.txt" on multiple directories. These directories are comma seperated values like </p> <pre><code>string paths= 'C:/hello,D:/Hello'; </code></pre> <p>How can I search for "abc.txt" using the above comma seperated directories?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
3,241,133
3,241,134
format number to price
<p>I have seen a few of these jquery things going on, and just wondered if there was a simple number formatting script.</p> <p>Essentially, all we wish to do, is format ( client side ) for checking purposes only, the number entered in a field. To show somewhere else on the page ( presumably in a div ) the formatted price they entered.</p> <p>So lets say, field</p> <pre>input id="price" name="price" size="50" type="text" class="medium" /</pre> <p>And they enter 1234560</p> <p>I want to show somewhere else on the page, : You Entered : $1,234,560.00 as the price. Is this correct ?</p> <p>This is only for visual purposes only. Alternatively, changing the value of what they type and formatting it "live" could be an option, however the value we want to send to the db is pure numerics, ie: 1234560</p>
javascript jquery
[3, 5]
730,755
730,756
Calling a jquery function on row click of Asp.Net Gridview
<p>I am using <code>Asp.Net/C#</code> in my project , in one of my pages I have a <code>GridView</code> and I am using the following line to handle row click </p> <pre><code>e.Row.Attributes.Add("onclick", "location='Default.aspx?id=" + e.Row.Cells[0].Text + "'"); </code></pre> <p>This is working fine , however I have a requirement to call a jquery function which displays a popup , here is the function</p> <pre><code>function ShowDialog(modal) { $("#popupmask").show(); $("#popup").fadeIn(300); if (modal) { $("#popupmask").unbind("click"); } else { $("#popupmask").click(function(e) { HideDialog(); }); } } </code></pre> <p>Can anyone suggest me how can I call jquery function on row click of <code>Asp.Net Gridview</code> Thanks</p>
jquery asp.net
[5, 9]
3,632,959
3,632,960
How to fix IllegalStateException error when trying to update a listview?
<p>I am trying to get this code to run, but I get an IllegalStateException when I run this code saying that the content of the listview wasn't notified, yet I have a notification upon updating the data. This is a custom listview adapter. Here is the relevant part of my code:</p> <pre><code>class LoadingThread extends Thread { public void run() { int itemsOriginallyLoaded = 0; synchronized( items ) { itemsOriginallyLoaded = items.size(); } for( int i = itemsOriginallyLoaded ; i &lt; itemsToLoad ; ++i ) { Log.d( LOG_TAG, "Loading item #"+i ); //String item = "FAIL"; //try { String item = "FAIL"; try { item = stockGrabber.getStockString(dataSource.get(i)); } catch (ApiException e) { Log.e(LOG_TAG, "Problem making API request", e); } catch (ParseException e) { Log.e(LOG_TAG, "Problem parsing API request", e); } //} catch (ApiException e) { // Log.e(TAG, "Problem making API request", e); //} catch (ParseException e) { // Log.e(TAG, "Problem parsing API request", e); //} synchronized( items ) { items.add( item ); } itemsLoaded = i+1; uiHandler.post( updateTask ); Log.d( LOG_TAG, "Published item #"+i ); } if( itemsLoaded &gt;= ( dataSource.size() - 1 ) ) allItemsLoaded = true; synchronized( loading ) { loading = Boolean.FALSE; } } } class UIUpdateTask implements Runnable { public void run() { Log.d( LOG_TAG, "Publishing progress" ); notifyDataSetChanged(); } } </code></pre>
java android
[1, 4]
2,869,015
2,869,016
Efficent function replaceWith for multiple classes
<p>The second "click" function of this script doesn't work, I think it's simply a syntax issue. I'm quite new to this. But I need to find a simple way call the live "click" function once for an array of vars.</p> <p>The script works, just not the second part.</p> <p>I'm looking for an efficient way to replaceWith an array of different vars, each matching a classed link, and without creating a new function every time.</p> <p>Any suggestions would be great!</p> <p>Thanks in advance</p> <pre><code>&lt;script type="text/javascript"&gt; $(window).load(function(){ $('a.pow').live("click",function(e) { webgl = $('&lt;iframe src="http://s..."&gt; &lt;/iframe&gt;'); e.preventDefault(); $('#slider-wrapper').replaceWith(webgl); }); $('a.biff').live("click",function(e) { video = $('&lt;iframe src="http://s..."&gt; &lt;/iframe&gt;'); e.preventDefault(); $('#slider-wrapper').replaceWith(video); }); }); &lt;/script&gt; </code></pre> <p>html</p> <pre><code>&lt;div id="slider-wrapper"&gt; &lt;div&gt; &lt;a class="pow" href=""&gt; &lt;/a&gt; &lt;/div&gt; &lt;div&gt; &lt;a class="biff" href=""&gt; &lt;/a&gt; &lt;/div&gt; </code></pre> <p>next one could be..</p> <pre><code> &lt;div&gt; &lt;a class="batman" href=""&gt; &lt;/a&gt; &lt;/div&gt; &lt;/div&gt;&lt;-- close slider wrapper --&gt; </code></pre>
javascript jquery
[3, 5]
632,486
632,487
Jquery and PHP rating function problem
<p>I know that I was already posted similar question but I just can't find the answer and figure it out how to solve this problem.</p> <p>I'm trying to customize Jquery Star Rating plugin (<a href="http://php.scripts.psu.edu/rja171/widgets/rating.php" rel="nofollow">link text</a>) but I do not know what to do to show the message based on response of PHP script.</p> <p>Jquery script successfully send rating data to PHP scripts that query the database and based on that echo message of proper or improper rating.</p> <p>What should I add to an existing JS code so I can get echo from PHP and base on that write a message on some DIV beside rating star?</p> <p>Jquery:</p> <pre><code>$('#gal').rating('gl.php?gal_no=&lt;?=$gal_no;?&gt;&amp;id=&lt;?=$id;?&gt;', {maxvalue:10,increment:.5, curvalue: &lt;?=$cur;?&gt;}); </code></pre> <p>Simplified PHP code:</p> <pre><code>$br=mysql_query("SELECT count(gal) as total FROM ...") if ... { echo '0'; } else echo '1'; } </code></pre> <p>Jquery code successfully transmitted data to PHP script and when the PHP done with checking data echo the result ('1' or '0'). How can I get this PHP result back to Jquery and based on them write a message? Something like:</p> <pre><code>if(data=="1") { $("#error").show("fast").html('not correct').css({'background-color':'#F5F5F5','border-color' : '#F69'}); }else{ $("#error").show("fast").html('correct').css({'background-color' : '#FFF','border-color' : '#3b5998'}); } </code></pre> <p>If someone has an idea...I would appreciate it.</p>
php jquery
[2, 5]
4,660,960
4,660,961
Get ID of filtered element
<p>I have multiple elements that share a class. At any given time, one of them may be visible. I can determine that one of them is visible, but how do I get it's ID?</p> <p>n is the ID of an element that has been clicked, 1-4. I want to see if n matches the ID of the visible element so that no action is taken if the matching element is already visible. If you have already clicked one of them and made something visible, clicking again should do nothing. So, which element in c is the visible element - need it's ID.</p> <pre><code>function manageVisible(n) { var x = n, i, c; c = $('.glowSafe:visible'); if(c.length !=0){ c.fadeOut(300).hide(); $('#glowSafe' + x).fadeIn(800); } $('#glowSafe' + x).fadeIn(800); } </code></pre>
javascript jquery
[3, 5]
3,710,704
3,710,705
The false element in a Logical operation
<p>I wish to know if there's some way to know which is the elemnet of a logic operation is false?<br> Example. </p> <pre><code>if( String.IsNullOrEmpty(obj1) || (String.IsNullOrEmpty(obj2) ) throw("..............."); </code></pre> <p>How can I kown which one of those is the empty one? </p>
java c#
[1, 0]
5,948,237
5,948,238
Which language is most suitable for an efficient web-crawler?
<p>i need to write an web crawler and i need need which is best language for performance like memory and performance ..</p> <p><strong>Edit:</strong> Original title was "which language is optimized for speed and perfomance c++ or C#"</p>
c# c++
[0, 6]
3,483,594
3,483,595
Return array from JSON file with JQuery?
<p>I have a JSON file that contains the following: [{name:joe,number:4},{name:ralph,number:76}]</p> <p>Simply put, I'm trying to create a function that returns that as an array:</p> <pre><code>function createArray(){ x = $.getJSON("/names.json", function(json) { var myArray = []; $.each(json, function() { myArray.push(json); }); return myArray; }); return x; } </code></pre> <p>This is not working, I'm not sure what part of it doesnt make sense</p>
javascript jquery
[3, 5]
767,008
767,009
Edit serverside files in JS
<p>i am making some script for some personal use. Now i tend to keep my CD collection list in a html file which has some sleek design, but i am tired of editing the list by "hand" and that means that i don't want to edit the code everytime i add new CD. So is there a way that i can use JS or JQuery so i could add/read from a local file(this script is not remote it is local(although i might try to host it remote).</p> <p>I don't want to use any other language than HTML, CSS and JS/JQuery.</p> <p>EDIT: Is it possible to add a link that when i click some application on my computer would launch.</p>
javascript jquery
[3, 5]
326,605
326,606
How to get the id of the checkbox that has just been checked by the user using jQuery?
<p>I have an asp.net repeater which binds the memberid to the id of the checkbox wrapped in a fieldcontain of jquery mobile.</p> <pre><code>&lt;div data-role="fieldcontain" style="margin: 0px"&gt; &lt;fieldset data-role="controlgroup"&gt; &lt;asp:Repeater ID="rpt" runat="server"&gt; &lt;ItemTemplate&gt; &lt;input type="checkbox" name="chkBox" id="&lt;%# DataBinder.Eval(Container.DataItem, "[MemberId]").ToString() %&gt;" class="custom" /&gt;&lt;label for="&lt;%# DataBinder.Eval(Container.DataItem, "[MemberId]").ToString() %&gt;"&gt;&lt;%# DataBinder.Eval(Container.DataItem, "[LastName]").ToString() %&gt;, &lt;%# DataBinder.Eval(Container.DataItem, "[FirstName]").ToString() %&gt;&lt;/label&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/fieldset&gt; &lt;/div&gt; </code></pre> <p>I have this jQuery function:</p> <pre><code>$('input:checkbox[name=chkBox]').change(function () { var id = $(this).attr('id'); //var isChecked = $(this).attr('checked'); var isChecked = $('#'+id).is(':checked'); }); </code></pre> <p>How do I get the id of the checkbox that has just been clicked and tell if it is checked or unchecked by the user as the result of the click action? The current code will loop through all of the checkboxes. The click() does not get caught for some reason so I use change().</p> <p>Thanks,</p>
c# jquery asp.net
[0, 5, 9]
3,784,280
3,784,281
Android UI - align buttons in the centre, order vertically
<p>I'm trying to create a UI that has a banner on the top but one table row below has a list of buttons ordered vertically, but aligned horizontally...</p> <p>My code so far is...</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; </code></pre> <p> </p> <pre><code>&lt;Button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Theme"&gt; &lt;/Button&gt; &lt;Button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Theme2"&gt; &lt;/Button&gt; &lt;Button android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Theme3"&gt; &lt;/Button&gt; </code></pre> <p> </p> <p>All this does is put all the buttons in the centre, how do I make each button flow down? I basically want a similar UI design to <a href="http://www.appbrain.com/app/friday-soundboard-rebecca/com.randomcrap.soundboard" rel="nofollow">http://www.appbrain.com/app/friday-soundboard-rebecca/com.randomcrap.soundboard</a> (not nearly as evil with content though :) )</p> <p>Thanks!</p>
java android
[1, 4]
4,400,768
4,400,769
How do I get a Font from a string?
<p>In the the <code>System.Web.UI.DataVisualization.Charting.Chart</code> control a font can be set by referring Font by it's family name. How do I do something similar in code?</p> <pre><code> &lt;asp:Chart runat="server"&gt; &lt;legends&gt; &lt;asp:Legend Font="Microsoft Sans Serif, 8.25pt, style=Bold"/&gt; &lt;/legends&gt; &lt;/asp:Chart&gt; </code></pre> <p>How can I do something similar in the codebehind?</p> <pre><code>chart.Legends[0].Font = Font.???("Microsoft Sans Serif, 8.25pt, style=Bold") </code></pre>
c# asp.net
[0, 9]
287,720
287,721
How to make a button in an iframe trigger a function on a specific object in the parent window?
<p>I have the following 2 html files, INDEX.HTML and FRAME.HTML, which is shown in an iframe on INDEX.HTML. When I click button1, I get the alert "action1: your value 1". A click on button2 shows the alert "action1: your value 2".</p> <p>My question is, how can I make an onclick on button3 that triggers action2 on the myfunction object bound to button1? This should give me the alert "action2: your value 1".</p> <p>INDEX.HTML:</p> <pre><code> &lt;a id="button1" href="#"&gt;BUTTON 1&lt;/a&gt; &lt;a id="button2" href="#"&gt;BUTTON 2&lt;/a&gt; &lt;iframe id="frameforbutton3" src="frame.html"&gt;&lt;/iframe&gt; &lt;script type="text/javascript"&gt; //&lt;![CDATA[ $.fn.myfunction = function(value) { $(this).click(function() { action1(); return false; }); var action1 = function() { alert("action1: " + value); } var action2 = function() { alert("action2: " + value); } } $(function() { $("#button1").myfunction("your value 1"); $("#button2").myfunction("your value 2"); }); //]]&gt; &lt;/script&gt; </code></pre> <p>FRAME.HTML:</p> <pre><code> &lt;a id="button3" href="#"&gt;BUTTON 3&lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
1,119,602
1,119,603
which is the best way to show a status message in asp.net
<p>Which is the best way to show a status message in asp.net. For example, after saving data to DB I want to show a message like 'Data Saved Successfully". I would like to know which is the best way to show this kind of status message in asp.net.</p> <p>Thanks All.</p>
javascript asp.net
[3, 9]
2,690,524
2,690,525
Using jQuery for alternating png transition
<p>Very basic question. I have a very simple web design utilizing a png with transparency, overlaying another base image. The idea here is that it cycles visibility continously, fading in quickly, displaying for a longer interval, fading out quickly, and remaining invisible for an equal longer interval, basically replicating the behavior of an animated GIF from back in the day. The png starts with display set to none.</p> <p>My problem is jQuery doesn't seem to have a "pause" or "delay" event handler to help here. There are numerous plugins filling the gap, but I'd rather not include one if there's a simple way that I'm missing. That might require falling back on setInterval or setTimeOut, but I'm uncertain of the syntax to do that.</p> <p>What I want schematically is something like:</p> <pre><code>--loop start-- $("#pngOverlay").fadeIn(1000); (5000 delay) // using setTimeout or setInterval if jQuery method unavailable $("#pngOverlay").fadeOut(1000); (5000 delay) --loop repeat-- </code></pre> <p>The following does the behavior once, so I guess if this could be wrapped in a loop it might work, but it doesn't strike me as elegant or the right way.</p> <pre><code> setTimeout(function() { $("#pngOverlay").fadeIn(1000); }, 5000); setTimeout(function() { $("#pngOverlay").fadeOut(1000); }, 10000); </code></pre> <p>Thanks for any suggestions. I would just use GIFs, but need the transparency for this. (In the old days, we used animated GIFs and we <em>liked</em> them...)</p>
javascript jquery
[3, 5]
1,686,073
1,686,074
New page - no ajax? but ajax?
<p>Look at this page: <a href="https://github.com/mozilla/chromeless/tree/master/examples/first_browser" rel="nofollow">https://github.com/mozilla/chromeless/tree/master/examples/first_browser</a></p> <p>When I browse between the folders and files, my browser changes the complete url. No Hashtag found like in other jQuery-ways. A whole new page.. </p> <p>But how to change the complete Page and not reloading it?</p> <p>Thanks for your answers.</p>
javascript jquery
[3, 5]
1,581,538
1,581,539
Encrypt and decrypt
<p>I wrote Decrypt and Encrypt with C# and used it in my project, and right now it works But I am wondering that I have to write Decrypt and Encrypt with JavaScript for Sniff or it is enough?</p>
c# javascript
[0, 3]
4,343,833
4,343,834
Is JavaScript multithreaded?
<p>Here's my issue - I need to dynamically download several scripts using jQuery.getScript() and execute certain <a href="http://en.wikipedia.org/wiki/JavaScript">JavaScript</a> code after all the scripts were loaded, so my plan was to do something like this:</p> <pre><code>function GetScripts(scripts, callback) { var len = scripts.length for (var i in scripts) { jQuery.getScript(scripts[i], function() { len --; // executing callback function if this is the last script that loaded if (len == 0) callback() }) } } </code></pre> <p>This will only work reliably if we assume that script.onload events for each script fire and execute sequentially and synchronously, so there would never be a situation when two or more of the event handlers would pass check for (len == 0) and execute callback method.</p> <p>So my question - is that assumption correct and if not, what's the way to achieve what I am trying to do?</p>
javascript jquery
[3, 5]
363,538
363,539
Uploading multiple files when user clicks on [add more]
<p>I have a wizard, in some steps I want the user to be able to upload multiple files (no limit) each with description. by default one <code>FileUpload</code> control should be visible, and by clicking (add more) new once are created.</p> <p>I need something like <a href="http://geekswithblogs.net/QuandaryPhase/archive/2009/10/02/asp.net-multiple-file-uploading.aspx" rel="nofollow">this</a> . when I tried to run this code alone, it is working just fine, but when I added it to my website it doesn't work ( the default <code>FileUpload</code> control is not created ) and the error occurs when I click (Upload)</p> <p>I'm appreciating any help to fix the code, or any new ideas. if my question is not clear enough or I need to give more information please let me know </p>
c# asp.net
[0, 9]
5,986,349
5,986,350
How to bind data dynamically to RadioButtonList in asp:repeater using c#?
<p>i want to make a MCQ test paper like following:</p> <ol> <li>question1</li> </ol> <p>radiobuttonlist with values ans1,ans2,ans3,ans4</p> <ol> <li>question2</li> </ol> <p>radiobuttonlist with values ans5,ans6,ans7,ans8</p> <p>all the values of answers and questions must be retrieved from database.</p> <p>please help me..!!.. i need answer urgently..</p> <p>thanks in advance... </p>
c# asp.net
[0, 9]
2,922,722
2,922,723
How do I change button Text on Click MVC?
<p>I have a toggle button, with a show/hide feature in javascript. How do I change the text when the button is clicked? </p> <pre><code>&lt;button id="ShowHide"&gt;Show&lt;/button&gt; </code></pre>
javascript jquery
[3, 5]
2,950,493
2,950,494
jquery select li element in hierarchical menu
<p>I need to be able to get the text from the certain <code>li</code> when it is clicked on, code is below:</p> <pre><code>&lt;div&gt; &lt;ul&gt; &lt;li&gt;list item 1&lt;/li&gt; &lt;li&gt;list item 2&lt;/li&gt; &lt;li&gt; &lt;ul&gt; &lt;li&gt;list item 3&lt;/li&gt; &lt;li&gt;list item 4&lt;/li&gt; &lt;li&gt;list item 5&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;list item 6&lt;/li&gt; &lt;li&gt; &lt;ul&gt; &lt;li&gt;list item 7&lt;/li&gt; &lt;li&gt;list item 8&lt;/li&gt; &lt;li&gt;list item 9t&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>In this case, I need to get the "<em>list item 5</em>" by its index. </p> <p>Edited:</p> <p>Basically, when the <code>&lt;li&gt;list item 5&lt;/li&gt;</code> is clicked i want to get this particallar text or value, when something else is clicked - do nothing. Note that although the menu is hierarchical, 5th element means flat 5th element. Carefully check the texts of the <code>li</code> items to understand.</p>
javascript jquery
[3, 5]
813,145
813,146
Web application to accept Tamil font
<p>I am just developing a web application using ASP.Net, which accepts TAMIL font. Here, if I type something in the textbox in tamil, it should be getting saved with the same values whatever I type in it. </p> <p>For this I just changed the font style of that textbox to BAMINI, with this BAMINI style I can type the words in Tamil, but when I debug the code, the value of the textbox is showing in English only, but I want it should be in Tamil only.</p> <p>I thought I can fix this by using CultureInfo, and I tried with that. But its not happening. How can I fix this. Can anyone help me out here. Thanks in advance</p> <p>here is my Style for the textbox,</p> <pre><code>.tamilTextBox { font-family: bamini; font-size: large; font-style: oblique; width: 50%; } </code></pre> <p>and in the code behind am trying like this,</p> <pre><code>customer.FirstName = txtFirstName.Text.ToString(new System.Globalization.CultureInfo("ta-IN")); </code></pre>
c# asp.net
[0, 9]
3,568,482
3,568,483
Find object's value
<p>Is there any <strong>not loop-based</strong> approach in <strong>JavaScript</strong> or <strong>JQuery</strong> that can check presence of some VALUE from object's properties. I mean here if I have </p> <pre><code>obj = { prop1:val, prop2:val2 } </code></pre> <p>is that possible with maybe one statement check is <strong>val2</strong> presence among values of <strong>obj</strong> ?</p> <p><strong>UPDATE 1:</strong> The loop here is not the key! I can use loop if it is wrapped in some <strong>JQuery</strong> predefined function!</p> <p><strong>UPDATE 2:</strong> Writing a hand-made function is not so elegant, I think. I would like to find some library based solution for such a common and usual problem.</p>
javascript jquery
[3, 5]
5,057,778
5,057,779
Javascript get output from separate php script
<p>I want javascript to be able to call a php script (which just echos a string) using jQuery.</p> <p>I think <code>$.get</code> is the right way, but not too sure.</p> <p>I then want to use the returned string as a javascript variable.</p>
php javascript jquery
[2, 3, 5]
4,157,139
4,157,140
jQuery scrolling by mouse position
<p>is there a jQuery plugin, that does something like on this website: <a href="http://tympanus.net/Tutorials/ThumbnailsNavigationGallery/" rel="nofollow">http://tympanus.net/Tutorials/ThumbnailsNavigationGallery/</a> ?????</p> <p>I'm looking for script, which will scroll content depending on where mouse is. For example when user moves mouse to right content goes slightly to left.</p> <p>is there anything like this?</p>
javascript jquery
[3, 5]
1,168,175
1,168,176
Jquery Time difference of utc offSets
<p>I just want to find time difference between user's time and server side time. like what time is user having on his system and what's the value coming from database. i have got it approximately. but now my problem is what if user is from difference time zone rather then the value is coming from database? So now i just wantto find the exact difference by managing their time zones. Here i am putting my sample code and the values i am getting with their formats.</p> <pre><code> var studentSessionStartTimeDate = that._sessionData.studentSession.dtStart; //date with time from db var splitTimeDate = studentSessionStartTimeDate.split(' '); var oldDate = splitTimeDate[0]; // split date different var dateold = new Date(oldDate).getTime(); //convert date into milliseconds var time=that._sessionData.studentSession.start; // User's exact start time from db var convertedTime=(Number(time.split(':')[0])*60+Number(time.split(':')[1]))*1000; // converted time in milliseconds var sessionStartTime = dateold+convertedTime; // db time and date value in milliseconds var systemTime = new Date().getTime(); // user's system time value in milliseconds var timeDiff = sessionStartTime - systemTime; // now i want this time diff to be exact but it is not calculating the zone difference </code></pre> <p>now if someone want i can get utc Offset from db also, but how can i get differnce? please help guys its urgent for me. Any help would be appreciated.</p>
javascript jquery
[3, 5]
5,782,790
5,782,791
Shopping cart Asp.net
<p>i have a aspx page and inside i have called a .ascx page which is the shopping cart , on the aspx page i have a lot of links to the books and we can add the books to the shopping cart. On clicking the add button i store the bookid,name,price in a cookie and on the ascx page i get the copy and paste the value in the shoping cart using session variable everything is working fine..The code is something like this..on clicking the add btn i call this javascript funtion</p> <pre><code> function addCookies(typeShopping,id,name,price) { document.cookie = typeShopping + "=" + id + "," + name + "," + price; } </code></pre> <p>But after this i have to do post back so the ascx page loads and adds this info to the shopping cart. so on the btn which call this function is like this..</p> <pre><code> &lt;a onclick="addCookies('ShoppingCart',1, 'A summary of the Creed....' ,25);"href=".../ShowBooks.aspx?CategoryName=Qur'an&amp;Mushaf&amp;CatID=1" &lt;/a&gt; </code></pre> <p>but this as you see cause the page to post back and although the item adds to the shopping cart i move to the top , how can i do that i just click and the item add and the page dont post back and i stay on the same book. Thank you</p>
javascript asp.net
[3, 9]
3,610,308
3,610,309
How can I check for IsPostBack in JavaScript?
<p>I need to run a JavaScript function onLoad(), but only do it if the page loaded the first time (i.e. is not the result of a postback).</p> <p>Basically, I need to check for IsPostBack in JavaScript.</p> <p>Thank you.</p>
asp.net javascript
[9, 3]
1,760,457
1,760,458
Selecting the first img from div
<p>I have the following html. </p> <pre><code>&lt;div&gt; &lt;img class="foo"&gt; &lt;a href="#" onClick="changeImage(this, param1, param2)"&gt;sth&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I want to change the class of image (remove <code>foo</code>, add <code>bar</code>) when user clicks on the link. However, I cannot write down the right selector for jquery. </p> <p>I am also not sure if I really need to pass the <code>this</code> to the function.</p> <pre><code>function changeImage(link, param1, param2) { //Following line does not work $(link).parent('div img').removeClass("foo").addClass("bar"); } </code></pre>
javascript jquery
[3, 5]
3,279,131
3,279,132
Learning Java and Python
<p>I've been learning Java for a while now, however, I just found these lessons: <a href="http://www.udacity.com/" rel="nofollow">http://www.udacity.com/</a> . I don't know any Python, but I still want to learn it. however, I've been learning Java for the past month or so, so I'm not sure if I could learn two languages at once. These lessons just look like too good of an opportunity to pass up for free, and would it bee good to know both Python and Java. For instance, would developing be easier with knowing Java and Python, compared to just one. Also, will knowing Java transfer over into Python? Feedback is appreciated and I'm just looking for opinions, thanks.</p>
java python
[1, 7]
2,312,943
2,312,944
How to select the text of a span on click?
<p>I am looking for a way to select the text inside a span using jquery when the text is clicked on.</p> <p>For example in the html snippet below, I want the text "\apples\oranges\pears" to become selected when it is clicked on.</p> <pre><code>&lt;p&gt;Fruit &lt;span class="unc_path"&gt;\\apples\oranges\pears&lt;/span&gt;&lt;/p&gt; </code></pre> <p>I've tried implementing this myself to no avail.</p>
javascript jquery
[3, 5]
5,421,131
5,421,132
Converting javascript in C# function as a argument
<p>In bing map AJAX api v7 there is a method for eventhandling in Events object:</p> <pre><code>addHandler(target:object, eventName:string, handler:function); </code></pre> <p>which is used like this:</p> <pre><code>Microsoft.Maps.Events.addHandler(pin2, 'mousedown', mouseDownHandler); </code></pre> <p>how can i write this in csharp:</p> <pre><code>public void addHandler(object target, string eventName, ----) </code></pre> <p>what should be the 3rd argument?</p>
c# javascript
[0, 3]
3,931,216
3,931,217
image preloader not working in IE
<p>I have the following code to preload images:</p> <pre><code>preloader : function(images) { var imgCount = images.length; var counter = 0; $.each(images, function(i, n) { alert('hi'); // load each image $("&lt;img /&gt;").attr("src", n).load(function() { counter++; if(imgCount == counter) { $('#loader').hide(); $('#wheel').show(); } }); }); } </code></pre> <p>which I'm calling like so:</p> <pre><code>preloader(['../images/image1.png','../images/image2.png','../images/image3.png']); </code></pre> <p>It works fine in firefox but in IE it doesn't work. I get all 3 alerts back so the each loop runs but it only ever loads the first image. If I out just one image in the array I get in to the final if statement and the div's are shown and hidden. But any more than one image and Ie trips up. As i say this works fine in FF so it's not a problem with paths to images or images missing etc.</p> <p>Any idea? I'm really stumped on this.</p>
javascript jquery
[3, 5]
704,922
704,923
Assign Resulted Value to Third TextBox Using jQuery
<p>i have three textboxes. I want to get the value from the first 2 textboxes, calculate the value and then assign the result to the 3rd textbox. To achieve this, i have done something like following in jquery;</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function myfunction() { $("#TxBx_MarksObtained").change(function () { //var value = $(this).val(); var a = $("#TextBoxTotalMarks").val(); var b = $("#TxBx_MarksObtained").val(); var c = (b * 100 / a).toFixed(2); $("#TextBoxMarksInPercent").val(c); }); }); &lt;/script&gt; </code></pre> <p>Now, the problem is, when i focus on <code>TextBoxTotalMarks</code> and enter the value, and for <code>TxBx_MarksObtained</code> too, Everythings works great and the result is assign to <code>TextBoxMarksInPercent</code>. <br /> However, when i change my focus to another textbox (somewhere else in form) and then come back and change the value of <code>TextBoxTotalMarks</code> and <code>TxBx_MarksObtained</code>. I dont see any changes in <code>TextBoxMarksInPercent</code>. <br /> <strong>What i am getting wrong? <br /> Why my value isn't updated after comming back from another textbox?</strong></p>
javascript jquery
[3, 5]
711,766
711,767
Closing lightbox permanently for a user on close button click
<p>I am using a jquery plugin ( lightbox) on my asp.net page(http://www.ericmmartin.com/projects/simplemodal/#demo). This lightbox loads a page using Iframe in this lightbox. this lightbox has an image for closing popup.</p> <p></p> <p>I want that when user clicks this image and loads page again then this pop up doesn't appear. Right now popup appears on each time user hits F5. I guess I need to use cookies with JS/Jquery but not exactly sure.</p>
javascript jquery asp.net
[3, 5, 9]
2,842,582
2,842,583
How make a select dropdown to select an option value based on current time
<p>I have a select dropdown with times in 30 min intervals like</p> <pre><code>11:00 AM, 11:30 AM, 12:00 PM, 12:30 PM, 1:00 PM </code></pre> <p>beginning from 0:00 AM and ending with 11:30 PM</p> <pre><code>&lt;select id='time'&gt; &lt;option value="11:30 AM"&gt;11:30 AM&lt;/option&gt; &lt;option value="12:00 PM"&gt;12:00 PM&lt;/option&gt; &lt;option value="12:30 PM"&gt;12:30 PM&lt;/option&gt; &lt;option value="1:00 PM"&gt;1:00 PM&lt;/option&gt; &lt;option value="1:30 PM"&gt;1:30 PM&lt;/option&gt; &lt;option value="2:00 PM"&gt;2:00 PM&lt;/option&gt; &lt;option value="2:30 PM"&gt;2:30 PM&lt;/option&gt; &lt;option value="3:00 PM"&gt;3:00 PM&lt;/option&gt; &lt;option value="3:30 PM"&gt;3:30 PM&lt;/option&gt; &lt;option value="4:00 PM"&gt;4:00 PM&lt;/option&gt; &lt;option value="4:30 PM"&gt;4:30 PM&lt;/option&gt; &lt;/select&gt; $(document).ready(function(){ $('#time').val(.now()); // this wouldnt work it gives the current time which may be between 30 min }); </code></pre> <p>I want this select dropdown to default to rounded to nearest higher time based on current time.</p> <p>For eg. if the current time is 10:46 AM then the selected value should 11:00 AM and if the current time is 10:31 AM should also default to 11:00 AM.</p> <p>Any pointers on achieving this using jquery or with normal javascript.</p> <p>Thanks</p>
javascript jquery
[3, 5]