Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
3,799,428
3,799,429
Fade background image with fadeIn()
<p>I want to change the background image, which I built a <code>ChangeBg</code> function for, to be faded.</p> <p>Why is this not working? What am I doing wrong?</p> <pre><code>&lt;script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.4.js"type="text/javascript"&gt;&lt;/script&gt; &lt;script language="JavaScript"&gt; function changeBg (color) { document.getElementById("wrapper").style.background="url(Images/"+color+".jpg) no- repeat"; $("changeBg").fadeIn("slow"); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,237,594
4,237,595
jConfirm form submit returns incorrect value to php
<p>hi im using jConfirm to return form submission to php</p> <p>my html looks like this:</p> <pre><code>&lt;form id="formdelete" name="formdelete" method="post" action="/home.php"&gt; &lt;input type="hidden" name="remove_user" id="remove_user" value="3"&gt; &lt;input type="submit" value="" border="0" name="image" src="" id="removeuser" class="ui-removes" onclick="DeleteUser();return false;"&gt; &lt;/form&gt; &lt;form id="formdelete" name="formdelete" method="post" action="/home.php"&gt; &lt;input type="hidden" name="remove_user" id="remove_user" value="4"&gt; &lt;input type="submit" value="" border="0" name="image" src="" id="removeuser" class="ui-removes" onclick="DeleteUser();return false;"&gt; &lt;/form&gt; &lt;form id="formdelete" name="formdelete" method="post" action="/home.php"&gt; &lt;input type="hidden" name="remove_user" id="remove_user" value="5"&gt; &lt;input type="submit" value="" border="0" name="image" src="" id="removeuser" class="ui-removes" onclick="DeleteUser();return false;"&gt; &lt;/form&gt; </code></pre> <p>my javascript looks like this:</p> <pre><code>function DeleteUser(){ jConfirm('Can you confirm this?', 'Confirmation Box', function(r) { if(r){ $("#formdelete").submit(); return true; } else return false; }); } </code></pre> <p>but the value returned to PHP is always wrong. it returns 5 even tho i've clicked on value 4</p> <p>it works fine if i use a normal javascript such as the following:</p> <pre><code>function DeleteUser(){ result = confirm('Delete?'); if(!result) return false; submit(); } </code></pre>
php jquery
[2, 5]
3,339,647
3,339,648
jQuery to trigger CSS3 button
<p>I have this CSS3 enter button <a href="http://dl.dropbox.com/u/2568/enter/enter.html" rel="nofollow">here</a>:</p> <p>If you click it, it seems like it's pressed. I want to achieve the same effect (probably using jQuery), by pressing the enter key physically on my keyboard. </p> <p>I did something like this: (sorry if it's completely wrong, I don't do jQuery at all)</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("enter").keypress(function(event){ if(event.keyCode == 13){ $(this).toggleClass(".button-clicked"); } }); }); &lt;/script&gt; </code></pre> <p>The CSS selector for the unpressed button is: <code>.button</code> and <code>.button.orange {}</code></p> <p>The CSS selector for the pressed button is: <code>.button:active, .button-clicked {}</code></p> <p>Thanks for your help!</p>
javascript jquery
[3, 5]
158,451
158,452
Passing div to jquery function and get its innerhtml
<p>I have a function to print the content of a div. Let me share my aspx markup.</p> <pre><code>&lt;div&gt; &lt;div id="printarea" runat="server"&gt; &lt;/div&gt; &lt;asp:Button ID="btnPrint" runat="server" Text="Print Div" OnClick="btnPrint_Click" /&gt; </code></pre> <p></p> <p>In the OnClick event innerhtml is set to the div printarea. The code is: </p> <pre><code> protected void btnPrint_Click(object sender, EventArgs e) { string divText = GenerateInPatientBill();// "content you want to print"; printarea.InnerHtml = divText; ScriptManager.RegisterStartupScript(this, Page.GetType(), "script", "PrintDiv(" + printarea.ClientID + ");", true); } </code></pre> <p>I need to pass the clientid of printarea div to the javascript function and get it printed. The javascript function used is</p> <pre><code> function PrintDiv(printarea1) { alert($("#" + printarea1 + "")); var printContent = $("#" + printarea1 + "").html(); alert(printContent); var popupWin = window.open('', '_blank', 'width=300,height=400,location=no,left=200px'); popupWin.document.open(); popupWin.document.write(printContent); popupWin.document.close(); popupWin.focus(); popupWin.print(); popupWin.close(); } </code></pre> <p>Am getting javascript syntax error at line 2. Please help me on this.</p>
javascript jquery asp.net
[3, 5, 9]
334,904
334,905
submit onChange using pretty url's
<p>i've already opened a question for this problem, but it was very bad formulated and because of that i did not get a good response.... so heres another try... hope it's ok</p> <hr> <p>i have a form with a selected tag and some options inside</p> <pre><code>&lt;form&gt; &lt;select&gt; &lt;option selected="selected"&gt;&lt;/option&gt; &lt;option value="1" data-seourl="food-intake"&gt;Food intake&lt;/option&gt; &lt;option value="2" data-seourl="homemade-cake"&gt;Homemade cake&lt;/option&gt; &lt;option value="3" data-seourl="good-fruits"&gt;Good fruits&lt;/option&gt; &lt;option value="4" data-seourl="apple-type"&gt;Apple type&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre> <p>When i select an option (onchange) i want to submit a friendly url to the server that ressembles this:</p> <pre><code>http://www.mywebsite/kitchen/food-intake.1 http://www.mywebsite/kitchen/homenade-cake.2 ... </code></pre> <p>instead of sending the default:</p> <pre><code>http://mywebsite/kitchen/?category=1 http://mywebsite/kitchen/?category=2 </code></pre> <p>I know how to use mod_rewrite, so that's not a problem. I need to understand how to submit a friendly url instead of the default?</p> <p>Is javascript (jQuery in this case) the only solution or is there a native solution?</p> <p>Thanks</p>
php jquery
[2, 5]
1,906,057
1,906,058
Is it possible to convert input control to label?
<p>I am making a form that contains a lot of User Controls, each User Control is part of the form (contains TextBox, ComboBox etc).</p> <p>User will use the form to update their information. At end of submission, I need to display the original data and the data that the user have entered.</p> <p>I wonder if is possible that I can replace the input control (TextBox etc) to Label? So I can just simply use the same user control, then convert each of the input control to label to display the data... (I just don't really want to use readonly or disable)</p> <p>Note: I used different dataset to map each of the User Control data....</p> <p>What I was thinking to do is like to get the input control from Page.Controls:</p> <pre><code>aInputControl = new Label(); </code></pre> <p>or...</p> <pre><code>Page.Controls.Remove(aInputControl); </code></pre> <p>Then somehow add new Label in same position in the page... But I have no idea how...can't think of anything except add another div to surround each of the control...</p> <p>I just wonder if it this is possible...</p> <p>Thanks in advance.</p> <p>================</p> <p>Edit: Seems like making new user control is not a good way for me....I will just try to somehow map each original data and new data into a new User control, and write them into page...but anyway, thanks for the idea guys.</p>
c# asp.net
[0, 9]
699,258
699,259
Why serialize does not include submit button name?
<p>Why serialize (Jquery) does not include submit button name?</p> <p>In PHP I normally do this:</p> <pre><code>if (isset($_POST['submit_signup'])) { print_r($_POST); //Then check firstname, password, etc POSTS } </code></pre> <p>That don't work, what is the solution to this?</p>
php javascript jquery
[2, 3, 5]
5,530,268
5,530,269
getting error while replacing the single quotes from text
<p>I have a text box with tinyMCE editor, i am giving some text from that text box with single quotes, but in query it is showing syntax error</p> <p>I am trying to remove the single quotes by this </p> <pre><code>txbCaption.Text = txbCaption.Text.Replace("'", "''"); </code></pre> <p>and my query</p> <pre><code>public void UpdateCaptions(Hashtable hashtable) { if (hashtable != null) { foreach (int key in hashtable.Keys) { string query = "update Image set Description='" + hashtable[key] + "' where Id=" + key; // in this query i am getting error SqlHelper.ExecuteNonQuery(Conn, CommandType.Text, query); } } } </code></pre> <p>first i am calling replace Text.Replace("'", "''");<br> after that i am assigning this to </p> <pre><code>if (ViewState["imgIdCapHtbl"] != null) imgIdCapHtbl = (Hashtable)ViewState["imgIdCapHtbl"]; int index = Convert.ToInt32(ViewState["pSelecectedImgIndex"]); if (imgIdCapHtbl != null &amp;&amp; imgIdCapHtbl.ContainsKey(imgIds[index])) imgIdCapHtbl[imgIds[index]] = txbCaption.Text; </code></pre> <p>and imgIdCapHtbl hashtable key i am sending to query for saving discription</p> <p>when i am giving the single quotes in my text then in query 2 times single quotes is getting added.</p> <p>I used regular exp. validation also but because of TinyMCE editor its not working for that.</p> <p>some one plz tell me how to replace single quotes, I want if user wants to give single to with text then text box should accept the single quotes and my data gets save without any error, </p>
c# asp.net
[0, 9]
1,173,264
1,173,265
How to return this value?
<p>I am building a mobile app using <code>phonegap</code>, <code>jQuery</code> and <code>jQuery mobile</code>. I want to use <code>SqLite</code> database in my app for storing some user information. (I can't use <code>local storage</code> i want to do search/sort operations on the data)</p> <p>This is the code I am working on to get this done,</p> <pre><code>function getAccountInformation(){ var accounts = {}; db.transaction(function(transaction) { transaction.executeSql('SELECT * FROM account;', [], function(transaction, result) { if (result != null &amp;&amp; result.rows != null) { for (var i = 0; i &lt; result.rows.length; i++) { var item={}; var row = result.rows.item(i); for(var prop in row){ item[prop]=row[prop] } accounts[i]=item; } } },errorHandler ); },errorHandler,nullHandler); console.log(JSON.stringify(accounts)); } </code></pre> <p>If I put this <code>console.log(JSON.stringify(accounts));</code> after the end <code>}</code> of the <code>for loop</code> it shows proper output.</p> <p>But if I put it where it is right now the <code>{}</code> is printed as an output.</p> <p>How can I make <code>getAccountInformation()</code> function return that <code>accounts</code> object to my other function? Where I will use <code>jQuery</code> to render the output.</p> <p>What I want to do is return this <code>accounts</code> object simply by wrting <code>return accounts;</code></p>
javascript jquery
[3, 5]
598,283
598,284
How can I put JavaScript code at the bottom of an ASP.NET page?
<p>In my ASP.NET page, I am referring to an external JavaScript file.</p> <p>As per my learning in the web, it's recommended always to put inline JavaScript code at the bottom of the page. There is no information about how to do it for an external JavaScript reference.</p> <p>I want to know, if I am referring to an external JavaScript file, where should I write it?</p> <pre><code>&gt; 1. Inside &lt;Head/&gt; top of the page &gt; 2. bottom after closing tag of &lt;/form&gt; </code></pre>
javascript asp.net
[3, 9]
3,481,622
3,481,623
Hyphen (-) in string bound to text input control in GridView with Eval("columnName") cuts off the text after the hyphen
<p>I have a GridView which is bound to a data source. In the .aspx file I use somthing like this</p> <pre><code>&lt;asp:GridView...&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;input type="text" value='&lt;%# Eval('type') %&gt;' ... &lt;/GridView&gt; </code></pre> <p>What happens is, when type="Rock'n'Roll - guitar" for example, after databinding the text in the input is cut off before the hyphen and on, so whats left is "Rock'n'Roll"</p> <p>This also happend for the quotes ('), and i tried using </p> <pre><code>&lt;input type="text" value='&lt;%# Server.HtmlEncode(Eval('type').ToString()) %&gt;' </code></pre> <p>which solved the issue with quote sign in the string but still have the issue with hyphen. </p> <p>Any ideas? thanx</p>
c# asp.net
[0, 9]
2,840,022
2,840,023
how to select a particular tag from seletected array of tags using Jquery
<p>I am selecting all tags where href attribute is starting with "picThumbImgA_" as below.</p> <p><code>$('a[id^="picThumbImgA_"])')</code></p> <p>now i want to update some attributes of first four tag. I can select first as </p> <p><code>$('a[id^="picThumbImgA_"]):first')</code></p> <p>and last as <code>$('a[id^="picThumbImgA_"]):last')</code> odd as <code>$('a[id^="picThumbImgA_"]):odd')</code> and even as <code>$('a[id^="picThumbImgA_"]):even')</code></p> <p>But how can I process first four tags only.</p> <p>Please help me out for the same.</p>
javascript jquery
[3, 5]
3,721,298
3,721,299
Check if popup is closed in phone-friendly way (Checking value of .closed doesn't work)
<p>If I have created a popup window using <code>newWindow = window.open(url, name, dimensions)</code>, how can I check whether the window is closed in a way that will work on mobile browsers?</p> <p>I tried using <code>if(newWindow.closed)</code>, and this works in Chrome on a PC and works on iPhone. However, on the Android phones I have tested on, this doesn't work; the popup closes but newWindow.closed is not true. <strong>What test should I use instead that will work on any platform to check if a popup is closed?</strong></p> <p>Extra info: I used <a href="http://jsconsole.com/?%3Alisten" rel="nofollow">jsconsole</a> to log newWindow (with <code>console.log(newWindow)</code>) before and after the popup was closed when visiting my page on an Android phone. While the popup window is open, it shows up in the console as <code>[object DOMWindow]</code>, and once the window is closed <code>console.log(newWindow)</code> just prints a blank line to the jsconsole. Note that printing a blank line is distinct from how jsconsole displays <code>null</code>, <code>undefined</code> or <code>false</code>, which show up exactly as I just typed them. Furthermore, trying <code>if(newWindow.closed || !newWindow)</code> works no better than just <code>if(newWindow.closed)</code> did; it seems that whatever kind of object <code>newWindow</code> becomes after the popup is closed, it is still truthy.</p>
javascript android
[3, 4]
2,404,244
2,404,245
Differences between jQuery's hide() and .css('display', 'none')?
<p>I've changed a few pages from using generic JavaScript that sets a CSS style property</p> <pre><code>element.style.display = "none"; </code></pre> <p>to jQuery's method</p> <pre><code>element.hide(); </code></pre> <p>When the back button is used to return to my page, elements that were hidden using jQuery are no longer hidden. When I use raw JavaScript to set the display, the hidden elements stay hidden when I return to the page.</p> <p>Is there a workaround to allow jQuery's hide() function to work the same way?</p>
javascript jquery
[3, 5]
5,124,442
5,124,443
Given a website's HTML in a string, how to extract tag elements?
<pre><code>HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.home.com"); myRequest.Method = "GET"; WebResponse myResponse = myRequest.GetResponse(); StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); string result = sr.ReadToEnd(); sr.Close(); myResponse.Close(); </code></pre> <p>The string contains whole html of that webpage, now I want to extract html tags from that string. </p> <p>How do I that?</p>
c# asp.net
[0, 9]
3,769,928
3,769,929
Compiled code spreadsheet-like cell management? (auto-updating)
<p>Okay so I am fully aware how spreadsheets manage cells, they build dependency graphs where when one cell changes it tells all the other cells that are dependent on it that it changed. So they can from there update. </p> <p>How they update I think involves either re-evaluating the formulas stored as strings, or re-evaluating the abstract syntax tree which I think is stored differently and might be faster. Something like that.</p> <p>What I'm looking to do is manage a few variables in my code so I don't have to update them in the correct way, which would be a nightmare. But I also want it much faster than spreadsheets. And since I'm not looking for any functionality as great as are in these spreadsheets, I just figured from that thought point that there has to be a way to have a very fast implementation of this functionality. Especially since I don't have to modify cells after compiling unless that would be an option.</p> <p>I'm very new to programming so I have no idea. One example might be to have a code-generator that generates code that does this for me. But I have no clue what the generated code would look like. Specifically, how exactly would variables inform others that they need to update, and what do those variables do to update?</p> <p>I'm looking for any kind of ideas. Programming is not my job but nonetheless I was hoping to have some kind of system like this that would greatly help me with some stuff. Of course I have been programming plenty lately so I can still program. I just don't have the full scope on things.</p> <p>I'm looking for any kind of ideas, thank you very much in advance!</p> <p>Also, please help me with the tags. I know C# and Java mainly and I'm hoping to implement this in either of those languages and I'm hoping this can stay in those tags. Forcing this into some kind of spreadsheet tag wouldn't be accurate. </p>
java c#
[1, 0]
1,775,621
1,775,622
Cached Jquery selector behavior that I do not understand
<p>Given the following code why am I getting different values for <code>a</code> and <code>b</code>? I would have thought they would return the same thing:</p> <pre><code>(function() { var a = $('#foo'); var Test = function(){ console.log(a); //outputs 'jQuery()' var b = $('#foo'); console.log(b); //outputs 'jQuery(select#foo)' which is what I want }; })(); </code></pre> <p>This question stems from me trying to stick frequently used selectors into vars. Originally I was doing it in each method (like I did with <code>var b</code> in the above example) but then I found I needed to use the selectors in multiple methods so I moved the assignment out to be available (or so I thought) to all of the methods in that anonymous function. As you can see, it does not work. Why is this?</p> <p>EDIT: this code is loaded by a method that is triggered by a click. The id foo is present at page load and is not dynamically set or changed.</p>
javascript jquery
[3, 5]
4,268,201
4,268,202
Split a title in half, or get as close to the middle as posible
<p>So I have this H3 title and I want to take half of it and wrap it in a span. The problem is the title can have 4 words, or 2 or 5 and so on, and I just can figure out how to split the title in half (more or less).</p> <p>So I want to go from:</p> <pre><code>&lt;h3&gt;Some random title goes here&lt;/h3&gt; </code></pre> <p>to this:</p> <pre><code>&lt;h3&gt;Some random &lt;span class="green"&gt;title goes here&lt;/span&gt;&lt;/h3&gt; </code></pre> <p>PHP or JavaScript, anything goes.</p>
php javascript
[2, 3]
937,588
937,589
Form that removes WWW. and prints result on input?
<p>I need to make a form similar to the one "shorten link" sites use. It should simply remove WWW. and echo the result so I later add my code around it.</p> <p>For example if the user types www.pizza.com/blablabla clicking on input should display: pizza.com/blablabla</p> <p>Thanks</p>
php javascript
[2, 3]
4,532,381
4,532,382
Echo PHP variable inside jQuery SwitchCase?
<p>I have a jQuery script that I am including on a PHP page that takes mt content and creates facebook/myspace share links. I am having trouble echoing PHP code inside of the swith case statement that builds the share URL's. Here's my code:</p> <p>case 'facebook': this.href += '?t=' + document.title + '&amp;u=http://foobar.com/detail.php?id='; break;</p> <p>The server isn't parsing the PHP code correctly, it's passing the value <code>id=&lt;?php echo "1";?&gt;</code> rather than 1. Can I not insert PHP code into a javascript include? </p>
php javascript jquery
[2, 3, 5]
1,539,422
1,539,423
Handling elements generated by Javascript in Asp.Net
<p>I have several elements in my web page generated by JavaScript. Here's an example of such content:</p> <pre><code>&lt;input id="uploadfile01" type="file" onchange="change(1);" /&gt; &lt;input id="uploadfile02" type="file" onchange="change(2);" /&gt; </code></pre> <p>My question is: How can I interact with these elements in the server side, (Asp.net) after a post? (Since the elements were dynamically generated they do not exist in the original asp.net page)</p>
asp.net javascript
[9, 3]
1,301,457
1,301,458
Setting a Php variable to a parameter
<p>I need to set a Php variable according to a param name.</p> <p>Javascript Code: </p> <pre><code>&lt;param name="movie" value="....;"&gt; </code></pre> <p>located in a separated external js file</p> <p>I took the value out, since it will be dynamic.</p> <p>My attempts:</p> <pre><code>$movie = $_GET["movie"] </code></pre> <p>I tried the above but it didn't work.</p> <p>Am able to set a id to the above param, because then I could call the id</p>
php javascript
[2, 3]
3,276,466
3,276,467
Disable hover, text select, etc when dragging an element in JQuery plug in
<p>I have a carousel based off of:</p> <p><a href="http://nooshu.com/explore/jquery-iphone-animation/" rel="nofollow">http://nooshu.com/explore/jquery-iphone-animation/</a></p> <p>When you are in the process of grabbing and dragging, you're apt to select text. If I have links in the panels, I get the hover message, etc...</p> <p>I would like to disable all that, so when you are in the process of dragging, the rest of the interaction is disabled.</p> <p>Ideas?</p>
javascript jquery
[3, 5]
1,927,119
1,927,120
why "$(opener.document).ready()" is not working?
<p>I tried something like, below in popup-window, but not working...</p> <p>any correction at line 3, please suggest.</p> <pre><code>function closePopup() { window.opener.history.go(0); $(opener.document).ready(function(){ window.opener.some_function(some_variable); self.close(); }); } </code></pre>
javascript jquery
[3, 5]
2,093,737
2,093,738
Getting broken images on localhost but not on websites
<p>On our website we have images dropped on a grid with the following line:</p> <pre><code>imgUpdated.ImageUrl = "./images/Test_Icon.gif"; </code></pre> <p>This works fine when published to production or test websites but within the IDE it gives broken (Red-X) images. Properties on the broken image says this:</p> <pre><code>http://localhost:52168/OurApp/images/Test_Icon.gif </code></pre> <p>If I attempt to past that into a browser, it redirects me to the login page with the following URL:</p> <pre><code>http://localhost:52168/OurApp/login.aspx?ReturnUrl=%2fITRequest%2fimages%2fTest_Icon.gif </code></pre> <p>I'd appreciate any help you might offer. I've already tried setting up a virtual directory in IIS and taking out the period but that didn't help.</p>
c# asp.net
[0, 9]
4,003,712
4,003,713
Sequentially Load DIV using Jquery
<p>Is it possible to load a series of DIVS using Jquery using a preloader.</p> <p>For instance, I have a page with 4 divs nested within 1 main div.</p> <p></p> <p> </p> <p>I'd like to load content1, then content2, and so on.</p> <p>Plus, only 1 div will load at a time in the sequence.</p> <p>Is this possible with jquery, or anything else?</p>
php jquery
[2, 5]
1,491,140
1,491,141
gallery image loading problem using galleryView jquery plugin
<p>programmers. i need help</p> <p>I tried to implement jquery galleryview plugin for my image gallery(<a href="http://testyourproject.com/integra/client/shareArtMags/testImgLoad.php" rel="nofollow"> this is my image gallery</a> ). The problem i face is it gets some what properly loaded in firefox but, in chrome and safari the condition of the gallery is worse. Gallery doesn't load on first instant (or) on page refresh. On first load of the gallery in chrome and safari i get blank screen and without refreshing the gallery if i visit some url and click browser back button the gallery gets displayed.</p> <p>Where am i going wrong? How can i get smooth loading of the gallery on other browsers using this galleryview plugin?</p> <p>Thanks for any help.</p>
php javascript jquery
[2, 3, 5]
4,910,256
4,910,257
jQuery object get value by key
<p>How would you get the value of <code>assocIMG</code> by key matching the key eg</p> <p>if I have a var <code>11786</code> I want it to return <code>media/catalog/product/8795139_633.jpg</code></p> <pre><code>var spConfig = { "attributes": { "125": { "id": "125", "code": "pos_colours", "label": "Colour", "options": [{ "id": "236", "label": "Dazzling Blue", "price": "0", "oldPrice": "0", "products": ["11148"] }, { "id": "305", "label": "Vintage Brown", "price": "0", "oldPrice": "0", "products": ["11786", "11787", "11788", "11789", "11790", "11791", "11792", "11793"] }] } } }; var assocIMG = // Added - Removed { here, causes issues with other scripts when not working with a configurable product. { 11786: 'media/catalog/product/8795139_633.jpg', 11787: 'media/catalog/product/8795139_633.jpg', } </code></pre> <p>Above is the objects I am working with and below is my current jQuery. Help would be greatly appreciated.</p> <pre><code>$('#attribute125').change(function() { var image = $(this).val(); $.each(spConfig.attributes, function() { prods = $(this.options).filter( function() { return this.id == image; } )[0].products[0]; alert(prods); }); }); </code></pre>
javascript jquery
[3, 5]
1,705,927
1,705,928
How much Java should I have learnt before trying Android programming?
<p>I have been seeking beginner learning books in Android, and of course found out that I should learn Java first. So I began studying Java and now I am quite comfortable with objects, classes, inheritance, interfaces, and just moved onto Layouts in Swing as well as Swing Features. But I am starting to wonder.... do I know enough about Java now? Can I start programming Android yet?</p> <p>Of course I can keep going in Java, but have been itching to begin programming Android apps. </p> <p>Any definitive answer here about how much Java I need to know before Android?</p> <p>Thanks so much!</p>
java android
[1, 4]
1,751,979
1,751,980
selecting field text with javascript
<p>I am using the below code to select a fields text with JavaScript but it doesn't quite work:</p> <pre><code>//auto select that fields text for easy COPY var content = parent.document.getElementById('share_field_&lt;?php echo $id; ?&gt;'); content.focus(); content.select(); </code></pre> <p>Field to select:</p> <p>//share field</p> <pre><code>echo '&lt;div class="name" style="display: none" id="share_field_'.$row['id'].'"&gt;&lt;input name="share" type="text" value="http://www.site.com/play/'.$row['id'].'" size="53"&gt;&lt;/div&gt;'; </code></pre>
php javascript
[2, 3]
4,477,693
4,477,694
Passing URL from php to javascript
<p>I am reading a rss feed with php and creating html DOM from the same. Now I have a bunch of <code>&lt;li&gt;</code>'s with news feed. when a user clicks on a particular <code>&lt;li&gt;</code> I want to post certain data to another php file which performs some other function. </p> <p>How I want the data is tricky. I have a URL for all the feed elements. When a user clicks on a particular feed, I need to retrieve the URL associated with that particular feed. </p> <p>I want to run a $.click() function in which I am going to $.post to the next php script. </p> <p>How do I get that URL without storing it in the HTML itself. I do not want to store the URL in the html document for security puposes. </p> <p>I am new with PHP. </p>
php javascript
[2, 3]
5,373,941
5,373,942
How to tell if browser/tab is active
<p>I have a function that is called every second that I only want to run if the current page is in the foreground, i.e. the user hasn't minimized the browser or switched to another tab. It serves no purpose if the user isn't looking at it and is potentially CPU-intensive, so I don't want to just waste cycles in the background.</p> <p>Does anyone know how to tell this in JavaScript?</p> <p>Note: I use jQuery, so if your answer uses that, that's fine :).</p>
javascript jquery
[3, 5]
1,657,335
1,657,336
Java vs native coding in Android Application development
<p>I plan to create an SDK (involving huge data manipulations), which can used to create applications on Android.</p> <p>I plan to develop the complete SDK, including the libraries in Java, for the reason that if I implement my libraries in the native language(C++) the data movement between the Java and the native layer will involve memory copies and will make my application look slow.</p> <p>I plan to port the same SDK later to other platforms like Windows Mobile. I am a bit confused on the better approach to code in such cases, keeping in mind the portability and performance of the SDK.</p> <p>Inputs will be greatly appreciated.</p>
java android c++
[1, 4, 6]
446,072
446,073
JQuery multiple attributes filter not working
<p>I have some html that looks like this. It's the textbox on a popup window, specifically, Quora's ask question box. <a href="http://www.quora.com/" rel="nofollow">http://www.quora.com/</a></p> <pre><code>&lt;div class="qtext_editor_content qed_content" group="__w2_TrzaBWs_interaction" interactive="true" w2cid="TrzaBWs" id="__w2_TrzaBWs_editor" contenteditable="true" npdkey="h5evmzsf0.cz3gxez1tjn0cnmi"&gt;add&lt;br npdkey="h5evn1ub0.l1r3uudq6by8ehfr"&gt;This is my text&lt;/div&gt; </code></pre> <p>I would like to retrieve "this is my text", but JQuery's multiple attribute filter has been returning literally all the text on the page. I have tried doing </p> <pre><code>$("div[class='qtext_editor_content qed_content'][group$=_interaction]").text() </code></pre> <p>but without good effect.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
5,252,791
5,252,792
Using sessions for protecting web files to be accessed if the user is logged or not . useful or not?
<p>I have a login page and a global page where the user is redirected to after he logged in.</p> <p>I need to know if this is a good method for protecting some web files to be accessed if the user is not logged in.</p> <p><code>global.aspx</code> code (the protected page where the user is redirected after he logged in)</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (Session["Login"] != null) { if (Session["Login"].Equals("Logged")) { userName.Text = (string)Session["UserTest"].ToString(); } } else Response.Redirect("http://localhost:port/Login.aspx"); } </code></pre> <p>Login page code:</p> <pre><code>Session["Login"] = "Logged"; Session["UserTest"] = "Test123"; Response.Redirect("http://localhost:port/Global.aspx"); </code></pre> <p>Thanks</p>
c# asp.net
[0, 9]
36,495
36,496
Is beginner knowledge of Java enough to develop for Android?
<p>I just finished the book "Tech Yourself Java in 24 Hours, 6th Edition" I have an understanding of the language (by understanding I mean, the basics and everything covered in the book) and I have been experimenting and building little things with my knowledge. I want to learn about Android and was wondering if I need to increase my knowledge in Java before moving on to Android or can I just go straight to Android?</p>
java android
[1, 4]
3,243,707
3,243,708
Google AdSense code not executed in asp.net
<p>I put the AdSense script in my asp.net web site code.<br> I see that the script executed and I also receive from Google the relevant code.<br> But What I receive I see it in my web site as text and not as executable code.<br> I see that with Firebug.<br> Additionally I have to say that this script stays behind a DIV and that div is behind of a ContentHolder and that Holder is behind another DIV.<br> Can someone tell me why that happen? And How can I solve this issue? </p>
javascript asp.net
[3, 9]
1,389,857
1,389,858
jQuery Plugins: If I want to call something like $('selector').plugin.group.method(), how can I achieve this?
<p>I have written some relatively simple jQuery plug-ins, but I am contemplating writing something more advanced in order to keep commonly used methods on the site easily accessible and DRY</p> <p>For example, I might have something like this for a structure:</p> <pre> plugin - popup - element ... === popup === - login - product ... === element === - shoppingCart - loginStatus ... </pre> <p>So, to bind a popup login popup event, I'd like to be able to do: $('#login_button').plugin.popup.login();</p> <p>What's the best way to do this? Is there a better way of achieving what I want to do?</p> <p>Cheers,</p>
javascript jquery
[3, 5]
1,364,396
1,364,397
next and prev button for a custom pager using PagedDataSource
<p>I am trying to get the next and prev button on my custom pager. Here is what I have so far and it's working perfect except it needs next and prev button.</p> <p><strong>What I have done</strong></p> <pre><code> PagedDataSource page = new PagedDataSource(); page.AllowCustomPaging = true; page.AllowPaging = true; page.DataSource = query; page.PageSize = 5; QRep.DataSource = page; QRep.DataBind(); </code></pre> <p>*Qrep is a asp.net repeater control and *query is a result of linq to sql query.</p> <p><strong>here is how i create the pager controls and assigned event handlers</strong></p> <pre><code>private void CreatePagingControl() { for (int i = 0; i &lt; (RowCount / 5) + 1; i++) { LinkButton lnk = new LinkButton(); lnk.Click += new EventHandler(lbl_Click); lnk.ID = "lnkPage" + (i + 1).ToString(); lnk.Text = (i + 1).ToString(); plcPaging.Controls.Add(lnk); Label spacer = new Label(); spacer.Text = "&amp;nbsp;"; plcPaging.Controls.Add(spacer); } } void lbl_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; int currentPage = int.Parse(lnk.Text); int take = currentPage * 5; int skip = currentPage == 1 ? 0 : take - 5; FetchData(take, skip); } </code></pre> <p>the row count is stored as below</p> <pre><code>private int RowCount { get { return (int)ViewState["RowCount"]; } set { ViewState["RowCount"] = value; } } </code></pre> <p>This is working fine , except it only displays page numbers and I want to know how the next and prev controls can be integrated with this. Any help appreicated guys. Thanks in advance.</p>
c# asp.net
[0, 9]
1,237,925
1,237,926
JQuery: Push Effect?
<p>I'm currently using the JQuery slideDown/slideUp effect and am not accomplishing what I want.</p> <p>Essentially, I want to create an action where I "push" a div off the top of the browser window.</p> <p>Something similar to the <a href="http://aaronweyenberg.com/demos/voteflipper/demo.html" rel="nofollow">following push effect example.</a></p> <p>How can I do this with JQuery?</p> <p>The problem with just using slideDown/slideUp is that the other DIV just overlaps the div I'm hiding. But instead, I want to PUSH the div I don't want visible off the top of the browser window.</p>
javascript jquery
[3, 5]
4,101,097
4,101,098
How to detect if a click() is a mouse click or triggered by some code?
<p>How to detect if a click() is a mouse click or triggered by some code?</p>
javascript jquery
[3, 5]
2,005,032
2,005,033
Receive output of python script from PHP?
<p>I want to launch a python script similar to <a href="http://www.eventlet.net/doc/examples.html#web-crawler-example" rel="nofollow">this web crawler</a>, wait for it to finish, process the data in php, then return the results to the user.</p> <p>From what I hear, getting the output from python is trivial, but the above script is doing stuff in parallel, so just printing stuff as it finishes won't give me any kind of usable structure.</p> <p>What would you suggest to use to pass an array of html data from the python script to php? A temporary file? mysql? I have no experience whatsoever in python, so you'll need to be pretty explicit.</p> <p>Cheers.</p>
php python
[2, 7]
1,910,578
1,910,579
jquery show hide
<p>look I have this question, how can i do something like this (look at images)</p> <p>I think it's possible to do with jQuery or ajax, but i don't know how..</p> <ol> <li>i have page something like this : <img src="http://i.stack.imgur.com/fEY01.png" alt="enter image description here"></li> <li>when i click on 1st green cube slides up one #div container at the bottom of page : <img src="http://i.stack.imgur.com/AeirN.png" alt="enter image description here"></li> <li>when i click on red 1st cude #div container at the bottom of page slides down : <img src="http://i.stack.imgur.com/NjnfN.png" alt="enter image description here"></li> <li>but when i click for example (on image 2) at the green cube #div container at the bottom slides down and up with new information abou title 2.</li> </ol> <p>I hope so you will help me with this..</p> <p><strong>And one more thing, when i click o green cube it color chancing to red, and when i click on red cube it's changes back to green.</strong></p>
javascript jquery
[3, 5]
4,985,711
4,985,712
aspx.cs and aspx page problem
<p>I'm developing a sort of a Web-site that lets you search, display(as thumbnails), delete images. I've followed the example of this site <a href="http://www.codeproject.com/KB/web-image/EasyThumbs.aspx" rel="nofollow">http://www.codeproject.com/KB/web-image/EasyThumbs.aspx</a> , but i've found some problems into the "Default.aspx.cs". "ThumbFromId doesn't exist in the current context". Now i've noticed the Default.aspx.cs can't see the "objects" of the aspx pages., but i don't know why and how to solve that.</p>
c# asp.net
[0, 9]
5,678,919
5,678,920
Why does copying a file using FileInfo.CopyTo creates the destination copied file as readonly?
<p>I have two folders in my asp.net web application in which I create new folders programmaticaly. The entire solution is under VSS source control.</p> <p>I was not able to manipulate these two folders programmably. For that, I gave {MACHINE}\ASPNET user account full control over these two folders.</p> <p>Still, the "access denied to the path" error was coming. I saw that these entire folders were marked readonly. I tried to uncheck Readonly from explorer but not successfull, readonly check does not get removed.</p> <p>Also, if I copy files using method, the destinationn copied file becomes readonly. I have also tried File.SetAttributes(path,FileAttributes.Normal); but no success.</p> <p>How can I make the copied file not READONLY ?</p>
c# asp.net
[0, 9]
5,212,701
5,212,702
DropDownList inaccessible
<p>I have a drop down list in my TopicTreeSearchControl, on my page, but from the actually page where the control sits, I get an error:</p> <pre><code>'TopicSearchTree.ddlDatasources' is inaccessible due to its protection level </code></pre> <p>I am trying to do this from my page:</p> <pre><code>protected override void Render(HtmlTextWriter writer) { Page.ClientScript.RegisterForEventValidation(TopicSearchTreeControl.ddlDatasources.UniqueID); Page.ClientScript.RegisterForEventValidation(TopicSearchTreeControl.ddlYears.UniqueID); base.Render(writer); } </code></pre> <p>How do I access this?</p>
c# asp.net
[0, 9]
2,429,994
2,429,995
C# oncheckedchanged event handler of aspcheckbox does not fire when checkbox is unc
<p>Hey could you look at this code: I get this error:</p> <blockquote> <p>Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. </p> </blockquote> <p>Source Error: </p> <pre><code>{ CheckBox chkBox1 = (CheckBox)e.Row.Cells[8].FindControl("chkStatus"); chkBox1.CheckedChanged += new EventHandler(chkStatus_OnCheckedChanged); chkBox1.Checked = true; chkBox1.AutoPostBack = true; } </code></pre>
c# asp.net
[0, 9]
4,452,689
4,452,690
Class memory allocation difference b/w c# and c++
<p>The title is quite simple but i have a one problem with that. As we know, In c++ when a class is created none of memory allocated in ram. When it's instances created the memory allocation starts. but In C# i have listened from so many when class created memory allocated even u don't have any data type or instance/object of this class so Is this right or please give me a reason </p>
c# c++
[0, 6]
130,275
130,276
jQuery mouse over menu and animate position element behind
<p>Is there a jQuery equivalent to provide the same functionality as <a href="http://www.scriptiny.com/2008/05/sliding-javascript-menu-highlight-1kb/" rel="nofollow">here</a>? </p> <p>JavaScript</p> <pre><code>var menuSlider=function(){ var m,e,g,s,q,i; e=[]; q=8; i=8; return{ init:function(j,k){ m=document.getElementById(j); e=m.getElementsByTagName('li'); var i,l,w,p; i=0; l=e.length; for(i;i&lt;l;i++){ var c,v; c=e[i]; v=c.value; if(v==1){s=c; w=c.offsetWidth; p=c.offsetLeft} c.onmouseover=function(){menuSlider.mo(this)}; c.onmouseout=function(){menuSlider.mo(s)}; } g=document.getElementById(k); g.style.width=w+'px'; g.style.left=p+'px'; }, mo:function(d){ clearInterval(m.tm); var el,ew; el=parseInt(d.offsetLeft); ew=parseInt(d.offsetWidth); m.tm=setInterval(function(){menuSlider.mv(el,ew)},i); }, mv:function(el,ew){ var l,w; l=parseInt(g.offsetLeft); w=parseInt(g.offsetWidth); if(l!=el||w!=ew){ if(l!=el){var ld,lr,li; ld=(l&gt;el)?-1:1; lr=Math.abs(el-l); li=(lr&lt;q)?ld*lr:ld*q; g.style.left=(l+li)+'px'} if(w!=ew){var wd,wr,wi; wd=(w&gt;ew)?-1:1; wr=Math.abs(ew-w); wi=(wr&lt;q)?wd*wr:wd*q; g.style.width=(w+wi)+'px'} }else{clearInterval(m.tm)} }};}(); </code></pre>
javascript jquery
[3, 5]
1,927,179
1,927,180
jQuery keyword cannot recognize error
<p>I am using jQuery 1.6.1 and want to use JqGrid (a grid table plugin for JQuery). However when I use it, I get the following error in Firebug:</p> <pre><code>jQuery("#confTable").jqGrid is not a function </code></pre> <p>I changed it to this:</p> <pre><code>$("#confTable").jqGrid is not a function </code></pre> <p>I tried using <code>jQuery.noConflict();</code> before jqGrid code but still get the same error?</p> <p>Any ideas?</p>
javascript jquery
[3, 5]
1,825,951
1,825,952
Developing a Custom Asp.net Control with Nested Repeaters
<p>I've never created a custom control, so barring that in mind here is my question:</p> <p>Is it possible to create a custom control with nested repeaters?</p> <p>The usage would be something like this:</p> <pre><code>&lt;tag:NestedRepeater id="foo" runat="server" levels="6"/&gt; </code></pre> <p>I currently have 6 identical repeaters nested within each other. I then use the ItemDataBound event to bind the child who then binds its child. How does this chaining of events occur within a custom control? I'd like to be able to just have one repeater template that references itself. Is that possible?</p> <p>Is there anything obvious that I'm overlooking or should know before attempting to do this?</p>
c# asp.net
[0, 9]
5,402,545
5,402,546
Code not running when using ".remove()" function
<p>I'm writing this jquery code :</p> <pre><code>$('form').after('&lt;p id="suc"&gt;&lt;/p&gt;'); $('#suc').html('success !'); $('#suc').show(700); setTimeout(function(){$('#suc').hide('slow')},2500); $('#suc').remove(); </code></pre> <p>When i remove <code>$('#suc').remove();</code> like this :</p> <pre><code>$('form').after('&lt;p id="suc"&gt;&lt;/p&gt;'); $('#suc').html('success !'); $('#suc').show(700); setTimeout(function(){$('#suc').hide('slow')},2500); </code></pre> <p>The code run succefuly, but when i put it, it dosen't run !!</p> <p>What the problem with that ? it's illegal to but <code>$('#suc').remove();</code> here ?</p>
javascript jquery
[3, 5]
4,557,847
4,557,848
Android: Opening default phone dailing
<pre><code>&lt;TextView android:id="@+id/TextView03" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/header" android:layout_alignLeft="@+id/button1" android:layout_marginBottom="127dp" android:text="@string/phone" android:textColor="#000000" android:textSize="12dp" android:typeface="sans" /&gt; </code></pre> <p>I have a test view which holds my phone information. How do i open an default phone dailing box on the click of the message. </p> <pre><code>&lt;string name="email"&gt;Phone: 1-866-232-3805&lt;/string&gt; </code></pre> <p>Here is my Override method. </p> <pre><code> @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView t2 = (TextView) findViewById(R.id.TextView03); email.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub } }); } </code></pre> <p>What should i do from here?</p>
java android
[1, 4]
844,231
844,232
Android: How to Get 3G/UMTS Signal Strength Values
<p>I am a Cellular RF Engineer and have been trying to get some specific WCDMA/3G/UMTSsignal measurement values out of Android SDK environment. Using the public class <code>SignalStrength</code> I have been successful in getting meaningful GSM values (with the assistance of a Software Engineer) using <code>getGsmSignalStrength()</code>, but only yield "-1" values for <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> respectively which are supposed to return relevant CDMA signal strength values. -1 is definitely not right!</p> <p>My phone was definitely on a UMTS at the time and I can read UMTS parameters in the field test software (to get the field test software going was a hassle in itself).</p> <p>I think it is quite likely that <code>getCdmaDbm()</code> and <code>getCdmaEcio()</code> methods are for CDMA networks, not WCDMA (CDMA and WCDMA are different technologies) which leaves me high and dry in terms of trying to get 3G measurements out of the phone. Alternatively, there is some other methods out there but I simply can't find them in the reference material on the web:</p> <p><a href="http://developer.android.com/reference/android/telephony/SignalStrength.html">http://developer.android.com/reference/android/telephony/SignalStrength.html</a></p> <p>Can someone please assist me? There must be a way (after all, field test s/w can get this information) but how? Someone wrote an app called Cellumap which gets UMTS, GSM and CDMA measurement information.</p>
java android
[1, 4]
5,240,091
5,240,092
How do I get the total of table data with a particular class? (jQuery)
<p>Say I have the following table: </p> <pre><code>&lt;table class="table questions"&gt; &lt;tr&gt; &lt;td class="someClass"&gt;Some data&lt;/td&gt; &lt;td class="someOtherclass"&gt;Some data&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="someOtherClass"&gt;Some data&lt;/td&gt; &lt;td class="someOtherclass"&gt;Some data&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="someOtherClass"&gt;Some data&lt;/td&gt; &lt;td class="someClass"&gt;Some data&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>How would I get the total of table data where they had the class value of someClass? e.g. for this table the total would be two. </p>
javascript jquery
[3, 5]
657,542
657,543
Events with and without delegates in ASP.NET
<p>In some ASP.NET examples i see that events are used with delegates <a href="http://www.dotnetjohn.com/articles.aspx?articleid=62" rel="nofollow">like this</a> and sometimes without them <a href="http://asp.net-tutorials.com/user-controls/events/" rel="nofollow">like this</a>.</p> <p>Please explain!</p>
c# asp.net
[0, 9]
5,994,078
5,994,079
Replay the hint sound
<p>In my drag and drop game there is a grid that is populated with words that are hidden from the user. The aim of the game is to spell these words with the aid of a sound and a picture.</p> <p>When the user is spelling the word they should be able to replay the sound to help them. I had it working before but it has stopped working and I cannot work out why.</p> <p>Here is the code that makes it work...</p> <pre><code>$(".minibutton2").click(function() { var noExist = $('td[data-word=' + listOfWords[rndWord].name + ']').hasClass('wordglow2'); if (noExist) { $('.minibutton2').prop('disabled', true); } else { $("#mysoundclip").attr('src', listOfWords[rndWord].audio); audio.play(); } }); </code></pre> <p>Here is a fiddle - <a href="http://jsfiddle.net/smilburn/m8Squ/6/" rel="nofollow">http://jsfiddle.net/smilburn/m8Squ/6/</a></p>
javascript jquery
[3, 5]
1,994,215
1,994,216
2 javascripts plugin not working together
<p>I tried to implement 2 plugins in a page and when i introduce the 2nd one... the 1st plugins stops working .. can you please help me in this.. he is the page i am trying to build..</p> <p><a href="http://www.abc.com/home21" rel="nofollow">http://www.abc.com/home21</a></p> <p>and here are the 2 plugins i am trying to use.</p> <p><a href="http://www.catswhocode.com/blog/how-to-integrate-a-slideshow-in-your-wordpress-theme" rel="nofollow">http://www.catswhocode.com/blog/how-to-integrate-a-slideshow-in-your-wordpress-theme</a></p> <p><a href="http://www.fyneworks.com/jquery/star-rating/" rel="nofollow">http://www.fyneworks.com/jquery/star-rating/</a></p> <p>here is my code.. The rating script was working from beginning. i tried to add this slideshow in this page like</p> <pre><code>&lt;link rel="stylesheet" href="testing/t1/css/layout.css" type="text/css" media="screen" charset="utf-8" /&gt; &lt;link rel="stylesheet" href="testing/t1/css/jd.gallery.css" type="text/css" media="screen" charset="utf-8" /&gt; &lt;script src="testing/t1/scripts/mootools.v1.11.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="testing/t1/scripts/jd.gallery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="testing/t1/scripts/jd.gallery.transitions.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var newj = jQuery.noConflict(); function startGallery() { var myGallery = new gallery(newj('myGallery'), { timed: true, showArrows: false, embedLinks: false, showCarousel: true, defaultTransition: "continuoushorizontal" }); } window.onDomReady(startGallery); &lt;/script&gt; </code></pre> <p>please help me how to solve this problem</p>
javascript jquery
[3, 5]
5,865,105
5,865,106
how to check whether the value is inserted or not
<p>Am using DataSetTableAdapters for inserting data.how can i check whether the value is inserted or not..I want to show the error or success message after completion of inserting..</p> <p>My partial code is here: </p> <pre><code> DataSet5TableAdapters.sp_inempleaveTableAdapter TA = new DataSet5TableAdapters.sp_inempleaveTableAdapter(); TA.GetData(ddlperiod.SelectedItem.Text, lblid.Text, name, leave_value); </code></pre> <p>How can i display the success message (or) error message after the above step...</p>
c# asp.net
[0, 9]
113,647
113,648
Asp.Net(C#) Jquery Ajax with WebMethod Call Problem
<p><strong>Code Behind:</strong></p> <pre><code> [WebMethod] public static string emp() { return "BlaBla"; } </code></pre> <p><strong>Aspx Page:</strong></p> <pre><code>$(document).ready(function() { $.get("TestPage.aspx/emp", null, function(data) { alert(data); }) }) </code></pre> <p><strong>Message Box Output:</strong> TestPage.aspx on the page codes </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt;&lt;title&gt; &lt;/title&gt; &lt;style&gt; tr { background-color: red; color: White; } &lt;/style&gt; </code></pre> <p>How to make return string ?</p> <p>Thank You.</p>
asp.net jquery
[9, 5]
5,568,820
5,568,821
how to remove <p> , </p> and <br /> which are obtained by parsing JSON response
<p>I got JSON response from server parsing json response i got content which contains <code>&lt;p&gt; &lt;/p&gt;</code> and <code>&lt;br /&gt;</code> how to replace all with blank or white space? </p>
java android
[1, 4]
2,008
2,009
how to target certain time using jquery Countdown - http://keith-wood.name/countdown.html
<p>I am using these jQuery countdown - <a href="http://keith-wood.name/countdown.html" rel="nofollow">http://keith-wood.name/countdown.html</a>.</p> <p>I'm trying to get it to countdown to 17:00 (5:00 PM) everyday but I cannot seem to set the time.</p> <p>Any help welcomed.</p> <p>The code I have is :-</p> <pre><code>$(function() { var now = new Date() var since = new Date(now.getFullYear(), now.getMonth(), now.getDay(), 17, 00); $('#noDays').countdown({until: since, format: 'HMS'}); }); </code></pre> <p>timer is stuck at 0 with this.</p>
javascript jquery
[3, 5]
501,974
501,975
how to do an operation when the .scroll i stopped
<p>I have put a scroll handler to my page :</p> <pre><code>$(window).scroll(function() { ... }); </code></pre> <p>and I'd like to do some operation when i stop to scroll the bar, not when I'am scrolling it.</p> <p>How can I do it?</p>
javascript jquery
[3, 5]
4,907,142
4,907,143
Post Javascript variable to PHP
<p>I use Facebook JavaScript SDK. I want to know how to post the Javascript variables to another page with GET or POST or any other way. For example i have:</p> <pre><code>userInfo = document.getElementById('user-info'); </code></pre> <p>How to post it to new page ?</p> <pre><code>location.href="http://www.walla.com/?info=" + info.id; </code></pre> <p>Not working</p>
php javascript
[2, 3]
4,787,291
4,787,292
Returning html of an element along with the element in jquery
<p>I have mark up like</p> <pre><code>&lt;div id="div1"&gt; &lt;div id="div2"&gt; blah blah &lt;/div&gt; &lt;/div&gt; </code></pre> <p>If I use $("#div1").html(), it returns the div#div2. But I want to get the complete html. i.e, along with div#div1. </p> <p>Is there any way to do this?</p>
javascript jquery
[3, 5]
2,263,013
2,263,014
Pass the value from popup window to parent window
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4075296/passing-parameters-to-popup-window">Passing parameters to popup window?</a> </p> </blockquote> <p>I created Parent window and when i click on button popup window will appear.In popup window two drop down list are there.i have to take the list values from master table and populate in first drop down list on this basis of first, second drop down list will populate the value from its own table.when i click to go button it will show the result in data grid table in every row select hyperlink will present so after selecting it's result will populate in parent window and popup will close.</p>
javascript jquery
[3, 5]
377,342
377,343
How to generate a pop-up window if a user is not logged in?
<p>In an HTML page:</p> <pre><code>&lt;a href="/files/getfile.php?name=abc.zip"&gt;file download&lt;/a&gt; </code></pre> <p>in PHP script(getfile.php):</p> <pre><code>if('notlogged') { echo 'please, loggin~'; //pop up, possible? return false; } </code></pre> <p>So my question is, When user click the anchor tag, can I pop up a login window if user didn't log?</p> <p>I knew I can pre-check in Javascript before calling the PHP script whether user logged or not.</p> <p>But, it's not my case for use; the PHP script should have to throw pop up code.</p> <p>The page user is viewing should not changed — just pop up login window.</p>
php javascript
[2, 3]
5,052,284
5,052,285
ASP.NET Postbacks x jQuery: What are the cons and pros?
<p>I'll start some lab prototypes on some of our Web App pages. We use a lot of Postback, ViewState, UpdatePanels, ModalPopup Extenders, all the ASP.NET usual stuff. It's good enough for most cases. But I wanna push things further...</p> <p>I've been playing around with jQuery for some time now. I know what's capable of. I'm thinking of TRULY substituting the ASP.NET usual things by things like <code>$.ajax()</code>, <code>$.get()</code>, etc. No more postbacks. User interface? jQuery UI. I'm truly impressed by some plugins, specially jQuery grid.</p> <p>I think it's the next step into Web UI. I mean, it's ALREADY the current step! I love the power of C#, but I'm not that impressed with the ASP.NET framework. I imagine that by doing that, I'll truly separate UI from Business logic.</p> <p>However:</p> <ul> <li>Should I really do it? </li> <li>Should the code behind be only Web Handlers and Web Services? </li> <li>What should I beware of?</li> <li>How about security? How to implement it?</li> <li>What will I gain? I know I'll gain some in performance, since postbacks in pages with too much data takes time because of the ViewState AND I'll be transacting only XML and/or the always light JSON format. But I imagine, as usual, there will be pain... </li> <li>Where will the pain be?</li> </ul> <p>I'll take it slow, anyway. But I want to ask you guys: what am I getting into here?</p>
c# jquery asp.net
[0, 5, 9]
4,452,655
4,452,656
Handling dynamically generated controls in asp.net
<p>What's the best way to handle data entered through dynamically generated controls in ASP.NET?</p> <p>Currently, I have a group of controls that are generated in the Page_Load stage, and I need to access the data from them. It seems like it might be possible to just use a hidden field that's read and parsed on postback, but I'd like to know if there's a better way to do it that makes better use of the framework.</p>
c# asp.net
[0, 9]
3,469,557
3,469,558
how can i use referenced libraries
<p>Hi I made one jar file with 3 classes.They work fine they are supporting file for getting HXM data.Now when i made jar i want to use it in my next project.I imported it and now it is in referenced libraries.But i can not find how can i use the libraries. in old project from i take the 3 .class file they have the paths: sk.csabi.hxm.*</p> <p>but now how can i import and use them?</p> <p>thanks</p>
java android
[1, 4]
5,026,058
5,026,059
Binding a treeview Dynamically and getting selected nodes
<p>I am trying to dynamically (i.e. via code) bind a directory to a asp.net Treeview control and once the data is bound and displayed to the user i want to get a list of nodes the select.</p> <p>I have got the binding and displaying of checkboxes to work fine , but when i query the Treeview1.CheckedNodes it always returns 0. If i do not bind dynamically but created the nodes by hand then it is able to get the selected nodes.</p> <p>Thanks </p>
c# asp.net
[0, 9]
5,168,403
5,168,404
if ($('#selector').length == 0) doesn't work in IE7 and IE8
<p>Here is my jquery code:</p> <pre><code>$(document).ready(function() { if ($('#login').length == 0) { $('#login').css('background', "url('/css/login-bg.gif') 2px center no-repeat"); } if ($('#password').length == 0) { $('#password').css('background', "url('/css/password-bg.gif') 2px center no-repeat"); } $('#login').focus(function() { $(this).css('background', 'transparent'); }); $('#password').focus(function() { $(this).css('background', 'transparent'); }); }); </code></pre> <p>It works in Firefox but not in IE7 or IE8. Why?</p> <p>The purpose of this code: It is supposed to display a user friendly text inside sign in form so users know what to fill in username and password input fields. This is important because input fields don't have labels (I know... but client just does not want labels there).</p> <p>The if ($('#selector').length == 0) condition is there because if user saves his/her username and password in the browser, the browser will fill in the saved values automatically, so it makes sure the background image doesn't overlap them.</p>
javascript jquery
[3, 5]
2,077,371
2,077,372
Make the move to c++ from java?
<p>Ive been learning java for maybe 5 months, and for that whole time, i mostly tried making games. I made a halfway decent game with java2D, but I want to move on to bigger and better things... 3D. I began to learn LWJGL(which is basicly OpenGL). Before I get too deep into learning java, and going 3d with it, should I move to c++? Are pointers really that essential for large programs? Can I still make anything cross platform with c++? or am I stuck with windows. If I am stuck with windows, should I just go for c#?</p> <p>Thanks.</p> <p>When I said halfway decent, I meant that it was good, IMO. If you want to see it, to judge where i am in 2D experience, here you go: <a href="http://www.thenewboston.com/forum/viewtopic.php?f=119&amp;t=13249" rel="nofollow">http://www.thenewboston.com/forum/viewtopic.php?f=119&amp;t=13249</a></p> <p>So Java is okay for game devolepment, on large scales?</p>
java c++
[1, 6]
3,296,089
3,296,090
PHP cannot receive a String from Android
<p>The following code attempts to POST a String from Android to PHP.</p> <ul> <li>INTERNET permission is given.</li> <li>Shark has been checked.</li> <li>the device connects to MAMP (WAMP for MAC) server and sends the String.</li> </ul> <p>Code on Android:</p> <pre><code>HttpClient httpclient = new DefaultHttpClient(); HttpPost post = new HttpPost("http://MAMP-SERVER/post.php"); try { // Add your data List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1); nameValuePairs.add(new BasicNameValuePair("username", "Andro")); post.setEntity(new UrlEncodedFormEntity(nameValuePairs)); // Execute HTTP Post Request httpclient.execute(post); Log.i("POSTED", "YOUR USERNAME"); } catch (ClientProtocolException e) { Log.e("Client Protocol Exception", "Err "+ e.getMessage()); } catch (IOException e) { Log.e("IO Exception","Err "+ e.getMessage()); } </code></pre> <p>Code on PHP:</p> <pre><code>$test=$_REQUEST["username"]; print $_REQUEST["username"]; </code></pre>
java php android
[1, 2, 4]
5,138,158
5,138,159
How can I get the height/offset of an element after it has 'skew' transform has been applied with JS/jQuery?
<p>Quite simply my question is as the title:</p> <p>Is there any way to get the height of an element after it has had <code>transform:skew();</code> applied to it?</p> <p>e.g. If the height of an element is 100px and the top offset is 500px pre-transform, after having a skew applied to it, the height may actually be 150px and the top offset may actually be 450px, yet the standard height() and offset() methods in jQuery still report the original values.</p> <p>Is there any workaround for this?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
1,706,169
1,706,170
get the serverside control id in javascript in asp.net?
<p>I have asp:ImageButton in asp:table. I want to get the id of button in javascript and I want to enabled the button based on conditon. How cloud I acheive. I tried as below.</p> <pre><code>var btn; btn = document.getElementById('&lt;%= generateRptbtn.ClientID%&gt;').value; btn.enabled = true; </code></pre> <p>But I'm getting empty as btn value.</p>
javascript asp.net
[3, 9]
1,026,053
1,026,054
jquery load page with switch case
<p>it's me again!!</p> <p>Now.. i don't know what i'm doing wrong with this Switch Case... can help me?</p> <p>When i click in some LINK, the alert dont apear...</p> <p>this is my HTML:</p> <pre><code> &lt;div class="menu-site"&gt; &lt;ul class="topo-menu" id="topo-menu"&gt; &lt;li id="aabruzzo"&gt;a abruzzo&lt;/li&gt; &lt;li id="catalogo"&gt;catálogo&lt;/li&gt; &lt;li id="conceito"&gt;conceito inverno&lt;/li&gt; &lt;li id="representantes"&gt;representantes&lt;/li&gt; &lt;li id="clipping"&gt;clipping&lt;/li&gt; &lt;li id="loja"&gt;loja&lt;/li&gt; &lt;li id="contato" class="sem-right"&gt;contato&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>this is my javascript:</p> <pre><code>jQuery(document).ready(function(){ var sections = $("#topo-menu li"); var loading = $("#loading"); var content = $("#content"); sections.click(function(){ switch(this.id){ case 'aabruzzo': alert("teste"); break; case "catalogo": alert("teste"); break; case "conceito": alert("teste"); break; case "representantes": alert("teste");); break; case "clipping": alert("teste"); break; case "loja": alert("teste"); break; case "contato": alert("teste"); break; default: hideLoading(); break; } }); </code></pre> <p>i have this <a href="http://jsfiddle.net/D2Cqt/" rel="nofollow">fiddle</a></p>
javascript jquery
[3, 5]
777
778
What is the Python equivalent of PHP's set_time_limit()?
<p>I have a python script which is freezing (I think it stalls waiting for socket data somewhere), but I am having trouble getting a backtrace because the only way to stop it is to kill the process in. There is a timeout on the socket also, but it doesn't seem to work.</p> <p>I am hoping that Python has a feature like PHP's <a href="http://www.php.net/set_time_limit" rel="nofollow">set_time_limit()</a> function which can stop the script and give me a useful backtrace, perhaps showing a <code>sock.recv()</code> call which is frozen, or an endless loop somewhere.</p>
php python
[2, 7]
4,304,482
4,304,483
How to change name attribute of a hidden field?
<p>I have a hidden field on my aspx page and I use masterpage. Without using masterpage everything is fine and name attribute of hiddenfield is correct.</p> <pre><code>&lt;asp:HiddenField ID="apiversion" ClientIDMode="Static" runat="server" /&gt; </code></pre> <p>After rendering, result html is;</p> <pre><code>&lt;input type="hidden" name="apiversion" id="apiversion" value="v0.01"&gt; </code></pre> <p>But if use masterpage then result html is being like;</p> <pre><code>&lt;input type="hidden" name="ctl00$ContentPlaceHolder1$apiversion" id="apiversion" value="v0.01"&gt; </code></pre> <p>But I have to use masterpage and need name attribute as 'apiversion', not as 'ctl00$ContentPlaceHolder1$apiversion'.</p> <p>Any solution?</p>
c# asp.net
[0, 9]
1,079,637
1,079,638
What are some ideal ways to build a chat application?
<p>If I wanted to build a chat application that can chat with other users that are on the website and host chatrooms what would be some ideal ways? If there are some open source ones out there? If I build from scratch what should I use (i heard comet is good)? Thanks!</p>
c# asp.net
[0, 9]
4,429,560
4,429,561
Values which are changed in Jquery, are not showing up on codebehind
<ul> <li>ASP.NET 4</li> <li>Jquery 1.7.1</li> <li>Browser: IE9</li> </ul> <p>Hi</p> <p>I am using jquery with a gridview control inside a UpdatePanel so, everytime I click on a row of the gridview Jquery edits the value of a HiddenField control, so when I need "the selected index", I just use the value of the HiddenField. And everything works fine in Chrome and Firefox, but not in IE9. After clicking a row and assigning it's index to the HiddenField, when I click a button and fire a server side event, when I retrieve the HiddenField's value, I get its default value (the one defined in the mark-up), and not the changed one. And, strangely, if I use and alert(HiddenField.value), it shows me the row index! so, the problem only occurs on the server side function, even after the postback the HiddenField value is preserved, but always as default on server side...</p> <p>This is my Jquery code:</p> <pre><code>$('[id$=divtxtIdPresentacion]').click(function () { var tex = $('#&lt;%=HFSeleccionIndexRow.ClientID%&gt;').attr("Value"); var index = $(this).attr("commandargument"); if (tex != index) { $('#&lt;%=HFSeleccionIndexRow.ClientID%&gt;').attr("Value", index); } }); </code></pre> <p>And part of the button event:</p> <pre><code> protected void gridPresentacionAgregar_SelectedIndexChanged(object sender, EventArgs e) { int index = int.Parse(HFSeleccionIndexRow.Value); ... } </code></pre> <p>And the HiddenField (just in case):</p> <pre><code>&lt;asp:HiddenField runat="server" ID="HFSeleccionIndexRow" value="0" /&gt; </code></pre>
c# jquery asp.net
[0, 5, 9]
5,910,309
5,910,310
data import from excel facing an issue
<p>I am importing data from MS Excel. The code i have written is,</p> <pre><code>var ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + uploadfile.PostedFile.FileName + ";" + "Extended Properties=Excel 12.0;"; OleDbConnection objConn = new OleDbConnection(sConnectionString); objConn.Open(); try { var objCmdSelect = new OleDbCommand("select * from [Sheet1$]", objConn); } </code></pre> <p>and so on.</p> <p>I got an error which looks very generic to me</p> <p><strong>The Microsoft Office Access database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly</strong></p> <p>*</p> <blockquote> <p>My worksheet name is spelled correclty but for my confirmation, i did below code dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);</p> </blockquote> <pre><code>if(dt == null) { return null; } var excelSheets = new String[dt.Rows.Count]; int i = 0; // Add the sheet name to the string array. foreach(DataRow row in dt.Rows) { excelSheets[i] = row["TABLE_NAME"].ToString(); i++; } </code></pre> <p>* but i got my Data Table null. My question is the connection is open successfully but i can't read data from the excel file. <strong>Is there any special Authentication required.?</strong> because i am getting the above error.</p>
c# asp.net
[0, 9]
763,880
763,881
javascript/jquery- how to determine if a list/checkbox allows multiple values to be selected or not
<p>I am trying to parse through a typical form using jquery. I want to obtain all details about the various fields in the form- viz field name, field type (eg radio/checkbox/list)...</p> <p>How do I determine if a field allows multiple values to be selected? (eg in check box or list box)?</p> <p>If this cannot be done using jquery, then can it be done using pure javascript? I already have with me a ref to the element for which this (whether multiple values are allowed or not) has to be determined...</p>
javascript jquery
[3, 5]
2,196,985
2,196,986
Message Alert Tone
<p>I am working on an App that gets sms alerts and would like to control volume of alert tone based on device volume. How do I adjust alert notification sound in alignment with device master volume. Following code doesn't change volume of alert in my app based on device volume. Thank you.</p> <pre><code> volume = audioMan.getStreamVolume(AudioManager.STREAM_RING); mPlayer.setVolume(volume, volume); </code></pre>
java android
[1, 4]
3,587,762
3,587,763
javascript function that accepts (#id).val() returns wrong value
<p>I have a button with the id="kill".</p> <p>Here is my JavaScript:</p> <pre><code>$("#kill").click(function(){ getImage($(this).val()); }); function getImage(code){ var code, imgstr; imgstr="mypath/"+code+".png"; return imgstr; } </code></pre> <p>Unfortunately, the wrong value is getting returned. But if I assign the value inside the function getImage, like this:</p> <pre><code>$("#kill").click(function(){ getImage($(this).val()); }); function getImage(code){ var code="12", imgstr; imgstr="mypath/"+code+".png"; return imgstr; } </code></pre> <p>Then it returns the correct value. How can I fix this?</p>
javascript jquery
[3, 5]
1,857,166
1,857,167
Android touchevent on view even with dialog in front
<p>I am making video playback controls. All my code is present to make it work and it does, except for one thing. When I touch the surfaceview the controls come up, but once they are up, my surfaceview no longer has focused and doesn't receive touch events. What I need is for the surface view to still get touch events even with the dialog open. Also my dialog must also be able to receive touch events. How do I do this?</p>
java android
[1, 4]
5,598,620
5,598,621
Restarting countdown clock
<p>This is how it looks currently:</p> <pre><code>final CountDownTimer countdown = new CountDownTimer(5000, 1000) { public void onTick(long millisUntilFinished) { clock.setText("Seconds Remaining: " + millisUntilFinished / 1000); } public void onFinish() { qcount++; if (qcount &lt; 10) { this.start(); switch (diff) { case 0: //Novice difficulty </code></pre> <p>but it says the countdown variable isn't used and it doesn't run at all in the app.</p>
java android
[1, 4]
2,797,723
2,797,724
Jquery length of matched query
<p>How would I write both of these without using .each() and only using JQuery Selectors?</p> <pre><code>var xxxx = 0; $('.clonedInput').each(function(index) { if($(this).children().filter(':checked').length == 2) xxxx++; }); var num_normal_foods = 0; $('[id^="amount_"]').each(function(index) { if($(this).val() == '30.00') num_normal_foods++; }); </code></pre>
javascript jquery
[3, 5]
955,049
955,050
unhiding asp button onclick of the html button
<p>I have 2 buttons on my page. First one is a html button and the next is an asp button. Now i want to hide the asp button on page load and want to unhide the same on the onclick of the html button. Can anyone help me with this ??</p>
javascript asp.net
[3, 9]
5,531,384
5,531,385
How to redirect the site according to browser language?
<p>I am having 2 site in different language on same domain, </p> <p>Suppose, 2 language A and B, which run like below A site run from "<a href="http://site.com" rel="nofollow">http://site.com</a>" (default site). and B site run from "<a href="http://sit.com/b/" rel="nofollow">http://sit.com/b/</a>"</p> <p>if user browse the "<a href="http://site.com" rel="nofollow">http://site.com</a>" then if browser language is A then its open the default site and if browser language is set as "B" then it should open site like "<a href="http://sit.com/b/" rel="nofollow">http://sit.com/b/</a>". and if browser having any other language then in all cases it open only default site, </p> <p>Can anyone help me on this.</p>
c# asp.net
[0, 9]
1,369,734
1,369,735
Tabs and content into Array
<p>I have two tabs like in this example:</p> <pre><code>&lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;me&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#tabs-2"&gt;you&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tabs-1"&gt; &lt;ul id="sortable1" class="connectedSortable ui-helper-reset"&gt; &lt;li class="ui-state-default"&gt;Item 1&lt;/li&gt; &lt;li class="ui-state-default"&gt;Item 2&lt;/li&gt; &lt;li class="ui-state-default"&gt;Item 3&lt;/li&gt; &lt;li class="ui-state-default"&gt;Item 4&lt;/li&gt; &lt;li class="ui-state-default"&gt;Item 5&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id="tabs-2"&gt; &lt;ul id="sortable2" class="connectedSortable ui-helper-reset"&gt; &lt;li class="ui-state-highlight"&gt;Item 5&lt;/li&gt; &lt;li class="ui-state-highlight"&gt;Item 6&lt;/li&gt; &lt;li class="ui-state-highlight"&gt;Item 7&lt;/li&gt; &lt;li class="ui-state-highlight"&gt;Item 8&lt;/li&gt; &lt;li class="ui-state-highlight"&gt;Item 9&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to turn all of it into array's : me=>1,2,3,4,5 you=>5,6,7,8,9 any ideas? Thought maybe sortable1&lt; li.index and give every li id but how to connect it with tab? Little help would be nice.</p>
javascript jquery
[3, 5]
3,949,927
3,949,928
jQuery update form element
<p>I have a form that I create a checkbox on a click of a button. I am using <a href="https://github.com/pixelmatrix/uniform" rel="nofollow">https://github.com/pixelmatrix/uniform</a> which provides an update function to style dynamically create elements which does not work. I got a work around but my problem is that it also reset the already created elements so they double, triple etc.</p> <p>They are wrapped in a div with a class of <code>checker</code>. Is there a way to check if the div is around it first before applying my <code>$('.table').find('input:checkbox').uniform()</code>. I have tried different examples but they dont seem to work with my code and my jQuery is still limit.</p> <p>Thanks</p> <pre><code>&lt;div class="checker" id="uniform-160"&gt; &lt;span&gt; &lt;input type="checkbox" name="chbox" id="160" style="opacity: 0;"&gt; &lt;/span&gt; &lt;/div&gt; </code></pre> <p>jQuery:</p> <pre><code>$(".fg-button").live("click", function(){ $('.table').find('input:checkbox').uniform() }); </code></pre>
javascript jquery
[3, 5]
1,802,370
1,802,371
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]
639,641
639,642
jquery not function miss element
<p>I use a tool-tip to display error message on the page, I need it to be closed when I click elsewhere within the view. I use the below codes to control this action:</p> <pre><code>$(':not(.qtip)').click(function(){ $('.qtip').hide(); }); </code></pre> <p>The ".qtip" is used for marking the tool-tip area. The tool-tip itself creates a new one when it comes out, what happened here is when I click on the tool-tip, it disappears.</p> <p>But when I use a smaller scale of the selector instead of the whole body, it works fine, which is a little weird, for example:</p> <pre><code>$("#id").not('.qtip').click(function (){ $('.qtip').hide(); }); </code></pre>
javascript jquery
[3, 5]
3,374,020
3,374,021
jquery extension return $.each confusion
<p>I am trying to use a jQuery extension I came across (<a href="http://handsontable.com/" rel="nofollow">handsontable</a>). I am having no problem creating the table</p> <pre><code>var spreadsheet = $("#dataTable").handsontable({ rows: 3, cols: 15, minSpareRows: 2 }); </code></pre> <p>However after I create the table I want to call various helper functions I see declared in the javascript for the <code>Handsontable</code> object. The problem is the extension seems to return <code>this.each(function() { ... });</code> and I don't understand how I can access the underlaying <code>Handsontable</code> object from this. The js for the extension can be found <a href="https://github.com/warpech/jquery-handsontable/blob/master/jquery.handsontable.js" rel="nofollow">here</a> and I put a small demo together on the following link</p> <p><a href="http://jsfiddle.net/7JTG2/7/" rel="nofollow">http://jsfiddle.net/7JTG2/7/</a></p> <p>as you can see I would like get the data of one of the cells when I click a button.</p>
javascript jquery
[3, 5]
1,280,202
1,280,203
Get real height of div plus css generated content (if possible)
<p>I'm trying to use javascript to give three ULs nested inside divs a negative top position equal to their height. I've got it working, sort of (thanks to help from here!) but instead of calculating the height of each nested UL and calculating the top position accordingly, each UL is being assigned a negative top position of -367px:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { //Get height of footer popup var pHeight = $('footer ul li &gt; ul').outerHeight(); //Calculate new top position based on footer popup height var nHeight = pHeight + "px"; $('footer ul li &gt; ul').css({ //Change top position to equal height of footer popup 'top' : "-" + nHeight }); }); &lt;/script&gt; </code></pre> <p>I've tried this using <code>.height</code>, <code>.outerheight</code>, and even <code>.getheight</code> which someone mentioned on the Jquery documentation for <code>.height</code>. I also tried using an each statement, though it didn't seem to work; I may have written it incorrectly. </p> <p>In addition (if possible), I'd like the negative position to take into account the height of a content being generated using the css <code>:after</code> psuedo-property, though I can always manually add that in to the calculation if javascript has no way to access that.</p> <p><strong>EDIT:</strong> Added a test page link. It's the bottom divs (and nested ULs) I'm trying to target with JS; the "tails" on each box should line up at about 1.2em above their parent divs.</p> <p><a href="http://www.qualityprinters2.com/test/float-tab-test.html" rel="nofollow">http://www.qualityprinters2.com/test/float-tab-test.html</a></p>
javascript jquery
[3, 5]
2,330,271
2,330,272
how to limit the content to be shown on a page?
<p>I'm making a page which shows data, which is quite enormous.Tried pagination on it but didn't work the way I wanted. I'm looking for, something like "See more results", which on clicking will increase size of the page. Further, is it possible to do it with some limit on content to be shown on every click, like on every click it should show, say 10 or 15 rows ? </p>
php javascript jquery
[2, 3, 5]
3,726,944
3,726,945
JavaScript Postback on condition
<p>I need help with the javascript below please. I have 2 text boxes and 1 button on my form. What I would like to happen is if User enters a value in textbox one and not textbox two, then event need not be fired. However, if there is a value in textbox one and then textbox 2 then I want a post back to fire. My code below does not seem to be doing this at all and I would appreciate it if someone could help me fix this or better still figure it out. Thanks in advance</p> <pre><code>function Changed(textControl) { // alert(textControl.value); var conlength = document.getElementById('&lt;%=txtLength.ClientID %&gt;'); var conwidth = document.getElementById('&lt;%=txtwidth.ClientID %&gt;'); if (conlength != null &amp;&amp; conwidth != null) { if (conlength.value != null &amp;&amp; conlength.value != ' ' &amp;&amp; conwidth.value != null &amp;&amp; conwidth.value != ' ') { // ' ' corresponds to c#'s String.Empty __doPostBack(document.getElementById('&lt;%=btncalcboardfeet.ClientID %&gt;'), 'Calculate Board Feet Button event has been fired'); } } } </code></pre>
asp.net javascript
[9, 3]
3,447,761
3,447,762
Global variable in javascript not working properly
<p>I have an iframe issue ( little bit strange for me ) . The issue is that i have an iframe in my document, and there are several functions are operating different task on that iframe and for accessing the contents of iframe we use :</p> <pre><code>$("iframe").contents(); </code></pre> <p>So instead of writing this long statement i used a global variable :</p> <pre><code>var i = $("iframe").contents(); </code></pre> <p>But this is not working well, like</p> <pre><code>alert( i.find("someelement") ); </code></pre> <p>=> <code>undefined</code> </p> <pre><code>alert($("iframe").contents().find("someelement") </code></pre> <p>=> <code>[object]</code></p> <p>Whats the problem here?</p>
javascript jquery
[3, 5]
5,875,474
5,875,475
How can I write this jQuery statement shorter?
<p>I have this code. This works perfect but I just wanna know if it's possible to write it shorter or not? I looked at jQuery <a href="http://api.jquery.com/hasClass/" rel="nofollow">hasClass()</a> docs but didn't find anything useful.</p> <pre><code>$(this).hasClass('nw') ?'nw' :$(this).hasClass('ne') ? 'ne' : $(this).hasClass('sw') ? 'sw' : $(this).hasClass('se') ? 'se' : false ; </code></pre>
javascript jquery
[3, 5]