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
489,643
489,644
How to stop unloading the page?
<p>I have a page where user needs to enter some data and click save to validate the changes, but my problem is if the user is trying to close the browser window or click on a different link to navigate to a different page..I need to delete all the entries the user has saved so far.. I am doing it the following way</p> <pre><code>window.onbeforeunload = function() { if(confirm('Are you sure you want to navigate')) { //Invoke `enter code here`server side method } else { // return false; } } </code></pre> <p>Everything works fine if he click on Yes, the problem comes when he click on "No"..Even if he click on No..the page unload method is getting called and it is redirected to a different page..but I want it to stay in the same page in same state...can you please help me in achieving this.</p> <p>Thanks and appreciate your response....</p>
javascript jquery
[3, 5]
4,715,748
4,715,749
Selecting the correct input field using jquery
<p>I'm trying to select the id's of dynamic input fields in my code. When clicking a button, the form will create a form field like this:</p> <pre><code>&lt;td&gt;&lt;input type="text" id="field_a_1"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_b_1"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_c_1"&gt;&lt;/td&gt; </code></pre> <p>When I click on the button again I get this:</p> <pre><code>&lt;td&gt;&lt;input type="text" id="field_a_2"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_b_2"&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" id="field_c_2"&gt;&lt;/td&gt; </code></pre> <p>What I want to do is select only the field id that I need to pull the value from that particular input and pass it to a variable like this:</p> <pre><code>var example = $(":input:eq(0)").val(); </code></pre> <p>I know that by adding the <code>:eq(0)</code> after the <code>:input</code> selector it will only grab the id for <code>field_a_1</code>, so how do I set it up so that I can pull just the field that I need to assign it to a variable?</p>
javascript jquery
[3, 5]
665,646
665,647
Save WebResponse as txt
<p>I'm looking for a method equivalent to Request.SaveAs in WebResponse. But I can't find it.</p> <p>I want to store in txt file the headers and the body of a webresponse.</p> <p>Do you know any technique to achieve it?</p>
c# asp.net
[0, 9]
1,297,185
1,297,186
Need to Create Abstract Class for Items
<p>I need to create a class for Items? I planned to create it using Abstract Class. So other classes like Stores, Purchase, BOM can use the Items. I need to create some methods in Abstact class like ItemName, ItemDesc, ItemMake, etc., So that I can use it in any other classes, how to achieve this?</p>
c# asp.net
[0, 9]
1,043,142
1,043,143
Exception thrown on assignment of an array to another array
<p>I have a function which fetches a certain website's HTML code. Eventually that function will return the whole page as an array. I am trying to save the page in another array, but it will always throw an exception (ArrayIndexOutOfBoundsException) for some reason.</p> <p>I am not sure if I am just missing something elementary or if it's more than just that. To give you some of my code: </p> <pre><code> protected String[] doInBackground(String... login) { String[] page = new String[1024]; try { page = executeHttpGet(); //THIS IS WHERE IT FAILS } catch (Exception e) { page[0] = "Error"; } return page; } public String[] executeHttpGet() throws Exception { URL u; InputStream is = null; DataInputStream dis; String s; int i = 0; String[] page = new String[1024]; addSecurityException(); Authenticator.setDefault(new MyAuthenticator(activity)); try { u = new URL("https://myurl.com"); is = u.openStream(); dis = new DataInputStream(new BufferedInputStream(is)); while ((s = dis.readLine()) != null) { if (s.toString().length() &gt; 10) { page[i] = s.toString(); i++; } } } catch (IOException ioe) { } finally { try { is.close(); } catch (IOException ioe) { } } return page; } } </code></pre> <p>Does anyone have any ideas why I am not able to assign the returned array to the array in doInBackground()? Help would be greatly appreciated. </p>
java android
[1, 4]
84,709
84,710
JQuery/javascript how do I get the ID of an object?
<pre><code>function cat() { this.getMyID = function() { alert(this.id); } ; } var bob = new cat(); // I want it to say 'bob' bob.getMyID(); </code></pre> <p><a href="http://jsfiddle.net/n7eHj/" rel="nofollow">http://jsfiddle.net/n7eHj/</a></p> <p>alerts undefined, any ideas?</p> <p>I'll elaborate, this is what I want to do - insert into an onclick method of a button something that calls another function, eg:</p> <pre><code>function cat() { this.render = function() { $('#myButton').attr('onclick', 'this.meow()'); }; } var bob = new cat(); bob.render(); </code></pre> <p>However this will fail because 'this.meow' is nonsense. If I knew the ID, ie. bob, then I could change it to do <code>.attr('onclick', theID + '.meow()'); };</code></p>
javascript jquery
[3, 5]
3,051,462
3,051,463
Is there a shortcut way to refer to elements in my DIV?
<p>I have the following:</p> <pre><code>&lt;div class="modal hide fade" id="adminDialog" style="display: none;"&gt; &lt;div class="modal-header"&gt; &lt;a data-dismiss="modal" class="close"&gt;×&lt;/a&gt; &lt;h3 id='dialog-heading'&gt;&lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I created this variable:</p> <pre><code>dialogDiv = $('#adminDialog'); </code></pre> <p>I would like to change the text of the heading. If I want to do this do I need to use <code>$('#dialog-heading').text()</code> or is there a shortcut way that is based on the dialogDiv variable?</p>
javascript jquery
[3, 5]
4,239,584
4,239,585
Hide android soft keyboard in browser
<p>I'm building a webapp for ios/android and currently got a problem</p> <p>My app has a input element and when people focus on it, the soft keyboard show as usual. But some times I want to hide it by javascript, I tried this:</p> <pre><code>document.getElementById('oneinput').blur() </code></pre> <p>It works fine in ios safari , but in android browser, the input element just lost focus but the soft keyboard still appeared.</p> <p>I also tried to create a click event by javascript on some element but not working either. Any Ideas? </p>
javascript android
[3, 4]
5,869,660
5,869,661
jQuery Toggle Divs
<p>I'm having a little problem implementing some jQuery into a page I am doing.</p> <p>I've got about half way to making it do what I want, but I can't get my head around the last part. Though I've used snippets of jQuery for a while I'm pretty new when it comes to writing my own code.</p> <p>Basically I want 4 Divs which are hidden by default to be opened by clicking on the relevant link, but only one Div should be shown at any one time, so if Div1 has been opened, clicking the Div2 button closes Div1 and opens Div2.</p> <p>Also there is a 5th button, which opens Div1 is no Divs are open, or if any Div is open, to close that open Div.</p> <p>I've been looking at these pages for help, but nothing is exactly what I'm after:</p> <p><a href="http://css-tricks.com/forums/discussion/16451/.slidetoggle-one-div-a-time-problems-please-help/p1" rel="nofollow">http://css-tricks.com/forums/discussion/16451/.slidetoggle-one-div-a-time-problems-please-help/p1</a></p> <p>www.randomsnippets.com/2011/04/10/how-to-hide-show-or-toggle-your-div-with-jquery/</p> <p>webdesignerwall.com/tutorials/jquery-tutorials-for-designers</p> <p>At the moment I've made it so that the Divs appear on a button click, but that's all, I can't work out to make the toggle logic from these examples work on my code.</p> <p>I've set up a JSFiddle here: <a href="http://jsfiddle.net/vx6qu/2/" rel="nofollow">http://jsfiddle.net/vx6qu/2/</a></p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
3,317,842
3,317,843
suggest an alternate to getimagesize() in JS or PHP
<p>For reasons unknown to mankind, I have been forbidden to use <code>getimagesize()</code>, is there any better alternate to <code>getimagesize()</code> which can handle timeouts if I open a remote image? I am also looking at JS options</p> <p>Server guys tell me <code>allow_url_fopen</code> is turned off. I didn't check it :( My fault.</p>
php javascript
[2, 3]
1,743,906
1,743,907
How to call a function binding it to a jQuery object
<p>Does jQuery provides a API to call functions binding the <code>this</code> variable to the jQuery object? E.g.:</p> <pre><code>function log() { console.log(this); } $('body').execute(log); // prints the $('body') object in the console </code></pre> <p>I know that this could be solved by making the log a plugin, but I don't want to do that because the function I need to call is generic and I don't want to tie it to jQuery.</p> <h2>EDIT:</h2> <p>jQuery has no <code>execute</code> method, its just a snippet I added to demonstrate what I am trying to achieve.</p> <h2>EDIT 2:</h2> <p>I am not asking how to workaround this problem (underscore.js bind already got me covered), I am only asking if jQuery already provides a similar API.</p>
javascript jquery
[3, 5]
2,377,513
2,377,514
Arrange images and scale to fit a defined area
<p>I'm looking for a script that will take a bunch of images (of differing widths and heights) and arrange them into a perfect rectangle as shown below;</p> <p><img src="http://i.stack.imgur.com/tUHzg.gif" alt="enter image description here"></p> <p>I have been looking at isotope (http://isotope.metafizzy.co/demos/images.html), but it doesn't resize the images to fit neatly.</p> <p>Wondering if there is some javascript or php that could do this?</p> <p>Thanks.</p>
php javascript jquery
[2, 3, 5]
2,718,677
2,718,678
Get address of the page from which redirected to new page
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3805438/get-previous-page-url-after-response-redirect">Get previous page URL after Response.Redirect</a> </p> </blockquote> <p>Suppose in page 1.aspx, if error occurs, I'm using in catch() block:</p> <pre><code>Response.Redirect("err.aspx"); </code></pre> <p>In code behind of err.aspx, I need url of 1.aspx (or any page from which I'm redirecting to err.aspx page). How do I achieve this?</p>
c# asp.net
[0, 9]
4,663,707
4,663,708
variable assignment inside 'IF' condition
<p>in php, something like this is fine:</p> <pre><code>&lt;?php if ( !$my_epic_variable = my_epic_function() ){ // my epic function returned false // my epic variable is false die( "false" ); } echo $my_epic_variable; ?&gt; </code></pre> <p>I suppose is a shorter way of doing:</p> <pre><code>$my_epic_variable = my_epic_function(); if ( !$my_epic_variable ){ die( "false" ); } </code></pre> <p>Can this be done is javascript? I've tried to no success, wasnt sure if there was some kind of special syntax or something</p>
php javascript
[2, 3]
4,171,249
4,171,250
Javascript keycodes
<p>I am facing is weird problem. I have an input field on my page which gets its feed from a barcode scanner which appends a carriage return at the end (keycode: 13). When I use my scanner on a regular notepad, Once the input prints on screen, the cursor moves to the next line (it gets the carriage return), where as if I do the same thing on the <code>&lt;INPUT&gt;</code> tag, it never gives the carriage return. I tried <code>&lt;textarea&gt;</code> as well, but with no luck. How to tackle this issue? </p>
javascript jquery
[3, 5]
2,226,709
2,226,710
Set VAR on click and alert the value
<p>Why can't I get this to work??</p> <p>I want to get the index() from the menu, and alert() the value when the hash changes, which it does. </p> <p>The alert doesn't appear.</p> <pre><code> $('#menu li a').click(function() { var index = $(this).parent().index()+1; }); $(window).bind('hashchange', function () { //detect hash change var hash = window.location.hash.slice(1); //hash to string (= "myanchor") alert(index); }); </code></pre> <p>Can you tell me what I'm doing wrong???</p>
javascript jquery
[3, 5]
4,446,889
4,446,890
How to get the full file path while using FormFile in struts?
<p>Without uploading a xls file I want to read the data from xls file using POI API.For that I need the full file path with file name.IE gives the full file path where as Mozzila does not.Is there any alternate way to get the full file path. Please suggest....</p>
java javascript
[1, 3]
3,467,273
3,467,274
Accessing record using a Date
<p>Having a problems accessing a record in a database using date. I'm doing something wrong here cannot remember if you need to have #. What am I missing?</p> <pre><code>SqlDataReader MyReader; SqlConnection Conn; Conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NoteBook.mdf;Integrated Security=True;User Instance=True"); SqlCommand MyCommand = new SqlCommand(); MyCommand.CommandText = "SELECT Id, Date, Note FROM NoteBook Where Date = #07/04/2011#";//Id = 1"; //; // + Message.Text + ""; MyCommand.CommandType = CommandType.Text; MyCommand.Connection = Conn; MyCommand.Connection.Open(); MyReader = MyCommand.ExecuteReader(CommandBehavior.CloseConnection); while (MyReader.Read()) { TextBox1.Text = (string)MyReader["Note"]; } </code></pre>
c# asp.net
[0, 9]
1,784,317
1,784,318
Constantly Refresh the Page
<p>i need create web chat. So i need constantly refresh page.</p> <p>I think use this jQuery function:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ var sec = setInterval(function() { $('#chat').load('chat_r.php?id=' + Math.random()); }, 1000); }); &lt;/script&gt; </code></pre> <p>But I found out that this function is very slow. </p> <p>Maybe you know a better option?</p>
php jquery
[2, 5]
3,491,999
3,492,000
Two jquery datepicker instances in one control ASP.NET
<p>I have two text boxes that use the datepicker plugin on the same page.</p> <p>I use the code below to set attributes for each by using their cssclasses, however the minDate for datepickerLatest does not seem to work on the calendar. It works fine for datepickerEarliest</p> <pre><code>&lt;asp:TextBox runat="server" ID="tbEarliestDate" CssClass="datepickerEarliest"&gt;&lt;/asp:TextBox&gt; </code></pre> <p></p> <pre><code>$(".datepickerEarliest").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, yearRange: '-100:+10', changeYear: true, maxDate: '17/08/2012' }); $(".datepickerLatest").datepicker({ dateFormat: 'dd/mm/yy', changeMonth: true, yearRange: '-100:+10', changeYear: true, minDate: '21/06/2012' }); </code></pre> <p>Any help appreciated.</p>
jquery asp.net
[5, 9]
5,640,313
5,640,314
Accessing a public variable from another class?
<p>The app I'm currently developing has more than one class created, with a corresponding .xml file for each. My app requires progressing from one screen to the next after a calculation has been completed.</p> <p>In one class, I have declared a public double called V, which is the result of a voltage calculation.</p> <p>When the user presses "NEXT", a new class (ed: Activity?) is called, and the xml file will change the screen view to a new layout.</p> <p>In this new class, I need to use the variable (double V) for a new calculation.</p> <p>I thought that if a variable was public, it could be used anywhere in the package. Do I need to import this variable, or re-declare it somehow?</p> <p>Any answers would be much appreciated. I've tried everything that I can think of, but Eclipse just keeps saying V cannot be resolved.</p>
java android
[1, 4]
5,982,112
5,982,113
Set PHP variable value from a Javascript Variable value without refresh
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/9789283/how-to-get-javascript-variable-value-in-php">How to get javascript variable value in php</a> </p> </blockquote> <p>I am looking for help to set value of a php variable from javascript variable. </p> <p>I tried these but nothing worked:</p> <p>Try 1:</p> <pre><code>&lt;script&gt; &lt;?php $phpVar = ?&gt; jVar; &lt;/script&gt; </code></pre> <p>Try2:</p> <pre><code>&lt;?php $phpVar = echo "&lt;script&gt;document.write(jVar)&lt;/script&gt;"; </code></pre> <p>Failed too.. </p> <p>Please help. Please help!</p>
php javascript jquery
[2, 3, 5]
1,146,374
1,146,375
ASP.NET 3.5 C#: Best way to create and display dynamic menu with submenus
<p>I usually just create a datatable with one repeater and have all this html in my codebehind. I have not found an easy method for adding a submenu dynamically. Does anyone have a way to do this better?</p>
c# asp.net
[0, 9]
183,429
183,430
Access Cookie into sub domains
<p>I want to host multiple sites under one domain. But currently I am working on localhost, so I added these 2 lines to my etc/hosts file:</p> <pre><code>127.0.0.1 something.com 127.0.0.1 orders.something.com </code></pre> <p>There are 2 applications hosted in IIS. One can be browsed using: <code>orders.something.com/OrdersSSO</code> and other can be browsed using <code>something.com/SSOSample/</code>.</p> <p>I created authentication cookie using this code in <code>something.com/SSOSample/</code>:</p> <pre><code>FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, "abc", DateTime.Now, DateTime.Now.AddMinutes(30), // value of time out property true, // Value of IsPersistent property String.Empty, FormsAuthentication.FormsCookiePath); string encryptedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie authCookie = new HttpCookie( FormsAuthentication.FormsCookieName, encryptedTicket); Response.Cookies.Add(authCookie); </code></pre> <p>So I am logged in this application. However when I browse orders.something.com/OrdersSSO I don't get my authentication cookie.</p> <p>This is my forms section in web.config:</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/Login.aspx" enableCrossAppRedirects="true" timeout="2880" domain=".something.com" /&gt; &lt;/authentication&gt; </code></pre> <p>What am I missing?</p>
c# asp.net
[0, 9]
4,330,155
4,330,156
What is the difference between OOP in JS and Java?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/879061/what-are-the-advantages-that-prototype-based-oo-has-over-class-based-oo">What are the advantages that prototype based OO has over class based OO?</a> </p> </blockquote> <p>What is the exact difference between prototypical inheritance in js and classical inheritance in java?</p>
java javascript
[1, 3]
4,281,888
4,281,889
Javascript spinning wait hourglass-type thing
<p>I'd like to indicate to the user of a web app that a long-running task is being performed. Once upon a time, this concept would have been communicated to the user by displaying an hourglass. Nowadays, it seems to be an animated spinning circle. (e.g., when you are loading a new tab in Firefox, or booting in Mac OS X. Coincidentally, the overflowing stack in the stackoverflow logo looks like one quarter of the circle).</p> <p>Is there a simple way to create this effect using Javascript (in particular, JQuery)? Ideally, I'd like to have one of these little spinners as elements in a table, to indicate to the user that the system is still active in processing a pending task (i.e., it hasn't forgotten or crashed). (Of course, I realize it's possible that the back-end has crashed and the front-end still show as an animating spinning thing, it's more for the psychological purpose of the user seeing activity).</p> <p>And what do you call that spinning thing, anyways?</p>
javascript jquery
[3, 5]
1,602,508
1,602,509
window.top === window false condition in IE8
<p>For some reason, using the</p> <pre><code>window.top === window </code></pre> <p>condition in IE8 always evaluates to false (in other browsers it works fine). What is the reason for this, and is there any other way for this condition to work cross-browser?</p> <p>Thanks,</p> <p>Joel</p>
javascript jquery
[3, 5]
3,410,084
3,410,085
Image Reposition Like Facebook Cover In Android
<p>I want to implement image reposition like facebook cover in my android app. Actually I don't have any background to do this. How can I start it?</p>
java android
[1, 4]
4,253,760
4,253,761
tab switch in js ,which is faster?
<p>I always romoving 'current' class of all siblings then add 'current' class to my clicked one. I want to know will it be faster only removing 'current' class of which has 'current'.seems to be a simple question, but I really want to know. </p> <p><img src="http://i.stack.imgur.com/R6vXc.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
4,866,634
4,866,635
change toolbarhelper values override in the program
<p>in the following, I can't seem to change the _<em>StartDate</em> and _<em>EndDate</em>. I wanted to show data for only past week but the values are coming from toolbarhelper for past month, how can I over ride these to the past week only?</p> <pre><code>protected override ObservableCollection&lt;Object&gt; CreateToolBar() { return new ObservableCollection&lt;Object&gt;() { ToolBarHelper.PrintButton(), ToolBarHelper.DateRange(_StartDate, _EndDate, (s, e) =&gt; { _StartDate = s; _EndDate = e; }), ToolBarHelper.UnitSelection(unit =&gt; { _Unit = unit; }), ToolBarHelper.RefreshButton(RefreshData), }; } </code></pre>
c# asp.net
[0, 9]
4,755,637
4,755,638
boolean argument not passing correctly
<p>I'm new to jQuery and im just trying to pass a boolean to a function.Ive tried various amendments but still not working ?</p> <p>I'm expecting the alert to be fired</p> <pre><code>isTrue(true); function isTrue(boolean isNot){ if(isNot){ alert('true'); } } </code></pre>
javascript jquery
[3, 5]
1,315,718
1,315,719
The status code returned from the server was 413
<p>Getting this error on pages using https when a event handler is called. e.g selecting a row of data.</p> <p>the data is in a infragistic webgrid.</p> <p>Please advise.</p>
c# asp.net
[0, 9]
1,707,169
1,707,170
Removing a table row using jquery, fading and changing color slightly
<p>I have a button that when clicked, gets the row in the table that was clicked on.</p> <p>So I have:</p> <pre><code>$("#someId").remove(); </code></pre> <p>I want to highlight the row that is being deleted, and fade it out (it is being deleted).</p> <p>Is there a way to do this with jQuery? I tried: $("#someId").fadeOut("slow").remove() but tat didn't seem to show anything.</p>
javascript jquery
[3, 5]
3,297,507
3,297,508
How to add more than one List<String> in Android?
<p>How to assign more than one List in Android?</p> <pre><code>List&lt;String&gt; inc = dh.selectInct1(); ArrayAdapter&lt;String&gt; inc1 = new ArrayAdapter&lt;String&gt;(this,R.layout.list,R.id.textViewx,inc); lvinc.setAdapter(inc1); lvinc.setOnItemClickListener(this); </code></pre> <p>Here <code>dh.selectInct1();</code> returns a list that is assigned into <code>inc</code>. Now I need to add one more list from database to this already existing <code>inc</code>. How to achieve it?</p>
java android
[1, 4]
5,052,965
5,052,966
How to add CheckBox, Label and DDL to ASP.NET page programmatically?
<p>I am trying to add a check box, label and DDL to ASP.NET page (aspx) from my back class in C#. I have been using <code>LiteralControl _liText = new LiteralControl();</code> to attach label so that I can show them using <code>this.Controls.Add(_liText);</code>in CreateChildControls() method. </p> <p>How do I add DDL and check box to ASp.NET page from C# code so that my label is in the same line with DDL and checkbox?</p> <p>I have already made DDL using this syntax:</p> <pre><code>List&lt;DropDownList&gt; _ddlCollection=new List&lt;DropDownList&gt;(); for (int i = 0; i &lt; 5; i++) { _ddlCollection.Add(new DropDownList()); } </code></pre> <p>Problem is not in this.Controls.Add() which I call from CreateChildControls(). It is OnPreRender() method where I fill ddl and check box. Is LiteralControl class good for this? Here is what I have tried in OnPReRender():</p> <pre><code> foreach (SPList list in web.Lists) { if (!list.Hidden) { _liText.Text += @&lt;input type="checkbox"&gt;; _liText.Text += list.Title + "&lt;br /&gt;"; } } </code></pre>
c# asp.net
[0, 9]
2,530,709
2,530,710
Only register a function with an event once?
<p>I have a jQuery plugin that needs to register a click event handler:</p> <pre><code>$.fn.myPlugin = function (options) { var settings = { // snipped }; $.extend(settings, options || {}); $("body").click(function () { // Do Something }); // Rest of the plugin }); </code></pre> <p>The problem is that multiple invocations register the function more than once. Since the function needs to stay attached, I can't use .one().</p> <p>Is there a way if a function is already attached? Can I give it a name or so? Or do I have to set some boolean flag using closure magic?</p>
javascript jquery
[3, 5]
4,236,497
4,236,498
pause jQuery function for 5 seconds before script returns true and posts
<p>Im using jQuery to post a form to a database, before posting the HTML form to a remote server via the form action method.</p> <p>All works fine, but I am trying to build in a message pre-the server POST , so is there a way that just before my jQuery function returns true to get it to pause for 5 seconds and display a message?</p> <pre><code> ... $.ajax({ type: "POST", url: "myform.php", data: dataString, success: function() { $('#details').html("&lt;div id='post-message'&gt;&lt;/div&gt;"); $('#post-message').html("&lt;h2 style='color:#fff'&gt;Thanks for getting in touch&lt;/h2&gt;") //.append("&lt;p&gt;Thank you&lt;/p&gt;") .hide() .fadeIn(1500, function() { // $('#message').append("&lt;img id='tick' src='images/tick.png' /&gt;"); }); } }); return true; }); ... </code></pre> <p>I ideally need a pause of 5 seconds just before the script returns true and finishes - any help much appreciated! Presently the message has no time to display as the script returns true and posts!</p> <p>Thanks</p>
php jquery
[2, 5]
1,414,158
1,414,159
Generate array in PHP for JavaScript function
<pre><code>&lt;script&gt; $(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy" ]; $( "#fname" ).autocomplete({ source: availableTags }); }); </code></pre> <p></p> <p>The above function helps me to achieve auto complete using static values, what I want is to get these values from the database. I wrote a php function that connect to the db but I am not sure how to pass the return value of that function to the javascript page below is snippet of that.</p> <pre><code>function getAllDrugs(){ $med = ""; $select = mysql_query("SELECT dname FROM phar_store_config where quantity &gt; 1"); while($row = mysql_fetch_array($select)){ $med = $med.$row['dname']; } return $med; } </code></pre> <p>Now i want the return value of the above php function to be passed to my js function.</p> <p>Any help will be appreciated.</p>
php javascript
[2, 3]
993,875
993,876
jQuery click(function() not working but plain Javascript working just fine
<p>THIS IS THE FULL SCRIPT</p> <p><a href="http://goo.gl/HoCxk" rel="nofollow">http://goo.gl/HoCxk</a></p> <p>I have a problem with this function:</p> <pre><code> $('.message').click(function(){ alert("it works"); var clicked_msg=$(this); $('#current_message').html(clicked_msg.attr("id")); }); </code></pre> <p>If instead of the above I add an onclick="msgClicked()", and then do something like this:</p> <pre><code>function msgClicked(){ var x=document.getElementById("current_message");alert("it works");x.innerHTML("test");} </code></pre> <p>The jQuery library is obviously imported as literally everything else is done using the jQuery framework and all the other functions implemented on the messaging system are jQuery. Everything works perfect there but for some reason I can't figure out what is wrong with this one.</p> <p>If any of you are willing to help out and you need to see what is actually going on, please let me know and I will create an account for you on my website. Removing all the protection from the content would take a looong long time.</p>
javascript jquery
[3, 5]
4,171,908
4,171,909
(PHP/JQuery) Populating form with data?
<pre><code>populate_form($array_data) { //Format: $array_data['css_selector'] = "value"; $html = "&lt;script&gt;\n$(document).ready(function(){\n"; foreach($array_data as $key =&gt; $val) { $html .= "$('$key').val('$val');\n"; } $html .= "});\n&lt;/script&gt;"; return $html; } </code></pre> <p>I just coded this function but havent used it yet. I wonder if this is approach for populating form with data is a good idea.</p>
php jquery
[2, 5]
624,721
624,722
I need to create a project file for an ASP.NET website
<p>I haven't got a solution file for a project that i have been asked to work on. However i have all the other aspx and aspx.cs files in one location on my comp. Is it possible for me to create a solution file or may be create a new website project in visual studio 2008 so i should be able to compile the website in visual studio.</p> <p>Alternatively if someone can direct me to a link for setting up a website on IIS would be a great help but bare in mind i dont have a .sln or a .csproj file.</p> <p>Any Help would be much appreciated.</p> <p>Thanks in Advance, Nitesh.</p>
c# asp.net
[0, 9]
560,434
560,435
jQuery: How to get the width sum of all previous elements and put it in data attribute
<p>how to get the width of each previous elements and sum them up (after page load)<br><br> Then put the value in each element data attribute<br><br> This is the code on jsfiddle <a href="http://jsfiddle.net/jSfKJ/2/" rel="nofollow">http://jsfiddle.net/jSfKJ/2/</a><br><br> so how to make this code<br></p> <pre><code>&lt;ul&gt; &lt;li style="width:130px"&gt;Num 1&lt;/li&gt; &lt;li style="width:150px"&gt;Num 2&lt;/li&gt; &lt;li style="width:140px"&gt;Num 3&lt;/li&gt; &lt;li style="width:175px"&gt;Num 4&lt;/li&gt; &lt;li style="width:100px"&gt;Num 5&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>to be like this<br></p> <pre><code>&lt;ul&gt; &lt;li style="width:130px" data-num="0"&gt;Num 1&lt;/li&gt; &lt;li style="width:150px" data-num="130"&gt;Num 2&lt;/li&gt; &lt;li style="width:140px" data-num="280"&gt;Num 3&lt;/li&gt; &lt;li style="width:175px" data-num="420"&gt;Num 4&lt;/li&gt; &lt;li style="width:100px" data-num="595"&gt;Num 5&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>This image to explain more clearly what I want <br> <img src="http://i.stack.imgur.com/ZT85d.jpg" alt="enter image description here"> <br> I hope I've explained what I want well</p>
javascript jquery
[3, 5]
846,370
846,371
Triggering click event crashes the browser
<p>Check this link: <a href="http://jsfiddle.net/ev3FR/1/" rel="nofollow">jsfiddle example</a></p> <p>When a div is clicked I want the link inside to trigger a click event. but the console shows that the click event keeps triggering until the browser crashes. Why is this happening? And whats the solution?</p> <p>The real div's has alot of content inside of it so I don't want the <code>&lt;a&gt;</code> tag to cover the whole div or wrap the div inside a <code>&lt;a&gt;</code> tag. This function is intended to work on mobile devices.</p>
javascript jquery
[3, 5]
2,821,402
2,821,403
Disabled inputs B&C if not inputA
<p><a href="http://jsfiddle.net/6Pu3E/" rel="nofollow">http://jsfiddle.net/6Pu3E/</a></p> <p>JS:</p> <pre><code>$(document).ready(function() { var block = false; if $('#password').attr('disabled'); { block = false; }else{ block = true; }; if block { $('.form_input input').attr('disabled','disabled'); }else{ $('.form_input input').removeAttribute('disabled'); } }); </code></pre> <p>HTML:</p> <pre><code>&lt;form&gt; &lt;input id="password" value="" /&gt; &lt;input class="form_input" id="Special" /&gt; &lt;input class="form_input" id="Nothing Special" /&gt; &lt;/form&gt; </code></pre> <p>The goal is that all the inputs with a certain class get the attribute disabled if the first input with ID="password" does NOT have the attribute disabled. If the first input is disabled, nothing happens. I.e. the other inputs won't get the disabled attribute.</p>
javascript jquery
[3, 5]
5,509,301
5,509,302
How to test if a jQuery selectors condition is more than 2 times?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4979738/fire-jquery-event-on-div-change">Fire jQuery event on div change</a> </p> </blockquote> <p>I'm using this tiny plugin to watch for changes in the html: <a href="https://github.com/jacobrelkin/jquery-watcher" rel="nofollow">https://github.com/jacobrelkin/jquery-watcher</a></p> <p>This works fine, the problem is I need the <code>if condition</code> to validate if it's over 2 times, reason being when the gallery loads and it shifts left and right creates the <code>-moz-grabbing</code> condition twice onload.</p> <p>I tried doing </p> <pre><code> if( $('#gallery-1').has('div').css('cursor', '-moz-grabbing') &gt; 2) if( $('#gallery-1').has('div').css('cursor', '-moz-grabbing').length &gt; 2) </code></pre> <p>I also tried putting it in a variable then doing <code>&gt; 2</code></p> <p>None of the above seem to be working not sure what I'm doing wrong?</p> <pre><code>$('.sliderContainer').watch('innerHTML', function() { if( $('#gallery-1').has('div').css('cursor', '-moz-grabbing') ) { console.log($('#gallery-1').has('div').css('cursor', '-moz-grabbing')); $('#collapse_content_1').toggleClass('collapse_inner_off'); } }); </code></pre>
javascript jquery
[3, 5]
4,516,527
4,516,528
Click on button with PHP or javascript?
<p>I want to run a PHP script on my computer and renew my IP every half hour. I can do this by surfing to <code>http://192.168.1.1/</code> and clicking the disconnect button. (This is probably different for you, it depends on your router I guess)</p> <p>Now I was thinking to load the website <code>http://192.168.1.1/</code> into an iFrame and then PHP or javascript could click the button.</p> <p>I'm curious if these kind of things are possible with PHP or javascript? I saw in the source code that there is a javascript function behind the button. Can I run the function without physically clicking on the button?</p> <p>I think an important note, I am not able to edit the source code of <code>http://192.168.1.1/</code>.</p> <p>I hope someone can point me in the right direction!</p>
php javascript
[2, 3]
3,337,247
3,337,248
specify filetype for FlashGet's download command with JavaScript
<p>Consider a web page with of links to files. <a href="http://www.flashget.com/download.htm" rel="nofollow">FlashGet</a>'s normal operation is by right-clicking, and selecting from the context menu. </p> <p>I want to make it easy to launch FlashGet, and make a selection of file type to my desired file type without downloading any other resources being linked to.</p> <p>For example, my desired file type is .rar , and other links shown are .jpg, .php, and others.</p> <p>I just want to click one "download" button/link to launch FlashGet, and have it download all links in the page to files of type .rar, or whatever the user chooses/selects.</p> <p>Can this be done with JavaScript?</p>
javascript jquery
[3, 5]
2,543,494
2,543,495
Call Function Upon Document Ready
<p>I need to start polling a URL upon the page loading, to get a JMS response from a credit card server. I put the following together.</p> <p>It works, but only if I hit the Refresh button on the browser. I want the data from the URL to load automatically when the page is first displayed, without requiring the user to Refresh.</p> <p>I am missing a fundamental concept here, and would appreciate any advice on how to make it work. I have about 2 days of JavaScript experience so far.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="p_results"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { function doJMSPolling() { $.ajax({ url: "./poll", type: "GET", dataType: "text", success: function(json) { var json = $.parseJSON(json); if (json.status === 'continue-polling' &amp;&amp; json.msg === 'ok') { setTimeout(function() { doPolling(); }, 2000); } else if (json.status === 'stop-polling' &amp;&amp; json.msg === 'success') { for (key in json) { if (key === "providerResponse") { res = json[key]; for (reskey in res) { $("#p_results").append(reskey + ":" + res[reskey] + "&lt;br&gt;"); } } } } else if (json.status === 'stop-polling') { $("#p_results").text(json.status); } } }); } }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
2,956,724
2,956,725
jquery.val() on the page works, off the page does not? Why?
<p>I had the following: </p> <pre><code>&lt;script type="text/javascript"&gt; var noteid = $('#noteid').val(); &lt;/script&gt; &lt;input type="hidden" name="noteid" id="noteid" value="321"&gt; </code></pre> <p>This works great... but now I'm trying to move the JavaScript off the page into a linked JS file like so: </p> <pre><code>&lt;script type="text/javascript" src="/js/note_beta.js"&gt; &lt;/script&gt; &lt;input type="hidden" name="noteid" id="noteid" value="321"&gt; </code></pre> <p>This ext JS file has the code: "var noteid = $('#noteid').val();" but it isn't working... Is there a trick to getting this to work when it isn't on the page itself?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,184,891
1,184,892
android tabs are too big
<h2>Rephrasing an old question as suggested by a group of mods.</h2> <p>Why are android tabs too big ,specially on a device that small? Eg. <a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-tabwidget.html</a></p> <p>I am converting a java Swing application to android and tabs are giving me the most trouble. Besides looking ugly, each page seem to require a separate activity too. I mean with a JtabbedPane all I did was to put whatever components on a separate JPanel and add them to the host pane. </p> <h2>Thanks</h2> <p>First I believe both of my questions are stated clearly in the above post but i will rephrase anyway</p> <p>a) Why are the default android tabs so big compared to other components. It takes up a lot of space of the limited available space. If it is to make it comfortable for the user why aren't the other components equally big ?</p> <p>b) [ANSWERED]Why does each page requires starting a separate activity. In my app for example I just need to display some chats. This is already answered i.e use of Fragments.</p> <p>Hope it is clear enough now</p>
java android
[1, 4]
3,387,965
3,387,966
Sync music to Android using a python script
<p>I would like to know if it is possible to connect and sync music to my Android phone using python. I don't want to just transfer the music file to the directory on my SD card but instead be able to view all the current tracks on the phone, delete/add tracks, and if possible create a new playlist. Is there a way this can be done in python?</p>
android python
[4, 7]
5,880,113
5,880,114
Add URL variables with Server.Transfer in asp.net
<p>I am currently trying to add a variable to the url using Server.Transfer. I need to use Server.Transfer as I need to keep form post data which is why I can't use Response.Redirect.</p> <p>I am using <code>Server.Transfer("add_account.aspx?error=userNotFound");</code> but the variable is not being added to the URL. </p> <p>Thanks for your help. </p>
c# asp.net
[0, 9]
3,684,858
3,684,859
Can I change the way a $.fn. function is declared?
<p>I have the following code:</p> <pre><code>$.fn.buildTableOfContent = function () { var h2 = this.find('h2'); if (h2.length &gt; 0) { </code></pre> <p>I would like to change it around so it's not declared as a variable:</p> <pre><code>function $.fn.buildTableOfContent () { var h2 = this.find('h2'); if (h2.length &gt; 0) { </code></pre> <p>Is it possible to do this like the above? I have done this for regular functions but not sure about ones that start with $.fn. Am I correct in saying that $.fn. adds the function the the jQuery namespace?</p>
javascript jquery
[3, 5]
3,627,440
3,627,441
Android device update for G1
<p>I am using android G1 phone and now i have upgraded my sdk to 1.5 and i want to run my application on device but when i connect my phone to PC i am able to install my app only when i am selecting 1.1 sdk but not when selected 1.5 .So is there any updates required for the device so i can proceed with 1.5 sdk also .if possible can u provide with a proper link that would be great .</p>
java android
[1, 4]
4,847,229
4,847,230
Image is not loaded in IE and firefox?
<p>I would like to add CAPTCHA source to the div id <code>captchaImage</code>. But it is not working in IE and Firefox, but it is work in Chrome. Please help me. Difficulty reading the words? Load another image.</p> function getNewImage(){document.LogonForm.captcha.value = '';var url = '${startpage.captchaURL}';document.captchaImage.src = url;} <p>Thanks</p>
javascript jquery
[3, 5]
5,741,937
5,741,938
Loadind system shared library runtime in Android
<p>I need to write an application, which will be using a shared library. I need that application to be installed on devices with Android 1.6 and above. I have added the shared library information on the manifest file as follows:</p> <pre><code>&lt;uses-library android:name="com.google.android.maps" android:required="false" /&gt; </code></pre> <p>Now, the <strong>android:required</strong> field is added from Android 2.1 above and this tag will be ignored by the Android 1.6, and hence the application will fail to install saying " INSTALL_FAILED_MISSING_SHARED_LIBRARY".</p> <p>My question is that, is there any way by which, I need not define the shared library information in the manifest and instead I can load the system library ("com.google.android.maps" in my case) dynamically and use reflection to access the class and methods of the library?</p>
java android
[1, 4]
3,244,805
3,244,806
How to return workable filepath?
<p>I have an activity that when users press "share" on a file it would open my app and start uploading the file. Now this works perfectly with images because the URI returned is for MediaStore. But I want to be able to return the URI from any source such as from ES File Explorer</p> <p>Here is the current code:</p> <pre><code> public String getPath(Uri uri) { String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(uri, projection, null, null, null); int column_index = cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } </code></pre> <p>How can I make this so instead of MediaStore it will be used for any type of file?</p>
java android
[1, 4]
148,484
148,485
Trying to get a jquery script to hide an element when a user clicks outside the scope
<p>I am trying to implement a bit of code that Twitter use to toggle off the drop-down login box when a user clicks outside the scope of the drop-down box itself.</p> <p>I am having a bit of trouble, currently if I click outside the scope of the element it works as expected but the same thing also happens when I click inside the element scope I.e. within the #form element.</p> <p>HTML Markup:</p> <pre><code>&lt;body&gt; &lt;div id="form"&gt; &lt;div id="form-tab"&gt;&lt;/div&gt; &lt;div id="form-header"&gt;FooBar&lt;/div&gt; &lt;form&gt; &lt;label&gt;Test&lt;/label&gt; &lt;input type="text"&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>jQuery Code:</p> <pre><code>$(document).mouseup(function(e) { if ($(e.target).parent("div#form").length==0) { hide(); } }); function hide() { $element.animate({ right: $rightPos }, 1000); } </code></pre> <p>If anyone can help me figure out where I am going wrong it would be greatly appreciated.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,546,776
2,546,777
ASP.NET 4.0 Radio button checked changed event fires only once
<p>I have two radio buttons both set as async triggers for an update panel and problem is that first time one is clicked the CheckedChanged event fires but then no matter which radio button is clicked the event never fires again.</p> <p>Markup:</p> <pre><code>&lt;asp:RadioButton ID="rdoDeliveryBilling" runat="server" Checked="true" GroupName="DeliveryAddress" Text="Deliver to this address" AutoPostBack="true" OnCheckedChanged="rdoDelivery_CheckedChanged" /&gt; &lt;asp:RadioButton ID="rdoDeliveryShipping" runat="server" GroupName="DeliveryAddress" Text="Deliver to a different address" AutoPostBack="true" OnCheckedChanged="rdoDelivery_CheckedChanged" /&gt; &lt;asp:UpdatePanel ID="panDeliveryAddress" runat="server"&gt; &lt;ContentTemplate&gt; ...delivery details form controls and validators goes here... &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger ControlID="rdoDeliveryBilling" EventName="CheckedChanged" /&gt; &lt;asp:AsyncPostBackTrigger ControlID="rdoDeliveryShipping" EventName="CheckedChanged" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>Code:</p> <pre><code>protected void rdoDelivery_CheckedChanged(object sender, EventArgs e) { ...only code that enables/disables the delivery form controls and validators goes here... } </code></pre> <p>I have set a breakpoint inside rdoDelivery_CheckedChanged and it only hits the first time.</p> <p>Any ideas?</p>
c# asp.net
[0, 9]
2,710,694
2,710,695
I have to disable button when page is loading ,,after full loading page i a have to enable using jquery or javascript how to do?
<p>I have to disable button when page is loading ,,after full loading page i a have to enable using jquery or javascript how to do?</p>
java javascript jquery
[1, 3, 5]
672,017
672,018
How to check if a function is already defined?
<p>How to check if a function is already defined ?</p>
javascript jquery
[3, 5]
3,288,616
3,288,617
jQuery/JavaScript trim HTML that contains white space/empty line
<p>Suppose I have the HTML code as below</p> <pre><code>&lt;table width="600" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff"&gt; &lt;tr&gt; &lt;td&gt;&lt;img src="/images/pho_01.jpg" width="600" height="63" border="none" style="border: 0px;" alt="photo" /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>The HTML code is not readable, I want to convert to something likes</p> <pre><code>&lt;table width="600" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#ffffff"&gt; &lt;tr&gt; &lt;td&gt;&lt;img src="/images/pho_01.jpg" width="600" height="63" border="none" style="border: 0px;" alt="photo" /&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>I have ever used the <a href="http://api.jquery.com/jQuery.trim/" rel="nofollow"><strong>$.trim()</strong></a>, but not works, could someone please suggest a way to <br /> 1. remove space(but don't remove the space between attribute likes <code>table width="600"</code>...)<br /> 2. remove empty line</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,877,308
3,877,309
Update Panel + window.open + https
<p>I'am developing with c# and asp.net.</p> <p>I have some pages with update panels. In this update panels there is a button that redirects to a new window. This is done by calling the window.open with the scriptmanager in code behind. Everything works fine until I don't use https. If I use tunnelling with a router to have a secure line till the router and then use a proxy to access my webpages, the window.open called from the buttons that are in an update panel open a new register card, but there I get the error : page not found. In the url I can see that the router did not put the proxy+IP before the path. That does not happen if I remove the update panel.With Firebug I could see that with the update panel I get a POST and in the resonse the contentType is text/plain. Without the update panel there is a GET and the response contentType is text/html. So what can I do to run this without removing the update panels?</p> <p>This works fine until I don't use https over my proxy:</p> <pre><code>protected void btnPrint_Click(object sender, EventArgs e) { url = "~/Gui/Report/ReportViewer.aspx?ReportName=CustomerReport"; Page page = (Page)HttpContext.Current.Handler; if (page == null) { Redirect(url); } url = page.ResolveUrl(url); string script = @"window.open(""{0}"");"; script = String.Format(script, url); ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true); } &lt;asp:UpdatePanel ID="UpdatePanel" runat="server"&gt; &lt;ContentTemplate&gt; &lt;dx:ASPxButton runat="server" ID="btnPrint" Text="print" OnClick="btnPrint_Click"&gt; &lt;/dx:ASPxButton&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
1,727,196
1,727,197
jquery date picker with editable dropdownlist
<p>I was using this solution given here for my editable dropdownlist</p> <p><a href="http://www.codeproject.com/Articles/290218/Custom-ASP-NET-Editable-DropDownList" rel="nofollow">Editable DropdownList</a> . It works fine. However i added a date field and tried to use the JQUERY UI datepicker. These two does not seem to work together. As soon as i add the jquery-ui-version.js file, the editable dropdownlist does not work. So something in the js file messes up the dropdownlist. Whats the best way to start figuring out a fix for this? Is there a simple version of jquery datepicker that i can use? </p> <p>Or is there another solution for an editable dropdownlist in asp.net?</p> <p>Thanks.</p> <p>Yes you are right.The files that are required by editable dropdownlist are (it uses some components of jquery UI)</p> <pre><code> jquery.ui.core.js jquery.ui.widget.js jquery.ui.button.js jquery.ui.position.js jquery.ui.autocomplete.js jquery.ui.combobox.js </code></pre> <p>The main UI js is </p> <pre><code> jquery-ui-1.10.1.js </code></pre> <p>and this is the one that makes editable dropdownlist fail.</p>
jquery asp.net
[5, 9]
1,837,552
1,837,553
strange issue with jQuery
<p>I have a very strange issue with jQuery.</p> <p>The problem:</p> <pre><code>$("#button-prev").attr("disabled", "disabled"); </code></pre> <p>This doesn't work. If I check with Firebug I see disabled="" as element attribute</p> <p>But for example this</p> <pre><code>$("#button-prev").attr("disablea", "disabled"); </code></pre> <p>works as you should expect. Anyone an idea what it could be?</p>
javascript jquery
[3, 5]
379,165
379,166
Access an already loaded user control
<p>I am working an Asp.net project, I am loading two user controls into another ascx control. First, I am loading the <code>control1.ascx</code> and then the control2. After loading both of them inside control2.ascx I want to access a function that reloads some data of control1. I am doing it with the following code: </p> <pre><code> private ASP.control1_ascx tree; tree = (ASP.control1_ascx)LoadControl("control1.ascx"); tree.aload(); </code></pre> <p>When I debug the code, it seems that it calls the aload() function and updates the data. But the problem is that I cannot see them after the function is called, instead I can see the correct data after a postback event. Why is this happens?. Is there a solution to see them when I call the function ?</p>
c# asp.net
[0, 9]
3,083,293
3,083,294
Save the audio file by java applet in to the server side
<p>I developed the program to record audio by java applet, I used the following method to save the file: public void saveToFile(String name, AudioFileFormat.Type fileType) {</p> <pre><code> if (audioInputStream == null) { reportStatus("No loaded audio to save"); return; } else if (file != null) { System.out.println("now saving file in saveTo file!=null:"+name); createAudioInputStream(file, false); } // reset to the beginnning of the captured data try { System.out.println(" in saveTo file: reset"); audioInputStream.reset(); } catch (Exception e) { reportStatus("Unable to reset stream " + e); return; } File file = new File(fileName = name); System.out.println(" in saveTo file:"+ file); try { if (AudioSystem.write(audioInputStream, fileType, file) == -1) { throw new IOException("Problems writing to file"); } } catch (Exception ex) { reportStatus(ex.toString()); } samplingGraph.repaint(); } </code></pre> <p>but i want to save the file directly to the server, because the file is saved in the client side and it saved in the directory of the browser such as: </p> <p>file:///C:/Users/Mohammed/AppData/Local/Google/Chrome/Application/20.0.1132.47/</p> <p>for this purpose, i also used the following method for keeping directory:</p> <pre><code>public void init() { applet = this; String media = "./audio"; String param = null; if ((param = getParameter("dir")) != null) { media = param; } getContentPane().add("Center", demo = new JavaSound(media)); } </code></pre> <p>I am appreciated to help me and give me an idea how can save the file in the current directory or saved in the server side. Thanks a lot.... </p>
java javascript
[1, 3]
225,029
225,030
Uploading files in dedicated server with asp.net
<p>I upload files and convert it into bytes and saved it in Database. It works correctly in my local system. but I hosted it in dedicated server, it cannot convert path into bytes. It shows an error </p> <blockquote> <p>'Could not find a part of the path 'C:\fakepath\1003.pdf'.</p> </blockquote> <p>Code:</p> <pre><code>//byte[] bContent = myWebClient.DownloadData(@strFileUploadSubSplit[3]); byte[] bContent = null; // Open file for reading System.IO.FileStream _FileStream = new System.IO.FileStream(strFileUploadSubSplit[3].ToString(), System.IO.FileMode.Open, System.IO.FileAccess.Read); // attach filestream to binary reader System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(_FileStream); // get total byte length of the file long _TotalBytes = new System.IO.FileInfo(strFileUploadSubSplit[3].ToString()).Length; // read entire file into buffer bContent = _BinaryReader.ReadBytes((Int32)_TotalBytes); // close file reader _FileStream.Close(); _FileStream.Dispose(); _BinaryReader.Close(); string base64String = System.Convert.ToBase64String(bContent, 0, bContent.Length); str = strFileUploadSubSplit[0] + "*" + strFileUploadSubSplit[1] + "*" + strFileUploadSubSplit[2] + "*" + base64String ; string URL = "http://dev2.weicorp.com:81/IApp.svc/IApp/Doc"; string ret = string.Empty; var webRequest = System.Net.WebRequest.Create(URL) as HttpWebRequest; byte[] byteArray = Encoding.UTF8.GetBytes(str); webRequest.Method = "POST"; webRequest.ContentType = "application/octet-stream"; webRequest.ContentLength = byteArray.Length; Stream dataStream = webRequest.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); HttpWebResponse resp = (HttpWebResponse)webRequest.GetResponse(); dataStream = resp.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); ret = reader.ReadToEnd(); string status = ret.ToString(); context.Response.Write(status); </code></pre>
c# asp.net
[0, 9]
4,716,489
4,716,490
upload image file without post back in asp.net
<p>Does anybody know how can I upload an image file in a specific folder without post back using c# .</p>
c# asp.net
[0, 9]
1,354,014
1,354,015
Find and get last character of class name
<p>I have html with class that always differs depending on amount of elements inside it(ul>li...) class name has pattern like <code>sf-single-children-*</code> where <code>*</code> always different depending on li's inside it. How do i get this <code>*</code> with javascript, so i could style depending on this number?</p> <p>Example code:</p> <pre><code>&lt;ul class='someclass'&gt; &lt;li class="sf-single-children-* some-other-classes-here-aswell"&gt; &lt;ul style="width: * "&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with childer element which should not be counted &lt;ul&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;li&gt;Item with no children element&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>The other way how i'd do this its count elements in only parent <code>&lt;ul&gt;</code> But i'm not sure how to do that</p>
javascript jquery
[3, 5]
4,422,424
4,422,425
Adding jQuery to Master Pages
<p>I have the following jquery in my ASP.NET regular pages</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;Color Items&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function() { $("select option:even").addClass('evenColor'); }); &lt;/script&gt; &lt;style type="text/css"&gt; .evenColor { background-color:Gray; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:DropDownList ID="DropDownList1" runat="server"&gt; &lt;asp:ListItem Text="Gori"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Muf"&gt;&lt;/asp:ListItem&gt; &lt;asp:ListItem Text="Lizo"&gt;&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Now i want to convert this into a Master Pages. I am unable to figure out what will be added to the master page and what to the content page. Will the scripts go to MasterPage?</p> <p><strong>Please Note:</strong> I have many such regular asp.net pages with individual jquery files. Will I have to add all these jquery files into one master page. </p> <p>What is the correct way?</p>
asp.net jquery
[9, 5]
1,160,266
1,160,267
How do you set report name from query string
<p>I am trying to set the report name for a telerik report from the query string. I am using <a href="/activeReportViewer.aspx?reportname=activecases">Cases</a> and I want to pass the reportname to the following line of code:</p> <pre><code>report = new Volunteer.MainApplication.Reports.*reportname* </code></pre> <p>I have tried </p> <pre><code>report = new Volunteer.MainApplication.Reports.*reportname* &lt;%request.querystring("reportname")%?&gt; var newRpt = "new Volunteer.MainApplication.Reports."; newRpt += Request.QueryString["Report"].ToString(); report = newRpt; </code></pre>
c# asp.net
[0, 9]
2,684,611
2,684,612
How to get the full file path
<p>When Im using a file field and browsing an image by its full path say <code>F:\Images\me.gif</code>.</p> <p>how can i fetch this full path while submitting the form containing it by using php or javascript?</p> <p>Thanxx in advance..</p>
php javascript
[2, 3]
5,587,765
5,587,766
javascript and php not quite working
<p>You can look at the application here: <a href="http://jsfiddle.net/YYMJS/6/" rel="nofollow">application</a></p> <p>I know the code doesn't work in jsfiddle but I have included my code in the jsfiddle so that you can see the whole code and the way it is laid out. <a href="http://jsfiddle.net/YYMJS/6/" rel="nofollow">jsfiddle</a></p> <p>Now if textbox is empty, it displays "false" in alert and displays a message which is fine.</p> <p>The problem though is this:</p> <p>If I type the correct or incorrect room number value in the textbox, it always states it is "false" and does not come with a javascript message.</p> <p>What should happen is if textbox value matches database, then it should alert "true" and display a javascript message "room is Valid", if textbox value doesn't match database then it should alert "False" and display a javascript message "room is Invalid" How can I achieve this?</p> <p>You can test the application, enter in these figures in the textbox if you wish for testing:</p> <p>Valid room number CW5/10 , Invalid room number CN2/10.</p> <p>Below is where error occurs:</p> <pre><code> var js_var = []; &lt;?php while($data = mysql_fetch_assoc($roomquery)){ ?&gt; js_var.push(&lt;?php $data['roomChosen']; ?&gt;); &lt;?php }?&gt; </code></pre> <p>Jsfiddle application url updated above</p>
php javascript
[2, 3]
980,724
980,725
How to remove grey color line from CANVAS in the jSignature plugin?
<p>How to remove grey color line from CANVAS (Signature panel) in the <code>jSignature plugin</code> ?</p> <p>Is there any option to validate whether user enter signature or not ? Any built in function for this ?</p> <p><a href="http://willowsystems.github.com/jSignature/#/demo/" rel="nofollow">http://willowsystems.github.com/jSignature/#/demo/</a></p>
javascript jquery
[3, 5]
2,867,366
2,867,367
how can i control jquery validation engine control with multiple buttons?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1602911/jquery-validation-multiple-submit-buttons-on-one-asp-net-form-different-valid">jQuery Validation - Multiple submit buttons on one asp.net form, different validation groups?</a> </p> </blockquote> <p>I am using jQuery validation engine plugin and I have two buttons in my content page: one of them is a submit buttton, and the other one is a cancel button. </p> <p>When I click on the submit button, the form validation fires but when I click on the cancel button, the form validation fires again. I don't want to fire validation when the cancel button is clicked. </p> <p>Any idea ? </p> <pre><code>&lt;form&gt; &lt;asp:TextBox ID="TextBox1" CssClass="validate[required]" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="TextBox2" CssClass="validate[required]" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="Button1" runat="server" Text="send" /&gt; &lt;/form&gt; &lt;asp:Button ID="Button2" runat="server" Text="cancel" /&gt; </code></pre>
c# javascript jquery
[0, 3, 5]
3,512,512
3,512,513
Multiple divs problem when working with Jquery
<p>I am facing a wired problem when using Jquery Dialog. </p> <pre><code> &lt;div id="divSupplierGrid" style="display: none"&gt; &lt;uc2:SupplierGrid ID="Tab1UCSupplierGrid" runat="server" /&gt; &lt;/div&gt; &lt;div id="divCreateInqGeneral" style="display: none"&gt; &lt;uc1:CreateInqGeneral ID="Tab1UCCreateInqGeneral" runat="server" /&gt; &lt;/div&gt; function DisableBackGrd() { $("#divCreateInqGeneral").dialog({ bgiframe: true, modal: true, open: function () { hideScrollBars(); }, beforeClose: function () { showScrollBars(); } }); } </code></pre> <p>When i keep only 'divSupplierGrid' on my page .Jquery dialog works fine but as soon as i add 'divCreateInqGeneral' i get 'Microsoft JScript runtime error: Object doesn't support this property or method' Exception. Whats going wrong?</p>
javascript jquery asp.net
[3, 5, 9]
2,765,018
2,765,019
get web page height through jquery
<p>How can I get the height of viewable web page of browser with jquery? I have tried $(window).height() but it did not return accurate result.. Thanks..</p>
javascript jquery
[3, 5]
5,407,623
5,407,624
write text to image
<p>I have uploaded an image, now i want to write text dynamically anywhere on the uploaded image. I want that user should himself choose whre to write on the image and then save image with text written on it.</p>
php javascript
[2, 3]
1,296,071
1,296,072
Search content and creating custom selector filters
<p>I want ckack in table if there are row similar (in column "title 1" and "title 3") get this second row ("tr") <code>background-color: red;</code>.</p> <p><img src="http://i.stack.imgur.com/qKJay.jpg" alt="enter image description here"></p> <p>In the this table both rows in column "title 1" and "title 3" have similar content so second row(if it was more of two rows similar all rows except first row get css.) get css <code>background-color: red;</code>, How is it by jQuery?</p>
javascript jquery
[3, 5]
3,643,114
3,643,115
Inverted comma - php to javascript
<p>Consider this line of JavaScript</p> <pre><code>str += "onclick=runTest(" + field + "," + atom[0] + ",'" + atom[1] + "'); </code></pre> <p>In the browser, it renders as:</p> <pre><code>onclick="runTest(104,213,'Orsan" Miller'); </code></pre> <p>There is an inverted comma between Orsan and Miller although in fact there was not any inverted comma, it's causing a bug.</p> <pre><code>atom[1] = Orsan Miller </code></pre> <p>'Orsan Miller' comes from DB query in PHP.</p> <p>How can this be fixed?</p>
php javascript
[2, 3]
1,015,062
1,015,063
Strange bug with tabbed content box, prevent click and multiple instances
<p>I have a page which is going to have multiple tabbed content boxes on but I cant seem to get my box working when theres more than one, Also i need to disable the "A" tag with the class disable on only for some reason everything Ive tried I cant seem to prevent the event! </p> <p>Ive made a fiddle if anyone can help me out, thanks</p> <p><a href="http://jsfiddle.net/j6A94/" rel="nofollow">http://jsfiddle.net/j6A94/</a></p>
javascript jquery
[3, 5]
5,096,230
5,096,231
Re-Building Each Tier
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4518692/asp-net-project-dependency-issue-building-each-tier-seperately">Asp.net project dependency issue (Building each tier seperately)</a> </p> </blockquote> <p>Project1 = Asp.net pages project (presentation Layer)</p> <p>Project2 = Data Access Layer</p> <p>when Project1 is hosted and running smooth, if i have to add few PRIVATE methods into the Project2 and call these methods within some of the PUBLIC methods that i know are being called by Project1, should the changes apply that i made in Project2?</p> <p>I did the above, but the new methods were not called. (I think Project1 is still pointing to the old assemblies of Project2)</p> <p>I am sure if i rebuild the Project1, the changes will work.</p> <p>But if i have to rebuild Project1 after every change i make in Project2, what is the point of having the separate tier Architecture? I thought the good thing about separate tiers is that one can do as many changes in 1 layer, without rebuilding the other layers ... is that a wrong perception?</p>
c# asp.net
[0, 9]
846,650
846,651
Kill one thread in sleep mode in android
<p>I have an android application, that have one thread, which will run after each 1 minute. So my problem is, when i click one button, i have to reset the app, that means, it'll be a fresh app. So now when i clicked on that button, all the database and shared preference will clear. But the thread will start again.</p> <p>Now am using like this</p> <pre><code>if (killthread.isAlive()) { killthread.interrupt(); }else { // Here what'll i do, I mean how to kill that thread, which in sleep mode. } </code></pre> <p>Thank you vishnu</p>
java android
[1, 4]
2,954,321
2,954,322
Need to show MODALPOPUP Extender while clickig on Link button
<p>Need to show MODALPOPUP Extender while clickig on Link button and in modal pop up extender we need to get send an email to the required mail ID holder.</p> <p>Is there any specifications and functionality to use in ASP.NET with C#.Please suggest me the best.</p> <p>Thanks in advance</p>
c# javascript asp.net
[0, 3, 9]
2,955,942
2,955,943
keep content stay on tab1 after filling in tab2
<p>Seen from the attached image, the page has a tab menu. After filling in the information on the tab 1, then going to fill in tab 2. After completing to fill tab2, the content is lost on the tab1, because page refreshed after fill in tab2</p> <p>My question is how to keep content stay on tab1 after filling in tab2?</p> <p><strong>UPDATE</strong></p> <p><strong>If page isn't refresh after filling in tab2, the content will stay on tab1. However, the page refresh is required in the code for some reason.</strong></p> <p><img src="http://i.stack.imgur.com/SyJDN.jpg" alt="enter image description here"></p>
php javascript jquery
[2, 3, 5]
5,694,767
5,694,768
Display a string for each day of the year
<p>I want to play around with making an Android app that displays a famous quote of the day. So I will have 365 quotes and each day will display a new one. Any thoughts on how to accomplish this? Do I need 365 @strings in my <code>string.xml</code> file? Is there a way to access an array of strings (or another data structure perhaps) by their index to accomplish this?</p>
java android
[1, 4]
2,721,451
2,721,452
ASP.NET Getting a blank page after submitting a form (beginner)
<p>I am trying to make some game, I'm not going to explain what is it because it's not really important, anyway, the problem is the following form: </p> <p><a href="http://pastebin.com/8XwdDFWY" rel="nofollow">http://pastebin.com/8XwdDFWY</a></p> <p>after submitting that form I'm getting a blank page.</p> <p>Here's the server side code which that form navigates to:</p> <p><a href="http://pastebin.com/tfeAMxrF" rel="nofollow">http://pastebin.com/tfeAMxrF</a></p> <p>Thank for helpers!</p>
c# asp.net
[0, 9]
85,581
85,582
order of javascript events?
<p>I have a "a.adress" element in a div. on blur, the div dissapears. Whenever I click the a.adress element, I want the value of the a element to populate a field.(the same that gets blurred.</p> <p>This is what I expected to work:</p> <pre><code>$('.field').blur(function() { $("a.adress").click(function() { event.preventDefault(); $(this).parent().parent().parent().parent().prev(".field").val($(this).text()); }); $(this).next('.spacer').children().removeClass("visible"); }); </code></pre> <p>Each part works seperately, </p> <p>this hides the div</p> <pre><code>$('.field').blur(function() { $(this).next('.spacer').children().removeClass("visible"); }); </code></pre> <p>this populates the field:</p> <pre><code> $("a.adress").click(function() { event.preventDefault(); $(this).parent().parent().parent().parent().prev(".field").val($(this).text()); }); </code></pre> <p>sample page: <a href="http://dev.resihop.nu/addtrip?from=&amp;to=&amp;when=&amp;name=&amp;email=&amp;phone=&amp;details=&amp;posted=&amp;got_car=1" rel="nofollow">http://dev.resihop.nu/addtrip?from=&amp;to=&amp;when=&amp;name=&amp;email=&amp;phone=&amp;details=&amp;posted=&amp;got_car=1</a></p> <p>But when I put them together, I don't manage to populate the label. How do I make it work?</p>
javascript jquery
[3, 5]
3,477,271
3,477,272
Type into a field, and use jQuery/JS to display this value lower on the page
<p>I have a simple task which I'm failing at.</p> <p>I want to take this field:</p> <pre><code>&lt;input id="amount" name="amount" value="{$formRefill.amount}" class="textInput auto required validateNumber" type="text"&gt; </code></pre> <p>And once the user has typed a value in there (i.e. <code>950.50</code>), and they click outside of text field (focus somewhere else), jQuery takes this field and displays it somewhere else on the page.</p> <p>I was trying to do this inside of a DIV lower down the page.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
3,191,673
3,191,674
Multiple Fields Handling in Database
<p>I Have a JobApplication Form which sends Data to multiple Tables on a Button Click. Inside this i have Eduation Fields, Education1, Education 2,...</p> <p>when user clicks on Add more Education, Div 2 Adds in the form </p> <p>I am confused how to handle, when user click Add more. How can i catch that event and submitt those changes in databse, i am new so please be kind, and i dont have much experience.</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,396,708
3,396,709
jQuery $.toJSON not letting me post?
<p>I have the following</p> <pre><code> var storage = [], obj; $('form input[type=hidden]').each(function(){ obj = {}; obj[this.name] = this.value; obj["spot"] = this.className storage.push(obj); }); storage = $.toJSON(storage); console.log(storage); $.post('storage/', storage, function(data) { if(data == "true") { //window.location.href = href; }else{ alert("An error has been encountered, Blah has been notified, please try again later"); } }); </code></pre> <p>and in PHP I have a simple <code>&lt;?php print_r($_POST); ?&gt;</code> and it is printing <code>Array( )</code> it does not seem to be posting the json encoded results.</p> <p>It's driving me nuts and I have no idea what is going on lol. Any help?</p> <p>ps. I am using <a href="http://code.google.com/p/jquery-json/" rel="nofollow">http://code.google.com/p/jquery-json/</a> as a json encoder.</p>
php jquery
[2, 5]
899,601
899,602
How to get year, month and day from different timezone?
<p>I am now in Hong Kong. How can I get the year, month and day from USA??<br> I have tried: </p> <pre><code>Calendar calendar = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy hh:mm:ss z"); sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); sdf.format(calendar.getTime()); </code></pre> <p>But I don't know how to get the year, month. Please help</p>
java android
[1, 4]
6,023,573
6,023,574
make value of a function global to be called in any other function
<p>hello i want to pass the value of a function to any other function or make the value of a function global so that it can be called in any other function . but i dnt knw how to do it , tried some codes still no sucess . </p> <p>here is the function code </p> <pre><code>function newalbum(val1,loginuser) { $.ajax({ type:"GET", url: 'ajax/album.php?val='+val1+'&amp;&amp; loguser='+loginuser, success: function(data) { $("#newalbum1").html(data); var ab=$('#ab').val(); var abc=$('#loginuser').val(); var action=$('#action').val(); alert(ab); } }); } </code></pre> <p>in this function i want to make the three variables var ab, var abc, var action to be global so that its value can be used in any other function . can any one help?</p> <p>edit - the value of var ab, var abc, and var action is comming from ajax data that is why i am not able to use those variable directly , it says undefined if i use it directly.</p> <p>after the varibales value received from ajax in function newalbum . i want to use those varibales inside </p> <pre><code> (function( $ ){ $.fn.Uploadrr = function( options ) { </code></pre>
javascript jquery
[3, 5]
3,943,744
3,943,745
Retrieve the Original (Client) Url Without the Default Document
<p>I'm trying to obtain the actual client requested URL. The standard <code>Request.Url</code> object contains the response URL. These can be different if the original request did not contain a default document.</p> <p>Original Request: <a href="http://my.server.com/folder/" rel="nofollow">http://my.server.com/folder/</a></p> <p>Request.Url.ToString(): <a href="http://my.server.com/folder/default.aspx" rel="nofollow">http://my.server.com/folder/default.aspx</a></p> <p>Is there a way to obtain the original client request in asp.net?</p>
c# asp.net
[0, 9]
1,881,556
1,881,557
jquery, TypeError: $(selector) is null, problem?
<p>i have a web page that redirects to another page on click. on the second page i have this:</p> <pre><code>&lt;?php if(isset($_POST['tab1'])) { ?&gt; &lt;script&gt;$('#home').trigger('click'); &lt;/script&gt; &lt;?php }?&gt; </code></pre> <p>the <code>$_POST</code> comes back ok, only i get this error in the console for the jquery:</p> <p>in firebug:</p> <pre><code>TypeError: $("#home") is null </code></pre> <p>or in Chrome:</p> <pre><code>$('#home').trigger('click'); </code></pre> <p>if i run this: <code>alert(document.getElementsByTagName('#home'));</code></p> <p>i get a alert with: <code>[object HTMLCollection]</code> as <code>undefined</code></p> <p>if i view the source i can see my jquery there:</p> <pre><code>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; !window.jQuery &amp;&amp; document.write('&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"&gt;&lt;\/script&gt;'); &lt;/script&gt; </code></pre> <p>any ideas on why the jquery fails?</p> <p>thanks</p>
php jquery
[2, 5]
4,370,980
4,370,981
please explain this jQuery statement
<p>What is this doing exactly?</p> <pre><code>this.$blah = jQuery("&lt;div id=blahblah1&gt;&lt;/div&gt;"); </code></pre>
javascript jquery
[3, 5]
201,344
201,345
Creating dynamic hyperlink in asp.net using c#
<p>In my application I have DataSet containing name and Id of user and I want to create a dynamic hyperlink of the all the user name. Please anyone tell me how to create dynamic hyperlink using C#.</p>
c# asp.net
[0, 9]
1,938,818
1,938,819
How can I preselect a radio button using javascript or jquery?
<p>I know this is probably easy, but I just can't figure it out.</p> <p>I am working with a SAAS shopping cart solution so I can't adjust the form code or use PHP, so I need to use javascript or jquery. </p> <p>In this cart, I have a form.... </p> <pre><code>&lt;form method="post" action="cart.php" id="productDetailsAddToCartForm"&gt; Please Select a Bottle Size: &lt;ul&gt; &lt;li&gt;&lt;label&gt;&lt;input name="variation[1]" type="radio" class="RadioButton" value="30" /&gt; 11oz&lt;/label&gt;&lt;/li&gt; &lt;li&gt;&lt;label&gt;&lt;input name="variation[1]" type="radio" class="RadioButton" value="31" /&gt; 33oz &lt;/label&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; </code></pre> <p>And I need to preselect the first radio button using jquery or javascript. </p> <p>Can you help?</p>
javascript jquery
[3, 5]
5,954,397
5,954,398
jQuery: Selecting an element in inside an already selected element
<p>For example:</p> <pre><code>$("table tr").click( function(event) { //Say, here i want get the data of td element where its class name="special" }); </code></pre> <p>Is there any way I can select a element while in the click event, a element under the attached element above ( $("table tr") )?</p>
javascript jquery
[3, 5]