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
26,455
26,456
after inserting some script the dollar sign returns null
<p>javascript newbie here, I wrote a form in html and submitted it with an onchange event, but after I added a daterange picker in javascript the submission doesn't work. Here is my code:</p> <pre><code> &lt;form id="dash_form" method="get"&gt; &lt;div&gt;Select a Tag Bundle dimension:&lt;/div&gt; &lt;select name="dimension" id="id_dimension" onchange="$('form#dash_form').submit()"&gt; &lt;option value=""&gt;No dimension &lt;/option&gt; &lt;option value="Hello"&gt;Hello&lt;/option&gt; &lt;/select&gt; &lt;h4&gt;Please select a date range below:&lt;/h4&gt; &lt;div id="calendars"&gt;&lt;/div&gt; &lt;span&gt; &lt;input type="text" name="from" value="" id="start"/&gt; &amp;ndash; &lt;input type="text" name="to" value="" id="end"/&gt; &lt;/span&gt; &lt;/form&gt; &lt;script type="text/javascript" charset="utf-8" src="/site_media/crm/javascripts/prototype.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8" src="/site_media/crm/javascripts/timeframe.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; //&lt;![CDATA[ new Timeframe('calendars', { startField: 'from', endField: 'to', latest: Date.parseToObject({{Now}}), resetButton: 'reset' }); //]]&gt; &lt;/script&gt; </code></pre> <p>in firebug I get <code>$("form#dash_form") is null</code>, and when I remove the script lines it works... what can cause this?</p>
javascript jquery
[3, 5]
2,262,751
2,262,752
Checkbox for images in an ASP.NET repeater control
<p>I am working with ASP.NET. I am using a repeater to display images, and I also am using a check box for each image. </p> <p>How can I select individual images and update their values as per image id? </p> <p>My code is:</p> <pre><code> &lt;asp:Repeater ID="Repeater1" runat="server"&gt; &lt;ItemTemplate&gt; &lt;img ID="ImageZoom" runat="server" src='&lt;%# DataBinder.Eval(Container.DataItem, "ImageUrl") %&gt; ' style="display: inline; height:auto; left: 0pt; top: 0pt; width:auto;" /&gt; &lt;asp:CheckBox ID="CheckBox1" runat="server" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre>
c# asp.net
[0, 9]
3,649,343
3,649,344
Retrieving the XML feeds which corresponds to the search results that the user enters in Android Application
<p>I m supposed to implement Entertainment Guide using Android wherein the user is allowed to select a TV channel whose tv schedule should be displayed. here, we need to retrieve the corresponding XML feed based on the user's TV channel Selection. and this XML sheet needs to be parsed, so that the corresponding details of the Channel would be displayed......</p>
java android
[1, 4]
4,001,544
4,001,545
Echo Javascript Variable in Php to another page
<p>I have code which passes php variable to another page on my site:</p> <pre><code>echo'&lt;a class="btn btn-danger" style="margin-left:10px;width:120px;float:left;" href="fullsizemarket.php?imageid=',$imageid,'&amp;action=removed"&gt;Remove from Cart&lt;/a&gt;'; </code></pre> <p>I am able to retrieve the php variable $imageid by the following: </p> <pre><code>$imageid = htmlentities($_GET['imageid']); </code></pre> <p>I want to also pass in this code the value of a javascript variable. The variable is set in an earlier part of the code as follows: </p> <pre><code> var rowcount </code></pre> <p>I don't know how to pass var rowcount in the same echo code as I pass $imageid. What is the code to do this?</p>
php javascript
[2, 3]
3,629,719
3,629,720
Dynamically creating controls inside a repeater
<p>I have 2 Drop down controls inside a repeater and i have to repeat those with a button click how can i achieve it??</p> <pre><code>if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { TextBox t = new TextBox(); t.ID = e.Item.ItemIndex.ToString(); e.Item.Controls.Add(t); } </code></pre> <p>is this is the correct way but how can i find the button inside a repeater and fire it.</p>
c# asp.net
[0, 9]
1,765,369
1,765,370
iPhones jQuery show/hide conflict with auto scrolling slideshows
<p>There seems to be an issue with iPods and iPhones (4,4S, and probably 5). We have an autoscrolling slideshow utilizing Flex Slider. I have a toggle trigger to show and hide our menu (div). When the menu is toggled open and the slideshow auto scrolls to the next image the menu closes. On my Android phone (Android OS 4.1) it seems to work perfectly fine.</p> <p>Seems like the iDevices are having issues with the Javascript. Would this be a correct assumption? Anyone have a possible idea or solution to my issue?</p> <p>Thanks in advance.</p>
jquery iphone
[5, 8]
2,267,491
2,267,492
How to return response from webservice
<p>I have made a web service and clients will call its methods. Suppose one method takes four parameters and I want to check that if any one of these is empty I want to send a response back to the client and I want to send it like an alert so client knows what argument is empty. I can not force client to give all parameters accurate. Is this possible?</p> <pre><code>[WebMethod] Public void Method1(string str1,string str2,string str3,string str4) { if((str1=="") || (str2=="")) { //send response back to client in form of an alert } } </code></pre>
c# asp.net
[0, 9]
2,202,123
2,202,124
How to read a variable from another class?
<p>Im wondering how can I read a variable from one class's to another?</p> <p>I have two class's, triangle.java and screen.java</p> <p>in triangle.java I have: public double bound=0;</p> <p>how to I read that variable in Screen.java? </p> <p>triangle.java:</p> <pre><code>public class triangle extends Activity { public EditText txtbound; public double bound = 0; txtbound = (EditText)findViewById(R.id.txtbound); public double calculate() { bound=Double.parseDouble(txtbound.getText().toString()); // do maths here } } </code></pre> <p>and Screen.java has:</p> <pre><code>double bound1 = triangle.bound; </code></pre> <p>this doesnt work, how to I get the variable in Screen.java? thanks! </p>
java android
[1, 4]
1,860,213
1,860,214
adding php to javascript
<p>How can I add php variable to javascript e.g:</p> <pre><code>onClick="javascript:alert('echo $name;')Click Me&lt;/a&gt;*** </code></pre> <p>but it is not working</p> <p>i have not includey original becuse it is not showing original …!!</p>
php javascript
[2, 3]
4,079,640
4,079,641
asp.net range validator on textbox
<p>I have an <code>asp:textbox</code> with both required and range validators attached to it, where the code looks like this:</p> <p>ASP:</p> <pre><code>&lt;asp:TextBox ID="textBox1" runat="server" CausesValidation="true"&gt;&lt;/asp:TextBox&gt; &lt;asp:RangeValidator ID="rangeValidator1" runat="server" ControlToValidate="textBox1" MaximumValue="1" MinimumValue="0" ValidationGroup="valid" ForeColor="Red" ErrorMessage="Out of Range" /&gt; &lt;asp:RequiredFieldValidator ID="requiredValidator1" runat="server" ControlToValidate="textBox1" ValidationGroup="valid" ForeColor="Red" ErrorMessage="Cannot be blank" /&gt; </code></pre> <p>And when the page is dynamically loaded (after a quick callback), I have code that is supposed to change the <code>MaximumValue</code> of the RangeValidator to more specific value. Here is the code for that:</p> <pre><code>rangeValidator1.MaximumValue = GetMaxValue(params).ToString(); </code></pre> <p>Now, I have set a breakpoint, and <code>rangeValidator1.MaximumValue</code> is being set correctly, however, when the page loads, and I look at the compiled client side javascript, it appears that the maximum value is still only 1.</p> <p>What confuses me more is that any integer typed in will pass, as long as the first digit is a '1'. So if the maxValue is <em>supposed</em> to be something like "1234567", "1" will match, as will "12345678910". But "2" will not. Nor will "3000" or "46000". </p> <p>Has anyone else had a similar issue with RangeValidators on Textboxes?</p>
c# asp.net
[0, 9]
553,948
553,949
Padding text with ellipsis if it's too long
<p>Hi I'm trying to solve a jQuery problem. I'm using a wordpress plugin that creates a widget from recent posts. The plugin auto-generates some code that I'm sort-of trying to format/hack with CSS and jQuery. One of the items that is auto generated is a headline:</p> <pre><code>&lt;h4 class="srp-post-tilte"&gt;HEADLINE HERE&lt;/H4&gt; </code></pre> <p>My design depends on this headline not exceeding a given length. (about 45 characters). The plugin provides an option to add an elipsis after the headline for this very issue (I set it to 45 characters). The problem is that when the headline is under 45 characters the elipses still show up.</p> <p>So, I've turned off the feature and am trying to do it in jQuery. I'd only like to add an elipsis in situations where the headline is cropped to 45 characters. I tried this, but it's not working. </p> <pre><code>if ($j("h4.srp-post-title").val().length &gt; 44) { // Show the elipsis $j('h4.srp-post-title').append("..."); } else { // Don's show the elipsis (do nothing) $j('h4.srp-post-title').append(""); } </code></pre> <p>If anyone out there can help, it would be very much appreciated. You can see a live example at <a href="http://dreamlets.sfplanning.org/" rel="nofollow">http://dreamlets.sfplanning.org/</a> but be forewarned, there is a lot of CSS therein, so it may be tricky to decipher what's going on under the hood.</p> <p>Thanks in advance. Your help in resolving this is huuuuuugley appreciated.</p> <p>-Paul</p>
javascript jquery
[3, 5]
1,245,655
1,245,656
jQuery Countdown serverSync 15 hours difference
<p>I am using Keith Woods countdown timer (http://keith-wood.name/countdown.html) with the serverSync function. This seems to work great in a single country however when I check the countdown from a different country it seems there is 15 hours ish difference.</p> <p>So in Australia the countdown shows 1 day but in the US it shows 1 day 15 hours. I have implemented the server side code exactly as explained on the site but there is still the time difference. If I change my local clock it changes the countdown time but when hit refresh the countdown shows the correct amount of time so I know its getting the server time. However in the US there is still the time difference.</p> <p>Any ideas why this could be if its reading the server time?</p> <pre><code>function serverTime() { var time = null; $.ajax({url: 'server-time.php?random=' + Math.floor(Math.random() * 1000000), async: false, dataType: 'text', success: function(text) { time = new Date(text); }, error: function(http, message, exc) { time = new Date(); }}); return time; } var launchDate = ""; $(function () { launchDate = new Date( 2012, 5-1, 22, 11 ); $('#launchCountdown').countdown('destroy') $('#launchCountdown').countdown({ until: launchDate, serverSync: serverTime, format: 'DHMS', expiryText: '&lt;p&gt;It\'s all over&lt;/p&gt;' //onTick: highlightLast5 }); }); </code></pre>
php jquery
[2, 5]
2,292,002
2,292,003
Javascript Functions and default parameters, not working in IE and Chrome
<p>I created a function like this:</p> <pre><code>function saveItem(andClose = false) { } </code></pre> <p>It works fine in Firefox</p> <p>In IE it gives this error on the console: <code>Expected ')'</code></p> <p>In Chrome it gives this error in the console: <code>Uncaught SyntaxError: Unexpected token =</code></p> <p>Both browsers mark the source of the error as the function creation line.</p>
javascript jquery
[3, 5]
949,700
949,701
partial page update in jquery Simple Request
<p>i have simple request I'm beginner in jquery so all i want to do is to do </p> <p>button when i click it increment counter variable and update only label on page not all page also i will use same code to make clock in page thank you </p>
javascript jquery
[3, 5]
474,000
474,001
Simple $_GET question
<p>Hey, i am currently creating a pagination script using php and jquery and for some reason can't display the $_GET that im trying to grab.</p> <p>There is no form, but looking at the firebug console I get a url like this:</p> <pre><code>pagination.php?id=category </code></pre> <p>Just wondering how I can get that 'category' and just echo it out.</p>
php jquery
[2, 5]
2,949,942
2,949,943
Find dynamic control inside DevExpress Dockpanel
<p>I have a added a dynamic dev express dockPanel to my asxp page. Inside that dynamic dockPanel I dynamically create a dynamic gauge control. I want to perform a callback on the gauge to update its value. </p> <p>Currently the callback should be executed inside this ASPxTimer:</p> <pre><code>&lt;dx:ASPxTimer ID="ASPxTimer1" runat="server" Interval="5000"&gt; &lt;ClientSideEvents Tick="function(s, e) {gaugeControl1.PerformCallback();}" /&gt; &lt;/dx:AspxTimer&gt; </code></pre> <p>The problem is when I load the site, I get an error: Microsoft JScript runtime error: Unable to get value of the property 'parentNode': object is null or undefined</p> <p>It appears that the callback is trying to be performed on the dockPanel instead of the gauge. Any idea on how I can fix this?</p>
c# asp.net
[0, 9]
1,502,623
1,502,624
asp.net call javascript function from code behind
<p>I have to call the javascript from code behind.</p> <pre><code> &lt;script&gt; $(document).ready(function () { $(document).click(function () { test(); }); }); function test() { \\ blah } </code></pre> <p>The question is that there is no function name in the first part. Then my question is how to call this javascript from code behind? </p> <p>Thanks.</p>
javascript asp.net
[3, 9]
1,183,316
1,183,317
Open My Documents
<p>Hi I have a link to a file in 'my documents' this is an internal web site. How can I open the users local MY Documents folder using JS or JQ </p> <p>I used this code and thought the documents would appear in a web page but it didnt</p> <pre><code>address = "G:\systems Projects" ; window.open(address,"Detail ","width=800,height=600" ) </code></pre> <p>Any help appreciated ! , thanks </p>
javascript jquery
[3, 5]
3,071,906
3,071,907
how can I do a digest authorization?
<p>I need to do a digest authorization, I tried this <a href="http://stackoverflow.com/questions/12631354/apache-httpclient-digest-authentication-failed">Apache HttpClient Digest Authentication Failed</a> and this <a href="http://stackoverflow.com/questions/2954434/apache-httpclient-digest-authentication">Apache HttpClient Digest authentication</a> , but the server answered "HTTP/1.1 401 Unauthorized".</p> <p>is there any other way to do the digest authorization?</p>
java android
[1, 4]
1,809,323
1,809,324
Display Message on same popup window
<p>I want to display message on same customised popup window . Say for eg when i click on signin link a popup window comes and when i click on submit button , it get redirected to loginpage.php where php code for connection is written and other code of php is wriiten for database fetching . and if login credential match it get redirected to main page </p> <p>So what i want to do is when some one click on signin link and popup window open up and when clicked on submit button , if the credential dont match it should throw error on same popup window before it closes</p>
php javascript
[2, 3]
5,480,292
5,480,293
button click event automatically fires
<p>My situation is like this i have a asp button inside my user control </p> <pre><code> &lt;asp:Button ID="btnSubmit" Text="Send Notification" class="submit-btn01" onclick="btnSubmit_Click1" runat="server" /&gt; </code></pre> <p>in my browser when I refresh my page, button click event automatically happens.i cant figure out what is wrong with this..</p>
c# asp.net
[0, 9]
2,648,065
2,648,066
Sugestion for FB meta tags using jquery and php
<p>here is my problem:</p> <p>i have FB app, where i am getting data from json and using that data for making list of items in my main window, i can click on every item, and after i click it opens in new ajax window where i get more info about that item</p> <p>problem is about meta tags for FB, cos i have LIKE button for every item, so when i click on it, i can post that item on FB wall with infomations like title, picture and description</p> <p>i have this situation: when i click on item in my main window, it opens in new ajax window, and i manually add item it to the URL like this:</p> <pre><code>window.location.href=window.location.href + "?id=" + ID + "#id=" + ID; </code></pre> <p>and php code is this:</p> <pre><code> &lt;?php if(isset($_GET['id'])){ $json = file_get_contents("http:....." . $_GET['id'] . "&amp;..."); $json_array = json_decode($json); print '&lt;meta property="og:title" content="' . $json_array-&gt;title . '" /&gt; '; } ?&gt; </code></pre> <p>it all work all right, but i get problem with refreshing page, cos every time i click on item in my main window it open new window cos i add GET parameter in url</p> <p>so how can i avoid refreshing page and still have functionality for describe like option on FB wall</p>
php jquery
[2, 5]
5,411,194
5,411,195
jquery and condition statement: problem in fetching data
<p>I wrote this post function in my jquery plugin and then faced to a strange problem .</p> <p>Is the condition statement in this jquery code correct ?</p> <pre><code> if(info = "enabled"){ $("#mod"+mod_id+" &gt; img.status").attr("src","images/active.gif"); }else if(info = "disabled"){ $("#mod"+mod_id+" &gt; img.status").attr("src","images/inactive.gif"); }else{ $("#waiting"+mod_id).delay(2000).html(\'&lt;img src="images/error.png" /&gt;\'+data); } </code></pre> <p>Problem is that it only returns the value enabled and can't handle the "disabled" value</p>
php jquery
[2, 5]
1,564,000
1,564,001
How to get element/component name using JavaScript?
<p>I have a webpage that contains ASP.NET panels and JavaScript that gets all of the components in the page:</p> <pre><code>var items = Sys.Application.getComponents(); </code></pre> <p>I need to get the name/ID of each of the elements in the items variable. I have tried the following code: (but it doesn't work)</p> <pre><code>for (var item in items) { alert(item.name); } </code></pre> <p>What attribute of 'item' contains the name/ID? How can I modify the above code to do this?</p>
javascript asp.net
[3, 9]
157,603
157,604
Android Development using c#
<p>Is there a free way to develop apps for my Galaxy Tab (Androind 2.2) using c#? Or are there only paid solutions?</p>
c# android
[0, 4]
5,893,764
5,893,765
Resize iframe on content refresh or update
<p>I have an iframe that I would like to resize to match its contents whenever the contents auto refreshes (every few minutes) or when the user interacts with it. Although the contents are in the same domain, it would be difficult for me to modify the contents. Ideally, the iframe would just self adjust to the size of its contents.</p> <p>Current code that resizes only once:</p> <pre><code>&lt;iframe id="ganglia-frame" src="ganglia.url" width="100%" height="500%"&gt; blah not supported blah &lt;/iframe&gt; &lt;script language="Javascript"&gt; function setIframeHeight(iframe) { if (iframe) { var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow; if (iframeWin.document.body) { iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight; } } } $(window).load(function () { setIframeHeight(document.getElementById('ganglia-frame')); }); &lt;/script&gt; </code></pre> <p>Related question: <a href="http://stackoverflow.com/questions/819416/adjust-width-height-of-iframe-to-fit-with-content-in-it">Adjust width height of iframe to fit with content in it</a></p>
javascript jquery
[3, 5]
4,862,434
4,862,435
Updating one text box as text is typed in another text box, using jQuery
<p>I have created a webpage using HTML and jQuery. And I am using webpy framework. I have two text boxes in my html/webpage. I want to display the contents of first textbox in second textbox meanwhile I type in first textbox. How can I implement this using jQuery.</p>
javascript jquery
[3, 5]
1,742,490
1,742,491
dynamic button inside dynamic literal control
<p>I want to add dynamic literal control and dynamic button.</p> <p>so I try like this:</p> <pre><code> Literal lit = new Literal(); lit.Text = lit.Text + theRow["CaseExampleDescription"].ToString() + "\n\n"; Button btn = new Button(); btn.ID = "btn1"; lit.Controls.Add(btn); </code></pre> <p>but there is error -System.Web.UI.WebControls.Literal' does not allow child controls.</p> <p>How can I solve this?</p>
c# asp.net
[0, 9]
2,490,737
2,490,738
Need some explanation in python arrays
<p>I am converting a python algorithm to c#, and I need some explanation. So I have this list of lists: </p> <pre><code>offsets2 = [[(0.1, 0.1), (0.5, 0.1), (0.9, 0.1), (1.1, 0.1)], [(0.1, 0.5), (0.5, 0.5), (0.9, 0.5), (1.1, 0.5)], [(0.1, 0.9), (0.5, 0.9), (0.9, 0.9), (1.1, 0.9)], [(0.1, 1.0), (0.5, 1.0), (0.9, 1.0), (1.1, 1.0)]] </code></pre> <p>and this: </p> <pre><code>for offset in offsets2: offset = [(int(x + lane.width * dx), int(y + self.canvas.row_height * dy)) for dx, dy in offset] </code></pre> <p>and I am wondering what dx and dy are? I am guessing it's delta x and delta y, but just want to make sure, and also ask how to get them in c#.</p>
c# python
[0, 7]
3,012,989
3,012,990
Disable LinkButton when OnClick Event Fires
<p>I have an asp:LinkButton as follows:</p> <pre><code>&lt;asp:LinkButton ID="LinkButtonNewServicesCategory" runat="server" OnClientClick="this.disabled=true;return false;" style="float:left;margin-right:5px;" CausesValidation="False"&gt;new services category&lt;/asp:LinkButton&gt; </code></pre> <p>The intent is that when the LinkButton is clicked, it disables itself and returns false to prevent the postback (this control is used as a trigger for an animation). </p> <p>The behavior I'm experiencing is that the LinkButton correctly triggers the animation and returns false, but does not disable itself. </p> <p>It's inside an updatepanel, but I'm sure that no postback is occurring. </p> <p>Why doesn't this.disabled=true work?</p>
asp.net javascript
[9, 3]
4,028,199
4,028,200
How to monitor iframe from parent website?
<p>I have a website called A i want to include another website called B into A using iframe. Website B is an e-shopping site. I want to monitor all the pages of B through A. Is it possible? </p>
javascript jquery
[3, 5]
1,890,290
1,890,291
Function "remembers" value problem
<p>This is a simplified partial version of my code to demonstrate the issue:</p> <pre><code>function testFunc(){ var randomNum = Math.floor( Math.random() * 100 ); if( !flag ){ addEvents(); flag = true; }; function checkNumber(){ alert(randomNum) } function addEvents(){ $("#someElement").click(function(e){ checkNumber() }); } } </code></pre> <p>I want to bind the click event only ONCE for this element, but use outside variable that changes from someplace else. thing is, this always alerts randomNum with the initial value it had when the bind first took place! </p> <p>why doesn't it "reads" the variable everytime click is triggered?</p>
javascript jquery
[3, 5]
282,753
282,754
val() returning html() instead of undefined for <option> tag when no value attribute is set
<p>Consider the following HTML:</p> <pre><code>&lt;select&gt; &lt;option value="hasAttr"&gt;Has a value attr&lt;/option&gt; &lt;option&gt;Does not have a value attr&lt;/option&gt; &lt;/select&gt; </code></pre> <p>As you can see, one of the options has a value attribute set and the other does not. However, when I go to check the <code>val()</code> for each of the options via jQuery, the option that does not have a value attribute set is returning the text inside of the tag (<code>html()</code>) instead of <code>undefined</code> as I would normally expect. </p> <pre><code>var $select = $('select'); $select.each(function() { var $this = $(this), $options = $this.children('option'); $options.each(function(){ var $option = $(this), $value = $option.val(), $html = $option.html(); console.log('Option Value: '+ $value +'\nOption HTML: '+ $html); }); }); </code></pre> <p>Even if I change the code to look for <code>$option.attr('value')</code>, I still get the same results. Is there a way that I can check to see if an <code>&lt;option&gt;</code> has a <code>value</code> attribute present that will return boolean?</p> <p>Here is a <a href="http://jsfiddle.net/cVJux/" rel="nofollow">jsFiddle</a>.</p> <hr> <p>Updated <a href="http://jsfiddle.net/cVJux/2/" rel="nofollow">jsFiddle</a> with solution.</p>
javascript jquery
[3, 5]
1,848,910
1,848,911
Can't fire click event on the elements with same id
<p>Could you help me to understand - where I made the mistake. I have the following html code:</p> <pre><code>&lt;div id="container"&gt; &lt;a href="#info-mail.ru" id="getInfo" onClick="return false;"&gt;Info mail.ru&lt;/a&gt; &lt;/div&gt; &lt;div id="container"&gt; &lt;a href="#info-mail.com" id="getInfo" onClick="return false;"&gt;Info mail.com&lt;/a&gt; &lt;/div&gt; &lt;div id="container"&gt; &lt;a href="#info-mail.net" id="getInfo" onClick="return false;"&gt;Info mail.net&lt;/a&gt; &lt;/div&gt; </code></pre> <p>and the following js code (using jQuery):</p> <pre><code>$('#getInfo').click(function(){ alert('test!'); }); </code></pre> <p><a href="http://jsfiddle.net/dizpers/Xde7K/" rel="nofollow">example here</a></p> <p>"Click" event fired only on first link element. But not on others.</p> <p>I know that each <strong>ID</strong> in html page should be used only one time (but <strong>CLASS</strong> can be used a lot of times) - but it only <strong>should</strong> (not <strong>must</strong>) as I know. Is it the root of my problem?</p> <p>TIA!</p> <p><strong>upd:</strong> Big thx to all for explanation!:)</p>
javascript jquery
[3, 5]
285,260
285,261
OLE Object in Crystal Report
<p>I am very-very confused how to use OLE Object in Crystal Report </p> <p>I am performing the following steps :-</p> <p>(RC - Insert- OLE OBJECT). Select From File : Select an Image and Place Ole Object to Crystal Report.</p> <p>But after doing that if you are trying to show preview then nothing will be shown here.</p> <p>So please describe me what is the problem behind that.</p>
c# asp.net
[0, 9]
2,676,235
2,676,236
Communicating with iFrame contents
<p>There is an iFrame that contains a whole document <code>(&lt;html&gt; to &lt;/html&gt;)</code>. This document contains some <code>script</code> tags too. My question is, can we call the functions of the scripts which are present in the iFrame?</p>
javascript jquery
[3, 5]
1,347,806
1,347,807
Performance in jQuery with selectors
<p>i was wondering things...</p> <p>If i need to get the content or append an click function to an div, as the structure of the selectors it's something like that:</p> <pre><code>$('body #content #sidebar .modalwindow #global-content') </code></pre> <p>i want to target #global-content, the final id of the selectors. what its better? Just target it as $('#global-content') and do what i wanna or give to it all the path?</p>
javascript jquery
[3, 5]
2,255,071
2,255,072
source only allowed values in JQuery UI autocomplete plugin
<p>Is is possible to restrict the user input to only the source values with <a href="http://jqueryui.com/demos/autocomplete" rel="nofollow">JQuery autocomplete plugin</a>?</p> <p>For example, if the source array contains <code>"Bold","Normal","Default","100","200"</code>, the user is allowed to only type those values.</p>
javascript jquery
[3, 5]
1,966,740
1,966,741
Align text with radio button
<p>In below script : </p> <pre><code>&lt;script type="text/javascript" charset="utf-8" src="http://static.polldaddy.com/p/6352993.js"&gt;&lt;/script&gt; &lt;noscript&gt;&lt;a href="http://polldaddy.com/poll/6352993/"&gt;This is very long test question to test how polldaddy handles questions that exceed that normal length............ yes a very long question indeed..............&lt;/a&gt;&lt;/noscript&gt;​ </code></pre> <p>I amending the width of the text so it fits into 220px. This causes the text to wrap underneath the radio button if it is of a certain length. As shown in this fiddle : </p> <p><a href="http://jsfiddle.net/25LjE/8/" rel="nofollow">http://jsfiddle.net/25LjE/8/</a></p> <p>The options should wrap to right of radio button as shown in diagram : </p> <p><img src="http://i.stack.imgur.com/8Z4oX.png" alt="enter image description here"></p> <p>Is this possible ? I think I need to amend the class "pds-answer-span" ?</p>
javascript jquery
[3, 5]
4,175,983
4,175,984
.NET Get logged in user
<p>My problem is that I have a asp.net solution that uses a seperate project for logging and now I want the log to save the logged in user. Windows authentication is used for the webapp and the app pool is run under a service account. So when I call the logger through a method(static) I want the logger to pick up who is the logged in user. The only thing I currently get is the service account that the app pool run under.</p> <p>Any ideas of how to get the user from the webapp?</p>
c# asp.net
[0, 9]
5,666,185
5,666,186
Android/Java: Convert any string to color (hex)
<p>Is there any way to generate a color from any String in Java / Android like an Encrypt / Hash function?</p> <p>Example: The String "Home" generates a color like "#FF1234".<br> The String "Sky" generates a color like "#00CC33" ...</p> <p>Without randomize. So, the system will always calculate the same colors for that strings </p> <p>Thanks</p> <p>EDIT: The Strings are freely defined by the user</p>
java android
[1, 4]
4,884,292
4,884,293
Why my code to set the checked state of a checkbox with query doesn't work?
<p>Why this works</p> <pre><code> document.getElementById("myCheckbox").checked = false; </code></pre> <p>whereas this doesn't with jquery:</p> <pre><code> $("myCheckbox").attr("checked") = false; </code></pre>
javascript jquery
[3, 5]
4,784,651
4,784,652
Customize web site for Anonymous users and remember settings and information
<p>I have a E-Shop Site and I need some customization for my users like following :</p> <ol> <li>Store favorite products in their own basket.</li> <li>Customize products list in order to what are their favorite.</li> <li>It must remember their basket next time they want to visit our site.</li> </ol> <p>my question is how I can store information for my customers who are new to my web site also most of customers don't like to have username and password then login first they like to buy during a week and at the end of week pay for them then we can send some products to their locations.</p> <p>I have already written my application using asp.net with framework 4.0. So what is the best solution ?</p>
c# asp.net
[0, 9]
776,962
776,963
categorizing data in in to hash map
<p>I have a javascript object in the following format and I am trying to categorize it</p> <pre><code>var inputFacetArray=[ { category: "Company" , name: "nokia" }, { category: "Persons" , name: "ben affleck" }, { category: "Persons" , name: "daniel craig" }, { category: "Persons" , name: "george clooney" }] </code></pre> <p>I am trying to get it in to the output format</p> <pre><code>[{Persons:["george clooney", "daniel craig", "ben affleck"]}, {company:["nokia"]}] </code></pre> <p>My code is following</p> <pre><code>var facetCategorizedArray=[]; for(var k=0; k&lt;inputFacetArray.length; k++){ var l={}; inputFacetArray[k]["name"].push(l[inputFacetArray[k].category]); facetCategorizedArray.push(l); } </code></pre> <p>above code is not working.</p>
javascript jquery
[3, 5]
5,285,877
5,285,878
Include jQuery, if not included already
<p>I want to include the jquery in file, if not included already in the page. How can I do this?</p> <p>I wrote this, but it's giving undesired output.</p> <pre><code>&lt;script type="text/javascript"&gt; if ('undefined' == typeof window.jQuery) { // jQuery not present // alert("Jquery Unavailable"); &lt;?php echo '&lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"&gt;&lt;/script&gt;'; ?&gt; } else { // jQuery present alert("Jquery Available"); } &lt;/script&gt; </code></pre>
php jquery
[2, 5]
3,947,963
3,947,964
How to select different input type at the same time?
<p>Is it possible to do something like this in jQuery to select multiple input control so that I can bind the onchange event on all of them at the same time.</p> <pre><code>jQuery('div input[type=(text|select|radio|checkbox)]') </code></pre> <p>or is it something like this <code>jQuery('div input[type=*]')</code> ?</p>
javascript jquery
[3, 5]
5,219,275
5,219,276
Customizing the sort functionality of JavaScript arrays
<p>I have this very simple sort method:</p> <pre><code>sortByNumericAttr : function (a, b,attr){ a = a[attr]; b = b[attr]; return ((a &lt; b) ? -1 : ((a &gt; b) ? 1 : 0)); } </code></pre> <p>the idea here is that I have different objects with different attr that needs sorting (id,type etc.), so i thought instead of writing different sort function for each (where all the difference is only the sorted attribute), I'd write a generic method and pass the attribute to it.</p> <p>So if it is written like this i can call it like:</p> <pre><code>arr.sort(utils.sortByNumericAttr,'typeId'); </code></pre> <p>How can I achieve this or a similar effect, based on this function?</p>
javascript jquery
[3, 5]
551,043
551,044
how to make a file uploading detail
<p>i am implementing a uploading box in my site,The file got uploaded successfully but i want to make a box or loading bar which shows me detail of uploading like how much file is uploaded or what is the speed of transfer,I am bit confused with this, i want to know what is the logic behind this,Any help will be appreciated.</p>
php jquery
[2, 5]
5,850,998
5,850,999
javascript bug in firefox with string manipulation
<p>I have the following function in javascript. It works in every browser except firefox. There seems to be some problems with the substring keyword in this browser.</p> <pre><code>function EvalMonthYear() { var RawMonth = $.trim( $('#MonthList').val() ); var SpacePosition = RawMonth.lastIndexOf(' ') + 1; var TheYear = $.trim(RawMonth.substring(SpacePosition, RawMonth.lenght)); var TheMonth = IndexOfMonth($.trim(RawMonth.substring(0, SpacePosition))); }; </code></pre> <p>MonthList contains a month/year string such as January 2011 or May 2009. The goal is to fill the variables TheYear and TheMonth so that it works in every browser.</p> <p>If you've run into this problem and can think of a good solution this would be helpful.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,417,994
4,417,995
Can views be added within GridView cells?
<p>I'm trying to create the following screen in my android app:</p> <p><img src="http://i.stack.imgur.com/vuC0n.png" alt="enter image description here"></p> <p>Except I may need to list up to 9 or more teams. I've been looking at GridView, but I can't find anything in the <a href="http://developer.android.com/reference/android/widget/GridView.html" rel="nofollow">GridView docs</a> or <a href="http://developer.android.com/reference/android/widget/ListAdapter.html" rel="nofollow">ListAdapter docs</a> to show that I can do that. Is this possible or am I looking in the wrong place?</p>
java android
[1, 4]
1,408,073
1,408,074
trigger failure in jquery trigger
<pre><code>$(document).ready(function(){ jQuery("#but1").bind("click",function(e){ alert(e.name); }); jQuery("#but1").trigger({name:'Dmy', surname:'My'}); }); </code></pre> <p>The alert fails to pass the data, why is that?!? the alert says 'undefined'. </p> <p>What am I doing wrong, why I fail to pass the data?</p> <p><a href="http://jsfiddle.net/RTXxY/23/" rel="nofollow">JSFiddle</a> here.</p>
javascript jquery
[3, 5]
4,795,599
4,795,600
Dynamically changing an object parameter with jQuery
<p>I have the following HTML (simplified and stripped for purposes of this question):</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;My page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;object id="myExp" class="myClass"&gt; &lt;param name="bgcolor" value="#ffffff" /&gt; &lt;param name="wmode" value="transparent" /&gt; &lt;param name="width" value="560" /&gt; &lt;param name="height" value="310" /&gt; &lt;param name="id" value="1535" /&gt; &lt;/object&gt; &lt;script type="text/javascript"&gt; function changeId(id) { // $('#myExp'). } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>What I am trying to do is make the <code>changeId()</code> function work. What it should do is replace my <code>&lt;param name="id" value="1535" /&gt;</code> line above with whatever <code>id</code> is passed into the function. How can I use jQuery (or plain old javascript, if need be) to dynamically change the <code>id</code> of the <code>object</code>/<code>param</code> value?</p>
javascript jquery
[3, 5]
4,339,248
4,339,249
Manipulating one of many?
<p>I have some markup, like so...</p> <pre><code>&lt;div id="items"&gt; &lt;div class="item"&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;/div&gt; &lt;div class="item"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want to write some functions to affect each one using jQuery. Something like...</p> <pre><code>$(".item").click(function(i){ i.hide(); }); </code></pre> <p>Can someone give me a brief explanation how to make this work? Should I use .each()?</p>
javascript jquery
[3, 5]
796,401
796,402
jQuery iterate through HTML in a variable and remove first radio button
<p>I have a some HTML stored in a javascript variable that looks like below. Example looks like below.</p> <pre><code>var divHTML = "&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;input type='radio' name='radio_1'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;tr&gt;&lt;td&gt;&lt;input type='radio' name='radio_2'&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;; </code></pre> <p>I would like to iterate through the <code>divHTML</code> and remove the first radio button along with the <code>&lt;tr&gt;&lt;/tr&gt;</code> that wrapped around it and return the rest of the HTML. (could acheive the same by removing the first <code>&lt;tr&gt;&lt;/tr&gt;</code> as well I think - as it will remove what's inside but the end goal is to not see the first radio button).</p> <p>Also created a JSFiddle with the string in place. <a href="http://jsfiddle.net/chin/ZDwTd/" rel="nofollow">jsFiddle</a> Please help. Hope the question is clear and many thanks in advance. </p>
javascript jquery
[3, 5]
3,330,960
3,330,961
How does jQuery protect overwriting jQuery and $
<p>These variables are located immediately after defining a local copy of jQuery in the <a href="http://code.jquery.com/jquery-1.4.4.js" rel="nofollow"><strong>jQuery source</strong></a>.</p> <pre><code>// Map over jQuery in case of overwrite _jQuery = window.jQuery // Map over the $ in case of overwrite _$ = window.$ </code></pre> <p><em>One can read the comments and know the why... but</em></p> <ul> <li><p><strong>How</strong> do these lines of code do this? </p></li> <li><p>Would adding something similar protect my personal namespace or is there more too it deeper in the source?</p></li> <li><p>What is an example of something bad that could happen if this weren't in the source code?</p></li> </ul>
javascript jquery
[3, 5]
3,209,294
3,209,295
Adding a counter to a slideshow
<p>Hi Does anyone know how I would go about adding a counter (i.e. 1/12, 2/12, 3/12 etc.) to this slideshow?</p> <p><a href="http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow" rel="nofollow">http://www.switchonthecode.com/tutorials/jquery-creating-a-slideshow</a></p> <p>Also, I would like the option to have another button that takes the user back to the first image at any given point during the slideshow. </p> <p>Any help on this would be really appreciated.</p> <p>Thanks!!</p>
javascript jquery
[3, 5]
3,911,290
3,911,291
Facebook query Language
<p>Dear all, How can i use FQl(facebook query language ) in my application to </p> <p>1)GetOnline friends 2)Get Images 3Upload Photos and more features </p>
java javascript
[1, 3]
5,108,061
5,108,062
ShowModalDialog of javascript is not closing from ASP Code behind and opening a new pop up of same page
<p>i m opening an Webpage(Clock.aspx) from window.showModalDialog of javascript.In the Clock.aspx i have a button and i want that when the user click on that button the Clock.aspx page will be closed. I dont want to use onClientClick() method of javascript as some server side database insertion is going on and after the insertion i want to close this page.</p> <p>The Code behind of the button is as follows:-</p> <pre><code>protected void btnStop_Click(object sender, EventArgs e) { _nonProduction = new NonProduction(); if (Session["LastNonProdTimeID"] == null) { } else { int NonProdTimeEntryID = Convert.ToInt32(Session["LastNonProdTimeID"]); //Updating the TimeSpent isTimeSpentUpdated = _nonProduction.UpdateTimeSpentInDB(NonProdTimeEntryID); if (isTimeSpentUpdated == true) { string timespent = Convert.ToString(_nonProduction.GetTimeSpent(NonProdTimeEntryID)); string msg = "Total time consumed in " +HiddenTaskname.Value.ToString()+": " + timespent.ToString() + " Minutes"; ClientScript.RegisterStartupScript(typeof(Page), "closePage", "&lt;script type='text/JavaScript'&gt;window.close();&lt;/script&gt;"); //ShowPopUpMsg(msg); } else { } } } </code></pre> <p>Here when i m clicking on the Button one more (Clock.aspx)pop up is appearing and window is not closing. Please help me that how i close the ShowModalDialog from server side code. I m using Script manager in my page also. Thanks in Advance. </p>
c# javascript asp.net
[0, 3, 9]
417,955
417,956
Getting a radio button immediately by clicking a label with jQuery
<p>I've got some radio buttons styled to be hidden with the labels visible and styled as I want them.</p> <p>The problem is when I click a label I don't get the radio button's value on the first click.</p> <p>If you look here you can see what I mean: <a href="http://jsfiddle.net/bQwtK/1/" rel="nofollow">http://jsfiddle.net/bQwtK/1/</a></p> <p>Is there a way to get the value on the first click?</p> <p><strong>ANSWER-</strong> Thanks to asawyer and blocco- <a href="http://jsfiddle.net/bQwtK/14/" rel="nofollow">http://jsfiddle.net/bQwtK/14/</a></p>
javascript jquery
[3, 5]
1,431,776
1,431,777
to set value parent page's frame from popup
<p>I want to set label's value from popup.But label is in frame and I dont know how to achieve it from popup. From parent page,i get this label by following javascript function.</p> <p>But when I use this function in popup page, I cant find topframe.Do u have any solution about how to success it? </p> <pre><code>if (window.parent.document.getElementById('lbl')) { window.parent.document.getElementById('lbl').innerText = sender.getSelectedItem().get_text(); } else { window.parent.frames['topFrame'].document.getElementById('lbl').innerText = sender.getSelectedItem().get_text(); } </code></pre>
asp.net javascript
[9, 3]
3,686,188
3,686,189
jQuery animate to offset/position
<p>I'm using jQuery animate to change the position of an element:</p> <p><code>$('#item').animate({'top' : '-50'}, 0);</code></p> <p>I don't need the animation, I just want to set the position. I tried both <code>offset</code> and <code>position</code>, but neither seemed to work right.</p> <p>How should update this to not use animate?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
4,301,058
4,301,059
jQuery - Show and hide last 4 numbers of a phone number
<p>How can I show and hide the last 4 numbers of a phone number by replacing it with something like 949XXXX and when you click on it show the rest of the numbers?</p> <p>I just want to do this with jQuery/JavaScript.</p>
javascript jquery
[3, 5]
3,609,240
3,609,241
Div width resize based on how many radio buttons are selected
<p>Basicly theres 2 divs open by default, the one of the left is always there and then you have 3 radio buttons. Atleast one must be selected (can't have "default" column all by itself). By default, the "default" div and "1" is there, and "2" and "3" are invisible (display:none). Each radio button is linked to specific div, so when clicked, jQuery will animate width to merge the selected div into the overall div with the other visible divs. How would this be achievable with jQuery?</p> <p><a href="http://imgur.com/HGvJ9" rel="nofollow">Picture</a> &lt;-----i have a link to a picture i made for a better understanding</p>
javascript jquery
[3, 5]
5,964,753
5,964,754
Need assistance in editing javascript to add options to a slider so it will loop
<p>I have slider content (images) within tags in html and need my js to loop through all the inner divs or basically return to the beginning when it hits the last one. I won't know how many total images there are but it should detect and do a continuous loop. Currently, the user clicks to advance and I'd like to keep it that way. Thanks for looking.</p> <p>JS</p> <pre><code>$('.slide_arrow').click(function(){ var hs = $('.main_slide').animate({left: '-=960'}, 1000); }); </code></pre> <p>HTML</p> <pre><code>&lt;div class="main_slide"&gt; &lt;div class="inner_slide"&gt; &lt;img src="/images/hero_box_placeholder.jpg" /&gt; &lt;/div&gt; &lt;div class="inner_slide"&gt; &lt;img src="/images/hero_box_placeholder2.jpg" /&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Perhaps something along the lines of: $('.inner_slide').continuous(true);</p> <p>-- using jquery/1.6.2/jquery.min.js</p>
javascript jquery
[3, 5]
2,946,232
2,946,233
How to Run a jQuery or JavaScript Before Page Start to Load
<p>I have a script that I want to run before the page start to load. The script checks the value of a variable and depending on the value redirect the user to a new page.</p> <p>I can successfully check the variable and redirect if needed but the page still loads and display empty page but then quickly redirects to the other page. I don't want that empty page to be displayed on the page at all before the redirect.</p> <p>Thank you, Ver</p>
javascript jquery
[3, 5]
5,608,580
5,608,581
Storing array of data into input with jQuery
<p>Each time the user clicks over a checkbox I add a couple of values to a hidden input value. </p> <p>Each checkbox stores 2 values and it looks like this:</p> <pre><code>&lt;input type="checkbox" class="first" value="9598864;3"&gt; </code></pre> <p>Where the first value would be: <code>9598864</code> and the second: <code>3</code>.</p> <p>Currently I am adding data to the input in this way:</p> <pre><code>var currentValue = $('#myInput').val(); var text; //adding the value to the input + separator "-" if($(this).is(':checked')){ $('#myInput').val(currentValue + "-" + $(this).val()); } //erasing the value from the input + separator "-" else{ text = currentValue .replace("-" + $(this).val(), ""); $('#myInput').val(text); } </code></pre> <p>The result is something like this:</p> <pre><code>&lt;input type="hidden" name="demo" value="-9582856;3-9598864;3" id="myInput"&gt; </code></pre> <p>Where i get an array of 2 elements each one with another 2 elements inside:</p> <p><strong>Element 1:</strong></p> <blockquote> <ul> <li>9582856</li> <li>3</li> </ul> </blockquote> <p><strong>Element 2:</strong></p> <blockquote> <ul> <li>9598864</li> <li>3</li> </ul> </blockquote> <p>What I am doing now is processing the data on the server side (PHP) and exploding those strings by <code>-</code> and <code>;</code> to get the desirable elements. </p> <p>Is there any other better way to accomplish this task? Which would be the correct way to store an array of data inside an input using jQuery or Javascript?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
6,022,405
6,022,406
It it possible to attach a global handler two different objects, and then remove just one of them?
<p>Suppose I make a global handler for closing a popup :</p> <pre><code> mouseup_handler: function(item, mouse_is_inside){ if(!mouse_is_inside) { close_box(item); return false; }; }, </code></pre> <p>And I attach it as so :</p> <pre><code>$("body").bind('mouseup', function(){ mouseup_handler($popup, mouse_is_inside); }); </code></pre> <p>But let's say I have two objects that the <code>body</code> needs to be responsible for closing. </p> <p>Now when I call the close of one of the objects :</p> <pre><code> $("body").unbind('mouseup'); </code></pre> <p>Both, or any mouseup handlers attached to the body are removed. I could be more specific and say :</p> <pre><code>$("body").unbind('mouseup', mouseup_handler() ); </code></pre> <p>But this would still cause the same problem with all <code>mouseup_handler()</code>'s to be removed.</p> <p>How can I allow the <code>body</code> to differentiate between the two ( or many ) yet write the most minimal amount of code that can be shared between the two objects for the same handler?</p>
javascript jquery
[3, 5]
4,370,454
4,370,455
Call Jquery Server side asp.net
<p>i want to use <a href="http://www.erichynds.com/examples/jquery-notify/" rel="nofollow">this</a> plugin on my asp.net application. I am serializing my title and text serverside with <a href="http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx" rel="nofollow">this</a> class. and i have no problem to show it. but my challenge is : i am loading titles and Contents of notifies from database. i have no problem with load and selecting from Database. i want to refresh notifies on every page load for user. for example 4 row added to Notification Table on database. how can i serialize 4 valuable and binding it to Source and title property of JQUERY notification plugin and displaying 4 notifier to user dynamically ? for 1 valuable that i want to bind to a jquery property plugin i am using this code snippet:</p> <pre><code>JavaScriptSerializer serializer = new JavaScriptSerializer(); string jsArray = serializer.Serialize(my public Variable that is binded to Jquery plugin); </code></pre> <p>i am binding public c# valuable to jquery plugin in this type :</p> <pre><code> title : &lt;%=C# Variable%&gt; </code></pre> <p>how can i use this method to displaying notifiers to user dynamically? is there any better method? i want to show notifies on all pages. have i to put codes on Basepage? English Is not my frist language . Does my question Clear? thanks all</p> <p>For example i have 4 new notification in database i am loading them in memory how can i displaying them as notification to user. i said i have no problem to display one my problem to display them dynamically depend on my updates on database on each page load. thanks all</p>
c# asp.net jquery
[0, 9, 5]
1,898,827
1,898,828
Using an application in Landscape mode also?
<p>I've an application running successfully, the application runs only in portrait mode only, if i'm going to change this to landscape, it's also possible to change. But, it won't never come to portrait mode. How can i use these (portrait &amp; landscape) in same time? Is it possible? Thanks in advance.</p>
java android
[1, 4]
5,006,374
5,006,375
What is it in Java standard library that Python's lacks?
<p>I hear that the Java standard library is larger than that of Python. That makes me curious about what is missing in Python's?</p>
java python
[1, 7]
1,349,994
1,349,995
Add and transform layers of images and text like Photoshop fx
<p>This is just a question of approach and ideas, rather than solving an issue.</p> <p>You know it from Photoshop, where you can add layers of text and images onto each other and transform and move them around to design a complete image. </p> <p>What do you call this? And do you know some jQuery plugins that does this?</p> <p>Thank you in advance.</p> <p>EDIT: I don't need any other Photoshop feature, as blending, filters etc.</p>
javascript jquery
[3, 5]
2,705,942
2,705,943
what does jQuery(function) do
<p>I am reading <code>javascript</code> web application and the author is using following code:</p> <pre><code>mod.load = function(func){ $($.proxy(func, this)); }; </code></pre> <p>Can someone help me to understand why returning function from <code>jQuery.proxy</code> is inside <code>jQuery</code> wrapper. </p> <p>Is this the same as:</p> <pre><code>mod.load = function(func){ var temp = $.proxy(func, this); temp(); }; </code></pre>
javascript jquery
[3, 5]
2,134,375
2,134,376
image preloader not working in IE
<p>I have the following code to preload images:</p> <pre><code>preloader : function(images) { var imgCount = images.length; var counter = 0; $.each(images, function(i, n) { alert('hi'); // load each image $("&lt;img /&gt;").attr("src", n).load(function() { counter++; if(imgCount == counter) { $('#loader').hide(); $('#wheel').show(); } }); }); } </code></pre> <p>which I'm calling like so:</p> <pre><code>preloader(['../images/image1.png','../images/image2.png','../images/image3.png']); </code></pre> <p>It works fine in firefox but in IE it doesn't work. I get all 3 alerts back so the each loop runs but it only ever loads the first image. If I out just one image in the array I get in to the final if statement and the div's are shown and hidden. But any more than one image and Ie trips up. As i say this works fine in FF so it's not a problem with paths to images or images missing etc.</p> <p>Any idea? I'm really stumped on this.</p>
javascript jquery
[3, 5]
5,696,352
5,696,353
Formview paging controls not showing
<p>I have a formview which displays a recordset based on a parameter supplied by a dropdownlist. The formview has "AllowPaging = True".</p> <p>The first time the dropdownlist is changed, the formview shows the (correct) first row of the retrieved recordset but the paging controls are missing. From that point on, when the dropdownlist is changed, the formview works as expected, showing the correct page controls.</p> <p>What do I need to do to have the formview show the page controls the first time it is activated?</p>
c# asp.net
[0, 9]
621,608
621,609
Change Input to Upper Case
<p>JS: </p> <pre><code>&lt;script type="text/css"&gt; $(function() { $('#upper').keyup(function() { this.value = this.value.toUpperCase(); }); }); &lt;/script&gt; </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;div id="search"&gt; &lt;input type="radio" name="table" class="table" value="professor" tabindex="1" /&gt; Professor &lt;input type="radio" name="table" class="table" value="department" tabindex="2" /&gt; Department &lt;input type="radio" name="table" id="upper" class="table" value="course" tabindex="3" /&gt; Course &lt;input type="text" name="search" class="keywords" value="Select an option..." onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?':this.value;" tabindex="4" /&gt; &lt;div id="content"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Why is this still not working?? Just trying to call div ".keywords" from JS.</p>
javascript jquery
[3, 5]
1,093,183
1,093,184
Does Jquery add value to Java / Java EE programmer?
<p>I am a Java EE Programmer, I came across Jquery some where in Stack over flow, If I am Planning to learn Jquery</p> <p>My question is 1) Does Jquery Add any additional weightage in my Java / Java EE Career</p> <p>2) If Yes, What way it can help me </p> <p>3) Please share the links where I can learn Jquery</p>
java javascript jquery
[1, 3, 5]
785,117
785,118
content filter hides everything when it is told to filter nothing
<p>I have this content filter that filters <code>&lt;div&gt;</code>s with the class of container (div.container) by hiding those div that do not contain what is typed inside the input field.</p> <p>That way it only shows the <code>&lt;div&gt;</code>s that contain whatever is typed inside the input field.</p> <p>Now, it checks and filters on each key up inside the input field so the results seem instant.</p> <p>Now, my problem is that as a user deletes what is inside the input field, everything is hidden. Whereas when nothing is in the input field, everything should be visible.</p> <p>It works fine in the separated case <a href="http://jsfiddle.net/aegq4/15/" rel="nofollow">in this js fiddle</a></p> <p>but not when I applied it to my site as a whole. The filtering works, but everything disappears if nothing is typed in the input.</p> <p>How can I get it to work so that when nothing is in the input, any div.container that was hidden before becomes visible? So that it works like it should, like a filtre when there is nothing to filtre everything is shown.</p> <p><a href="https://dl.dropboxusercontent.com/u/270523/help/initializr/index.html#about" rel="nofollow">Here is the page</a> where this is happening, to access the filtre that filtres the content below it, click on 'learn more about me' or 'work'.</p>
javascript jquery
[3, 5]
4,420,822
4,420,823
Why doesn't my PHP-generated javascript work?
<p>i have the following javascript code</p> <pre><code>echo ' &lt;a href = "javascript:void(0)" onclick = "document.getElementById("items").style.display="block";document.getElementById("fade").style.display="block""&gt;&lt;span style="padding-left:0px"&gt;&lt;input type="submit" name="r" style="width: 138px; font-weight:bold; " value="Add item"/&gt;&lt;/span&gt;&lt;/a&gt; '; </code></pre> <p>i am trying to execute the script from within a php script. when i click on the button to execute the java part of it, nothing happens. i then try it this way</p> <pre><code>echo ' &lt;a href = "javascript:void(0)" onclick = "document.getElementById('items').style.display='block';document.getElementById('fade').style.display='block'"&gt;&lt;span style="padding-left:0px"&gt;&lt;input type="submit" name="r" style="width: 138px; font-weight:bold; " value="Add item"/&gt;&lt;/span&gt;&lt;/a&gt; '; </code></pre> <p>and got this parse error: parse error, expecting <code>'," or</code>';".</p>
php javascript
[2, 3]
2,874,543
2,874,544
Red Black Tree and Multimap
<p>In many compilers, Data structures such as<code>Set</code>, <code>Map</code>, <code>Multimap</code> use Red-Black-Trees in behind. And a <code>multimap</code> stores multiple and duplicated keys.</p> <blockquote> <p>"A red-black-tree stores keys uniquely and binds just one DataValue to each key"</p> </blockquote> <ol> <li>Is above statement true?</li> <li>If that is true, How we can use a red-black-tree to implement a <code>multimap</code> (as C++ STL did)?</li> </ol>
c# java c++
[0, 1, 6]
5,790,026
5,790,027
How to print value in array with jQuery - .html
<p>I am trying to print a value from an array in jQuery to the screen using the .html function. The variable is test.</p> <p>If I just use the line of code below it will print everything in the array:</p> <pre><code>$(this).html(test).addClass('messageboxerror').fadeTo(900,1); Array ( [0] =&gt; 2820 Prairie [1] =&gt; 19316 [2] =&gt; 2820 Prairie [3] =&gt; Beloit [4] =&gt; 53511 [5] =&gt; [6] =&gt; 2012-01-17 [7] =&gt; [8] =&gt; union [9] =&gt; Rock County ) </code></pre> <p>I have tried putting .html(test[0]) but this broke the script.</p> <p>Thanks,</p>
javascript jquery
[3, 5]
926,619
926,620
What is the best way to get the value of a div?
<p>I'm working on a site that has random background images in the container. Every time you load the site there is a different image generated by a php script. When the PHP script randomly chooses 1.jpg to show, I would like bg1.png to be used as background image. If the PHP script randomly chooses 2.jpg to show, I would like bg2.png to be used as background image.</p> <p>This is the jQuery i already made. But I can not find a way how to call the value of the div called background</p> <p>The jQuery:</p> <pre><code>$(document).ready(function() { if ($("#background").attr("value") == 1) { $(body).css("background-image", "url(images/bg/bg1.png);"); } else if ($("#background").attr("value") == 2) { $(body).css("background-image", "url(images/bg/bg2.png);"); } else if ($("#background").attr("value") == 3) { $(body).css("background-image", "url(images/bg/bg3.png);"); } else if ($("#background").attr("value") == 4) { $(body).css("background-image", "url(images/bg/bg4.png);"); } else if ($("#background").attr("value") == 5) { $(body).css("background-image", "url(images/bg/bg5.png);"); } else if ($("#background").attr("value") == 6) { $(body).css("background-image", "url(images/bg/bg6.png);"); } else { $(body).css("background-image", "url(images/bg.png);"); } }); </code></pre> <p>The Php:</p> <pre><code>echo "&lt;div id='background' value=\"$random\"&gt;&lt;img src=\"$image_folder/$image_name\" alt=\"$random\" /&gt;&lt;/div&gt;"; </code></pre>
php jquery
[2, 5]
271,542
271,543
Hide/Show elements with jQuery
<p>I have following site structure</p> <pre><code>&lt;div id="movies"&gt; &lt;a href=""&gt; &lt;div&gt;content&lt;/div&gt; &lt;/a&gt; &lt;a href=""&gt; &lt;div&gt;content&lt;/div&gt; &lt;/a&gt; ... &lt;/div&gt; </code></pre> <p>There can be up to 50 <code>a tags</code> inside <code>#movies</code>. I want to show only 10 and reveal another 10 if the user requests it.</p> <p>So I came up with following jquery code.</p> <pre><code> var count = $("#movies a").length; if(count &gt; 10){ for(i = 11; i &lt;= count; i++){ $('#movies a:nth-child('+i+')').hide(); } $('#more').append('&lt;a&gt;show more&lt;/a&gt;'); } $('#more a').click(function(){ var hidden = $("#movies a").filter(":hidden"); var count = 0; for(element in hidden){ if(count &lt;= 10){ element.show(); } } }); </code></pre> <p>But this gives me <code>Uncaught TypeError: Object 0 has no method 'show'</code>. Any ideas why? What do I need to change/add to make the idea work?</p>
javascript jquery
[3, 5]
1,869,707
1,869,708
Removing dynamically created controls
<p>I am attempting to remove dynamically created controls in C# 2008 asp.net</p> <p>The controls are created here:</p> <pre><code> int i; for (i = 0; i &lt; myCount; i += 1) { TextBox txtAuto = new TextBox(); TextBox txtModel = new TextBox(); TextBox txtMiles = new TextBox(); TextBox txtVINumber = new TextBox(); TextBox txtPlateNumber = new TextBox(); txtAuto.ID = "txtVehAuto" + i.ToString(); txtModel.ID = "txtVehModel" + i.ToString(); txtMiles.ID = "txtVehMilage" + i.ToString(); txtVINumber.ID = "txtVehVINumber" + i.ToString(); txtPlateNumber.ID = "txtVehPlate" + i.ToString(); phAuto.Controls.Add(txtAuto); phModel.Controls.Add(txtModel); phMiles.Controls.Add(txtMiles); phVINumber.Controls.Add(txtVINumber); phPlateNumber.Controls.Add(txtPlateNumber); dyntxtAuto[i] = txtAuto; dyntxtModel[i] = txtModel; dyntxtMiles[i] = txtMiles; dyntxtVINumber[i] = txtVINumber; dyntxtPlateNumber[i] = txtPlateNumber; LiteralControl literalBreak = new LiteralControl("&lt;br /&gt;"); phAuto.Controls.Add(literalBreak); phModel.Controls.Add(literalBreak); phMiles.Controls.Add(literalBreak); phVINumber.Controls.Add(literalBreak); phPlateNumber.Controls.Add(literalBreak); } } </code></pre> <p>How can I remove the controls? The user will click "submit" at which point the user entered data will be written to the db. The page will retrun back to itself (with blank fields). I want to remove the dynamic controls after the data has been written to the db. Remove meaning delete, not hide. I tried to set ViewState to false, but it doesn't help.</p>
c# asp.net
[0, 9]
4,456,630
4,456,631
Javascript function scope
<p>I'm trying to call an instance method a() from within a jQuery ajax call. But when I do so, it says that the method is not defined. I think it's because a() is not within the scope of $. But I thought it would be part of the scope chain. How can a() be within scope?</p> <pre><code>function Z() { this.x = 0 this.a = function() { return this.x; } this.b = function() { $.ajax({ ... success: function(data, textStatus, xhr) { this.a(); //a() is not defined }, ... }); } } z = new Z(); z.b(); </code></pre>
javascript jquery
[3, 5]
1,565,785
1,565,786
Pixels from top
<p>I'm working on a Facebook App that has a FancyBox (lightbox). The <code>iframe</code> is very long, and when you click an image, the lightbox shows at the middle of the <code>iframe</code> instead of the middle of the screen. </p> <p>How do I get the amount of pixels that the browser has scrolled down?</p> <p>/Kenneth B</p>
javascript jquery
[3, 5]
5,952,958
5,952,959
OnResizeListener or OnDrawListener or something Similar
<p>I need to get the width of my main <code>LinearLayout</code> at creation time. Until it is actually draw the width is 0 - it isn't drawn until after <code>onCreate(...)</code> is finished... So what I would like to do is be told when it has been drawn or resized and then grab the width from there. There doesn't appear to be any Listeners for those so does anyone have any suggestions on how to get the width at creation?</p>
java android
[1, 4]
5,409,409
5,409,410
How to make jQuery effects run in sequence, not simultaneously?
<p>How do I have two effects in jQuery run in sequence, not simultaneously? Take this piece of code for example:</p> <pre><code>$("#show-projects").click(function() { $(".page:visible").fadeOut("normal"); $("#projects").fadeIn("normal"); }); </code></pre> <p>The fadeOut and the fadeIn run simultaneously, how do I make them run one after the other?</p>
javascript jquery
[3, 5]
1,202,664
1,202,665
Can we access one control Id registered in one aspx in to another ascx control,,
<p>Can we access one control Id registered in one aspx in to another ascx control,,</p>
c# asp.net
[0, 9]
5,583,998
5,583,999
What is causing this button to crash?
<p>I'm writing an app that allows me to send a command through TCP/IP by clicking a button. However when I click to the button in the emulator it comes back with a message saying the button has stopped working. I was wondering if anyone could spot the error in my code.</p> <p><strong>CODE:</strong></p> <pre><code>package button.test; import java.io.IOException; import java.io.OutputStream; import java.net.Socket; import java.net.UnknownHostException; import android.app.Activity; import android.os.Bundle; import android.view.View; public class ButtonActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } public void onClick(View view) throws UnknownHostException, IOException { Socket socket = new Socket("192.168.2.92", 60128); try{ dataOutputStream.Object BUFFER = null; write(BUFFER); String buffer="ISCP000000100000000701000000!1PWR010D"; OutputStream os=socket.getOutputStream(); os.write(buffer.getBytes()); } catch(IOException e) { //error code } } private void write(Object BUFFER) { // TODO Auto-generated method stub } } </code></pre>
java android
[1, 4]
3,295,095
3,295,096
From PHP to Python accommodation
<p>I've been coding php for years, and now i have to finally make my own project, and i want it very optimized and shiny. So, i've been searching around the net about which programming language should i use for my needs (fast, secure, easy-understandable, customizable) and all points to -> Python. So I decided to go on, but i just can't feel "home" when writing python (inc Django app...). I got used to PHP's syntax, and my IDE (PHP Expert Editor 4.3) makes php look awesome, so now i just can't go with python.</p> <p>Maybe there is something which has php's syntax (let's say per example: Perl)...but the advantages of a high-level programming language (aka Python)?</p>
php python
[2, 7]
1,815,707
1,815,708
Is it possible to return an ASP page before continuing slow server side work (eg logging)
<p>Is it possible to return the page response to the user, before you've finished all your server side work?</p> <p>Ie, I've got a cheap hosting account with No database, but I'd like to log a certain event, by calling a webservice on my other, more expensive hosting account (ie, a very slow logging operation)</p> <p>I don't really want the user to have to wait for this slow logging operation to complete before their page is rendered.</p> <p>Would I need to spin up a new thread, or make an asynchronous call? Or is it possible to return the page, and then continue working happily in the same thread/code?</p> <p>Using ASP.Net (webforms) C# .Net 2.0 etc.</p>
c# asp.net
[0, 9]
4,884,421
4,884,422
jQuery mouseenter and mouseleave not working correctly after .append()
<p>I have a <code>div</code> object that is set to visible in a mouseover event, via jQuery. Inside this div I have a clickable element that runs a Javascript function, which loads HTML content from another file via <code>$.get()</code>.</p> <p>The problem is that my <code>div</code> is hidden automatically when I move my mouse over the newly added content, after the $.get() method is done. I've seen that a <em>mouseout</em> event is called on the newly added content.</p> <p>Here is the part of my code:</p> <p><strong>HTML</strong>:</p> <pre><code>&lt;div class="tab"&gt; &lt;div id="tab_content"&gt; Content... &lt;div id="more_container"&gt; More content goes here: &lt;a onclick="load_more(this)"&gt;Load more content&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>Javascript</strong>:</p> <pre><code>$(".tab").on({ mouseenter: function(){ show(); }, mouseleave: function(){ hide(); } }, "#tab_content"); function load_more(object) { $.get('/url/file', function(data){ var div = $(object).parent(); $(object).remove(); $(div).append(data); }); } </code></pre>
javascript jquery
[3, 5]
4,289,875
4,289,876
Cookies - PHP vs Javascript
<p>With regards to security and convenience which cookies are better the PHP ones or the Javascript ones?</p>
php javascript
[2, 3]
1,074,779
1,074,780
How to preload a div combobox in jquery
<p>I have code as follows:</p> <pre><code>$("#item_select").change(function() { var params = $("#item_select option:selected").val(); $.post('/account/ar_form.php', {idata: params}, function(data){ $("#message_display" ).html(data); }); }); </code></pre> <p>This is a dropdown that uses /account/ar_form.php to display html in the div correctly.</p> <p>But it only displays on the change event. I'd like it to preload the data. When I use a load event, it will display the html, but on change, it displays it twice.</p>
php jquery
[2, 5]
4,818,051
4,818,052
Asp.NET|Get Ip Of a user when he open the site\click on a button
<p>Simple as that. </p> <p>i want to save the ip on a session id, or. when he click on a button it will do like that:</p> <pre><code>using (StreamWriter writer = new StreamWriter(fileStream)) { writer.WriteLine(TextBox1.Text); } </code></pre> <p>(its not all the code ofc)</p> <p>when he click on a button, it will wirte the ip into the file. :)</p> <p>any way to do so?</p>
c# asp.net
[0, 9]
562,876
562,877
jQuery: $.post not working, $.get works
<p>Firstly, I did look at related posts, but none of them quite stoops down to my stupidity levels. Its my first time working with web technologies and I'm trying to work with Ajax/JQuery and Django. Here is the code:</p> <pre><code>$(document).ready(function() { $('#result').ajaxError(function() { $(this).text('Triggered ajaxError handler.'); }); $('#b').click( function() { codes = $('#code').text(); $.get("/questions/compile", function(data){ alert("data saved" + data); }); }); }); </code></pre> <p>Now this code works fine and I get a alert box as expected. But when I change $.get to $.post, I get ajaxerror. I did try using $.ajax with appropriate values, but get same problem as $.post . Firing up Firebug, shows an error at line 5252 in jquery.js. That line is </p> <pre><code>xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null ); </code></pre> <p>I'm not sure how to debug any further. And since I'm not sending any data, $.post should work just as well as $.get. Now go ahead and point out my stupidity. Cheers.</p>
javascript jquery
[3, 5]
4,010,297
4,010,298
jQuery and the accuracy of the css function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3029178/jquery-and-margin-0-auto">jQuery and margin: 0 auto</a> </p> </blockquote> <p>I have the following HTML:</p> <pre><code>&lt;p style="margin-left:auto; margin-right:auto; width:200px;"&gt;Hello&lt;/p&gt; </code></pre> <p>I then use jQuery to get <code>margin-left</code> like so:</p> <pre><code>alert(window.jQuery(element).css('margin-left')); </code></pre> <p>However, it alerts <code>0px</code> rather than the expected <code>auto</code>.</p> <p>Why is this the case and how can I get the auto?</p>
javascript jquery
[3, 5]
786,134
786,135
Is there any function in jquery that counts the time the mouse is over a div?
<p>I'm using jquery and when i mouse over div A, div B appears.</p> <p>What i would like to achieve is:</p> <p>When the mouse is over div A <strong>greater than 3 seconds</strong> ( > 3s), the div B shall appear.</p> <p>Is there any function in jquery that counts the time the mouse is over a div??</p> <p>Thanks, in advance</p>
javascript jquery
[3, 5]
443,545
443,546
update javascript in updatepanel
<p>lets say I've got a function that iterates over an array. The function is outside the updatepanel, the array is defined within the update panel. The items of the array are dynamically created. On the first try I've realized, that the values of the array do not update when the update panel loads again.</p> <p>Would be glad if someone can provide a solution for this.</p>
javascript asp.net
[3, 9]
291,793
291,794
Can't $_POST values from disabled Radio buttons
<p>I have two pages, in the first page I submit the form which contains Radio buttons.</p> <p>From the second page, I try to read the responses from the Radio buttons using the $_POST.</p> <p>The problem is when I hit submit, the $_POST in the second page reads NULL. But when I'm not disabling the Radio buttons in the first page the $_POST form the second page reads the data from the Radio butons correctly.</p> <p>Is there any solution to make the $_POST reads the values of disabled Radio buttons?</p> <p>I'm using this Javascript code to disable the radio buttons when the user clicks on it:</p> <pre><code>function disableRadio(groupName){ var radio=document.getElementsByName(groupName); for(c=0;c&lt;radio.length;c++) radio[c].disabled=true; } </code></pre> <p>Here is a simple code from each of the two pages.</p> <p>Page1:</p> <pre><code>echo '&lt;form action="Page2.php" method="post"&gt;', "&lt;input type='radio' name='Question1' value='1' onClick='disableRadio(Question1)' /&gt;", "&lt;input type='radio' name='Question1' value='2' onClick='disableRadio(Question1)' /&gt;", "&lt;input type='radio' name='Question1' value='3' onClick='disableRadio(Question1)' /&gt;", "&lt;div&gt;&lt;input type='submit' value='Submit'&gt;&lt;/div&gt;", "&lt;/form&gt;"; </code></pre> <p>Page2:</p> <pre><code>$response=$_POST['Question1']; echo $response; </code></pre> <hr> <h2>Update to this question</h2> <p>When using the ReadOnly attribute, the Radio buttons in the group are still click-able. So, I decided to Disable the other Radio buttons. Is there a better solution, as I don't want the user to have the feeling that he is able to change the answer.</p>
php javascript
[2, 3]