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,432,207
3,432,208
IS php same as java in terms of pass by reference?
<p>As PHP borrows most of its object oriented features from java. I would like to know whether PHP and java both uses the same concept of pass by value?</p> <p>I know Java is not pass by reference.Its just that object references are passed by value. How about PHP? Does PHP support pass by reference?</p>
java php
[1, 2]
5,683,305
5,683,306
jquery hide problem
<p>I use this to toggle my div elements, and hide all them when the DOM is ready...</p> <pre><code> $('div[class*="showhide"]').hide(); $('input:image').click( function() { var nr = $(this).attr('id').substr(7,2); $('div.showhide' + nr).toggle(400); }); </code></pre> <p>I have dynamically created div elements with class <code>showhide0;showhide1;showhide2</code>...etc... Inside the DIV tags I have search boxes. </p> <ul> <li>First when page is loaded all DIV tags hide.</li> <li>I toggle one of them to show.</li> <li>Start a search, so the page is reloaded with the result of the query.</li> </ul> <p>Of course all DIV is hide again, because the page is reloaded. Unfortunately...</p> <p>Is it possible to not hide again after I searched for something? It would be nice when I open the page, all the <code>div</code>s are hidden, but after then just when I toggle it...</p>
php jquery
[2, 5]
5,630,444
5,630,445
Handling board game fields with a loop?
<p>This is my first question here. I am writing a simple game on Android (my first one). It is a board game with 64 fields. Now every time one field is clicked something needs to be done. I figured a way to do it in this way:</p> <pre><code>switch(v.getId()) { case R.id.field1: ... ... ... } </code></pre> <p>It is working but it is kind of annoying for 64 fields. Can I somehow retrieve fields IDs and do it in a loop?</p> <pre><code>findViewById(R.id.field+i).doSomething(); </code></pre> <p>I know it cannot be done this way, I just want to ilustrate my thinking. The following would go in Javascipt but how to do it in Java? Is it possible?</p>
java android
[1, 4]
150,896
150,897
Creating an arguments and adding it to a click event
<p>Hi I'm pretty new to javascript looking for some help on creating an argument and adding it to a click event in jquery</p> <p>Heres a demo: <a href="http://jsfiddle.net/zidski/8VwAy/1/" rel="nofollow">http://jsfiddle.net/zidski/8VwAy/1/</a></p> <p>Can someone help example what I have to do?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,184,748
4,184,749
requestLocationUpdates can generate location when I want to?
<p>When the requestLocationUpdate generates a location that stands by my standarts I would like to re-generate a location after 5 minute. This is fine and possible by using the minTime parameter.</p> <p>But when the location is not stands by my standarts and I don't want to use it, can I re-generate immediately another location?</p>
java android
[1, 4]
5,717,182
5,717,183
Advantages of using php in frontend and java at the backend
<p>I want to use PHP in the frontend(for UI and calling services) and java at the backend(for database interaction and creating REST services) for my web application.</p> <p>I want to know the advantages and disadvantages of this kind of approach.</p>
java php
[1, 2]
56,200
56,201
'Object doesn't support this property or method' IE8 throwing jquery error
<p>I get this error on the page when I load my website on IE8,</p> <p>Message: Object doesn't support this property or method Line: 1025 Char: 5 Code: 0 URI: <a href="http://www.domain-name.com/../default/js/jquery.wt-rotator.js" rel="nofollow">http://www.domain-name.com/../default/js/jquery.wt-rotator.js</a></p> <p>i.e this particular line of code</p> <pre><code> $innerText.width(textWidth).html($p.html()); </code></pre> <p>this is the complete block of code </p> <pre><code>var initTextData = function($item, padding) { var $p = $item.find("&gt;div:hidden"); var textWidth = getPosNumber(parseInt($p.css("width")) - padding, 300); var textHeight = getPosNumber(parseInt($p.css("height")) - padding, 0); $innerText.width(textWidth).html($p.html()); if (textHeight &lt; $innerText.height()) { textHeight = $innerText.height(); } $item.data("textbox", {x:$p.css("left"), y:$p.css("top"), w:textWidth + padding, h:textHeight + padding, color:$p.css("color"), bgcolor:$p.css("background-color")}); } </code></pre> <p>Jquery image rotator is not displayed or loaded in IE8, opera whereas in firefox it loads and works perfect.</p>
javascript jquery
[3, 5]
5,678,896
5,678,897
How to display List items in Listview?
<p>I have a ListView in my aspx file like this:</p> <pre><code>&lt;asp:ListView ID="ListView1" runat="server"&gt;&lt;/asp:ListView&gt; </code></pre> <p>and then I have List like this:</p> <pre><code>List&lt;string&gt; mylist = new List&lt;string&gt;(); </code></pre> <p>Im trying to populate the ListView like so:</p> <pre><code>foreach(string elem in mylist) { ListView1.Items.Add(new ListViewItem(elem)); } </code></pre> <p>But my compiler is telling me best overload match error &amp; cannot convert string to ListViewItem. This is a asp.net 4.0 web app. Any suggestions?</p>
c# asp.net
[0, 9]
854,247
854,248
Unable to select multiple OPTIONS in a SELECT with jquery
<p>I have an HTML select element that allows multiple selection. I am populating the options with the results of an ajax request. I am adding custom attributes to the options. In one instance, when another ajax request completes, I would like to update the multi-selected values. I have the following javascript method to do this selection:</p> <pre><code>// select = id of the select control. // selected = list of json objects with an id representing those that are selected. updateSelection = function( select, selected ) { $('#'+select+' option').each( function() { var item = $(this); $.each(selected, function() { item.removeAttr( "selected" ); if ( this.id === parseInt(item.attr("optionId"), 10 )) { alert( "selecting " + item.text()); item.attr("selected", true ); } }); }); }; </code></pre> <p>The HTML before the method is run looks like this:</p> <pre><code>&lt;select id="putPlatforms" multiple="multiple"&gt; &lt;option optionid="1" optionversion="1"&gt;PC&lt;/option&gt; &lt;option optionid="3" optionversion="1"&gt;Xbox 360&lt;/option&gt; &lt;/select&gt; </code></pre> <p>In the case where only 'PC' is selected then the selection is made and reflected in the UI. The same if only 'Xbox 360' is selected. If BOTH options should be selected I see the alert stating that both will be selected, but only Xbox 360 is selected.</p>
javascript jquery
[3, 5]
3,986,215
3,986,216
asp image button refreshes page
<p>Hi My web page has lots of imageButtons, which refresh the page on click. How do I prevent this?</p> <pre><code> var imageButton = new ImageButton(); imageButton.ImageUrl = "Styles/unClicked.png"; imageButton.ID = "btn" + questionName; imageButton.OnClientClick = ("javascript:button_pressed()"); </code></pre>
c# asp.net
[0, 9]
4,320,152
4,320,153
How to notification to android remotely?
<p>Is there anyway in android to send a code or something to a device with an app installed and cause the device to show a notification or vibrate?</p> <p>What would be the best way to do this?</p> <p>like a PC you have the ability to send a specific code to the device with the app installed and cause it to do a notification.. What is the best way to do this or go about doing this?</p> <p>Any ideas will be great!</p>
java android
[1, 4]
5,311,322
5,311,323
disabling ASP.NEt Validtor such that its disabled on postback
<p>I am trying to disable ASP.Net Validator such that its disabled on postback.</p> <p>I am disabling the validator on client side using</p> <pre><code>$('.c_MyValidator').each(function() { ValidatorEnable(document.getElementById($(this).attr('id')), false); }); </code></pre> <p>but when the page postbacks, my page is still invalid. I am in UserControl (.ascx) so no override for Validate() for me. </p> <p>How can I disable the validator such that its enabled=false when the page postbacks. </p> <p>Any ideas?</p>
asp.net javascript jquery
[9, 3, 5]
4,275,004
4,275,005
window.location.href on Safari and Chrome
<p>This does not work in Safari and Chrome:</p> <pre><code>$(".myButton").click(function(){ window.location.href('www.blahblahblah.com'); }); </code></pre> <p>what's the solution?</p>
javascript jquery
[3, 5]
742,653
742,654
Append li after current li
<p>I would like to append a li in a ul after my current selection.</p> <p>I bound a click event to the li, and when it's clicked, another li has to be added after the current.</p> <p>What I have now is:</p> <pre><code>$(this).parent().append('&lt;li&gt;test&lt;/li&gt;'); </code></pre> <p>But this just adds the li to the ul, not after the current li.</p> <p>Is there a way to do that?</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
5,105,737
5,105,738
Change opacity with javascript?
<p>I need some help figuring this out! I am trying to change the opacity of a toolbar (Class) that's at the bottom of my site. The following code works for Chrome and Firefox but when it comes to IE8... NO GO. I've tried all kinds of stuff to get this to work but to keep this post clean I'm not gonna list it all.</p> <pre><code>&lt;script&gt; function hide() { $(".grid_10.bottombar").animate( { opacity: 0, left: 0 }, 1000 ); $( ".ArrowBottom.float-right" ).show(); } &lt;/script&gt; &lt;p&gt; &lt;img onclick="hide()" src="/images/BlueArrowSmall.png" /&gt; &lt;/p&gt; </code></pre> <p>Any help would be greatly appreciated! Thanks in advance.</p>
javascript jquery
[3, 5]
4,187,646
4,187,647
Is there a Java equivalent of php's gzdeflate?
<p>I'm using Java to construct a url to a php site. The query string has a parameter that has been compressed using php's gzdeflate. Is there a way in Java that I can do the same thing gzdeflate does?</p>
java php
[1, 2]
3,611,846
3,611,847
How to read the head section of a web page?
<p>On my web page, when the user types in a URL in the text field, I wan to get some information about that page, like title or link information. </p> <p>Is there way to do it? On the client (JavaScript) or on the server (PHP)? And how?</p>
php javascript
[2, 3]
1,431,978
1,431,979
Menu control generated js causes Sys undefined exception in Web Forms
<p>I'm developing an ASP.NET 4 web application. When I put a Menu control into the web form, the menu causes the following code to generate just before the closing <code>&lt;/form&gt;</code> tag:</p> <pre><code> &lt;script type='text/javascript'&gt; new Sys.WebForms.Menu({ element: 'NavigationMenu', disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: false }); </code></pre> <p>As long as I don't use URL Rewriting, the page compiles and loads properly. When I try to use URL Rewriting on the website, Visual Studio starts to throw "Sys is undefined" JavaScript exception.</p> <p>However, this does not happen always. Most frequently it happens when I change somenting positioning-related in the CSS file, but sometimes the exceptions seems just arbitrary.</p> <p>How can this be fixed?</p>
asp.net javascript
[9, 3]
1,587,067
1,587,068
Getting complex attribute value of object
<p>Given json like this :</p> <pre><code>{ "rss": { "page": 1, "results": [{ "type": "text", "$": 10 }], "text": [{ "content": "Lorem ipsum dolor sit amet.", "author": { "name": "Cesar", "email": "cesar@evoria.com" }, }, { "content": "Tema Tis rolod muspi merol.", "author": { "name": "Cleopatre", "email": "cleopatre@pyramid.com" }, }] } </code></pre> <p>In javascript, I can retrieve value like this :</p> <pre><code>var json = JSON.parse(datajson); $.each(json.text, function(key, val) { // this one is ok var content = val['content']; // this one does not work var authorname = val['author.name']; }); </code></pre> <p>Is this a way, given the attribute name in a string format, to retrieve the value of a complex object, for instance <code>json.text[0].author.name</code>?</p> <p><strong>EDIT</strong> I would like to store the needed attributes in another object like :</p> <pre><code>[ { dt: "Text content", dd: "content" }, { dt: "Author name", dd: "author.name"} ] </code></pre>
javascript jquery
[3, 5]
992,653
992,654
Method...Must Override a Superclass Method (Latest SDK)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/8697513/why-do-i-get-must-override-a-superclass-method-with-override">Why do I get “must override a superclass method” with @Override?</a> </p> </blockquote> <p>I recently installed the latest Android SDK in a new eclipse set up on a new machine. When I brought over an old project in several places I got a syntax error concerning @Override stating "method suchandsuch of type suchandsuch must override a superclass method". These items were fixed by removing @Override (which I don't think is correct).</p> <p>I just made my first new project with my new setup and the initial untouched code is giving this error which has me confused.</p> <pre><code>package com.geeksonhugs.whenimclose; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.view.MenuItem; public class ItemListActivity extends FragmentActivity implements ItemListFragment.Callbacks { private boolean mTwoPane; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item_list); if (findViewById(R.id.item_detail_container) != null) { mTwoPane = true; ((ItemListFragment) getSupportFragmentManager() .findFragmentById(R.id.item_list)) .setActivateOnItemClick(true); } } @Override public void onItemSelected(String id) { if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, id); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction() .replace(R.id.item_detail_container, fragment) .commit(); } else { Intent detailIntent = new Intent(this, ItemDetailActivity.class); detailIntent.putExtra(ItemDetailFragment.ARG_ITEM_ID, id); startActivity(detailIntent); } } } </code></pre> <p>The compiler accepts @Override before onCreate but gives the error with onItemSelected. Can someone please clarify what is going on for me please? Again this syntax error does not occur in prior versions?</p>
java android
[1, 4]
4,090,668
4,090,669
Setting active link dynamically on static navigation
<p>I have "navigation.html" (static coded navigtaion ) file loaded on multiple pages, using jQuery .load() Now I need to dynamically set active <code>&lt;li&gt;</code> for each page user clicking on. I can not use body id for specific reasons. Any other ways to do this?</p>
javascript jquery
[3, 5]
3,738,967
3,738,968
How to handle ThreadAbortException Without Specifying False for Response.End
<p>I know all about this exception, read the msdn article here <a href="http://support.microsoft.com/kb/312629/EN-US/" rel="nofollow">http://support.microsoft.com/kb/312629/EN-US/</a> but I do not know how to handle this when my boss does not want me to throw in false for the Response.End.</p> <p>Here's what I have:</p> <pre><code> else { try { VoidlOrder(transactionID); } catch (Exception ex) { LogError(ex.ToString()); } finally { RedirectUser(sessionID,"showfmsg=1", true); } } </code></pre> <p>RedirectUser is just a utility method we run that ultimately passes in true for the reponse.redirect resopnse.end param.</p> <p>So what other option is there other than putting false as this param? He's stating to catch it and do something...ok do what? I don't see any other fix than to send false into this call every time because I can't get pass this exception..I get it every time.</p> <p>UPDATED</p> <p>tried this but I still get a threadabortexception in the outer catch:</p> <pre><code> else { try { VoidOrder(transactionID); } catch (Exception ex) { LogError(ex.ToString()); } finally { try { RedirectUserBackToCheckout(sessionID, "showfmsg=1", true); } catch (ThreadAbortException) { } } } } catch (Exception ex) { // some other logic } </code></pre>
c# asp.net
[0, 9]
4,334,479
4,334,480
Sliding div panel goes back on clicking buttons inside div panel
<p>I am using this code to slide my div from right on (button_panel) button click, everything is working fine but when I click any button inside div panel the panel goes back to its original position. It shouldnt happen because the click event is used only for button_panel. Any idea why ?</p> <pre><code>var sipPos = 0; $(document).ready(function () { $("#button_panel").click(function (e) { e.preventDefault(); $("#panel").animate({ right: sipPos }, 300, 'linear', function () { if (sipPos == 0) { sipPos = -150; } else { sipPos = 0; } }); }); }); &lt;div id="panel" style=" border-style: solid; border-color: #008000; background-color:#D5FFD5; width:150px; height:400px; right:-150px; top:142px; position:absolute" align="center" &gt; &lt;asp:ImageButton ID="button_panel" runat="server" style=" background-image: url('images/ProgressBar1.jpg'); width:80px; height:30px; left:-83px; margin-top:-12px; position:absolute; top:0px" Font-Bold="True" ImageUrl="~/images/green_left_arrow_104.jpg" /&gt; &lt;asp:Label ID="Label6" runat="server" style="margin-top:5px" Text="Timer" /&gt;&lt;br /&gt; &lt;asp:Button ID="Button1" runat="server" style="margin-top:5px" Text="AFK!" /&gt;&lt;br /&gt; &lt;asp:Button ID="Button2" runat="server" style="margin-top:5px" Text="REVIEW" /&gt;&lt;br /&gt; &lt;/div&gt; </code></pre>
jquery asp.net
[5, 9]
387,681
387,682
Why does setTimeout(myFunction, 0) work, but running the function itself not work?
<p>This code should select the contents of a textarea when that textarea is selected. However, it doesn't work by itself:</p> <pre><code> $("#form").focus(function() { $("#form").select(); }); </code></pre> <p>It only works when I give it a <code>setTimeout</code> of 0, like so: </p> <pre><code> $("#form").focus(function() { setTimeout(function() { $("#form").select(); }, 0); }); </code></pre> <p>Why is that?</p>
javascript jquery
[3, 5]
4,046,765
4,046,766
Newly Opened Tab kills Function Calls
<p>I have such a for loop:</p> <pre><code>for (var i = 0; i &lt; documentsCount; i++) { var e = checkBoxes[i]; if (e.checked) { var documentType = documents[i].value; if ("ConcreteType_1" == documentType) { makeAction(); } else { if (attachmentCount &gt; 0) { downloadDoc(); } } } } </code></pre> <p>The downloadDoc() function opens an iframe for each file (that has attachemnts and is not of 'ConcreteType_1' type) and the makeAction() function opens a new tab to preview the file source. If I check several files with attachments, everything is fine - several download boxes are raised, but if there is at least one file of 'ConcreteType_1' type among files with attachments, a new tab opens and no download boxes are raised...</p> <p>If somebody knows how to deal with it, please share.</p>
javascript jquery
[3, 5]
4,749,312
4,749,313
$(document).ready(function(){}); vs script at the bottom of page
<p>what is the difference / advantage / disadvantage of writing script at the bottom of the page and writing the script in </p> <pre><code>$(document).ready(function(){}); </code></pre>
javascript jquery
[3, 5]
1,272,078
1,272,079
Javascript confirm dialog - prevent event handler firing?
<p><br></p> <p>I've got a form with a number of fields and a few checkboxes. When the user clicks save, if a certain checkbox isn't checked, they're prompted with a 'Confirm' dialog box asking if they still want to save the form. If they click okay, the button should fire it's event handler normally, but if they click cancel, nothing should happen. <br></p> <pre><code>function checkVerification(checkBox) { if (!document.getElementById(checkBox).checked) { confirm('Worksheet has not been verified. Save anyway?'); } } </code></pre> <p>As of right now, the Save button's event handler fires regardless of the user's choice. Any advice would be greatly appreciated.</p>
c# javascript asp.net
[0, 3, 9]
3,520,415
3,520,416
SharedPreferences not able to set
<p>Whats wrong with the below code</p> <p>I am not able to retrieve a simple setting saved in SharedPreferences. s1 is always "". What it the small mistake I am doing > SharedPreferences sp = getSharedPreferences("MyTestPref", 0);</p> <pre><code> String s = "Item1"; sp.edit().putString("VAL", (s)); sp.edit().apply(); //also tried commit String s1 = (sp.getString("VAL", "")); </code></pre>
java android
[1, 4]
4,859,746
4,859,747
How to see which element was clicked first?
<p>I have a selection menu using <code>toggleClass().</code> to see which menu options were selected:</p> <pre><code>$('.img1, .img2, .text1, .tex2').click(function() { $(this).toggleClass('selected'); }); </code></pre> <p>The way my selection menu works is that if two elements have the class <code>selected</code> then something will happen. For example:</p> <pre><code>if ( $('.img1').hasClass('selected') &amp;&amp; ('.text1').hasClass('selected') ) { // do something } </code></pre> <p>This all works perfectly however I want to disable the user from picking two <code>imgs</code> or two <code>texts</code>. The way I want to do this is just have the first selected element be removed from the selected class and the second selected element stay selected. For example:</p> <pre><code>if ( $('.img1').hasClass('selected') &amp;&amp; ('.img2').hasClass('selected') ) { // remove selected from the element that was first clicked and keep selected on the element that was clicked second } </code></pre> <p>What would be the best way of achieving this? Thanks in advance.</p>
javascript jquery
[3, 5]
2,453,689
2,453,690
How to create string HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReportFrench") in C#?
<p>I have hardcoded value in javascript in my aspx page which is working</p> <pre><code>PersonalReportLink.innerHTML = '&lt;%=(String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReportFrench")%&gt;'; </code></pre> <p>now I want do it dynamically what I am trying is </p> <blockquote> <p>sel_lang ="French" //i am geting from the user PerReportStr = '&lt;%= (String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReport'+ sel_lang + '") %>';</p> </blockquote> <p>which giving me empty string after execution ie PerReportStr="" I think correct keyword is not get passed to resource file</p> <p>Reason is I am not able to form below string correctly using C#</p> <p><strong>(String)HttpContext.GetGlobalResourceObject(@"languagetext","PersonalReportFrench")</strong> </p> <p>Please help me to create above string using C# ?</p>
c# javascript asp.net
[0, 3, 9]
2,439,254
2,439,255
jQuery -- How did I get here?
<p>I must have used someone's existing code as a framework, and I developed a jQuery/JavaScript application I now need to use. It works fine if invoked from within the following code but I need to pass values for <code>nnn</code> from elsewhere in the page. Because I don't understand jQuery structure well enough, my efforts so far have failed.</p> <pre><code>&lt;script&gt; $(function() { . . . var BuildTree = function(centralID) { ... } BuildTree(nnn); }); </code></pre> <p>I want to do something like:</p> <pre><code>function BuildTree(...) { ... } </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
2,001,220
2,001,221
How to get address from latiude and longitude?
<p>I'm getting the latitude and longitude on touch event in map in android.</p> <p>I want to getting address on particular touch in map.</p> <p>How do I do this?</p>
java android
[1, 4]
3,977,271
3,977,272
Something similar to checkstyle for C++ to be working on Linux
<p>I am looking for some tool to help with C++ like <code>checkstyle</code>, which is for JAVA. It should be available for LINUX.</p> <p>Are you guys aware of any?</p>
java c++
[1, 6]
5,774,991
5,774,992
objects in a c# arraylist
<p>I'm coming from a Javascript background which possibly is a good thing although so far it's proving to be a bad thing.</p> <p>In Javascript, I have:</p> <pre><code>function doStuff(){ var temp = new Array(); temp.push(new marker("bday party")); alert(temp[0].whatsHappening); // 'bday party' would be alerted } function marker(whatsHappening) { this.whatsHappening = whatsHappening; } </code></pre> <p>I would now like to do the same thing in C#. I have set up a class:</p> <pre><code>class marker { public string whatsHappening; public marker(string w) { whatsHappening = w; } } </code></pre> <p>and add a new object, but I can't seem to call the data in the same way:</p> <pre><code>ArrayList markers = new ArrayList(); markers.Add(new marker("asd")); string temp = markers[0].whatsHappening; // This last bit isn't allowed </code></pre>
c# javascript asp.net
[0, 3, 9]
1,814,120
1,814,121
Calling a function more than once in jQuery
<p>I have a function called "go()" which needs to be called thrice on page load. Right now I have called it on the ready event of a div with class "nav". Can someone suggest how can I call the go function thrice. Adding go() calls one after other calls it only once.</p> <pre><code>$('.nav').ready(function() { go(); }); </code></pre>
javascript jquery
[3, 5]
2,059,957
2,059,958
Add class to last div when it exists
<p>I have the following HTML structure, I want to add a class to the last <code>&lt;div&gt;</code> which contains the <code>&lt;p&gt;</code> tag but only when it exists. </p> <pre><code>&lt;div id="view"&gt; &lt;div class="login"&gt; &lt;/div&gt; &lt;div&gt; &lt;p&gt;Add a class to this parent DIV&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Any suggestions?</p>
javascript jquery
[3, 5]
5,442,248
5,442,249
Asp.net Beginner
<p>i have designed a Page just like Yahoo Sign Up Page.. i want to do such that when i fill all the required fields of that page, those filled values get displayed on a textbox. i wrote a code i.e:</p> <pre><code>TextBox9.Text = TextBox1.Text; TextBox9.Text = TextBox2.Text; TextBox9.Text = TextBox3.Text; TextBox9.Text = TextBox4.Text; TextBox9.Text = TextBox5.Text; TextBox9.Text = TextBox6.Text; TextBox9.Text = TextBox7.Text; TextBox9.Text = TextBox8.Text; </code></pre> <p>but it is displaying only the value of textbox8 in textbox9.. </p>
c# asp.net
[0, 9]
5,789,369
5,789,370
page 140 quiz questions
<p>I'm working right now at present to make a quiz page to my friends about firefighter training. and I'm thinking about whether I can do it with javascript or should I do it with php?. where there are about 140 questions but I will start to build so there are only 10 questions to start with :)</p> <p>I never try to do anything like that before so hope you can help me to the right and explain to me how to do it and help me further.</p> <p>I think such a little like this:</p> <pre><code>&lt;?php if(isset($_POST["ok"] == 1) { echo "TRUE!"; } elseif(isset($_POST["ok"] &gt;= 1) { echo "FALSE!"; } ?&gt; &lt;form action="#" method="post"&gt; &lt;input type="checkbox" name="1" /&gt;&lt;p&gt;Bla bla bla&lt;/p&gt; &lt;input type="checkbox" name="2" /&gt;&lt;p&gt;Bla bla bla&lt;/p&gt; &lt;input type="checkbox" name="3" /&gt;&lt;p&gt;Bla bla bla&lt;/p&gt; &lt;input type="submit" name="ok" value="Ok" /&gt; &lt;/form&gt; </code></pre> <p>It's probably not such but it must be such <strong>clicks</strong> on Mon such as it is true then it must be in it or look like in the still hope you can follow me in what I would like to have built?</p>
php javascript jquery
[2, 3, 5]
999,382
999,383
Is it possible to send an arraylist as a response to jquery?
<p>Is it possible to send an arraylist as a response(from action class) to jquery?If so please give sample code</p>
java jquery
[1, 5]
3,186,909
3,186,910
How do I use IValidatableObject?
<p>I understand that <code>IValidatableObject</code> is used to validate an object in a way that let's one compare properties against each other. </p> <p>I'd still like to have attributes to validate individual properties, but I want to ignore failures on some properties in certain cases.</p> <p>Am I trying to use it incorrectly in the case below? If not how do I implement this?</p> <pre><code>public class ValidateMe : IValidatableObject { [Required] public bool Enable { get; set; } [Range(1, 5)] public int Prop1 { get; set; } [Range(1, 5)] public int Prop2 { get; set; } public IEnumerable&lt;ValidationResult&gt; Validate(ValidationContext validationContext) { if (!this.Enable) { /* Return valid result here. * I don't care if Prop1 and Prop2 are out of range * if the whole object is not "enabled" */ } else { /* Check if Prop1 and Prop2 meet their range requirements here * and return accordingly. */ } } } </code></pre>
c# asp.net
[0, 9]
3,670,153
3,670,154
How to call javascript function from code-behind
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1828566/calling-javascript-from-code-behind">Calling javascript from code behind</a> </p> </blockquote> <p>I wrote a javascript function on asp.net page. This is that..</p> <blockquote> function Alert(){ alert('hello'); } </blockquote> <p>I want to call this function from code-behind view. How can I do.</p>
javascript asp.net
[3, 9]
2,445,406
2,445,407
strip unwanted html elements by retaining its content using JQuery
<p>I have an input with lots of html content. looking for a jquery function to efficiently strip the unwanted elements(just the elements, but would need to retain the content), the elements to retain would be the ones which i specify. Also would like the function to be easily configurable to add or remove the elements i dont want. eg: var tagsToRetain="p,i,u,br";</p> <p>I have tried below, but that would require to specify the elements that i don't want, which would be tedious to do so.</p> <pre><code>$("span,h1,h2").each(function(){ $(this).replaceWith($(this).html()); });​ </code></pre>
javascript jquery
[3, 5]
207,058
207,059
How to know how many times a button has been clicked?
<p>like I want the user to send some info only once ..actually have sent a link thru email that opens a page with text box in it ..In that user sends some info by clicking a button..now I dont want user to use that link over and over to send the info ... ..so how do i go abt it ? hope the ques isnt confusing</p>
c# asp.net
[0, 9]
1,794,649
1,794,650
Writing an ArrayList back to an XML File
<p>When my activity starts I check for an existing data file and if there isn't one I call a web service that provides a blank one to begin with. The file is read into an ArrayList collection and the user makes changes as needed. Now I am in need of advice for the best approach. </p> <p>Should I try to match the updated contents in the ArrayList to the element in the XML file (there is an ID field that could be used for matching) or should I just write out the ArrayList overwriting the old xml file? No worries about maintaining a hx.</p> <p>If I write out the file (what I'm thinking is the way to go) do I have to decorate everything in the DataObject class (ie all the properties) as serializable or just at the class level. Do I also somehow need to mark the ArrayList collection serializable as well?</p>
java android
[1, 4]
1,177,820
1,177,821
stop build up of clicks with jquery toggle
<p>I have a little query, when I click on the image to toggle the navigation multiple times really fastly it builds up a que of clicks that go on by themselves, its really annoying and I can't figure out how to stop it as the jquery .stop isn't working.</p> <p>here is the url</p> <p><a href="http://satbulsara.com/tests/" rel="nofollow">http://satbulsara.com/tests/</a></p> <p>here is my code</p> <pre><code>$('img').toggle(function() { $('ul').fadeIn("slow"); }, function() { $('ul').fadeOut("slow"); }); </code></pre>
javascript jquery
[3, 5]
3,772,776
3,772,777
Working with money in android app
<p>Hello my app is working with money. What structure i should use and how ? </p> <p>I mean that from web service i get decimal number price. I don't do any operations with this money, no calculating. Can i keep this in String and when time comes to pass this price to bank ? Nothing would happens. Can i lose in this way some numbers ? </p> <p>At some time i need to give this money using Intent and extras. Or i should use some other structure ? I appreciate for your help guys.</p> <p>So give me your ideas.</p> <p>Thanks.</p>
java android
[1, 4]
234,406
234,407
jquery load specific page / query strings
<p>I have the following working code:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $('#target').click(function() { $("#success").load("/contacts/person/view/1", function(response, status, xhr) { if (status == "error") { var msg = "Sorry but there was an error: "; $("#error").html(msg + xhr.status + " " + xhr.statusText); } }); }); }); &lt;/script&gt; </code></pre> <p>I wish to have a series of links such as:</p> <pre><code>&lt;a id="target"&gt;a&lt;/a&gt; &lt;a id="target"&gt;b&lt;/a&gt; &lt;a id="target"&gt;c&lt;/a&gt; </code></pre> <p>Each of which should when clicked bring up a specific person. So each link will reference a particular person. Therefore depending on which link clicked the value of:</p> <p>/contacts/person/view/<strong>1</strong></p> <p>must change.</p> <p>How can I do this please?</p> <p>Thanks for any assistance.</p>
javascript jquery
[3, 5]
141,816
141,817
How to open select element using jquery
<p>I have a select element as follows. i want to open it without user having to click on it.</p> <pre><code> &lt;select id="selId" class="pos_fixed"&gt; &lt;option value="volvo"&gt;Option1&lt;/option&gt; &lt;option value="saab"&gt;Option2&lt;/option&gt; &lt;option value="mercedes"&gt;Option3&lt;/option&gt; &lt;option value="audi"&gt;Option4&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Please let me know if its possible using jquery or javascript</p>
javascript jquery
[3, 5]
257,906
257,907
JavaScript Scripts in dynamic content
<p>I've got a problem. I have a web-app with dynamic content (so URL in browser is always /index.php). I want to add some scripts in that, but they talk about elements that WILL BE created, for example some divs. FireBug throws me an error that element, e.g. $('#div1") is null. When I attach those scripts in loaded views, they're not working because thay need to get document.ready event. How to make those scripts fired?</p>
javascript jquery
[3, 5]
3,026,025
3,026,026
Object required?
<pre><code>$(document).ready(function(){ function openEditor(){ $("#editor").show().animate({width: 965, height: 380}, 1500); $("#editor textarea").show(); } function closeEditor(){ $("#editor").animate({width: 985, height: 1}, 1500, function(){ $("#editor").hide(); $("#editor textarea").hide(); }); } function setedit(){ $.ajax({ type: "POST", url: "engine.php", data: "title="+ $('#editorTitle').attr('value') +"&amp;text="+ $('#editorText').html(), beforeSend: function(){ $('#mainField').html('&lt;img src="data/images/loader.gif" alt="Loading..."&gt;'); }, success: function(msg){ alert(msg); closeEditor(); search(); } }); } function search(){ // Row 138 $('#editorTitle').val($('#search').val()); $('#mainField').html('&lt;img src="data/images/loader.gif" alt="Loading..."&gt;'); $.get('engine.php?search='+ $('#search').val() , function(data) { $('#mainField').html(data); }); $.get('engine.php?raw=true&amp;search='+ $('#search').val() , function(data2) { $('#editorText').html(data2); }); $.get('engine.php?title=true&amp;search='+ $('#search').val() , function(data2) { $('#h1').html(data2); // Row 152 $('#editorTitle').html(data2); }); } $("#ready").html('Document ready at '+ event.timeStamp); // Row 157 }); </code></pre> <p>Hello,</p> <p>At row 138 and row 157 i get some strange error that an object (?) is required? I've been working on it all day and it still isn't working...</p> <p>Help! Please!</p> <p>Greetings!</p>
javascript jquery
[3, 5]
4,603,914
4,603,915
Implementing BluetoothChat in emulator
<p>I want to implement the bluetooth chat in my Emulator while application running in Eclipse. Plz help me. . . </p> <p>Same way i also want to implement the Online chat threw the Emulator. Is it possible ? And if it is then plz give me the Sollution for it.</p> <p>Thanks.</p>
java php android
[1, 2, 4]
4,197,269
4,197,270
Zoom in and zoom out images in Javascript
<p>How do I zoom in and zoom out images, like Google Maps, using mouse scroll in Javascript? Is there any jQuery framework that supports this feature?</p>
javascript jquery
[3, 5]
3,580,660
3,580,661
Using autocomplete with on the fly elements
<p>I have autocomplete nested within a jquery that creates text elements on the fly. The autocomplete works properly on the <code>#url</code> text field on every text field I create, however, I cannot make it work on the price field. </p> <p>It only works if <code>nextUrlId</code> is not increasing every time I press "Add" (without <code>nextUrlId++</code>). Because of this, I cannot autopopulate the price field upon selection from autocomplete. </p> <p>This does not work:</p> <pre><code> $('#AddUrl').click(function(){ $('&lt;p /&gt;').attr('id', 'urlParagraph' + nextUrlId) .text("URL: ") .appendTo('#inputBoxes'); $( "#url"+nextUrlId ).catcomplete({ delay: 0, minLength : 2, source: "searchsku.php", select: function(event, ui){ $("#price"+nextUrlId).val(ui.item.price)} }); NextUrlId++ </code></pre> <p>HTML:</p> <pre><code>&lt;div id="inputBoxes"&gt; &lt;table border="1"&gt; &lt;tr&gt; &lt;td&gt;&lt;p id="nameParagraph"&gt;Name: &lt;input type="text" id="name" /&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;p id="urlParagraph1"&gt;URL: &lt;input type="text" id="url1" /&gt;&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
2,119,376
2,119,377
Get link href and apply it to another link jQuery
<p>I have a set of DIVs, each contains an image with an empty anchor tag wrapped around it</p> <pre><code>&lt;a href="#"&gt; Image is here &lt;/a&gt; </code></pre> <p>I then have a <strong><em>'Continue reading'</em></strong> link just before the div closes</p> <pre><code>&lt;a href="?p=453"&gt;Continue reading &lt;span class="meta-nav"&gt;→&lt;/span&gt;&lt;/a&gt; </code></pre> <p>Is there a way with jQuery that when the page loads, I can that the <code>href</code> location of the <strong><em>continue reading</em></strong> button and apply that the empty anchor wrapped around my image? </p> <p><em><strong>Demo:</em></strong> <a href="http://jsfiddle.net/2hu66/1/" rel="nofollow">http://jsfiddle.net/2hu66/1/</a></p>
javascript jquery
[3, 5]
4,390,897
4,390,898
How to get Valuepath property of a asp.net treeview node using Jquery?
<p>Can Anyone help me with the following queries</p> <ol> <li>How to get Valuepath property of a asp.net treeview node using Jquery?</li> <li>How to insert a node in asp.net treeview control using Jquery?</li> <li>How to delete a node from asp.net treeview control using Jquery?</li> </ol> <p>I want to do these thing on client side using jQuery. Does any one have any idea, how to do these things.</p>
jquery asp.net
[5, 9]
3,616,259
3,616,260
C++ equivalent of PHP's pack()
<p>My question is simple.</p> <p>Is there an equivalent of PHP's pack() and unpack() function in the C++ STL? If no, is there an alternative to achieve the same goal?</p> <p><a href="http://us.php.net/pack" rel="nofollow">http://us.php.net/pack</a></p> <p>Thanks.</p>
php c++
[2, 6]
2,268,891
2,268,892
FileNotFoundException when trying to save game
<p>When I attempt to save my android game (played via Android simulator on my Windows laptop), I get a <code>FileNotFoundException</code>. I have spent hours trying different things, but remain perplexed as the code works perfectly on my previous version not for Android.</p> <pre><code>FileOutputStream saveStream; ObjectOutputStream savePlayerObject = null; String destinationFile = player1.getName() + ".txt"; try { saveStream = new FileOutputStream(destinationFile); savePlayerObject = new ObjectOutputStream(saveStream); savePlayerObject.writeObject(player1); } catch(FileNotFoundException ex) { Toast toast = Toast.makeText(getApplicationContext(), "Save Failed", Toast.LENGTH_LONG); toast.show(); } catch(IOException ex) { Toast toast = Toast.makeText(getApplicationContext(), "Save Failed", Toast.LENGTH_LONG); toast.show(); } finally { try { if(savePlayerObject !=null) { savePlayerObject.flush(); savePlayerObject.close(); Toast toast = Toast.makeText(getApplicationContext(), "Thank-You For Playing, See You Soon", Toast.LENGTH_LONG); toast.show(); System.exit(0); } } catch(IOException ex) { Toast toast = Toast.makeText(getApplicationContext(), "Save Failed", Toast.LENGTH_LONG); toast.show(); } } </code></pre>
java android
[1, 4]
5,614,684
5,614,685
How to only clear file upload field?
<p>Here is the JSfiddle: <a href="http://jsfiddle.net/buyC9/128/" rel="nofollow">http://jsfiddle.net/buyC9/128/</a></p> <p>I want to clear only the file upload field when pressed on clear.</p> <p>My HTML:</p> <pre><code>&lt;h1&gt;Upload image:&lt;/h1&gt; &lt;input type="file" name="blog[opload]" id="blog_opload" class="imagec"&gt; &lt;input type="url" size="50" name="blog[url]" id="blog_url" class="imagec"&gt; &lt;div id="preview"&gt; &lt;/div&gt; </code></pre> <p>My Jquery:</p> <pre><code>$('input').change(function() { var el = $(this); if (this.value === "") { $('.imagec').prop('disabled', false); this.disabled = false; $('#preview').hide(); } else { $('.imagec').prop('disabled', true); el.prop('disabled', false); alert(el.val()); if (el.attr('type') == 'url') { $('#preview').show().html('&lt;img src=' + '"' + el.val() + '"' + ' /&gt;'); } } }); function reset_html(id) { $('.' + id).html( $('.' + id).html() ); } var imagec_index = 0; $('input[type=file]').each(function() { imagec_index++; $(this).wrap('&lt;div id="imagec_' + imagec_index + '"&gt;&lt;/div&gt;'); $(this).after('&lt;input type="button" value="Clear" onclick="reset_html(\'imagec_' + imagec_index + '\')" /&gt;'); }); </code></pre>
javascript jquery
[3, 5]
4,757,270
4,757,271
How to call a function repeatedly with 5 seconds delay? (ASP.NET with C#)
<p>I have a some piece of code in Default.aspx.cs file which is written within Page_Load function like this:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { //code stars here ... //code ends here } </code></pre> <p>What i want is that this piece of code will run continously with 5 seconds delay. How can I do this here? Thank You.</p>
c# asp.net
[0, 9]
4,091,533
4,091,534
How To exporting to Excel parent and nested GridView data?
<p>I have a gridview and some nested gridview inside it, when I try to export gridview data to Excel I get downloaded entire web page, I am sure it is beacause of nested gridviews.</p> <p>How can I export parent and nested gridview data into an Excel sheet?</p> <p>I use the following code to export to excel</p> <pre><code> gvExportToExcel.DataSource = objDs; gvExportToExcel.DataBind(); System.Web.HttpContext curContext = System.Web.HttpContext.Current; System.IO.StringWriter strWriter = null; System.Web.UI.HtmlTextWriter htmlWriter = null; curContext.Response.Clear(); curContext.Response.Buffer = true; curContext.Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("SearchSubmissionResult", System.Text.Encoding.UTF8) + ".xls"); curContext.Response.ContentType = "application/vnd.ms-excel"; curContext.Response.Write("&lt;meta http-equiv=Content-Type content=text/html;charset=UTF-8&gt;"); strWriter = new System.IO.StringWriter(); htmlWriter = new System.Web.UI.HtmlTextWriter(strWriter); this.ClearControls(gvExportToExcel); gvExportToExcel.RenderControl(htmlWriter); curContext.Response.Write(strWriter.ToString()); curContext.Response.End(); </code></pre>
c# asp.net
[0, 9]
2,225,863
2,225,864
match the passwords
<p>I have a piece of code for the password match. I want to verify every character with password field while typing in confirm password field.</p> <pre><code> var npass = $('#password'); var rpass = $('#confirmpassword'); if( npass.val() != rpass.val() ) { Val.errors = true; Val.showerrors = true; $("#confirmpasswordError").html("must match"); $("#confirmpasswordError").addClass('error-Yes-msg').show(); $("#confirmpassword").addClass('error-input'); return false; } else { $("#confirmpasswordError").removeClass('error-msg').html(''); $("#confirmpassword").removeClass('error-input'); } </code></pre>
javascript jquery
[3, 5]
1,821,095
1,821,096
jquery clone form fields and increment id
<p>I have a block of form elements which I would like to clone and increment their ID's using jQuery clone method. I have tried a number of examples but a lot of them only clone a single field.</p> <p>My block is structured as such:</p> <pre><code>&lt;div id="clonedInput1" class="clonedInput"&gt; &lt;div&gt; &lt;div&gt; &lt;label for="txtCategory" class=""&gt;Learning category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select class="" name="txtCategory[]" id="category1"&gt; &lt;option value=""&gt;Please select&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div&gt; &lt;label for="txtSubCategory" class=""&gt;Sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select class="" name="txtSubCategory[]" id="subcategory1"&gt; &lt;option value=""&gt;Please select category&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div&gt; &lt;label for="txtSubSubCategory"&gt;Sub-sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select name="txtSubSubCategory[]" id="subsubcategory1"&gt; &lt;option value=""&gt;Please select sub-category&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>Obviously elements are lined up a lot better but you get the idea.</p> <p>I would like to keep the id structure i.e. category1, subcategory1 etc as I use these to dynamically display select options based on the parent selection so if its possible to have each cloned block like category1/category2/category3 etc that would be great.</p>
javascript jquery
[3, 5]
2,838,745
2,838,746
JQuery event.stopPropagation() not working
<p>In my html I have a span of class dragHandle embedded within a li. </p> <pre><code>&lt;div class='treeView'&gt; &lt;ul class='tree'&gt; &lt;li&gt;&lt;span class="dragHandle"&gt;&lt;/span&gt;Item 1 &lt;ul&gt; &lt;li&gt;&lt;span class="dragHandle"&gt;&lt;/span&gt;Item 2 &lt;a href="#"&gt;link&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I attach event handlers using jQuery as follows: </p> <pre><code>$(".tree li").click(function(event) { alert("click"); event.stopPropagation(); }); $(".dragHandle").mousedown(function(event) { alert("down"); event.stopPropagation(); }); $(".dragHandle").mouseup(function(event) { alert("Up"); event.stopPropagation(); }); </code></pre> <p>When I mousedown and mouse up over the element I get the down and up alerts, however I also get the click alert of the li's event handler too. I thought that this should be prevented from by the call to event.stopPropagation in the mousedown and mouseup handlers. How do I stop the click event being called for mousedown/up events on the dragHandle?</p> <p>TIA, Adam</p>
javascript jquery
[3, 5]
912,112
912,113
Where are the options saved in this javascript?
<p>I am about to learn javascript and encountered <a href="http://themematcher.com/" rel="nofollow">http://themematcher.com/</a> where I have a question about their javascript. If you enter an address on the front page, you can select different on step two and this is managed by <a href="http://themematcher.com/script.js?v=1.7" rel="nofollow">http://themematcher.com/script.js?v=1.7</a> but how do they do to save what we choose? Can not find in the script that they use hidden field or cookies to store the value you choose (on step 2). Have also tried to run a debug with firebug but the JavaScript variables contains no div id or similar?</p> <p>Can anyone help me to identify how / where they save what we choose on step 2 to step 3 (after conversion)? In other words, if i select by clicking on it, where is the value saved to step 3 (conversion)?</p>
javascript jquery
[3, 5]
230,459
230,460
jQuery - click (almost!) anywhere to hide div
<p>I have a search input box that appears upon rollover of a button. Rather than having its own close button I would like to be able to click anywhere on the page to re-hide the Search.</p> <p>If I attach a click handler to the document this works fine but the problem being is that the search itself is part oofthe document. So if you click the input (which of course you need to do in order to type in a search) the search disappers.</p> <p>I had hoped I'd be able to write a function soemthing like this...</p> <pre><code>$(document).not("#search").click(function(){ $('#search_holder').fadeOut('fast'); }); </code></pre> <p>i.e apply a click handler to the entire document APART from the search. Unfortunately that doesn't work.</p> <p>so whats the answer?</p> <p>thanking You in advance</p>
javascript jquery
[3, 5]
1,685,204
1,685,205
jQuery: FadeIn a selected value on click
<p>I have a selected box with 5 values. I'm trying to fadeIn inputs of what is selected in the box. For example: If input1 is selected, fade in input1 on click.</p> <p>Here is what I'm trying to do:</p> <pre><code>$(document).ready(function(){ $('.btn').click(function() { if($("#selectbox").value == 'Input1') { $(".input1").show(); } else if($("#selectbox").value == 'Input2') { $(".input2").show(); } else if($("#selectbox").value == 'Input3') { $(".input3").show(); } else if($("#selectbox").value == 'Input4') { $(".input4").show(); } else if($("#selectbox").value == 'Input5') { $(".input5").show(); } } }); </code></pre> <p>And here is a NOT working fiddle: </p> <p><a href="http://jsfiddle.net/rzMHJ/" rel="nofollow">http://jsfiddle.net/rzMHJ/</a></p>
javascript jquery
[3, 5]
2,074,643
2,074,644
Android Progress Bars (Continuously Updating)
<p>The following code updates a set of progress bars when a button is clicked. (the values are random generated test values).</p> <p>For testing purposes I would ideally like the progress bars to be continuously updating. i.e. the button is pushed and the progress bars update, wait a second or two and update again and so on.</p> <p>I added a while loop to the onClick method but it causes the application to crash.</p> <p>Does anyone know how can I implement this? Maybe I am missing something very simple?</p> <p>Thanks in advance for any help!</p> <pre><code> Button dtTest = (Button) findViewById(R.id.button1); dtTest.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { // Generate Data Table int pb1 = (int)(Math.random()*100); int pb2 = (int)(Math.random()*100); int pb3 = (int)(Math.random()*100); int pb4 = (int)(Math.random()*100); ProgressBar pbFeedPump = (ProgressBar) findViewById(R.id.progressBar1); ProgressBar pbMediaFilter = (ProgressBar) findViewById(R.id.progressBar2); ProgressBar pbCartridges = (ProgressBar) findViewById(R.id.progressBar3); ProgressBar pbMotor = (ProgressBar) findViewById(R.id.progressBar4); // Update Progress Bars pbFeedPump.setProgress(pb1); pbMediaFilter.setProgress(pb2); pbCartridges.setProgress(pb3); pbMotor.setProgress(pb4); } }); </code></pre>
java android
[1, 4]
4,173,401
4,173,402
jQuery: sharing function between page code and document.ready code
<p>I have some nice dialogues defined as such in jQuery:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $( "#someDialog" ).dialog({ autoOpen: false, model: true, buttons: { "Do Something": function() { var cleanInput = sanitizeInput(input); // Do something with the clean input }, Cancel: function() { $( this ).dialog( "close" ); } }, close: function() { } }); function sanitizeInput(input) { // Some magic here return input; } }); &lt;/script&gt; </code></pre> <p>Somewhere in the page, unrelated to the dialog, I have an element that calls a function with a parameter:</p> <pre><code>&lt;a href="#" onclick="doSomething('wendy');"&gt;Wendy's stats&lt;/a&gt; </code></pre> <p>And the associated JavaScript:</p> <pre><code>&lt;script type="text/javascript"&gt; function doSomething(input) { var cleanInput = sanitizeInput(input); // Some code here } &lt;/script&gt; </code></pre> <p>I would like to reuse the sanitizeInput() function for this function as well. However, from outside the document.ready function, the dialog does not work. Putting the doSomething() function inside the document.ready function breaks it likewise. So where do I put the sanitizeInput() function such that both can use it?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
2,305,130
2,305,131
Question on popup window
<p>In my code I am using a popup window to display extra information. I also have the ability to export the information in the main window to Excel.</p> <p>The problem is, after the window pops up -> I see the info -> I close the popup window -> but if I try the export to Excel button, it throws the exception <em>"null object referrence"</em> (if I use a try/catch, the exception doesn't occur - but I don't get any information). </p> <p>In the export function I am doing something like this:</p> <pre><code>{ //some code .... here con.close(); session["dss"] = mydataset; } </code></pre> <p>In the export button click event:</p> <pre><code> system.data.dataset dss = (system.data.dataset)session["dss"]; //then some work on this </code></pre> <p>I think, probably when the popup window opens it ends the execution and that's why when I come back to the main window and try the export button the values for the tables and all goes out of scope.</p> <p>Also, if I refresh the main page after closing the popup window I don't have any issue and can export the data.</p> <p>Can you please help me with this?</p> <p>Thanks, Rahul</p>
c# asp.net
[0, 9]
2,290,003
2,290,004
how to popup modal before window close?
<p>I am using a fancybox jquery plugin, what i need is to make sure before the website close a modal popup up and get us the details for submission to a form. </p> <p>Please let us know how to make sure that before close a website a modal box fires up.</p> <p>Have tried using unload method. It works when you use return but in return you can not use a form.</p> <p>Please help!</p>
javascript jquery
[3, 5]
5,726,405
5,726,406
closests jquery
<pre><code>&lt;div class="panels"&gt; &lt;div&gt; &lt;h2&gt; Test &lt;/h2&gt; &lt;/div&gt; &lt;div class="inner_panel statict"&gt; Test2 &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want so that when people click on Test, Test2 appears. If not, they don't see Test2, How can I make that happen using jquery?</p> <p>I tried the following but it does not work.</p> <pre><code> $('.inner_panel').hide(); $('.panels').click(function () { $(this).closest('div .inner_panel').toggle(); }); </code></pre> <p>I have multiple divs with class panels in the file, so I don't want click on Test affecting the other "panels."</p>
javascript jquery
[3, 5]
2,794,962
2,794,963
How to programmatically invoke the error function in $.getJSON?
<p>In the code below, is it possible to call the error function from the else block?</p> <pre><code>$.getJSON('something.php', function(data) { if (data.error === undefined) { } else { // How can I call the error function below? } }).error(function() { // This is the error function the be called. }); </code></pre>
javascript jquery
[3, 5]
4,850,079
4,850,080
How to send serialize form data using JQuery if the input element is an array
<p>I have this piece of code in my PHP code:</p> <pre><code>while ($row = mysqli_fetch_assoc($result)) { extract($row); echo "&lt;tr&gt;"; echo "&lt;td bgcolor='#FFFFFF'&gt;&lt;input id='bookArray[]' name='bookArray[]' type='checkbox' value='$book_id' /&gt;$book_id&lt;/td&gt;"; echo "&lt;td bgcolor='#FFFFFF'&gt;$threat_name&lt;/td&gt;"; echo "&lt;/tr&gt;"; } </code></pre> <p>In HTML page, I want to use jQuery serialize() method to sent array of selected books in bookArray[]. In my JavaScript,</p> <pre><code>var selectedbooks = $("book_form").serialize(); alert (selectedbooks); </code></pre> <p>In the alert message box, i did not get any value (empty string).</p> <p>Previously when i am using Prototype, it worked nicely.</p>
php jquery
[2, 5]
2,703,458
2,703,459
Is there anything I can do to optimize the tab loading in javascript?
<p>My colleagues have create a website and there is a webpage which contains a Tab. He Implement the tab with the following method: </p> <p>1.Load all content of the page<br> 2.Use javascript to display those group content as block and organize them into tabs.<br> 3.when user click one tab, then acitve it, and hide all other tabs. </p> <p>And these functions works very well, but the performance is bad:<br> 1.Load all contents cost lots of time<br> 2.It will show all content at first, and then shrink to a tab control. When the user see this, it might think this is a bug of our system. </p> <p>And These code are ready to deploy, is there any quick fix to handle these problems ?<br> Thanks in advance !</p>
javascript asp.net
[3, 9]
2,012,081
2,012,082
Parsing python arguments in c++ extension
<p>Is there a function similar to PyArg_ParseTuple and PyArg_ParseTupleAndKeywords, without using a variable argument list?</p> <p>I have a c++ extension that takes a long list of input arguments. Parsing them in the format of PyArg_ParseTuple and PyArg_ParseTupleAndKeywords is just ugly to look at. I'm hoping to be able to pass my argument list in the form of ([keyword1, format1, ptr1], [keyword2, format2, ptr2], ...). Are there existing functions or packages to do so?</p>
c++ python
[6, 7]
784,713
784,714
Simple javascript Question (not simple for me)
<p>Can someone please correct my code here. It works well in most browsers but I get an error in ie7. I'm sure it's a syntax thing:</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function() { $(".testimonail-label").addClass("-webkit-animation"); $(".banner h2").addClass("-webkit-animation"); $(".banner .test-name").addClass("-webkit-animation"); }; </code></pre> <p></p>
javascript jquery
[3, 5]
2,714,968
2,714,969
Looking for a JQuery plugin that can upload images and provide a slide show for the same
<p>I am looking for a <strong>single</strong> jquery plugin that provides a slide show for uploaded images and an image upload section. </p> <p>While searching it I found many plugins but none of them could do both the tasks (<strong>uploading + slideshow</strong>). </p> <p>If anyone knows a plugin satisfying my requirement please share it with me.....!</p> <p>Thanks in advance. </p>
javascript jquery
[3, 5]
4,816,923
4,816,924
How do I create tags like stackoverflow?
<p>I've searched google looking for the jquery/php code to create the tags used when asking a question. Does anyone have a good reference or example of how this is done. </p> <p>I'm basically trying to create the multiple blocks allowing a user to remove them by clicking the 'X' I also need to integrate them with my DB tables.</p> <p>Thanks</p>
php jquery
[2, 5]
676,547
676,548
C# Image.FromStream is that secure?
<p>after reading the data from the request as Stream i needed to convert it to Image so i used this Method:</p> <pre><code>Stream inputStream = HttpContext.Current.Request.InputStream; Image img = Image.FromStream(inputStream) </code></pre> <p>my question is, while im unable to know what was in that inputStream (file format is done already but still..) there may be a virus or malware, so in that case FromStream(Stream) would throw ArgumentException. since it's not an image.</p> <p>my question is - If the file uploaded contains a virus, and the method throws an exception while trying to convert the stream to Image, did that make any harm to the server? if so, how to avoid it? what should be the scenario for handling file upload in the server?</p>
c# asp.net
[0, 9]
3,134,924
3,134,925
Need help with logic on how to assign the correct value to a textbox
<p>I am passing in a value to the form that I ultimately assign to a textbox using javascript. The value is a calculation based on values from another page/form. However, the textbox is editable. </p> <p>When reloading the form with the previously saved data, I don't want the value of the textbox to be overwritten with the pre-calculated value from another page if it was edited manually upon save.</p> <p>The other stipulation is, the page/form that has the values that the calculation is created from, can be changed. Therefore, I would also want to check to see if the calculated value has changed since last load, and if so, load that over the manually entered value.</p> <p>So... If textbox is blank populate with calculated value else if Manually entered value trumps calculated value else if calculated value has changed since last calculation, it trumps manually entered value.</p> <p>The other concern with this all, is how do I determine if the user has typed in the textbox to determine if the value was manually entered?</p>
javascript asp.net jquery c++
[3, 9, 5, 6]
639,981
639,982
meta tag for compatibility mode
<p>I have web app with lots of JS and jQuery code and my problem is with IE9. For some reason my JS is not responding in IE9, in all other browsers is working well including IE8.</p> <p>What is happening is that when I put <code>&lt;meta http-equiv="X-UA-Compatible" content="IE=8"/&gt;</code> the JS is working in IE9 but not like in other browsers (some of the features are not working well), then when I change it to <code>&lt;meta http-equiv="X-UA-Compatible" content="IE=9"/&gt;</code> and refresh everything starts to work fine, but if I clear the cache and restart browser I have the same problem again.</p> <p>I've also tried to remove meta tag totally but that doesn't help. If someone have more experience with IE any advice is welcome.</p> <blockquote> <p>Note: This problem is appears only on online server, locally on my WAMP is fine.</p> </blockquote> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
4,621,531
4,621,532
DataTable that can be accessed from Repeater.ItemDataBound
<p>I'm new to ASP.Net, C#, and OOP in general, and I'm trying to get into the right paradigm about classes, objects, methods, etc.</p> <p>I would like to access a <code>DataTable</code> from the Repeater.ItemDataBound event. Where would I create the <code>DataTable</code> so the method can access it? I don't want the DataTable created everytime ItemDataBound is called, just once. Would that be a separate class, or another method in the same class, or something else? </p> <p>I want to use this to set values on controls in the <code>HeaderTemplate</code> of a <code>Repeater</code>. Here is my code:</p> <pre><code>public partial class test : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int numPages = 3, numItems = 10; int[] parentRepeatCnt = Enumerable.Range(0, numPages).ToArray(); int[] childRepeatCnt = Enumerable.Range(0, numItems).ToArray(); ParentRepeater.DataSource = parentRepeatCnt; ParentRepeater.DataBind(); foreach (int i in parentRepeatCnt) { Repeater ChildRepeater = ParentRepeater.Items[i].FindControl("ChildRepeater") as Repeater; ChildRepeater.DataSource = childRepeatCnt; ChildRepeater.DataBind(); } } public void ChildRepeater_ItemDataBound(Object Sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Header) { Label Label1 = e.Item.FindControl("Label1") as Label; // access DataTable here Label1.Text = myDataTable.Rows[0]["item"].ToString(); } } } </code></pre> <p>Also, please feel free to critique my existing code. Thanks!</p>
c# asp.net
[0, 9]
4,081,599
4,081,600
jQuery Form Problem
<p>I have developed a form using jQuery, HTML and a C# and ASPX back-end.</p> <p>It works fine on Firefox and other Web browsers but if fails on Internet Explorer and don't know why.</p> <p>I have tryied everything.</p> <p>The URL is <a href="http://incolmotos.datacenter.arkix.com/appYamaha/Frmcontacto.aspx" rel="nofollow">Web Form</a></p> <p>Any ideas??</p> <p>Thanks!!</p>
c# jquery asp.net
[0, 5, 9]
480,698
480,699
Conditional HyperLink in GridView?
<p>I have a gridview with a hyperlink:</p> <pre><code>&lt;asp:GridView ID="gvEmployees" runat="server" AutoGenerateColumns="False" CssClass="table table-hover table-striped" GridLines="None" &gt; &lt;Columns&gt; &lt;asp:TemplateField HeaderText="Name" SortExpression="EmployeName"&gt; &lt;ItemTemplate&gt; &lt;asp:HyperLink ID="HyperLink1" runat="server" Text='&lt;%# Bind("EmployeName") %&gt;' &gt;&lt;/asp:HyperLink&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField HeaderText="ID" SortExpression="EmployeID" Visible="False"&gt; &lt;ItemTemplate&gt; &lt;asp:Label ID="lblID" runat="server" Text='&lt;%# Bind("EmployeID") %&gt;'&gt;&lt;/asp:Label&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>However, it should only appear as a hyperlink if the employeeID is that of the logged in employee.</p> <p>I can do all that, but what I do not know is how to make the hyperlink look like a Label. It's easy to have it not link anywhere, but I do not know how to make it look like a label.</p> <p>Thanks</p>
c# asp.net
[0, 9]
5,484,320
5,484,321
jQuery Click how to?
<p>I have a newsletter I am sending and when a certain link is clicked I want it to show information not shown on the page by default. I am doing this by having the URL check for URL parameters but I am doing something wrong as it does not work. Can someone help me please since I am not very good at javascript.</p> <p>Here is my code: </p> <pre><code>&lt;p class="textcenter"&gt;&lt;a id="click" href="javascript:showPhotoInfo();"&gt;Photo Info &lt;/a&gt;&lt;/p&gt; &lt;div id="PhotoInfo" class="hide"&gt; &lt;p&gt;Info Here...&lt;/p&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; var $j = jQuery.noConflict(); $j(document).ready(function() { var url = window.location.href; url = url.toLowerCase(); if (url.indexOf('?photoinfo=1') != -1 || url.indexOf('&amp;photoinfo=1') != -1) { $j("#click").click(); } }); function showPhotoInfo() { document.getElementById('PhotoInfo').style.display='block'; } &lt;/script&gt; </code></pre> <p>I have also tried this: </p> <pre><code>&lt;script type="text/javascript"&gt; var $j = jQuery.noConflict(); $j(document).ready(function() { var url = window.location.href; url = url.toLowerCase(); if (url.indexOf('?photoinfo=1') != -1 || url.indexOf('&amp;photoinfo=1') != -1) { function showPhotoInfo() { document.getElementById('PhotoInfo').style.display='block'; } } }); function showPhotoInfo() { document.getElementById('PhotoInfo').style.display='block'; } &lt;/script&gt; </code></pre> <p>If a person clicks the link on the page it shows correctly. I need the URL parameter to be checked then click the link to display the needed information. </p>
javascript jquery
[3, 5]
5,496,574
5,496,575
I need some help importing an RSS feed from Wordpress
<p>I'm trying to import the last 5 posts from a Wordpress RSS feed and show them on my site.</p> <p>I was using this, but it grabs the whole feed.</p> <pre><code>&lt;asp:DataList ID="dataNews" runat="server" DataSourceID="xmlSource" &gt; &lt;ItemTemplate&gt; &lt;a href="&lt;%# XPath("link") %&gt;"&gt;&lt;%# XPath("title") %&gt;&lt;/a&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; &lt;asp:XmlDataSource ID="xmlSource" runat="server" DataFile="http://myblog.com/feed" XPath="rss/channel/item" EnableCaching="true" /&gt; </code></pre> <p>How can I accomplish this?</p>
c# asp.net
[0, 9]
4,071,056
4,071,057
Grid view SelectedRowStyle does not apply to Template Fields
<p>Markup</p> <pre><code>&lt;asp:GridView ID="gridView_Config" runat="server" AutoGenerateColumns="False" CssClass="gridViewStyle" OnRowDataBound="gridView_Config_RowDataBound" OnSelectedIndexChanged="gridView_Config_SelectedIndexChanged"&gt; &lt;Columns&gt; &lt;asp:TemplateField ControlStyle-CssClass="ConfigProfileColumn ProfileTextBoxWidth"&gt; &lt;ItemTemplate&gt; &lt;div&gt; &lt;asp:TextBox Text='&lt;%# Bind("Type") %&gt;' ID="type" runat="server" ReadOnly="true" CssClass="FieldLabel " &gt;&lt;/asp:TextBox&gt; &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;SelectedRowStyle CssClass="gridViewSelectedRow" /&gt; &lt;HeaderStyle CssClass="gridHeader" /&gt; &lt;/asp:GridView&gt; </code></pre> <p>Code-Behind</p> <pre><code>protected void gridView_PrintConfig_RowDataBound(object sender, GridViewRowEventArgs e) { //check the item being bound is actually a DataRow, if it is, //wire up the required html events and attach the relevant JavaScripts if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.gridView_PrintConfig, "Select$" + e.Row.RowIndex); } } </code></pre> <p>The gridViewSelectedRow css class has background color blue and color as white. but when a row is selected the text color of the template field still remains black instead of white. how do i solve this?</p>
c# asp.net
[0, 9]
5,548,959
5,548,960
Unable to set GridView row widths on RowDataBound
<p>My current code to attempt to set widths for the rows on a gridview is:</p> <pre><code>protected void RowDataBound(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { foreach (DataControlFieldHeaderCell dcfhc in e.Row.Cells) { dcfhc.Width = 100; } } else { foreach (DataControlFieldCell dcfc in e.Row.Cells) { dcfc.Width = 100; } } } </code></pre> <p>But that just keep all of the widths default! What am I doing wrong?</p> <p>EDIT: I have already tried thise code as well!</p> <pre><code>PoolToDBHeaders.DataSource = new DataView(headerTable); PoolToDBHeaders.DataBind(); foreach (DataControlField dcf in PoolToDBHeaders.Columns) { dcf.ItemStyle.Width = 100; } PoolToDBHeaders.DataBind(); </code></pre>
c# asp.net
[0, 9]
4,949,789
4,949,790
Start a thread a second time
<pre><code>thread = new Thread() { @Override public void run() { while(!requestedToExit) { SystemClock.sleep(3000); Log.d("debug", "in"); } } }; </code></pre> <p>So a button got an event, Each time I click on it it's start the thread (if the previous thread is not alive).</p> <p>So I tried use thread.start() but it throw thread already started. I tried .run(), nothing happens, I also tried each time I click on the button, and it's possible to run it again, create a new thread and start it : nothing.</p> <p>Some ideas ?</p> <hr> <p>Using Runnable : </p> <pre><code> r= new Runnable(){ public void run() { while(!requestedToExit) { Log.d("debug", "in"); SystemClock.sleep(3000); } } }; </code></pre> <p>Then I use in my listener : </p> <pre><code>thread = new Thread(injection); thread.start(); </code></pre> <p>But I only see the debug the first time, he never enter into it after.</p> <p>Thanks in advance</p>
java android
[1, 4]
5,318,009
5,318,010
Javascript encoding test for url?
<p>I need to send data via a url (it's JSON'd) that I would like to encrypt using some method that I can then decrypt it using php. I was thinking base64, but I need a url safe base 64 (I'm using CI and CI removes +,= and /).</p> <p>Is there anyway to duplicate </p> <pre><code>function url_base64_encode(&amp;$str="") { return strtr( base64_encode($str), array( '+' =&gt; '.', '=' =&gt; '-', '/' =&gt; '~' ) ); } </code></pre> <p>in Javascript?</p> <p>Or some other alternative?</p>
php javascript
[2, 3]
3,007,535
3,007,536
open URL with IF THEN
<p>I would like to open a website with IF THEN command in my app.</p> <p>Here is my code thus far:</p> <pre><code>if (RecognizerIntent.EXTRA_RESULTS.equals ("google")){ Executions.getCurrent().sendRedirect("http://www.google.com", "_blank"); </code></pre> <p>but it says 'executions' can not be resolved.</p> <p>Than kyou in advance. Flinx</p>
java android
[1, 4]
5,744,458
5,744,459
Android simple widget
<p>I have a problem with my first android widget... I am doing like this:</p> <pre><code>public class TestwidActivity extends AppWidgetProvider { @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager,int[] appWidgetIds) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1, 1000); } @Override public void onReceive(Context context, Intent intent) { // v1.5 fix that doesn't call onDelete Action final String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt( AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { super.onReceive(context, intent); } } private class MyTime extends TimerTask { RemoteViews remoteViews; AppWidgetManager appWidgetManager; ComponentName thisWidget; java.text.DateFormat format = SimpleDateFormat.getTimeInstance(SimpleDateFormat.MEDIUM,Locale.getDefault()); public MyTime(Context context, AppWidgetManager appWidgetManager) { this.appWidgetManager = appWidgetManager; remoteViews = new RemoteViews(context.getPackageName(), R.layout.main); thisWidget = new ComponentName(context, TestwidActivity.class); } @Override public void run() { Bitmap bm; remoteViews.setTextViewText(R.id.Clock, "Time = " + format.format(new Date())); bm= BitmapFactory.decodeFile("/sdcard/myFile.png"); remoteViews.setImageViewBitmap(R.id.team11, bm); appWidgetManager.updateAppWidget(thisWidget, remoteViews); } } } </code></pre> <p>but this stops printing the time after 2 seconds. If I only print the time without the image it works perfect, but in this way it doesn't.why?</p>
java android
[1, 4]
2,025,527
2,025,528
Dynamically adding asp:button to web form using jQuery append() method
<p>I am trying to add an ASP.Net Button programatically using jQuery append method to HTML. Here is the code:</p> <pre><code>$("#form1 #container").append('&lt;div id="cool"&gt;&lt;asp:Button ID="Button1" runat="server" Text="Button" &gt;/div&gt; '); </code></pre> <p>But somehow it shows this error </p> <blockquote> <p>Control 'Button1' of type 'Button' must be placed inside a form tag with runat=server.</p> </blockquote> <p>Please help me. Thanks.</p>
jquery asp.net
[5, 9]
1,143,639
1,143,640
Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
<p>I am getting an : <strong>Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function</strong> error in Chrome with my script.</p> <pre><code> &lt;script type="text/javascript"&gt; function showSlidingDiv() { $("#slidingDiv").fadeToggle("slow", "linear"); } function showSlidingDiv2() { $("#slidingDiv2").fadeToggle("slow", "linear"); } function showSlidingDiv3() { $("#slidingDiv3").fadeToggle("slow", "linear"); } &lt;/script&gt; </code></pre> <p>Does anyone know what could be wrong here? Jasper</p>
javascript jquery
[3, 5]
2,517,517
2,517,518
edittext validation
<p>I have following small block of code to set validation on edit text when a button is pressed and display the validation message in a dialog.</p> <p><strong>Java Code</strong> </p> <pre><code>setContentView(R.layout.addnewcontacts); Button buttonSave = (Button) findViewById(R.id.buttonSave); final EditText editTextName = (EditText) findViewById(R.id.editTextName); buttonSave.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { if (editTextName.getText().toString().length() == 0) { editTextName.setError( "First name is required!" ); } } }); } </code></pre> <p>Code is working fine but the popup is not displaying text in it.</p> <p><strong>Screen shot :</strong></p> <p><img src="http://i.stack.imgur.com/rRguF.png" alt="enter image description here"></p> <p>Why popup is not showing text?</p>
java android
[1, 4]
5,553,089
5,553,090
using php array in jquery
<p>In the below code i have an array arrSGoal. On Click of RemoveGoal i need to delete or set the value to 0 for the the id in the array. Array is in php. dont know how to use in the jquery. </p> <pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt; $(document).ready(function() { $('a.removegoal').click(function(e) { e.preventDefault(); //Getting the TR to remove it in case of successful deletion var objRow = $(this).closest('tr'); objRow.remove(); }); }); $arrSGoal[$i] = $row-&gt;id_goals; ?&gt; &lt;tr&gt; &lt;td style='vertical-align:top;'&gt; &lt;textarea name="stg&lt;?php print $i;?&gt;" id="short_goal" class="short_go"&gt;&lt;?php print $row-&gt;goal_description?&gt;&lt;/textarea&gt; </code></pre> <p>&lt;/td&gt; &lt; td style='vertical-align:bottom;' nowrap&gt; &lt;span class='hidden'&gt; echo $i &lt;/span&gt; &lt;a href=# class="removegoal" &gt;Remove Goal</p>
php jquery
[2, 5]
1,601,311
1,601,312
.click function .load not working
<p>I am a total novice at jQuery, but giving it a go. I cant seem to get the <code>.click</code> function below to work. Can anyone tell me were I am going wrong?</p> <pre><code>$(".news").click(function() { $("#contentarea").load("console/news.php"); }); </code></pre>
javascript jquery
[3, 5]
4,314,609
4,314,610
Jquery script not working with IE
<p>I written this script, to add JavaScript functionality to my online shop, the script works fine with Firefox and Chrome, but will not run on ie, and i am not sure why?</p> <p>i am using <code>jQuery(function( $ ){</code> instead of <code>.ready</code> due to script conflicts, i have tested the script using <code>.ready</code> and it still does not work with ie.</p> <p>if anyone has an ideas they would be much appreciated.</p> <pre><code>jQuery(function( $ ){ setInterval(function(){ updatecart(); },8000); $('.addtobag').on('click', function(){ event.preventDefault(); var postdata = new Object(); var action = $(this).closest('form').attr('action'); $(':input',$(this).closest('form')).each(function(evt){ var L = $(this).attr('name') postdata[L] = $(this).val(); }); $.post(action, postdata); generate('success'); //display banner updatecart(); //update cart }); var postdata = new Object(); postdata['basket'] = phpbasket; function updatecart() { $.post("/get_cart_details.php", postdata, function (data) { var obj = $.parseJSON(data); $('#qty_js').text(obj.items_qty); $('#amt_js').text(obj.items_value); }); } function generate(type) { var n = noty({ text: 'The item(s) have been added to your basket.', type: type, dismissQueue: true, layout: 'topCenter', theme: 'defaultTheme' }); console.log('html: '+n.options.id); setTimeout(function() { $.noty.closeAll(); }, 5000); } }); </code></pre>
javascript jquery
[3, 5]
2,603,547
2,603,548
RegisterStartupScript not working inside catch block
<p>I am <code>ASP.NET/C#</code>.In one of my pages where I am submitting customer information to the database I am using popup to notify the user if data was inserted, or when the form has not been filled correctly and I am also trying to show popup if something goes wrong while trying to insert.So far the popup displays correctly when data is inserted successfully and also when validation fails.But the popup doesnot display if something goes wrong while submitting. Here is my code</p> <pre><code>catch (Exception ex) { ClientScript.RegisterStartupScript(GetType(), "UnexpectedError", "ShowSubmitPopUp('uerror')", true); NewCustomerStatusMsg.Style["display"] = "block"; NewCustomerStatusMsg.Style["color"] = "Red"; NewCustomerStatusMsg.Text = "There was some error while submitting your information.Please re-enter the values and try again."; } </code></pre> <p>Can anybody help me out with this.What is missing here.</p> <p>Any suggestions are welcome.</p>
c# asp.net
[0, 9]
997,775
997,776
How to know at page load, if view state is clear at some other event on the page?
<p>I am facing a weird problem, i am dynamically loading user control at page load with ViewState condition check, if true then load it, else not. Now the problem is on a dropdown selected index change event i set NULL to view state but the page load comes in action first and it sees that the viewstate is not null, so it load the control again, how to overcome with this problem, please let know how to fix it.</p>
c# asp.net
[0, 9]