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
4,424,352
4,424,353
Passing a jQuery event as a variable
<p>You can do this with JavaScript:</p> <pre><code>function bar(test) { alert(test); } var foo = bar; foo('hi'); </code></pre> <p>I'd like to be able to do something similar with a jQuery event:</p> <pre><code>var foo = $('#bork').click; foo(function() { alert('I was just clicked.'); }); </code></pre> <p>However, I get an error when the page loads: <code>this.bind is not a function</code>. Am I doing something wrong with the events here? Is there a better way to get the same effect?</p>
javascript jquery
[3, 5]
3,412,797
3,412,798
Any tutorials or books that teach C# the way I learned java (commandline, without intelliSense or VS)?
<p>I'm a good java programmer and want to learn C# (seems fun, delegates, linq, lambda expressions, access to native dlls and unmanged code etc).</p> <p>Every tutorial, book seems to teach C# with Visual Studio. But at the learning state I want to write everything manually without intelliSense or project/solution etc and compile it at command prompt, the way anyone learns java.</p> <p>Is there a good resource or book that teaches C# and .net this way?</p>
c# java
[0, 1]
4,031,111
4,031,112
data pager in listview Issue
<p>I have a listview where in I placed datapager as follows. I am using SQl datasource and binding the records to ListView.</p> <pre><code>asp:ListView runat="server" ID="ListView1" DataKeyNames="ProductId,GameName" DataSourceID="GameTable" OnItemCommand="On_Select_Item" </code></pre> <p>and datapager in the LayoutTemplate</p> <p>And in the item template I am placing a button, when clicked it calls a method where i am trying to fetch DatakeyName values. It is working fine in first page when pager is given, However when moved to other page in the pager, it is throwing me an exception. Here is the button click code,</p> <pre><code>protected void On_Select_Item(object sender, ListViewCommandEventArgs e) { if (String.Equals(e.CommandName, "AddtoCart")) { //checks if the user is logged in if (User.Identity.IsAuthenticated) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; DropDownList dl = e.Item.FindControl("DropDownList") as DropDownList; String val=""; if (dl != null) { val = dl.SelectedValue; //Get the selected value from DropDownList } String price = Convert.ToString(e.CommandArgument).Trim(); //Get the price for the selected game. </code></pre> <p>-------------Exception is thrown at below line ---------</p> <pre><code> string ProductId = ListView1.DataKeys[dataItem.DataItemIndex]["ProductId"].ToString(); //Product Id for the selected game. string GameName = ListView1.DataKeys[dataItem.DataItemIndex]["GameName"].ToString(); //gamename ............................... ............................. </code></pre> <p>}</p>
c# asp.net
[0, 9]
1,742,110
1,742,111
how might I disable a div when the data inside it reaches 0 possibly using an if else?
<p>I have a snippet of javascript that displays the amount of sessions available for an event </p> <pre><code>for ( var j in data.events[i].sessions ) { first_session_id = !first_session_id ? data.events[i].sessions[j].id : first_session_id; session_html += '&lt;li id="session_row_'+ data.events[i].sessions[j].id +'"&gt;'+ data.events[i].sessions[j].time+ '&lt;div class="right"&gt;'+ data.events[i].sessions[j].available +' sessions remaining&lt;/div&gt;&lt;/li&gt;'; } </code></pre> <p>at the moment when the sessions become empty or are all booked the value -1 is displayed. What I would like to do is add an if else statement that basically disables or blacks out the .right when we get to 0?</p> <p>Can anyone advise me on how this might be done?</p> <p>Regards Kyle</p>
javascript jquery
[3, 5]
2,334,015
2,334,016
how to set text an integer and get int without getting error
<p>This is the code i used in getting the intent for integer. The String get intent works fine and displays well but when i put the integer i get a force close error. I might be doing something wrong here. This is the code:</p> <pre><code>package kfc.project; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.widget.EditText; import android.widget.TextView; public class productdetail extends Activity{ @Override protected void onCreate(Bundle bundle) { // TODO Auto-generated method stub super.onCreate(bundle); setContentView(R.layout.productdetail); //stuff to get intent Intent receivedIntent = getIntent(); String productName = receivedIntent.getStringExtra("name"); int productCalories = receivedIntent.getIntExtra("calories",0); /*Intent intent = new Intent(ProductListView.this, productdetail.class); intent.putExtra("name",product.getName()); intent.putExtra("calories", product.getCalories()); intent.putExtra("serving size", product.getServingSize()); intent.putExtra("fat", product.getFat()); intent.putExtra("saturated fat", product.getSaturatedFat()); intent.putExtra("trans fat", product.getTransFat()); intent.putExtra("cholesterol", product.getCholesterol()); intent.putExtra("sodium", product.getSodium()); intent.putExtra("carbs", product.getCarbs()); intent.putExtra("fiber", product.getFiber()); intent.putExtra("sugar", product.getSugar()); intent.putExtra("protein", product.getProtein()); intent.putExtra("vitamina", product.getVitaminA()); intent.putExtra("vitaminc", product.getVitaminC()); intent.putExtra("calcium", product.getCalcium()); intent.putExtra("iron", product.getIron());*/ Bundle extras = getIntent().getExtras(); String name = extras.getString("name"); if (name != null) { TextView text1 = (TextView) findViewById(R.id.servingsize); text1.setText(productName); } //int calories = extras.getInt("calories"); TextView text1 = (TextView) findViewById(R.id.calories); text1.setText(productCalories); /* Intent intent = getIntent(); String str = intent.getStringExtra("name");*/ } } </code></pre>
java android
[1, 4]
1,478,464
1,478,465
jQuery check all not working on checkboxes
<p>I'm writing some code that will allow the following:</p> <p>1.) If a user checks a checkbox it will change the parent <code>&lt;tr&gt;</code> to have a class of selected (this can also be unchecked and remove the class)</p> <p>2.) Any checkboxes that are already checked will have the class added on document load</p> <p>3.) If a user checks the #checkall input then all inputs will become checked and add the class of selected (if checked again then it will unselect all and remove the class)</p> <p>This is the code I have so far:</p> <pre><code>$("table input[name=choose]:checked").each(function() { $(this).closest("tr").addClass("selected"); }); $("table input[name=choose]").live("change", function() { $(this).closest("tr").toggleClass("selected"); }); if ($('#checkall:checked') == true) { $('#checkall').live("click", function() { $('table input[name=choose]').attr('checked', false); $('table input[name=choose]').closest("tr").toggleClass("selected"); }); } else { $('#checkall').live("click", function() { $('table input[name=choose]').attr('checked', true); $('table input[name=choose]').closest("tr").toggleClass("selected"); }); } </code></pre> <p>The first two work fine but number 3 doesn't uncheck the checkboxes... Any ideas why? But the class part works fine??</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,772,206
3,772,207
To identify the load - from button click or refresh
<p>I have a button in my page which does some transaction in my database.</p> <p>Currently, I am facing a problem: </p> <ul> <li>If I click the button it posts back the page and it goes into <code>button_Click(object sender, EventArgs e)</code> and does the transaction <strong>which is okay for me</strong>.</li> <li>If I refresh the page , it again goes into <code>button_Click(object sender, EventArgs e)</code> which is not desirable.</li> </ul> <p>How can I determine if the user has refreshed the page and avoid duplicating the transaction?</p> <p>Thanks in advance.</p>
javascript asp.net
[3, 9]
4,432,870
4,432,871
jQuery LightBox( SlimBox): How to populate an ASPX file inside it?
<p>I am having an ASPX page and i m trying to using jQuery light box(slimbox).I am able to invoke the Lightbox.Now i want to show the content of another page in this lightbox.Ex : I have a data entry form for user registration(signup.aspx).I want to show this when user clicks on the link (which is now showing image in the light box) .Is this possible, If Yes, Willl the evenet handlers work for that ASP page ? ie ;When user enter the data and clicks on the Button,Will it fire a Server side event ? </p> <p>Thanks in advance</p>
asp.net jquery
[9, 5]
5,792,569
5,792,570
use database to keep track log in attempt
<p>I know this question might be duplicate of other similar questions but I couldn't find a proper answer, sorry if I didn't show you the code becuase I am not sure how to do it.</p> <p>I try to create a login page in PHP, but I want to keep track of the users log in attempt if they didn't sucessfully log in. I assume using database but don't know how exactly to do it. </p> <p>what I want is that when people failed after three attempt it should generate an alert dialogue (modal window will be even better) and when user click OK in the alert the log in window should be closed as well.</p> <p>After that if the user go to the login page again, the login form should not be shown to the user again within an hour, I assume to use ip or session to block it. But since the user not logged in, I don't know if I can store the ip in the database. s</p> <p>Can anyone help me with that? Any help would be greatly appreciated! </p>
php javascript jquery
[2, 3, 5]
3,735,522
3,735,523
mediaplayer.start() makes app crash only on Motorola Droid devices
<p>I have a soundboard uploaded on the android market. The app is doing pretty well in the market(50,000+ downloads), but the developer console reports that I have an error, and this is bothering me.</p> <p>All crash reports come from only one device - Motorola Droid. I've looked at what the error actually is, and it happens when I call the start() method for the MediaPlayer class. I get the following:</p> <p>java.lang.NullPointerException:</p> <p>at com.meeg.soundit.Soundboard.playAudio(Soundboard.java:2517)</p> <p>the code for the method playAudio is as follows and line 2517 is mp.start():</p> <pre><code>public void playAudio(int resid){ final MediaPlayer mp = MediaPlayer.create(this, resid); mp.start(); mp.setOnCompletionListener(new OnCompletionListener() { public void onCompletion(MediaPlayer arg0) { mp.release(); } }); } </code></pre> <p>Like I said, my soundboard has over 50,000 downloads, and it has 80 reports, all from the Motorola Droid. Is this something that I should ignore because 80 reports isn't much compared to how many people have used this, is there a problem with Moto Droid's and MediaPlayer, or is it just my code thats faulty?</p>
java android
[1, 4]
4,407,417
4,407,418
Are inline function calls completed first in every browser?
<p>Is it guaranteed that inline <code>onClick="asdf()"</code> will always <strong>complete</strong> before any jquery attached functionality is called? In all browsers?</p> <p>Seems so,( <a href="http://jsbin.com/eribeb/1/edit" rel="nofollow">http://jsbin.com/eribeb/1/edit</a> ) but I haven't seen any documentation that states categorically that this is the case. </p>
javascript jquery
[3, 5]
3,756,460
3,756,461
javascript onchange query issue
<p>I have the following javascript at the head of my file.</p> <pre><code>&lt;?php echo "&lt;script language='JavaScript'&gt;\n"; echo "var times = new Array();\n"; echo "times[0] = 0;\n"; foreach($times as $time) { echo "times[". $time-&gt;DESC ."] = " . $time-&gt;FEE . ";\n"; } echo "&lt;/script&gt;\n"; ?&gt; </code></pre> <p>i then have a dropdown, where the options are the same $time->DESC,</p> <p>i have an onchange, and i want to set another text box value to equal the PBT_FEE according to the PBT_DESC</p> <p>i have</p> <pre><code>onchange="document.getElementById('Price').value = times[this.value];" </code></pre> <p>i presume that times[this.value] should call for the fee according to the matching descriptions, but i get no output</p>
php javascript
[2, 3]
5,186,961
5,186,962
passing a string parameter when calling a method in asp.net
<p>I have this method in cs page:</p> <pre><code>public String getToolTip(Object productId, Object imgBtnId) { return UtilsStatic.getWishListButtonToolTip(Int32.Parse(productId.ToString()), getCumparaturiCategoryID(imgBtnId.ToString())); } </code></pre> <p>and i want to call it from asp.net page (aspx).</p> <p>I tried like this but it fails:</p> <pre><code> ToolTip="&lt;%# getToolTip(getProductIdNoutatiFeatured(), 'imgBtnWishSubcategory2Featured')%&gt;"/&gt; </code></pre> <p>Please note that the second parameter is an hardcoded string...but it says: </p> <blockquote> <p>CS1012: Too many characters in character literal</p> </blockquote> <p>I think it is wrong to put the string between ' '. But how?</p>
c# asp.net
[0, 9]
535,334
535,335
Query string problem
<pre><code>Response.Redirect(my site's url + "editques/" + "QuesID/" + QuesID + "/" ); </code></pre> <p>Redirecting as shown above...In the editques.aspx page, whenI debug, I see the Query String's value as {QuesID=jhgjgjhjk&amp;PID=jhhkjkj}</p> <p>Where on earth did this PID came from!??</p>
c# asp.net
[0, 9]
3,495,789
3,495,790
How to increase div content value?
<p>I want to increase div value +1 in certain events.How can i get div value and increase it?</p>
javascript jquery
[3, 5]
3,826,360
3,826,361
Load user control data after page postback?
<p>I have a page where a user can update their user information (like their first name). I also have a user control on this page that displays a lot of information, including the user's first name.</p> <p>My problem I'm having is that when I change the first name on this page, the user control isn't updated after I save the data.</p> <p>Here's my front end:</p> <pre><code>&lt;UC:LeftNav ID="leftNav" runat="server" /&gt; &lt;asp:TextBox ID="txtFirstName" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" /&gt; </code></pre> <p>My button click event to save the user info:</p> <pre><code>protected void btnSave_Click(object sender, EventArgs e) { ... user.FirstName = txtFirstName.Text(); user.Save(); ... } </code></pre> <p>My user control that displays the user info:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { ... lblFirstName.Text = user.Firstname; ... } </code></pre> <p>I went through the debugger, and I found that the <code>btnSave_Click</code> event on my page occurs <em>after</em> the <code>Page_Load</code> event of my user control.</p> <p>Is there a way that I can get the <code>btnSave_Click</code> event to occur <em>before</em> I load the user data in my user control?</p>
c# asp.net
[0, 9]
2,657,034
2,657,035
Combo box id in JavaScript
<p>Can I find the <code>id</code> of a combo box in JavaScript, not its value?</p> <p>jsp file code</p> <pre><code>function ChangeColor(colors) { var partcolor = (colors.options[colors.selectedIndex].value); if (partcolor=="black"){ document.getElementById("colorRow").style.backgroundColor = 'black'; } else if(partcolor=="brown") { document.getElementById("colorRow").style.backgroundColor ='brown'; } else if(partcolor=="yellow") { document.getElementById("colorRow").style.backgroundColor ='yellow'; } } </code></pre> <p>java file code </p> <pre><code>public String getColor(String colorName) { mySB.append("&lt;select onchange=\"ChangeColor(this);\" style=\"font-size:0.8em;\" id=\"").append(colorName).append("\" name=\"").append(colorName).append("\"&gt;") .append("&lt;option value=\"\"&gt;&amp;nbsp;&lt;/option&gt;"); } </code></pre> <p>How can I print the id of combo box here?</p>
java javascript
[1, 3]
1,448,269
1,448,270
Android: Help with tabs view
<p>So I'm trying to build a tabs view for an Android app, and for some reason I get a force close every time I try to run it on the emulator. When I run the examples, everything shows fine, so I went as far as to just about copy most of the layout from the examples(a mix of Tabs2.java and Tabs3.java), but for some reason it still wont run, any ideas?</p> <p>Here is my code(List1.class is a copy from the examples for testing purposes). It all compiles fine, just gets a force close the second it starts:</p> <pre><code>package com.jvavrik.gcm; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TabHost; import android.widget.TextView; public class GCM extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final TabHost tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("g", getResources().getDrawable(R.drawable.star_big_on)) .setContent(new Intent(this, List1.class))); tabHost.addTab(tabHost.newTabSpec("tab2") .setIndicator("C") .setContent(new Intent(this, List1.class)) ); tabHost.addTab(tabHost.newTabSpec("tab3") .setIndicator("S") .setContent(new Intent(this, List1.class)) ); tabHost.addTab(tabHost.newTabSpec("tab4") .setIndicator("A") .setContent(new Intent(this, List1.class)) ); } } </code></pre>
java android
[1, 4]
560,260
560,261
Not able to cache HttpResponse using cachingHttpClient in android
<pre><code>public class CacheDemo { public static void main(String[] args) { CacheConfig cacheConfig = new CacheConfig(); cacheConfig.setMaxCacheEntries(1000); cacheConfig.setMaxObjectSizeBytes(1024 * 1024); HttpClient cachingClient = new CachingHttpClient(new DefaultHttpClient(), cacheConfig); HttpContext localContext = new BasicHttpContext(); sendRequest(cachingClient, localContext); CacheResponseStatus responseStatus = (CacheResponseStatus) localContext.getAttribute( CachingHttpClient.CACHE_RESPONSE_STATUS); checkResponse(responseStatus); sendRequest(cachingClient, localContext); responseStatus = (CacheResponseStatus) localContext.getAttribute( CachingHttpClient.CACHE_RESPONSE_STATUS); checkResponse(responseStatus); } static void sendRequest(HttpClient cachingClient, HttpContext localContext) { HttpGet httpget = new HttpGet("http://www.mydomain.com/content/"); HttpResponse response = null; try { response = cachingClient.execute(httpget, localContext); } catch (ClientProtocolException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } HttpEntity entity = response.getEntity(); try { EntityUtils.consume(entity); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } static void checkResponse(CacheResponseStatus responseStatus) { switch (responseStatus) { case CACHE_HIT: System.out.println("A response was generated from the cache with no requests " + "sent upstream"); break; case CACHE_MODULE_RESPONSE: System.out.println("The response was generated directly by the caching module"); break; case CACHE_MISS: System.out.println("The response came from an upstream server"); break; case VALIDATED: System.out.println("The response was generated from the cache after validating " + "the entry with the origin server"); break; } } } </code></pre> <p>It is not worked for me.</p> <p>Every time it get the data from the server.not from the cache.</p> <p>I m using jar <code>"httpclient-cache-4.1-beta1"</code>.</p>
java android
[1, 4]
2,318,196
2,318,197
Change event for combobox not getting fired in jQuery
<p>I am working in <a href="http://en.wikipedia.org/wiki/PHP" rel="nofollow">PHP</a>. I have written code for displaying a combo box like this:</p> <pre><code>&lt;select name="country" id="idCountry" class="clsCountry" &gt; &lt;?php foreach($objCountries as $objCountry):?&gt; &lt;option value="&lt;?php echo $objCountry-&gt;getId()?&gt;" &gt;&lt;?php echo $objCountry-&gt;getName()?&gt; &lt;/option&gt; &lt;?php endforeach;?&gt; &lt;/select&gt;&lt;/td&gt; </code></pre> <p>For change event:</p> <pre><code>$("#idCountry").change(function(){ .... }); </code></pre> <p>but change event is not getting fired. How can I fix this problem? </p>
php jquery
[2, 5]
2,306,484
2,306,485
How to use Eval() dynamically in Asp.net
<p>I want to use like this</p> <pre><code>for (int i = 1; i &lt;= x; i++) {string z=Request.Cookies[i.ToString()].Value; %&gt; &lt;td&gt;&lt;%# Eval(z).ToString()%&gt;&lt;/td&gt; &lt;% } </code></pre> <p>but its not taking variable "z". is any way to use like this. Not found on search thats why posting.</p> <p>thanks</p>
c# asp.net
[0, 9]
3,828,081
3,828,082
Can't push items into array from anonymous callback function in Javascript
<p>I'm having a javascript issue that's driving me completely insane. I have a collection of data that I'm iterating over using the jQuery .each() method. Inside the .each() callback function, I'm pushing data on the an array. Here's the code.</p> <pre><code>var p = procedure_tool.all(); previousValue = -1; var proceduresArray = []; p.each(function(d, proceduresArray) { proceduresArray.push(d.procedureID); }); </code></pre> <p>I've also tried making the proceduresArray global (no var in front), and then trying not to pass it through the anonymous function. </p> <pre><code>var p = procedure_tool.all(); previousValue = -1; proceduresArray = []; p.each(function(d) { proceduresArray.push(d.procedureID); }) </code></pre> <p>The data does exist (alerts inside the callback display it fine). Any ideas? I feel like it's a scope issue, but I figure that globalizing the array would have fixed it.</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,156,461
3,156,462
Count the number of occurence of a case sensitive word in a paragraph in jquery
<p>I want to count the number of occurrence of a specific words in a paragraph.</p> <p>I am writing my code for key down event. I may have few hundreds words initially that may increase later on.</p> <p>SO when the user is typing i will match the words in a paragraph and then get the number of occurrence. I also need to make sure that the match will be case sensitive.</p> <p>Right now i am using this code:</p> <pre><code>$('.msg').val().split("AP").length - 1 </code></pre> <p>Where AP is the keyword to match.</p> <p>But i am not very happy with this.</p> <p><strong>Actually i have a list of few hundred keywords, how can i implement it efficiently.</strong></p> <p>Please note the words to match have spaces on both side i.e they are boundary words</p> <p>Any help is appreciated</p>
javascript jquery
[3, 5]
1,122,790
1,122,791
Android - Video raw folder not being picked up
<p>I cannot seem to pick up my raw video folder, I am using the below code:</p> <pre><code> super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.learn_to_ref); VideoView vd = (VideoView) findViewById(R.id.VideoView); Uri uri = Uri.parse("android.resource://" + getPackageName() + "/"+R.raw.large); mc = new MediaController(this); vd.setMediaController(mc); vd.requestFocus(); vd.setVideoURI(uri); vd.start(); </code></pre> <p>I created a new folder called it 'raw' and added it into the 'res' folder. I then added my video 'large.mp4' into my res folder, however eclipse is giving me an error message, saying that 'raw cannot be resolved or is not a field'.</p> <p>What am I doing wrong, can someone please help.</p> <p>Thanks</p>
java android
[1, 4]
3,913,471
3,913,472
How to call a PHP class method from a JavaScript function
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7165395/call-php-function-from-javascript">Call php function from javascript</a> </p> </blockquote> <p>I understand that php is server side and JavaScript is client side. But I would like to know how to run a PHP method when a JavaScript function is called. Below is my code, I know the error is but how can I perform the php method?</p> <pre><code> &lt;script type="text/javascript"&gt; function toggle() { var ele = document.getElementById("addCatTextBox"); var text = document.getElementById("addCatButtonText"); if(ele.style.display == "block") { ele.style.display = "block"; text.innerHTML = "Save category"; &lt;?php Category::addCategory($inCatName)?&gt; } else { ele.style.display = "none"; text.innerHTML = "Add new category"; } } &lt;/script&gt; </code></pre> <p>Thanks for your help.</p>
php javascript
[2, 3]
4,003,942
4,003,943
applying css to nth child words
<p>An interesting little problem...</p> <p>Trying to loop through the children of a paragraph (words) and color them, one by one.</p> <p>Here's a hard coded working version with words in separate elements: <a href="http://jsfiddle.net/JjRHT/25/" rel="nofollow">http://jsfiddle.net/JjRHT/25/</a></p> <p>using</p> <pre><code>window.setInterval(function(){ $(".item:nth-child(1)").css("color", "#FFFFFF"); }, 1000); </code></pre> <p>just to show what I'm attempting...obviously not the way to go!</p> <p>so - can I select each child of a paragraph? and how do I do the loop properly - with a small delay...</p> <p>steven</p> <p>edit:</p> <p>I found a jquery <a href="https://github.com/davatron5000/Lettering.js" rel="nofollow">plugin</a> that splits text into words nicely ready for css:</p> <pre><code>&lt;p class="word_split"&gt;Don't break my heart.&lt;/p&gt; &lt;script&gt; $(document).ready(function() { $(".word_split").lettering('words'); }); &lt;/script&gt; </code></pre> <p>Which will generate:</p> <pre><code>&lt;p class="word_split"&gt; &lt;span class="word1"&gt;Don't&lt;/span&gt; &lt;span class="word2"&gt;break&lt;/span&gt; &lt;span class="word3"&gt;my&lt;/span&gt; &lt;span class="word4"&gt;heart.&lt;/span&gt; &lt;/p&gt; </code></pre>
javascript jquery
[3, 5]
14,909
14,910
Global Objects accessible throughout Android apllication
<p>I have an application that uses a custom class. When the app is started I populate an instance of this class in the main activity with all the data it will hold.</p> <p>Basic data is then shown in a ListView from which you can select a ListView item to see further information displayed in another Activity.</p> <p>Currently, I am having to pass the data that is relevant to the new Activity to it by using: </p> <pre><code>intent.putExtra("NAME", value); </code></pre> <p>I want to implement a ViewPager so the user can easily switch between ListView items. Therefore the currently use method isn't very good as I only have the data for one entry at a time and would need to get back to the original Activity to get all the data again.</p> <p>Is there a way to have my class objects globally available ANYWHERE in my application? I feel my applications code is getting bloated as I am overcoming these issues in bad code methods.</p> <p>I've just looked into using:</p> <pre><code>MyApp myapp = ((MyApp)context.getApplication()); </code></pre> <p>but this won't work unless I can pass the context around, which I'm not sure how to do??</p> <p>In C# you'd create a static class that could handle this....</p> <p>Thanks Neil</p>
java android
[1, 4]
4,848,864
4,848,865
jQuery element width type
<p>Is there a way to use jQuery to figure out the type of width an element has? Whether it's an exact width (like <code>200px</code>) or a relative width (such as <code>20%</code>).</p> <p>I would also like to be able to detect if the element doesn't have any kind of width specifically set, either in the CSS file or inline styles.</p> <p>How would I go about doing this? Thank you so much in advance!</p>
javascript jquery
[3, 5]
340,878
340,879
stopPropagation() but keep other click events active
<p>I have some jQuery code to close my menu:</p> <pre><code>$('body').click(function(){ $('#menu').hide(); }); $("#menu").click(function(e) { e.stopPropagation(); return false; }); </code></pre> <p>However on my #menu element I have some elements that have click events attached to them:</p> <pre><code>$('.menu_elem').live("click", function(){ //Do something }); </code></pre> <p>My problem is that the e.stopPropagation() is preventing my click events for my menu. How can I avoid this?</p>
javascript jquery
[3, 5]
5,973,652
5,973,653
how to save a file while on subdomain application to main domain asp.net
<p>I have an application that is hosted on a subdomain. In asp.net I would like to save some files to a directory on the main domain not the sub. Thanks for any help.</p>
c# asp.net
[0, 9]
582,459
582,460
Examples of Combo box controls for the Web
<p>I am looking for examples of Combo box controls relying on jquery, or just javascript and CSS. The control would allow the user to slect from a drop down list, or simply type a custom value.</p> <p><a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx" rel="nofollow">http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ComboBox/ComboBox.aspx</a></p>
javascript jquery
[3, 5]
809,072
809,073
Keep .click() function after partial data update
<p>I'm using a table for a coordinate system, and with a function in each td element to update the field value. </p> <pre><code>[ ][ ][X][ ] [ ][X][X][X] [X][ ][ ][ ] </code></pre> <p>When I click an empty element, I want it to set the value to "X" in my database, by getting new partial data from my rails app (and sending GET-variables along), and then re-render the table. This works just fine using my rails app, however ONLY once. It seems like the jQuery function .click() only runs once. The function looks as following: (<em>generated via. coffeescript</em>)</p> <pre><code>$(document).ready(function() { $(".field").click(function(e) { $.get("http://localhost/dinners?ap="+$(this).attr('id'), function(data) { $("#dinner_table").html(data); }); }); }); </code></pre> <p>This will run just fine, and once I click an element, it will render new data in the table - but only once! If I redefine the .click() function after I swap the HTML in the function, it allows me to click (and update) twice, etc. </p> <p>I'm pretty sure this is a basic question, but no luck with the searches so far.</p>
javascript jquery
[3, 5]
2,096,329
2,096,330
Convert a .val() into string jQuery
<p>I have a jQuery function that gets the value from a form input text object named <code>content</code> in which a user can enter an HTML tag in the form. For example, the user types "Sample" with <code>&lt;b&gt;</code> tags. Once submit is fired, jQuery gets the value from <code>content</code>.</p> <pre><code>var content = $('[name=content]').val(); </code></pre> <p>My problem is if the user has a tag lets say a <code>&lt;b&gt;</code> tag, I want to output the raw html string to the user instead of having it rendered.</p> <p>How can I do it? Any help will be much appreciated, I'm new to jQuery.</p>
javascript jquery
[3, 5]
4,158,147
4,158,148
I want my app to run things in the background, even when the user is donig other things on his Android
<p>What should I look at to get started?</p> <p>Is it Timer? <a href="http://developer.android.com/reference/java/util/Timer.html" rel="nofollow">http://developer.android.com/reference/java/util/Timer.html</a></p> <p>Or am I missing something else?</p>
java android
[1, 4]
5,857,083
5,857,084
When I add jQuery library it invalidates my other jQuery on the same page
<p>I am trying to create a page that has a scroller of images and a voting system (which I copied from here: <a href="http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/" rel="nofollow">http://yensdesign.com/2008/09/how-to-create-a-stunning-and-smooth-popup-using-jquery/</a>).</p> <p>The scroller was working just fine until I added the voting pop-up. Essentially, when I add the library </p> <pre><code>&lt;script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"&gt; </code></pre> <p>needed for the pop-up to work, the scroller images disappear and the page seems to re-load whenever I hit the scrolling arrows. If I comment out the library above then the scroller re-appears (but the pop-up window does not work). Here are the directories for the other files.</p> <ul> <li>public/scripts/general0.js - init for scroller</li> <li>public/script/woo-jcar.js - scroller function</li> <li>public/scripts/popup.js" - pop-up javascript</li> </ul> <p>Please Help! I am a newby so this might just be a dumb thing like adding to conflicting libraries or something.</p> <p>Thanks,</p>
javascript jquery
[3, 5]
3,355,622
3,355,623
Gridview button filed dynamically add
<p>i m having one datagrid..i want to create one button field inside the datagrid dynamically. button filed type is link type.. this button field is fill after checking some condions in my database..any body helpme</p>
c# asp.net
[0, 9]
1,845,969
1,845,970
put content of all elements of class into array..why do i get these error messages
<p>I'm trying to load text of all divs that have a particular class into an array, but this</p> <pre><code>var temp = $('.theClass').text(); temp = temp.toArray(); console.log(temp); </code></pre> <p>keeps giving me the error</p> <p><code>Uncaught TypeError: Object has no method 'toArray'</code></p> <p>And</p> <pre><code>var tempArr = []; var temp = $('.theClass').text(); for (var t in temp){ tempArr.push(t); } console.log(tempArr); </code></pre> <p>results in an array filled with many, many objects within objects just filled with integers. <img src="http://i.stack.imgur.com/oUxEi.png" alt="screenshot of chrome console"></p> <p>An explanation of how to do this properly can be found <a href="http://stackoverflow.com/a/4948779/1252748">here</a>, but I wonder if someone could provide me with an explanation for why I get these errors. Thanks!</p>
javascript jquery
[3, 5]
19,258
19,259
jQuery Stop Effects - Form Validation
<p>I made a form validation script which uses the jQuery UI library to pulsate the invalid fields when submitted.</p> <p>My question is how do I stop the effects from queuing? I looked into animation queuing, however, it does not work with effects. I've tried:</p> <pre><code>$(item).stop(); $(item).stop().effect(...); $(item).stop(true,true); </code></pre> <p>The only results I get are the effects glitches off the screen ect...</p>
javascript jquery
[3, 5]
5,434,123
5,434,124
How do I pass a server control's actual client Id to a javascript function?
<p>I have the following textbox server control in my web page:</p> <pre><code>&lt;asp:TextBox ID="txtZip" runat="server" onchange="ZipCode_OnChange(this, &lt;%= txtZip.ClientId %&gt;, txtCity, txtState);/"&gt; </code></pre> <p>When the page renders, it is built including the following:</p> <pre><code>&lt;input name="txtZip" type="text" id="txtZip" onchange="ZipCode_OnChange(this, &amp;lt;%= txtZip.ClientId %&gt;, txtCity, txtState);" /&gt; </code></pre> <p>I'm trying to pass the text box's client IDas the 2nd param to this Javascript function:</p> <pre><code>function ZipCode_OnChange(txtZipCode, ClientId) { var ret; ret = WebService.GetCityAndState(txtZipCode.value, OnComplete1, OnError, ClientId); } </code></pre> <p>How do I get it to, on the server, evaluate the texbox's control and to pass that literal string to the Javascript function?</p> <p>Thanks in advance.</p>
asp.net javascript
[9, 3]
4,095,251
4,095,252
How best to implement this puzzle app for android
<p>Let's say I have a pair of two images .pngs being displayed in an Android App. The puzzle for the user is to identify the elements in Picture 1 that are missing from Picture 2 by touching the elements in Picture 1. Once all the elements in Picture 1 missing in Picture 2 are identified the App moves on to the next pair of images. </p> <p>I could store these images in SD Card or populate the ImageView in the App realtime from the server. I think since there are going to be a large number of images it would be wise not to store them on the device storage itself.</p> <p>I think it would be nice to have these image pairs show up like a carousel view so that both the images are not visible at once but the user moves back and forth between them to identify the differences.</p> <p>The thing that I am still trying to figure out is that what would be the best way to validate the user selection of differences for a pair of pictures.</p> <p>Any idea or help is much appreciated.</p> <p>Example images could be pic1.png and pic2.png below</p> <p><img src="http://i.stack.imgur.com/sLJ1Z.jpg" alt="Door Knob missing"></p> <p><img src="http://i.stack.imgur.com/UQ6sX.jpg" alt="Door Knob present"></p>
java android
[1, 4]
5,476,307
5,476,308
Fade in/out js mouseover event
<p>I am looking to implement a mouseover event on my page for a menu - </p> <p>I have 3 titles to the left with a respective content div on the right where the related text appears.</p> <p>Having trauled all the forums for a working js solution, I have settled with:</p> <p><a href="http://flowplayer.org/tools/demos/tabs/mouseover.html" rel="nofollow">http://flowplayer.org/tools/demos/tabs/mouseover.html</a></p> <p>which uses a very simple js function:</p> <pre><code>$("#products").tabs("div.description", {event:'mouseover'}); </code></pre> <p>What I am hoping to do however, is to incorporate a fadeIn(), fadeOut effect so that when the user hovers over a title on the left of the page, the existing content showing fades away and the repective content will fade in to view......</p> <p>The html coding is:</p> <pre><code>&lt;div id="products" &gt; &lt;img src="home.png" alt="home" /&gt; &lt;img src="services.png" alt="services" /&gt; &lt;img src="contact.png" alt="contact" /&gt; &lt;/div&gt; &lt;div class="description" id="home" &gt; .. content .. &lt;/div&gt; &lt;div class="description" id="services" &gt; .. content .. &lt;/div&gt; &lt;div class="description" id="contact" &gt; .. content .. &lt;/div&gt; </code></pre> <p>I have tried to incorporate thread 5404775 on this site but simply cannot get it working!</p> <p>Any help much appreciated</p>
javascript jquery
[3, 5]
414,583
414,584
Databind a List<System.Web.UI.WebControls.Image> to a repeater
<p>Im trying to bind a List of Images (<code>System.Web.UI.WebControls.Image</code>) to a repeater, but the image is shown as broken. It seems allright when I put a breakpoint inside the ItemDataBound-event, the DataItem is correct and have the correct ImageUrl. Yet, the result is wrong.</p> <p>This code is very simple, but will be way more complex at the end. Binding a <code>List&lt;String&gt;</code> with ImageUrls wont help me in the end, since all images will have more unique properties aswell.</p> <p>Repeater:</p> <pre><code>&lt;asp:Repeater ID="repButtons" runat="server" OnItemDataBound="repButtons_OnItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;asp:Image ID="imgButton" runat="server" /&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>Making the list with images:</p> <pre><code>List&lt;System.Web.UI.WebControls.Image&gt; myButtons = new List&lt;System.Web.UI.WebControls.Image&gt;(); Image myEditButton = new Image(); myEditButton.ImageUrl = "~/images/themes/pencil.png"; myButtons.Add(myEditButton); repButtons.DataSource = myButtons; repButtons.DataBind(); </code></pre> <p>Databinding:</p> <pre><code>protected void repButtons_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Image myImage = (Image)e.Item.DataItem; Image imgButton = (Image)e.Item.FindControl("imgButton"); imgButton = myImage; } } </code></pre>
c# asp.net
[0, 9]
5,384,696
5,384,697
jquery how to make sure that the user has selected a value for all select menus on a form
<p>i have a form with multiple select menus i want to make sure on submit that a user selected a value for each select menu how can i do that with jquery ? i tried something like </p> <pre><code>var form = $('myform'); if($(form ).find('select').length != $(form).find('select:option[selected="selected"]').length ) { alert('wrong please make sure to select all select menu'); } </code></pre> <p>but no luck </p> <p>please help </p> <p>Thank you</p>
javascript jquery
[3, 5]
4,723,956
4,723,957
Jquery broken by GetResponse (email marketing) web form script
<p>I'm working on a site that relies on quite a bit of javascript. The problem is, I'm not a javascript guru in the least. Yes, bit off more than I can chew, here.</p> <p>I'm using jquery for a spy effect, and use GetResponse for email signups.</p> <p>If I implement my GetResponse script, it breaks the area later in the page which depends on the jquery script. Pull the GetResponse script and it works just fine.</p> <p>Problem is, I need them both. ;)</p> <p>The trick, I suppose, is that the GetResponse script is actually another Jquery script, so it's getting called twice...</p> <p>Any help?</p> <p>The site is <a href="http://djubi.com/testserver" rel="nofollow">http://djubi.com/testserver</a> Check out (urlabove)/nogetresponsescript.php to see it work without the GetResponse script. You should be able to see all the source just fine.</p> <p>Thanks everyone. jf</p>
javascript jquery
[3, 5]
5,196,415
5,196,416
Can I wait for location.href to load a page?
<p>Is it possible to know when a page has loaded using location.href? My current code looks like this and I want to trigger some events to happen once my page has finished loading. I tried using $.get but it breaks my current implementation of <a href="http://www.asual.com/jquery/address/" rel="nofollow">jquery address</a> so this won't work.</p> <pre><code>$('.search').click(function(){ location.href = "/search.php"; // trigger event here... return false; }); </code></pre> <p>This will <strong>NOT</strong> work for my current setup:</p> <pre><code>$.get('search.php', function() { alert('Page has finished loading'); }); </code></pre> <p>Are there any other options?</p>
php javascript jquery
[2, 3, 5]
5,663,569
5,663,570
jQuery UI. Do a function after Block UI load
<p>I use jQuery BlockUI plugin.</p> <p><a href="http://www.malsup.com/jquery/block/" rel="nofollow">http://www.malsup.com/jquery/block/</a></p> <p>I want to alert after jQuery BlockUI finished loading.</p> <p>Here is the code;</p> <pre><code>$('#trigger').click(function() { $.blockUI({ message: $('#mymessage'), }); alert("hi"); }); </code></pre> <p>But the alert happens 1st and UIBlock loads 2nd. How can I fix this?</p> <p>Here is the live demo <a href="http://jsfiddle.net/yHCjF/" rel="nofollow">http://jsfiddle.net/yHCjF/</a></p>
javascript jquery
[3, 5]
2,624,935
2,624,936
I can install an application but I don't see its icon in the set of installed applications(on the emulator)
<p>Hey, When I load an application(which I just compiled) in the emulator. I don't see its icon in the icons of the installed application(on the emulator). The command "adb install ..." tells me that the application is successfully installed(I can even uninstall it with "adb uninstall ..." command). The application is nothing more than a "Hello World" type of application, you get when you create a project with "android create project --target ...." command. I can compile and run other application perfectly with the same set of tools. </p> <p>Give me some pointers, what am I missing? what have I overlooked? Please help me.</p>
java android
[1, 4]
1,440,715
1,440,716
The name 'xxx' does not exist in current context user control
<p>I have this statemen at the beginning:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucCreditCard.ascx.cs" Inherits="UserControls_Common_ucCreditCard" %&gt; </code></pre> <p>in ucCreditCard.ascx.cs I have this:</p> <pre><code>using System; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class UserControls_User_ucCreditCard : System.Web.UI.UserControl { // } </code></pre> <p>When I try to reference any of the simple control like Textbox etc, I always get control 'xxx' does not exist in current content. What can be the problem?</p> <p>Thanks in advance :)</p>
c# asp.net
[0, 9]
3,289,674
3,289,675
easiest way to search a javascript object list with jQuery?
<p>What is the easiest way to search a javascript object list with jQuery?</p> <p>For example, I have the following js config block defined:</p> <pre><code>var ProgramExclusiveSections = { "Rows": [ { 'ProgramId': '3', 'RowId': 'trSpecialHeader'}, { 'ProgramId': '3', 'RowId': 'trSpecialRow1' }, { 'ProgramId': '3', 'RowId': 'trSpecialRow2' }, { 'ProgramId': '1', 'RowId': 'trOtherInfo' } ] } </code></pre> <p>The user has selected Program ID = 3 so I want to get only the "rows" that I have configured in this js config object for Program ID = 3. This will get me the javascript object list:</p> <pre><code>var rows = ProgramExclusiveSections.Rows </code></pre> <p>but then I need to filter this down to only where RowId = 3. What's the easiest way for me to do this with jquery?</p>
javascript jquery
[3, 5]
3,582,901
3,582,902
revise href attribute
<p>So I have a link like this:</p> <pre><code>&lt;a href="http://thissite.org/thisfolder/21/thispage.php"&gt; </code></pre> <p>What I want to do is revise it but keep part of it eg: </p> <pre><code>&lt;a href="http://thissite.org/thatfolder/21/thatpage.php"&gt; </code></pre> <p>Can this be done with Jquery or js?</p> <p>I know I can replace href property with jquery but I need to leave part of the url ("21") and just change the text before and after it.</p> <p>I was thinking maybe grab the href property, stick it in a variable and take it apart and put it back together somehow.</p> <p>Any help with this would be largely appreciated.</p>
javascript jquery
[3, 5]
5,481,356
5,481,357
jquery: Get full css property set as string from an element
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/754607/can-jquery-get-all-css-styles-associated-with-an-element">Can jQuery get all CSS styles associated with an element?</a> </p> </blockquote> <p>How to get the full css property set as string from an element with jQuery or JavaScript?</p> <pre><code>var x = $('myelement').css().toString(); </code></pre>
javascript jquery
[3, 5]
5,486,388
5,486,389
jQuery ajax() vs get()/post()
<p>Let's say I want to execute a PHP script. Which way is better?</p> <p>This:</p> <pre><code>$.ajax({ type: "GET", url: "php-script.php", dataType: "script" }); </code></pre> <p>Or this:</p> <pre><code>$.get("php-script.php", function(data) { }); </code></pre>
javascript jquery
[3, 5]
1,298,672
1,298,673
Creating custom/intutive layout for controls
<p>I have an address control which display the contact info of the person. </p> <p>so it displays something like </p> <p>1234, street City, CA 12345</p> <p>Now i want to give user flexibility to create format out of it. For ex someone might want to display address as,</p> <p>street, City, Country</p> <p>OR </p> <p>Just display their emails: s@s.com z@z.com </p> <p>Any good ideas on how to it or similar examples? thanks</p>
c# asp.net jquery
[0, 9, 5]
4,189,901
4,189,902
Development under Android
<p>I have the Android-based tablet, and I want to do some development actions on it.</p> <p>Is there a way to code and compile Java and Android applications on my tablet?</p>
java android
[1, 4]
3,609,804
3,609,805
Add HTML elements into an object
<p>I want to add HTML elements in form of variable into an object by using JQuery *or without.</p> <h3>HTML elements</h3> <pre><code>&lt;a href="#" class="edit"&gt;EDIT&lt;/a&gt; </code></pre> <p>Now I am just using this elements as variable...</p> <pre><code>var link = "&lt;a href="+'"'+"#"+ '"'+ " class="+'"'+"edit"+'"'+"&gt;EDIT&lt;/a&gt;"; Obj.addvariable(link) ????????? // This Object could be any ID Or Class Or Div </code></pre>
javascript jquery
[3, 5]
2,067,976
2,067,977
how to create similar or related articles module
<p>i am creating news system for my client, and he requested that when he publishes the article, he want a list at the bottom to show similar or related articles to his published articles.</p> <p>so how can i create this if he does not want to put it manually ? </p> <p>thanks in advanced.</p>
c# asp.net
[0, 9]
5,334,537
5,334,538
How to build data to fit window height
<p>Using JQuery, I want to build a screen that will fade from one page to another if there is more data on the first screen than can fit.</p> <p>Each user can have a different monitor size with different resolution capabilities. I need to compensate for this by somehow getting the window height first, then based on that height, build my rows to match that height so that there is never any scrolling involved. If there is an excess than the screen height will allow, build a second screen and fade into the next screen</p> <p>What is the best and easiest way to handle this?</p>
javascript jquery
[3, 5]
1,945,021
1,945,022
call a c# function in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12421716/call-c-sharp-function-in-javascript">Call c# function in javascript</a> </p> </blockquote> <p>I have a c# function containing an if statement (if (condition) test=true else test= false )), Can anyone tell me how to call that function in javascript and use the result of that test variable to do an if statement.</p> <p>The c# file I am referencing is the code behind (.aspx.cs) to an .aspx page. Is there not a way I can call the following function from this .aspx page.</p> <pre><code>public void write(bool complete) { System.IO.StreamWriter writer = new System.IO.StreamWriter(Server.MapPath("~file.txt"), true); if (complete == true) { writer.WriteLine("completed"); } else { writer.WriteLine("FAILED"); } writer.Flush(); writer.Close(); writer.Dispose(); } </code></pre>
c# asp.net
[0, 9]
554,793
554,794
Remove or hide div if undifined/null or empty
<p>I have a script which can display information based up on url and save this information: <a href="http://moskah.nl" rel="nofollow">moskah.nl</a></p> <p>The problem is that if you would click the button without giving url than the script will give an empty div. Just reload the page and you will see it will still be there. </p> <p>What can I do in Jquery in order to remove or hide these emty divs on document ready?</p>
javascript jquery
[3, 5]
3,209,971
3,209,972
Microsoft JScript runtime error: Automation server can't create object
<p>Trying to get UserName and used code below to obtine this. Note if I Call the function from button it shows correct user name in pupup window.</p> <pre><code>&lt;body onload = "GetUserName();"&gt; &lt;script language="javascript" type="text/javascript"&gt; function GetUserName() { var WinNetwork = new ActiveXObject("WScript.Network"); //alert(WinNetwork.UserName); var userName = WinNetwork.UserName; //var userName = 'test'; document.getElementById('label1').innerHTML = userName; } &lt;/script&gt; &lt;form runat="server"&gt; &lt;asp:HiddenField ID="hfUserName" runat="server" value="a"/&gt; &lt;asp:PlaceHolder ID="phLabelUser" runat="server"&gt;&lt;/asp:PlaceHolder&gt; </code></pre> <p>in code behind I create label to show it but intention is to use hidden controller </p> <pre><code> Label label= new Label(); label.ID = "lbl1"; label.Text = "test -&gt; " + hfUserName.Value; phLabelUser.Controls.Add(label); </code></pre> <p>I Enabled the following settings in IE so there is no security issues the site is on intranet.</p> <pre><code>Run ActiveX controls and plug-ins Initialize and script ActiveX controls not marked as safe. </code></pre> <p>Why this would create an error in debuger?</p> <p>"Microsoft JScript runtime error: Automation server can't create object" </p>
c# javascript asp.net
[0, 3, 9]
3,324,810
3,324,811
Is jQuery's $(selector).eq(index) and $(selector)[index] the same?
<p>What is the difference between all these ways?</p> <pre><code>//1 $('div').eq(index) //2 $('div')[index] //3 $($('div')[index] ) //4 $('div').get(1) </code></pre> <p>Are they same?</p> <p><img src="http://i.stack.imgur.com/iXlVs.png" alt="ScreenShot"></p>
javascript jquery
[3, 5]
1,749,480
1,749,481
jquery getJSON IP
<p>I am trying to convert the following code to work with jquery:</p> <pre><code>var req = new XMLHttpRequest(); req.open('GET', 'http://jsonip.appspot.com', true); req.onreadystatechange = function (e) { if (req.readyState === 4) { if(req.status === 200) { var ip = JSON.parse(req.responseText); alert(ip.address); } else { alert("Error loading page\n"); } } }; req.send(null); </code></pre> <p>This the jquery piece that doesn't work:</p> <pre><code> $.getJSON("http://jsonip.appspot.com", function(data){ alert( "Data Returned: " + data.ip); }); </code></pre>
javascript jquery
[3, 5]
2,023,584
2,023,585
Retrieve the Original (Client) Url Without the Default Document
<p>I'm trying to obtain the actual client requested URL. The standard <code>Request.Url</code> object contains the response URL. These can be different if the original request did not contain a default document.</p> <p>Original Request: <a href="http://my.server.com/folder/" rel="nofollow">http://my.server.com/folder/</a></p> <p>Request.Url.ToString(): <a href="http://my.server.com/folder/default.aspx" rel="nofollow">http://my.server.com/folder/default.aspx</a></p> <p>Is there a way to obtain the original client request in asp.net?</p>
c# asp.net
[0, 9]
370,515
370,516
How to tell if a drop down has options to select?
<p>How to tell if a drop down has options to select?</p>
javascript jquery
[3, 5]
315,029
315,030
Pass select list to php page
<p>I am currently trying to pass a select list (the whole list) into a php page and grabbing the individual values from the list to do a dynamic sql query. I pass in selectItems, but when I perform an echo, I get </p> <blockquote> <p>[object HTMLSelectElement]</p> </blockquote> <p>I have also tried passing in selectItems.value, but that only passes in one of the 3 list items.I have searched for the past day and I haven't had much success. I'm not too sure how to approach this. Any help would be greatly appreciated. </p> <p>The current select list is as follows</p> <pre><code> &lt;select multiple name="selectItems" size="6" id="selectItems"&gt; &lt;option value="value1" selected="selected"&gt;value1&lt;/option&gt; &lt;option value="value2" &gt;value2&lt;/option&gt; &lt;option value="value3" &gt;value3&lt;/option&gt; &lt;/select&gt; &lt;input type=button id="opener" value='Clickme' onclick="showTable(selectItems, 'getquery.php')"&gt; </code></pre> <p>A snippet from the showtable function below, I am basically trying to pass the list (denoted by q) and the location of the page.</p> <pre><code>xmlhttp.open("GET",page+"?q="+str,true); xmlhttp.send(); </code></pre>
php javascript
[2, 3]
124,472
124,473
What is the earliest javascript/jquery-based method to execute javascript ASAP?
<p>Is there a way to execute a few lines of javascript earlier than the <code>document.ready</code> event?</p>
javascript jquery
[3, 5]
4,657,347
4,657,348
how to get checkbox bulk value in javascript
<p>i want to get all the details of youtube,so if the user tick the checkbox i want to get the full details of video in javascript,i have done but only i can get first word from the you tube name, you tube name,example $name="Geet - Episode 456 - Clip 1 [24th November 2011] <em>HQ</em>" so alert(name) is showing only Geet .why? i need full name. this is my code:where i have do the mistake.</p> <pre><code> &lt;?php $watch="youtubelink"; $thumbnail="youyubeimage"; $val="somevalue"; $name="youtubename"; //eg:$name="Geet - Episode 456 - Clip 1 [24th November 2011] *HQ*"; $results=$watch.",".$thumbnail.",".$val.",".$name; ?&gt; &lt;input type="checkbox" name="checkbox[]" id="checkbox[]" class="addbtn" value=&lt;?php echo $results;?&gt; /&gt; </code></pre> <p>this is my js:</p> <pre><code> function chkbox() { $('[name^=checkbox]:checked').each(function() { var ckballvalue=($(this).val()); var fields = ckballvalue.split(/,/); var link = fields[0]; var thumbnail = fields[1]; var name = fields[3]; //var description = fields[4]; var categ = fields[2]; alert(name); var data = { action: 'my_action', link:link, thumbnail:thumbnail, name:name, categ:categ }; </code></pre>
php javascript
[2, 3]
3,334,814
3,334,815
Check whether console is present
<p>I am writing a plugin. For that I will log a few things, say warnings, necc things, etc. To log them I will use console, but there can be an error if some browser doesn't support console. To handle this error, I am thinking of using this code:</p> <pre><code> if (typeof console == 'undefined') console = {}; if (typeof console.log == 'undefined') console.log = function() {}; if (typeof console.debug == 'undefined') console.debug = function() {}; if (typeof console.info == 'undefined') console.info = function() {}; if (typeof console.warn == 'undefined') console.warn = function() {}; if (typeof console.error == 'undefined') console.error = function() {}; </code></pre> <p>Will this work right or is there a better option?</p>
javascript jquery asp.net
[3, 5, 9]
1,483,342
1,483,343
Pass javascript function name as parameter + Html Helper
<p>I have written html helper which initialize a javascript function.In the javascript function i have unHandledErrorCallback function which will default log the error into console.log.</p> <pre><code>&lt;script&gt; Initializefunction({ Url: "/xxx/yyyy", x: 10, y: true, somevalue: false, unHandledErrorCallback: function (message) { console.log("Somerror message " + message); } }); &lt;/script&gt; </code></pre> <p>Html helper would look like as below</p> <pre><code> public static MvcHtmlString Initializefunction(this HtmlHelper html, bool x, bool y, string someurl, int maxCount, string handleErrorFunctionName) { var Element = new TagBuilder("input"); Element.MergeAttribute("id", "logging"); Element.MergeAttribute("type", "hidden"); Element.MergeAttribute("data-abc-x", x.ToString()); Element.MergeAttribute("data-abc-y", y.ToString()); Element.MergeAttribute("data-abc-someurl", someurl); Element.MergeAttribute("data-abc-maxcount", maxCount.ToString(CultureInfo.InvariantCulture)); aicloggingElement.MergeAttribute("data-abc-callbackfunctionname", handleErrorFunctionName); return MvcHtmlString.Create(Element.ToString()); } </code></pre> <p>How Do i take the handlerErrorCallback function name from user through html helper and initilise in javascript function.</p>
c# javascript
[0, 3]
728,324
728,325
Android: Changing Wallpaper to Drawable
<p>I'm using this code to change the wallpaper of the android home</p> <pre><code>WallpaperManager wm = WallpaperManager.getInstance(this); wm.setBitmap(myBitmap); </code></pre> <p>I would like to set the background to a drawable. Is this possible?</p>
java android
[1, 4]
3,455,118
3,455,119
Jquery click function with same button display different text
<p>Hello eveyone I'm trying to using click function.When user clicks the button, second text will appear and the first one will be display none and then user click again the same button this time third text will appear and the second text will be display and finally click the same button again fourth text will appear third one display none. Here is my function:</p> <pre><code>$("#slider1next").click(function () { $(".text").css('display', ''); $("#first_one").css('display','none'); }); </code></pre> <p>here is the HTML</p> <pre><code> &lt;button id="slider1next" &gt;Clickme&lt;/button&gt; &lt;p class="text" id="first_one"&gt;This is the first text&lt;/p&gt; &lt;p class="text" id="second_one" style="display:none"&gt;This is the second text&lt;/p&gt; &lt;p class="text" id="third_one" style="display:none"&gt;This is the third text&lt;/p&gt; &lt;p class="text" id="fourth_one" style="display:none"&gt;This is the four text&lt;/p&gt;​ </code></pre> <p>Also you can see there <a href="http://jsfiddle.net/ganymedes/7kxAE/" rel="nofollow">http://jsfiddle.net/ganymedes/7kxAE/</a></p>
javascript jquery
[3, 5]
5,959,680
5,959,681
Strange behavior in JavaScript
<p>I have 2 elements - "span" (named "divLikedX") and "a" (named "aLikeX"). I have the following javascript (occurs clicking by "a"):</p> <pre><code> function CommentLike(CommentID, aLink) { if (CommentID != null &amp;&amp; CommentID &gt; 0) $.post("/Home/LikeComment", { CommentID: CommentID }, function () { //alert($("#divLiked" + CommentID).is(':visible')); /*alert($(aLink).text());*/if ($("#divLiked" + CommentID).is(':hidden')) { $("#divLiked" + CommentID).show(); $("#aLike" + CommentID).text('Unlike'); } else { $("#divLiked" + CommentID).hide(); $("#aLike" + CommentID).text('Like'); } }); }; </code></pre> <p>If I remove <code>$("#aLike" + CommentID).text('Unlike');</code> and <code>$("#aLike" + CommentID).text('Like');</code> strings I get the correct behavior. But with these strings it works correctly only first 2 clicks, after it <code>alert($("#divLiked" + CommentID).is(':visible')) == "true"</code> always. Why?</p>
javascript jquery
[3, 5]
4,541,113
4,541,114
Preventing jQuery from Loading
<p>If jquery is added in globally used header.php across the site then How to stop to load jquery library only for those pages of site which doesn't need actually? If we can't use more than one header.</p> <p>purpose of question is to not to penalize those page with slow loading which actually don't need. </p>
php javascript jquery
[2, 3, 5]
946,875
946,876
How to get the icon of other applications (Android)
<p>What I'm doing is getting a list of all the current running processes on the phone. Which I have done by, </p> <pre><code>private List&lt;RunningAppProcessInfo&gt; process; private ActivityManager activityMan; ... activityMan = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); process = activityMan.getRunningAppProcesses(); </code></pre> <p>this works fine. When I call the processName field like</p> <pre><code>process.get(i).processName; </code></pre> <p>I get a name like com.android.mail for example.</p> <p>what I'm trying to do is use this to get access to that application so I can display its icon to the user, but I cant find anything that lets me do this. Is there something that can help me? </p> <p>I'm testing this app on my hero so the api level is 3 (android 1.5). </p> <p>Thanks.</p>
java android
[1, 4]
724,533
724,534
On Mouse Over change the RotatorType property of RadRotator using javaScript
<p>*<em>Below is my Code:- But its not working *</em></p> <pre><code>&lt;telerik:RadRotator ID="TestRotator" runat="server" Width="560px" Height="140px" ScrollDuration="2000" FrameDuration="20000" ItemHeight="120" ItemWidth="520" WrapFrames="true" Skin="Forest" SlideShowAnimation-Type="none" RotatorType="SlideShowButtons" onClientMouseover="Rotater()"&gt; </code></pre> <p><strong>javaScript:-</strong></p> <pre><code>function Rotator() { var RadRotator = document.getElementById('&lt;%= TestRotator.ClientId %&gt;'); if (RadRotator.OnClientMouseOver = true){ RadRotator.style.RotatorType = "SlideShowButtons"; } else if (RadRotator.OnClientMouseOut = false) { RadRotator.RotatorType="SlideShow"; } } </code></pre>
javascript asp.net
[3, 9]
2,708,191
2,708,192
How to run the timer when mobile is locked?
<p>I need help for java script . I am using this code to try the run time execution of program if(seconds == sec){alert(sec);} function countdown(element) {enter code here enter code here</p> <pre><code>interval = setInterval(function() { var el = document.getElementById(element); if(seconds == 0) { //alert(seconds); if(minutes == 0) { el.innerHTML = "00 : 00"; alert("Sorry, you have exceeded our booking time and your order has been cancelled. We are afraid you have to start over!",null,''); clearInterval(interval); ajax_load_image(); window.location.href='movies.html'; return; } else { minutes--; seconds = 60; } } if(minutes &gt; 0) { var minute_text = minutes+(minutes &gt; 1 ? ' ' : ' '); } else { var minute_text = '0'; } if(minute_text&lt;0) { $('#countdown').css('color','red'); } var second_text =seconds &gt; 1 ? '' : ''; if(minute_text=='') { el.innerHTML ='0 : '+seconds; } else { if(seconds&lt;10) { seconds='0'+seconds; } el.innerHTML = '0'+minute_text + ' : ' + seconds + ' ' + second_text+' Min'; } seconds--; }, 1000); </code></pre> <p>}</p> <p>when i lock the mobile the timer automaticaly stop what can i do to run the run the timer when i lock the mobile. Help me</p>
javascript android
[3, 4]
2,254,276
2,254,277
How to set default application using Intents?
<p>If I need to play Youtube video using default youtube player of Android through Intents I can set it:</p> <pre><code> Intent youtube=new Intent(Intent.ACTION_VIEW, Uri.parse(mLinks[mPosition].trim())); youtube.setPackage("com.google.android.youtube"); startActivityForResult(youtube, 100); </code></pre> <p>But now I need to set default android media player through Intents. How can I do it? Which package name should I use? Thank you. </p>
java android
[1, 4]
2,808,387
2,808,388
jQuery Color Animation - does not fade back to background color
<p>I'm trying to use a jQuery color animation plugin <a href="http://www.bitstorm.org/jquery/color-animation/" rel="nofollow">http://www.bitstorm.org/jquery/color-animation/</a>. When we call it and pass it, say <code>#FFFF00</code> (yellow), we see it change to yellow and fade away. But it never quite fades back to the element's original background color, which is white <code>#FFFFFF</code>. After doing a DOM inspection, I noticed that the elements ended up with a variety of styles added to it, such as:</p> <ul> <li><code>style="background-color: rgb(255, 255, 215);</code></li> <li><code>style="background-color: rgb(255, 255, 149);</code></li> <li><code>style="background-color: rgb(255, 255, 207);</code></li> </ul> <p>What do we need to do to get the plugin to work in such a way that at the end, the background color is the original color.</p>
javascript jquery
[3, 5]
5,787,000
5,787,001
clear values on exit in android
<p>i have some static integer variables in my android application.I am testing the application in emulator.When i click back and return to homescreen and launch the application again, the previous values still persist and new values are added to it instead of overriding.So what is the procedure to clear these values when i close the application. I have tried with <code>onRestart()</code> and <code>onStop()</code> methods and reset the counter but it dint work.</p> <p>How do i overcome this issue</p>
java android
[1, 4]
4,712,094
4,712,095
adding to window.onload event?
<p>I'm wondering how to add another method call to the window.onload event once it has already been assigned a method call.</p> <p>Suppose somewhere in the script I have this assignment...</p> <pre><code> window.onload = function(){ some_methods_1() }; </code></pre> <p>and then later on in the script I have this assignment</p> <pre><code> window.onload = function(){ some_methods_2() }; </code></pre> <p>As it stands, only <code>some_methods_2</code> will be called. Is there any way to add to the previous <code>window.onload</code> callback without cancelling <code>some_methods_1</code> ? (and also without including both <code>some_methods_1()</code> and <code>some_methods_2()</code> in the same function block). </p> <p>I guess this question is not really about <code>window.onload</code> but a question about javascript in general. I DON'T want to assign something to <code>window.onload</code> in such a way that that if another developer were to work on the script and add a piece of code that also uses <code>window.onload</code> (without looking at my previous code), he would disable my onload event. </p> <p>I'm also wondering the same thing about </p> <pre><code> $(document).ready() </code></pre> <p>in jquery. How can I add to it without destroying what came before, or what might come after?</p>
javascript jquery
[3, 5]
4,997,611
4,997,612
Using hardware components in Android (Java)
<p>Hey, Sorry to bother you with such a silly question, but I can't find the answer myself.</p> <p>I'd like to use hardware components in my applications (or: sensors), but it seems that I don't have the necessary files, as writing <code>import android.hardware.Sensors;</code> causes an error ("The ... cannot be resolved"). It is weird because I can import all other classes without any problem; I've downloaded the SDK. So what is wrong?</p> <p>Thank you in advance.</p>
java android
[1, 4]
4,808,951
4,808,952
C++ I/O with Python
<p>I am writing a module in Python which runs a C++ Program using subprocess module. Once I get the output from C++, I need to store the that in Python List . How do I do that ?</p>
c++ python
[6, 7]
762,720
762,721
jQuery Function Implementation and Function Call?
<p>What is the difference of calling function like:</p> <p><code>testCall: function()</code> and <code>function testCall()</code> in jQuery ?</p> <p><strong>Update:</strong></p> <p><em><strong>Questions:</em></strong> Does usage of one over the another have some performance issues related to it <code>OR</code> it really does not matter which one you are using ?</p> <p><strong>Update 2</strong></p> <p>Also other thing that I noticed that whenn I am defining function using <code>testCall: function()</code> and I call it using <code>this.testCall()</code> it works fine and am able to call it in any other function. </p> <p>But when I am using <code>function testCall()</code> and I try to call it using <code>testCall()</code> in another function than I am getting errors and am not able to call it. Is this possible or there could be some other reason for the <code>errors</code> ?</p>
javascript jquery
[3, 5]
934,718
934,719
UnknownHostException while accessing www.khanacademy.org but working fine for others
<p>I am getting UnknownHostException in Line 2 when I use url (I can access using browser): <a href="http://www.khanacademy.org/api/v1/playlists" rel="nofollow">http://www.khanacademy.org/api/v1/playlists</a> but it works fine for all the other 2-3 url's </p> <ol> <li><code>httpGet = new HttpGet(getUrl);</code></li> <li><code>response = httpClient.execute(httpGet);</code></li> </ol> <p>I tried searching in previous posts and tried restarting the system/emulator etc. but its not solving.</p> <p>Thanks,</p>
java android
[1, 4]
5,020,855
5,020,856
JavaScript If statement not working in IE
<p>I have the following code, which is working great in firefox and chrome, but not working in Internet Explorer...</p> <pre><code>$("#nav-tabs").on("click", "a", function(e) { e.preventDefault(); $(this).tab('show'); $('li#test').each(function() { if($(this).attr('class') == "active") { //Active class is applied $(this).children().children().attr("src", "assets/img/button_home_selected3.png"); } else { $(this).children().children().attr("src", "assets/img/button_home_plain.png"); } }); }); </code></pre> <p>Is there any problems with conditional statements with IE???</p> <p>Here is the HTML</p> <pre><code>&lt;ul id="nav-tabs" data-tabs="tabs"&gt; &lt;li id="test" style="list-style: none;" class="active"&gt; &lt;a href="#home" data-toggle="tabs" &gt;&lt;img src="assets/img/button_home_selected3.png" id="test2" width="83" /&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>More over, the li tags are Addded dynamically...</p>
javascript jquery
[3, 5]
5,390,183
5,390,184
jQuery checking which radiobutton is checked
<p>I got 2 radiobutton and 1 radcombobox</p> <pre><code>&lt;asp:RadioButton ID="cbxYes" Width="60" Height="30" runat="server" GroupName="proffesional" OnCheckedChanged="cbxYes_CheckedChanged" /&gt; &lt;asp:RadioButton ID="cbxNo" runat="server" Width="60" Height="30" GroupName="proffesional" Checked="true" OnCheckedChanged="cbxNo_CheckedChanged" /&gt; &lt;telerik:RadComboBox ID="dblSelect" EnableEmbeddedSkins="false" BackColor="Black" ForeColor="#d8d8d8" runat="server" Width="200" Height="30" &gt;&lt;/telerik:RadComboBox&gt; </code></pre> <p>. don't use <code>clientidmode=static</code> and i want to show or hide radcombobox according what radiobutton is checked.</p> <p>I have written this code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).load(function () { var dropdown = $('#&lt;%= dblSelect.ClientID%&gt;'); var radio1 = $('#&lt;%= cbxYes.ClientID%&gt;'); var radio2 = $('#&lt;%= cbxNo.ClientID%&gt;'); if ((radio1.is(':checked').val()) == 'true') { dropdown.is(':visible').val() = 'true'; }; if((radio2.is(':checked').val() == 'false'){ dropdown.is(':visible').val() = 'false'; }; }); &lt;/script&gt; </code></pre> <p>What am I doing wrong?</p> <p>Thanks in advance :)</p>
jquery asp.net
[5, 9]
4,722,025
4,722,026
Android: Referring to a string resource when defining a log name
<p>In my Android app, I want to use a single variable for the log name in multiple files. At the moment, I'm specifying it separately in each file, e.g.</p> <pre><code>public final String LOG_NAME = "LogName"; Log.d(LOG_NAME, "Logged output); </code></pre> <p>I've tried this:</p> <pre><code>public final String LOG_NAME = (String) getText(R.string.app_name_nospaces); </code></pre> <p>And while this works in generally most of my files, Eclipse complains about one of them:</p> <blockquote> <p>The method getText(int) is undefined for the type DatabaseManager</p> </blockquote> <p>I've made sure I'm definitely importing android.content.Context in that file. If I tell it exactly where to find getText:</p> <blockquote> <p>Multiple markers at this line<br> - Cannot make a static reference to the non-static method getText(int) from the type Context<br> - The method getText(int) is undefined for the type DatabaseManager</p> </blockquote> <p>I'm sure I've committed a glaringly obvious n00b error, but I just can't see it! Thanks for all help: if any other code snippets would help, let me know.</p>
java android
[1, 4]
2,579,315
2,579,316
ASP.NET jQuery issue
<p>I'm digging around with jQuery for something work related, and I am trying to get a specific flow of events working which I can't seem to get my head around.</p> <p>I understand how jQuery runs on the front end, functions are called or available to call from within the document.ready area, and have got some animation running on my front end upon the page re-loading (after a postback) - how ever, this is not the exact functionality I want.</p> <p>Using the standard asp.net postback model (no ajax), is the following possible?</p> <p>1) Page loads, some jQuery executes bringing my div's into their correct place via an animation. (Working fine). 2) User can click on one of the links inside the div (or the div itself) which then executes a jQuery animation effect, once that animation effect is over, use javascript to postback the page passing in the element that was clicked on. 3) Page posts back, I do all my data handling before the page re-loads again and then my document.ready jQuery runs again.</p> <p>The part I cant seem to get is #2, I can make some jQuery run on the click of my element by attaching a CSS class to the element and then handling the .click event of that class. This work's fine, but the page doesn't post back (the item clicked on is a LinkButton, just for the sake).</p> <p>If I manually place Postback code inside a JScript function, and call that function at the end of the chain of animation effects within that jQuery function block, the page posts back but I do not get any of the jQuery animation effect.</p> <p>What i really need to be able to do is </p> <p>1) Call the jQuery animation effect 2) Wait until that animation effect is complete 3) Perform page postback upon completion</p> <p>I'm not a javascript expert by any means, but have managed fine up until this point.</p> <p>Any points would be greatly appreciated. Regards</p>
asp.net javascript jquery
[9, 3, 5]
4,075,385
4,075,386
JS/jQuery: Get depth of element?
<p>What's the easiest way to get the depth of an element in pure JavaScript or jQuery? By "depth" I mean how many elements deep is it nested, or how many ancestors does it have.</p>
javascript jquery
[3, 5]
2,536,849
2,536,850
Can I just put my javascript right next to my <div>
<p>If I have some javascript/jQuery acting on a particular div inside tags (for an animation), can I just put the javascript (in a src="link-to-my-js.js" file) right next to my div?</p> <p>I mean something like the following:</p> <pre><code>&lt;body&gt; &lt;div id="special"&gt;Some html&lt;/div&gt; &lt;script type="text/javascript"&gt;javascript related to my div tag above...&lt;/script&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
1,013,033
1,013,034
Asp: Login Control, adding a extra button
<p>When using the login control what would be the best way to get 1 or 2 more buttons to the left of the login button?</p> <p>To make it short i want the default control as it is, but with another button in the control called "anonymous".</p> <p>I have already made a custom web user control and made it display succesfully.</p> <p>Ive tried working with layout template, but without much succes so far.</p> <p><em><strong>LayoutTemplate does not contain an IEditableTextControl with ID UserName for the username</em></strong></p> <p>Also the login control does no longer display in the design mode for some reason.</p> <p>Best Regards.</p>
c# asp.net
[0, 9]
3,269,630
3,269,631
Get input value except the last by jquery
<p>I want getting all value in inputs except the last input in last class <code>.tr</code> by jquery, but it don't work for me, How can fix it?</p> <p>I try as:</p> <p><strong>DEMO:</strong> <a href="http://jsfiddle.net/d4xZK/" rel="nofollow">http://jsfiddle.net/d4xZK/</a></p> <p><strong>HTML:</strong></p> <pre><code>&lt;div class="tr"&gt; &lt;input type="text" value="111"&gt; &lt;/div&gt; &lt;div class="tr"&gt; &lt;input type="text" value="222"&gt; &lt;/div&gt; &lt;div class="tr"&gt; &lt;input type="text" value="333"&gt; &lt;/div&gt; &lt;div class="tr"&gt; &lt;input type="text" value="444"&gt; &lt;/div&gt; </code></pre> <p><strong>jQuery:</strong></p> <pre><code>$('.tr').each(function(){ var mpiVal = $('.tr input').not(':last').val(); alert(mpiVal) )} </code></pre>
javascript jquery
[3, 5]
4,993,155
4,993,156
View Changes In Force Portrait Mode
<p>i am new in android platform. I have set my android application to force portrait mode. Now , i have an activity group in my application. When i am in a child view of the activity group , then if i rotate my device the screen remains in portrait mode but the view changes from child view to parent view of the activity group. I don't know why this is happening. So please help me on the issue. Thanks in advance .... !!!</p>
java android
[1, 4]
1,854,754
1,854,755
success msg from jQuery
<p>I have success and error image, I need to show the success message from my jQuery, like, </p> <p><img src="http://i.stack.imgur.com/L3fyP.png" alt="enter image description here"></p> <p>I need to show like this in a label control, I've created a css class named "success", if I can call this class from my jQuery I can display this image, is it possible, can anyone help me.</p> <p>If I use alert like <code>"alert("Changes saved successfully.");"</code>, I can get the alert box, but what I need to do is in a label control I need to show this success image as well as <code>"Changes saved successfully."</code> text.</p> <p>I tried like <code>lblMessageBox.html("addClass","success" + "Changes saved successfully.")</code>, its not working</p>
jquery asp.net
[5, 9]
1,326,312
1,326,313
Insert a code inside .load
<p>I use jquery 1.3.2 and I am modifying a cart module to better suit my needs. I found a function which I think should be what I am looking for.</p> <pre><code>function ajaxCartReloadCartView() { if (jQuery('#cart-form-pane').length) { jQuery('#cart-form-pane').parent().load(Drupal.settings.uc_ajax_cart.SHOW_VIEW_CALLBACK, ajaxCartReloadCartViewSuccess ); } } </code></pre> <p>Would it be possible to insert code before and after function ajaxCartReloadCartViewSuccess? I neeed to insert for example this code $("#cart-block-contents-ajax").removeClass("xxx");</p>
javascript jquery
[3, 5]
4,855,508
4,855,509
Get the last part of an url in Javascript
<p>Using the following URL example, how would I get the obtain the username from it?</p> <p><a href="http://www.mysite.com/username_here801" rel="nofollow">http://www.mysite.com/username_here801</a></p> <p>A regex solution would be cool.</p> <p>The following sample only gets the domain name:</p> <pre><code> var url = $(location).attr('href'); alert(get_domain(url)); function get_domain(url) { return url.match(/http:\/\/.*?\//); } </code></pre> <p>jQuery solutions are also acceptable.</p>
javascript jquery
[3, 5]
2,852,713
2,852,714
In Gridview Anchor tags are not working in Safari
<p>In my project i am using Gridview to display List of Companies, under the Company name i have link to navigate to company details for this link i am using html anchor() tag. It's working good in IE and Chrome but in the Safari it's not navigating. Below is my sample gridview TemplateField.</p> <pre><code> &lt;asp:TemplateField HeaderText="Company Name" ItemStyle-Width="175px" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="left" SortExpression="CompanyName"&gt; &lt;ItemTemplate&gt; &lt;a href="#" title="Edit Company" onclick="LoadCompanyDetails('&lt;%# Eval("CompanyId") %&gt;', '&lt;%# Eval("CompanyName") %&gt;', 0)"&gt; &lt;%# Eval("CompanyName")%&gt;&lt;/a&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>JavaScript Function:</p> <pre><code> function LoadCompanyDetails(companyId, companyName, copyFlag) { $get('hdnCompanyId').value = companyId; $get('hdnCompanyName').value = companyName; $get('hdnCopyFlag').value = copyFlag; $get('btnEdit').click(); } &lt;a id="btnEdit" href="#" runat="server" onserverclick="btnEdit_ServerClick" style="display: none"&gt; </code></pre> <p>And out side grid also anchors are not working in safari.</p> <p>Can any one help me please.</p>
javascript asp.net
[3, 9]
5,943,312
5,943,313
Changing data-url or similar attributes on Element
<p>I'm trying to access the data-url attribute of the following element so it could be replaced upon callback or as needed with jQuery / Javascript. </p> <p><strong>What method will work to do this?</strong></p> <pre><code>&lt;a id="twitter_link" href="https://twitter.com/share" class="twitter-share-button" data-via="imdto" data-lang="en" data-url="http://mydomain.com/changeme"&gt;Tweet&lt;/a&gt; </code></pre> <p>I've tried using <code>attr()</code>, <code>prop()</code> functions but returns undefined.</p>
javascript jquery
[3, 5]
257,339
257,340
Ensuring unique Javascript identifiers in ASP.NET Web User Controls
<p>In my current project, I am creating a number of user controls, some of which include some custom Javascript for event handling on the client side. I am registering my event handlers using OnClientClick="function()" and the like.</p> <p>Now, I'm wondering how to ensure that all Javascript function names are unique for each specific instance of the control, so I don't risk name conflicts between controls. I have thought about putting all functions inside a named object, like</p> <pre><code>var &lt;%=ClientID%&gt;_Script { method1: function() { ...} } </code></pre> <p>and then subscribing to events using something like</p> <pre><code>OnClientClick="&lt;%=ClientID%&gt;_Script.methodName()" </code></pre> <p>It just seems like I can't but &lt;%= %>-expressions inside OnClient* attributes. I am therefore wondering; are there some "best practices" for doing this?</p>
asp.net javascript
[9, 3]
2,635,651
2,635,652
Attributes in JQuery
<p>Suppose I have these divs:</p> <pre><code>&lt;div class="hat" rel="cap"&gt; &lt;div class="hat" rel="pine"&gt; &lt;div class="hat" rel="mouse"&gt; </code></pre> <p>How do I use JQuery to do a "where"?</p> <p>For example</p> <pre><code>$("div.hat").remove WHERE rel="mouse" </code></pre>
javascript jquery
[3, 5]