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
2,825,621
2,825,622
jQuery bootbox dialog
<p>I try to get the following code to work</p> <pre><code>//===== Dialogs =====// $(".table a.delete").click(function (e) { e.preventDefault(); bootbox.confirm("Are you sure?", function (confirmed) { if (confirmed) { var $el = $(this); var $tr = $el.closest('tr'); var url = $el.closest('table').data('remove-url'); var id = $tr.data('id'); $tr.fadeOut(function () { $el.remove(); $.post(url, { id: id }); // do the delete on the server }); } }); }); </code></pre> <p>The bootbox is showing, but the code below <code>if(confirmed)</code> doesnt run. </p>
javascript jquery
[3, 5]
296,765
296,766
How to add DropDownlist of all users to ListView
<p>I have a ListView control, I want to edit the InsertItem Template to include a Dropdownlist Item which contains a list of users in Membership Directory.</p> <p>I tried this:</p> <pre><code> MembershipUserCollection users = Membership.GetAllUsers(); assigned_volunteerDropDownBox.DataSource = users; assigned_volunteerDropDownBox.DataBind(); </code></pre> <p>The biggsest issue is that it says <code>assigned_volunteerDropDownBox</code> does not exist in the current context... In fact none of the TextBox items on the insert template are in the current context (is this normal)?</p> <p>How would I go about doing this? I want to be able to only allow the row to be updated with valid usernames.</p> <p>I looked at <a href="http://stackoverflow.com/questions/8906367/how-to-list-all-users-in-active-directory-in-dropdownlist-control">this</a>, but it doesn't actually contain the code to DataBind to the DropDownList item.</p>
c# asp.net
[0, 9]
2,670,874
2,670,875
How to disable enter key from submitting in jquery / javascript, but retain other enter key behavior
<p>What is the best way to disable the <code>enter</code> key from submitting a form, but retain all other default behavior of the <code>enter</code> key? </p> <p>We have a website with hundreds of forms, many of which already have onsubmit handlers attached to the submit elements. Our users are getting annoyed that they keep accidentally submitting data when hitting the <code>enter</code> key, and our standard response that the web's default behavior is for the <code>enter</code> key to always submits isn't flying (particularly since it doesn't submit if you're on many inputs other than a textbox). </p> <p>What we'd love is for <code>ctrl-s</code> to always submit a form, and for <code>enter</code> to not. However, we'd love to do this without needing to change each page, and a solution that worked with IE7+, Chrome, and FF3+.</p>
javascript jquery
[3, 5]
2,062,155
2,062,156
lock all submit button before page fully rendered
<p>may i know how to use jquery to lock all the <code>&lt;input type="submit/button" ..</code> and only allow submit when page is fully rendered?</p>
javascript jquery
[3, 5]
5,650,834
5,650,835
php in javascript
<p>The javascript works fine without the php part but it needs to redirect and keep the link information how to do this ??</p> <pre><code>&lt;script&gt; if(navigator.userAgent.indexOf("Firefox") != -1) { window.location = "demo2.php?skin=&lt;?php echo $_GET["skin"]; ?&gt;"; } &lt;/script&gt; </code></pre> <p>works :</p> <pre><code>&lt;script&gt; if(navigator.userAgent.indexOf("Firefox") != -1) { window.location = "demo2.php?skin=&lt;?php echo $_GET['skin']; ?&gt;"; } &lt;/script&gt; </code></pre>
php javascript
[2, 3]
1,939,590
1,939,591
How to pass textbox value to Javascript variable?
<p>I need to pass a textbox value in asp.net to the javascript variable videoID and save it to the database.</p> <p><strong>Here is my code</strong></p> <pre><code>&lt;script&gt; var tag = document.createElement('script'); tag.src = "http://www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var player; function onYouTubePlayerAPI() { player = new YT.Player('player', { height: '350', width: '600', videoId: 'ASO_zypdnsQ', events: { 'onReady': onPlayerReady } }); } &lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
4,956,927
4,956,928
Inline coding in ASP.NET page
<p>hi guys i am using this code in my aspx page </p> <pre><code>&lt;%for (int i=o;i&lt;5;i++) {%&gt; &lt;asp: link button id=i text=i/&gt; &lt;%}%&gt; </code></pre> <p>at it's producing five link buttons like </p> <blockquote> <p>i i i i i</p> </blockquote> <p>but i just want five link buttons like that</p> <blockquote> <p>1 2 3 4 5</p> </blockquote> <p>with id=1,2,3,4,5 respectively</p> <p>how can I can implement that </p>
c# asp.net
[0, 9]
2,533,512
2,533,513
What would be the right syntax in jQuery
<p>I have a jquery function which on submit event is generating an url.If one the parameter is not defined, adding to url should be skipped </p> <pre><code> var category =$("#prod_category").val(); var group =$("#prod_group") window.location.href = "/page/" + **//add to url if category is definned** encodeURI(category) + "/" + **//add to url if group is definned** encodeURI(group) + "/" + </code></pre>
javascript jquery
[3, 5]
861,269
861,270
Getting system's hardware information of a connected user to a PHP website ? Is it possible?
<p>I am posting this in order to confirm if it is possible for PHP to get a user's machine hardware information when connected to a website? </p> <p>In my case I am developing an Intranet which requires one user - one machine login. Which means a user assigned to his/ her machine can only login, others cannot login from that particular machine. In this regard, my database and PHP Code is already up and running without machine dependency. </p> <p>I presume it is not possible because PHP is a Server Side code which requires none of the User's system resources to get in touch with. To get system's hardware information - some application must be installed in user's machine to get it done. But is this possible in any regard for example a PHP Desktop application (though not in development) or any Java application to check machine's information and get appended it to Normal user's login. </p> <p>Awaiting experts solutions...</p>
java php
[1, 2]
593,812
593,813
how to add textbox in the mail body?
<p>I am using asp.net and C#.</p> <p>I have a requirement in which i need to add one textbox in the mail body. After the user registration, i need to send a welcome mail. i tried to add the input tag in the mail body, but i am able to see on [ ](two square brackets).</p> <p>Can anyone tell me how to do this?</p>
c# asp.net
[0, 9]
3,541,176
3,541,177
how to give confirm message box when selecting previous date in asp.net
<p>hello i have created one webpage in asp.net &amp; in that webpage i am using Asp calendar control. I want to display message box whenever user selects the previous dates from that calendar control how can i do it please suggest me any solution.</p>
c# javascript asp.net
[0, 3, 9]
2,347,549
2,347,550
How do I pass a searchstring to perform a search?
<p>again I'm stuck and asking you to help me.</p> <p>I want to enter a search string in an input-field. The search string should perform a search like <a href="https://.../=~searchstring" rel="nofollow">https://.../=~searchstring</a></p> <p>The textfield:</p> <pre><code>$(&quot;&lt;input id='field-inputSearchString' type='text' name='field_inputSearchString'&gt;&quot;).insertAfter('.completed ticket');</code></pre> <p>I've got two questions here:</p> <ol> <li><p>I guess I need to 'find' the string to pass it to the search link. Is it sth. like this? <code><pre>$(function() { var foundin = $('input[id$='field-inputSearchString']:contains(text)'); }); </code></pre></p></li> <li><p>And how do I pass the text to the link? Have you got an example or link explaining what I'm looking for?</p></li> </ol> <p>I appreciate every help. Thank you so much in advance.</p>
javascript jquery
[3, 5]
3,995,354
3,995,355
Python as a web scripting language?
<p>I've recently been developing with Python, and I absolutely love it. It's a <em>huge</em> step up from PHP as a quick scripting language (imagine, no crazy function names!), and I would love to be able to use it as a web development language.</p> <p>I've heard about Django, but I want something a bit more simple.</p> <p>I run Lighttpd, and I've already gotten a Python script to work, but I can't pass arguments to it via the URL, like <code>http://localhost/index.py?foo=bar</code>. Is there a function/library that allows this?</p> <p>I could be going at this all wrong, so please tell me if I am. But I absolutely <em>hate</em> PHP, now that I've seen Python. ;)</p>
php python
[2, 7]
3,673,852
3,673,853
JavaScript style wrapping in PHP
<p>I'm primarily a JS developer, using PHP for that server-side kick and I'm looking to see if there's an method in PHP similar to the JS:</p> <pre><code>var something = { action1: function() { alert('Fire 1!'); }, action2: function() { alert('Fire 2!'); }, action3: function() { alert('Fire 3!'); } } </code></pre> <p>Then allowing me to call like:</p> <pre><code>something.action2(); // Alerts 'Fire 2!' </code></pre> <p>It's for a relatively small app I'm working on and I'd like to avoid building classes. Since PHP is such a small part I'd like to keep it as similar in code-style as possible.</p>
php javascript
[2, 3]
760,814
760,815
StronglytypingException the value is DBnull but value in row is not null
<p>When I take look in quick watch regarding the dataset returned It shows stronglytypingException saying value is DBnull But the value is 1 in the row. It is taking all the values correctly except this one.</p> <p>Also, The error is in the newly added column. Have i done anything wrong?. Thanks.</p>
c# asp.net
[0, 9]
4,026,225
4,026,226
How to create the div, dynamically in asp.net
<p>I have some textbox and submit button.</p> <p>When ever I click the submit button the div should be added dynamically in my aspx page.</p> <p>Also the information which is available in the text box also displayed in the page default.</p> <p>Use:Without using database i need to display the user suggestion in my page...</p>
c# asp.net
[0, 9]
644,948
644,949
javascript: Defining "this" in the context of a function
<p>When jQuery calls a function as an event handler for a raised event, jQuery is somehow able to define "this" in the context of a function that it calls. In the following example, jQuery define this as the dom element that was clicked on.</p> <pre><code>&lt;input id="someButton" type="button" value="click me!"/&gt; &lt;script type="text/javascript"&gt; $("#someButton").click(EventHandler); function EventHandler() { alert($(this).attr("id")); //This raises an alert message "someButton" } &lt;/script&gt; </code></pre> <p>How does jQuery do this? I would like replicate this behaviour for my own custom framework.</p>
javascript jquery
[3, 5]
1,727,084
1,727,085
jQuery dialog: external file load not working from button
<p>Could someone please tell me what is up with this code? I can't for the life of me see whats stopping it from working. If I set it to <code>autoOpen: true</code> it works, but getting it to open from the button does not seem to work! Many thanks in advance.</p> <p><strong>Jquery:</strong></p> <pre><code>$(document).ready(function () { $("#pextension").load('tour_extension_lb.aspx').dialog({ bgiframe: true, autoOpen: false, position: 'center', width: 440, height: 300, modal: true, }); $('a.extension-link').click(function () { $('#pextension').dialog('open'); return false; }); }); </code></pre> <p><strong>html:</strong></p> <pre><code>&lt;a href="#" class="extension-link"&gt;OPEN EXTENSION DIALOG&lt;/a&gt; &lt;div id="pextension" class="dialogBox" style="display:none;"&gt;&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,677,330
4,677,331
Compiling eAccelerator to decode PHP Coded Files
<p>By any chances is it possible to compile eAccelerator using OP Codes, to decompile the code loaded by eaccelerator_load(); and how? </p> <p>I Use eAccelerator 0.9.5, PHP 4.4.4.</p>
c# php c++
[0, 2, 6]
2,758,001
2,758,002
ASP.Net C# gridview
<p>I have a gridview with a linkbutton inside a <code>&lt;HeaderTemplate&gt;</code>. There is an event handler for a click on this button. Now if I bind data to the gridview on every <code>Page_Load</code> event, then this event fires. But if I bind data to the gridview inside <code>if (Page.IsPostBack == false)</code>, then this event doesn't fire.</p> <p>Is it that after the pageload it realizes there is no data in the gridview hence ignore events generated from the grid? </p> <p>How do I slove the problem ?</p>
c# asp.net
[0, 9]
4,340,717
4,340,718
Programming Challenge using jQuery
<p>This is a follow up to a previous question which seems to have confused people so I'll purify it a bit. Here is some markup.</p> <pre><code>&lt;div class="button width120 height30 iconLeft colorRed"&gt;&lt;/div&gt; &lt;div class="button width180 height20 iconPlus colorBlue"&gt;&lt;/div&gt; &lt;div class="button width200 height10 iconStar colorGreen"&gt;&lt;/div&gt; &lt;div class="button width110 height60 iconBack colorOrange"&gt;&lt;/div&gt; </code></pre> <p>The challenge is to fill in the code in the following.</p> <pre><code>$(".button").each(function(){ // Get the width from the class // Get the height from the class // Get the icon from the class // Get the color from the class }); </code></pre> <p>Now, I know that you shouldn't use classes this way so I'm not looking for alternative ways of doing it, this is an experiment and I'm interested to know if it's possible to do it this way.</p>
javascript jquery
[3, 5]
3,433,754
3,433,755
Get checkbox status as soon as it is checked or unchecked
<p>I want to get the current status of checkbox as soon as it is check or unchecked. Based on that show the Toast message. Here is my code so far.</p> <pre><code>SharedPreferences getPrefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); boolean Alarm = getPrefs.getBoolean("cbAlarm", true); if(Alarm == true) { Toast.makeText(this, "Checked", Toast.LENGTH_LONG).show(); } else if(Alarm == false) { Toast.makeText(this, "UnChecked", Toast.LENGTH_LONG).show(); } </code></pre> <p>How can I achieve this. Please help.</p> <p><strong>Edit</strong> here is my xml file</p> <pre><code>&lt;CheckBoxPreference android:title="Enable/Disable Alarm" android:defaultValue="true" android:key="cbAlarm" android:summary="Enable or disable alarm" /&gt; </code></pre>
java android
[1, 4]
831,273
831,274
How to check if jQuery UI files have been included?
<p>I use a CMS on my website and have run into a problem. The CMS includes jQuery files on some pages, but not on all, and I need to be able to use jQuery everywhere. I found a solution for including the base jQuery library by using the following code:</p> <pre><code>if(!window.jQuery) { document.write("&lt;" + "script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'&gt;&lt;/" + "script&gt;"); } </code></pre> <p>However, I don't know how to check whether the jQuery UI JS and CSS files have been included or not, specifically these files:</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"&gt; </code></pre> <p>Is there a way to check if those files have been included, similar to the above code for the base jQuery library?</p>
javascript jquery
[3, 5]
1,863,740
1,863,741
How to email Rendered Report in diffrent formats like pdf,excel,word in Report Viewer in Local Mode and Modify Tool bar of Report Viewer
<p>I have an issue related with Report viewer control Version=10.0.0.0 i am showing SSRS Report(.rdl) file on report viewer in Local Mode. I have following problems in Find Control of report viewer,</p> <ol> <li><p>When I search any text in rendered report and if text found but my report shift to upside and to click on find next user have to scroll again and again.</p></li> <li><p>After Last occurrence of searched text when we click on find next the message shown and text box of find control will be blank but i want the text should not blank. How can i do it.</p></li> </ol> <p>I want to know that how much control we have in report viewer's Find Control.</p>
c# asp.net
[0, 9]
5,049,307
5,049,308
label as dynamic navigation
<p>I Made label to had value from database and linked it . but the problem was it had only one value and i want it keep value when navigation thought site as.</p> <p>x>y>z>....</p> <p>this is my code</p> <p>&lt;</p> <p></p> <p>if (Request.QueryString["Category_Id"] != null) {</p> <pre><code> Banar.ImageUrl = "Handlers/Banner.ashx?Category_Id=" + Request.QueryString["Category_Id"] + ""; using (SqlConnection conn = Connection.GetConnection()) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "Navcategory"; cmd.Parameters.Add(Parameter.NewInt("@Category_Id", Request.QueryString["Category_Id"])); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { LblNavigaton.Visible = true; LblNavigaton.Text = dr[i].ToString(); NavHref.HRef = "ListView.aspx?Category_Id=" + Request.QueryString["Category_Id"] + ""; } } } else if (Request.QueryString["ProductCategory_Id"] != null) { Banar.ImageUrl = "Handlers/ProCatBanner.ashx?ProductCategory_Id=" + Request.QueryString["ProductCategory_Id"] + ""; using (SqlConnection conn = Connection.GetConnection()) { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "NavProductcategory"; cmd.Parameters.Add(Parameter.NewInt("@ProductCategory_Id", Request.QueryString["ProductCategory_Id"])); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { LblNavigaton.Visible = true; LblNavigaton.Text = dr["Name"].ToString(); NavHref.HRef = "ListView.aspx?ProductCategory_Id=" + Request.QueryString["ProductCategory_Id"] + ""; } else { LblNavigaton.Visible = true; LblNavigaton.Text = Page.Title; } } </code></pre>
c# asp.net
[0, 9]
1,571,167
1,571,168
Programmatically scroll an Android app using another app running in the background?
<p>I am creating an Android app and I am also planning and an iPhone version, so I am looking for the opinions of both Android and iPhone developers. The app I am creating runs in the background, i.e. it has no GUI, and checks if another app is running.</p> <p>If the other app is running I want to take screenshots using my background app, every few seconds. </p> <ul> <li><strong>Is taking screenshots with an app running in the background possible?</strong></li> <li><strong>I also want to scroll the screen of the foreground app programmatically using my background app, is this possible?</strong></li> </ul>
android iphone
[4, 8]
4,746,594
4,746,595
controls in asp.net repeater
<p>I have a repeater, which basically has a text box in it and I have implemented a paging function on the repeater, the repeater only shows 25 rows at a time. What I want to do is, get each text box for each row in the repeater, but at the moment I am only getting the text boxes that are shown on the repeater (the first 25 rows). What can I change in my code to get every single row?</p> <p>My code is as follows:</p> <pre><code>foreach (Control control in repeaterSegmentList.Controls) { foreach (Control innerControl in control.Controls) { if (innerControl.ID != null) { if (innerControl.ID == "Priority") { ((TextBox)innerControl).Text = txtPrio.Text; } } } } </code></pre> <p>thanks in advance.</p>
c# asp.net
[0, 9]
86,207
86,208
Passing values with session and adding to session one each page
<p>I need to store the values entered in <code>textBox's</code> and <code>dropdownList's radio buttons</code>.... My form is a multi paged form. Im not sure what im doing but this is what im thinking.</p> <p>I have a button that clicks to the next page. I have made a class with everyfield in the DB table i want to insert too. On the button click event i want to assign the values to the <code>session</code>. Is this how I would do it?</p> <pre><code>protected void img_btnNext_Click(object sender, ImageClickEventArgs e) { Incident obj = new Incident(); obj.witnessesYes = rad_ReportYes.Checked; obj.witnessesNo = rad_ReportNo.Checked; // lots more objects .... to values Session["mySession"] = obj; Response.Redirect("~/Communicating.aspx"); } </code></pre> <p>so when I go to the next page do I just carry on ? adding more values to the <code>obj</code> and adding it to <code>session</code>? Im not sure how to do this.</p>
c# asp.net
[0, 9]
5,760,956
5,760,957
I created a function using fopen in php if i use it as a function it doesnt work if i use it alone it does
<p>Basically i created a some code that creates a file.... I can use that code and works perfectly in the IF statements in my code... now... because i have to use it twice... I decided to make it a function... but as soon as i make it a function it doesnt work...</p> <p>anyone can tell me why?? I am just calling the function inside others IF statements as <code>if (createFile()) { echo "it worked"; }</code></p> <pre><code>function createFile () { //Creates File and populates it. $fOpen = fopen($dbFile, 'w'); $fString .= "&lt;?php\n"; $fString .= "// Database Constants\n"; $fString .= "define(\"DB_SERVER\", \"$server\");\n"; $fString .= "define(\"DB_USER\", \"$username\");\n"; $fString .= "define(\"DB_PASS\", \"$password\");\n"; $fString .= "define(\"DB_NAME\", \"$dbname\");\n"; $fString .= "?&gt;"; fwrite($fOpen, $fString); fclose($fOpen); } </code></pre>
php jquery
[2, 5]
20,911
20,912
Difference between log methods
<p>I am new in android and i print log-cat using:</p> <pre><code>Log.w("Tag", "String text"); </code></pre> <p>and log text print but after searching for a time i find some more way to print logcat like:</p> <pre><code>Log.v() Log.d() </code></pre> <p>and now i am confuse in these methods.</p> <p>Which is the best method for print log-cat and how may method for print lagcat and also what is the main difference between them?</p> <p>thanks in advanced.</p>
java android
[1, 4]
5,316,893
5,316,894
setTimeout not recursively calling anonymous function
<p>I was asked to make a small div cycle a fade in and fade out effect. There are several ways to do this, but I am wondering why the following only runs the effect one time.</p> <pre><code> $(document).ready(function() { (function(){ setTimeout(function(){$("#foo").fadeOut().delay(800).fadeIn(800);},0) })(); }); </code></pre> <p>As far as I can tell, the function should run recursively, but it doesn't.</p> <p>I went with <code>setInterval(function(){$("#foo").fadeOut().delay(800).fadeIn(800);}, 0);</code> because it gets the job done, but I'd still like to know why setTimeout didn't work as I expected.</p>
javascript jquery
[3, 5]
4,896,756
4,896,757
jquery or js: replace a link site-wide with another AND change to https
<p>I want to change every instance of</p> <pre><code>http[s]://www.mydomain.com/test/index.php?this_page=foo </code></pre> <p>to</p> <pre><code>https://www.mydomain.com/test/index.php?this_page=bar </code></pre> <p>I think its must be able to be done with <code>attr.replace</code> but I can't figure out the notation. How can I do this with jQuery or JavaScript?</p> <p>EDIT: it seems everyone so far is either missing the first part (http OR https changes to https) or the second part (foo to bar) :) Sorry for confusion</p>
javascript jquery
[3, 5]
3,817,808
3,817,809
Capture clicking on a checkbox's title in jQuery
<p>I'd like to listen on the event of a user clicking on a checkbox's title (in addition to the checkbox itself). How can this be done?</p>
javascript jquery
[3, 5]
618,044
618,045
Unfortunately HelloListView has stopped
<p>I've followed <a href="http://developer.android.com/resources/tutorials/views/hello-listview.html" rel="nofollow">this tutorial</a> but when I try to run the application I get <code>Unfortunately HelloListView has stopped</code> The IDE gives no warnings or errors.</p> <p>My HelloViewListActivity.java looks like this:</p> <pre><code>public class HelloListViewActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String[] countries = getResources().getStringArray(R.array.countries_array); setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, countries)); ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { // When clicked, show a toast with the TextView text Toast.makeText(getApplicationContext(), ((TextView) view).getText(), Toast.LENGTH_SHORT).show(); } }); } } </code></pre> <p>My strings.xml and list_item.xml are both <a href="http://developer.android.com/resources/tutorials/views/hello-listview.html" rel="nofollow">identical to the tutorial.</a></p> <p><a href="http://pastebin.com/P0xrX2PC" rel="nofollow">Logcat log here</a> What is it that I am doing wrong?</p>
java android
[1, 4]
5,116,975
5,116,976
calling both base and derived methods
<p>in both C# and C++, is it possible to call both base and derived versions of a method with the same signature instead of overriding the base class version?</p>
c# c++
[0, 6]
4,948,728
4,948,729
Invoking super class implementation of the method after setting some attributes in the subclass
<p>I am making a baseactivity for an Android app. I need to set some attributes in the onCreate method in the subclass before calling the super class implementation of it which does the work. So is this bad practice? To set attributes in the subclass then call the super class implementation of the method where you set them?</p> <p>Thank you</p>
java android
[1, 4]
4,186,259
4,186,260
Jquery- Find the element has given style property
<p>i have a html table </p> <pre><code> &lt;table class="mytable"&gt; &lt;tr&gt; &lt;td&gt; test value &lt;/td&gt; &lt;tr&gt; &lt;/table&gt; </code></pre> <p>on loading the page dynamically adding a td </p> <pre><code> $(".mytable tr:first").append("&lt;td id='scheduledInMyLearnStatus' class='changeFieldValue' style='background-color:#FE2E2E;'&gt;&lt;/td&gt;"); </code></pre> <p>now on clicking the that particular td i want to compare whether its has backgroung color =#FE2E2E or has anything else</p> <pre><code> $('td').live('click', function() { //compare here }); </code></pre>
javascript jquery
[3, 5]
3,129,988
3,129,989
Simple Modal not working in IE 9
<p>Below is URL of the page which works fine in Firefox, chrome, Safari but for some reason it is not working in IE 9.</p> <p>Modal shows a banner when page loads.</p> <p><a href="http://tinyurl.com/b52drmt" rel="nofollow">http://tinyurl.com/b52drmt</a></p> <p>link for modal i am using <a href="http://www.ericmmartin.com/projects/simplemodal-demos/" rel="nofollow">http://www.ericmmartin.com/projects/simplemodal-demos/</a></p> <p>Script looks fine to me, unfortunately i am not able to fix it so far.</p>
javascript jquery
[3, 5]
1,743,366
1,743,367
How to pass javascript variable value to java class
<p>I want to submit data from a html page to java class. I am using javascript to get data from html page, now I want to send this data to java class to save this data to db. I am using ftl template to generate html so I cant use jsp here. Please give an example using either javascript of ajax or jquery.</p> <p>thanks.</p>
java javascript
[1, 3]
701,147
701,148
why does loading jquery after mootools causes conflicts
<p>I was wondering what is the reason for the conflict when jquery is loaded after mootools. Anyone has a nice explaination since the web gives me shady answers. Thanks</p>
javascript jquery
[3, 5]
3,996,122
3,996,123
JS slideshow "nextPhoto"/"prevPhoto" not working
<p>I'm working on a JavaScript slideshow someone else originally built, and I seem to have busted it. The "previous" and "next" buttons don't work - they don't do anything, actually. </p> <p>Using the HTML Validator plugin for Firefox when I load the page, I get an error message: "Undefined variable: random_photo in [filename.php]"</p> <p>When I click on "next" or "previous", I get an additional error: "nextPhoto is not defined"</p> <p>I have compared the code on this page to another existing (and functional) slideshow, and I cannot find any differences. </p> <p>I'm happy to pup up code snippets, but I'm not sure what's relevant...I'm kind of a newbie to JavaScript.</p> <p>What am I missing/what can I do to define the supposedly undefined variables?</p>
php javascript
[2, 3]
5,864,451
5,864,452
Error bind click on jquery check value empty
<pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('#btnSubmit').bind('click', function(){ var option = $('#option1').val(); if(option == ''){ alert('Answer empty'); } return false; }); }); &lt;/script&gt; </code></pre> <p>...</p> <pre><code>&lt;input type="radio" id="option1" name="option1 /&gt; &lt;input type="submit" name="btnSubmit" id="btnSubmit" value="submit" /&gt; </code></pre> <p>...</p> <blockquote> <p>=> error click button submit not alert</p> </blockquote>
php jquery
[2, 5]
3,350,958
3,350,959
Select 2nd and 3rd element from each triplet of elements
<p>I have set of 6 elements and I would like to filter by every second and third element so I want to have elements 2, 3, 5 and 6. I've tried <code>.filter(':nth-child(2n+1)'));</code> but obviously that filters the 2, 4, and 6.</p> <p>The other way I was trying was to remove elements 1 and 4, but I couldn't find a jQuery function that was the opposite of filter that would remove the elements from the set.</p>
javascript jquery
[3, 5]
3,056,935
3,056,936
Check from where an ASP.Net page in my application was opened?
<p>Searched everywhere but couldn't find anything.</p> <p>My question is: is it possible to programmatically determine the address of the site from where a page in my ASP.Net application was opened (either from client code or server code)? </p> <p>Suppose i have a big job board application, some of the jobs are listed in Google. How can one tell if the page was opened directly from the application, or from an external source like search engines/ etc (i.e. did someone click a link in Google and got here?).</p> <p>Thanks!</p>
javascript asp.net
[3, 9]
453,094
453,095
Miltitasking and Progress Bar
<p>Does Android have multitasking functionality? If yes, then how can we use it to enable a progress bar?</p>
java android
[1, 4]
4,027,374
4,027,375
JavaScript to java, difference in Array Creation
<p>-In JavaScript you can use a generic value type <code>var</code></p> <p>-In Java you must use explicit value types <code>double</code>, <code>int</code>, <code>String</code> etc</p> <p>-In JavaScript the Array can have also heterogeneous values.</p> <p>-In Java an array can have only values of the same kind,(for example all double or all String).</p> <p>What happen if I write in JavaScript?</p> <pre><code>var test[]=new Array(); test[1] = 16.98; test[2] = 8.33; test[3] = 5.31; test[10] = 5.04; </code></pre> <p>The NOT-ASSIGNED index values are set to <code>0</code>, to <code>null</code>, or to <code>blankspace</code>? Since all primitive values have a specific null value, for boolean false, for int 0 etc. If I want to port the above array form JavaScript to Java without errors I should know exactly the JavaScript policy for not assigned index values of the array.</p> <p>Is correct to port the above sample in Java in this way?</p> <pre><code>double test[]={0, 16.98, 8.33, 5.31, 0, 0, 0, 0, 0, 0, 5.04} </code></pre>
java javascript
[1, 3]
3,891,811
3,891,812
Build common interface for two applications(one is in .asp, other in java)
<p>We have two applications. One application in .asp and second application in java. we want to build interface for universal authentication, so that one can access the other application once signed into one application. Both applications are using SQL database, but one is written in .ASP hosted on Windows server while the other is in JAVA hosted on a Linux server. The applications are currently resided on two different servers.</p> <p>requirements:</p> <p>1)The end user are most likely to access the applications through .ASP first, then reach the 2nd application more like "back office" management system. 2)he JAVA application currently works well with IE web browser, but not very smooth with other browsers such as Firefox. Would like to make the application to be more compatible with other browsers.</p> <p>Please help me, its very important to me. Thanks in advance!</p>
java asp.net
[1, 9]
5,581,624
5,581,625
Why I Can not display "person name :"?
<pre><code>&lt;p id="display1"&gt;&lt;/p&gt; &lt;p id="display2"&gt;&lt;/p&gt; var person1= { name: 'John Smith', hobbies: ['surfing', 'diving'] }; $("#display1").append( "&lt;br/&gt;" + "person name :" + person1.name + "&lt;br/&gt;"); var person2= clone(person1); $("#display2").append( "&lt;br/&gt;" + "person name :" + person1.name + "&lt;br/&gt;"); </code></pre> <p><a href="http://jsfiddle.net/centerwow/sGK6u/" rel="nofollow">Demo jsFiddle</a></p> <p>the above code siplay person1 name.</p> <p>why it doesn't display person2 ? Many thx.</p>
javascript jquery
[3, 5]
2,437,381
2,437,382
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,902,633
5,902,634
using isNaN to evaluate input
<p>I am using isNaN to evaluate input in text box my function is like this</p> <pre><code>function IsNumeric(n) { return !isNaN(n); } </code></pre> <p>it's working fine with numeric but not on negative values nor decimal values like 1.2,</p> <p>but I will not accept negative or decimal values like 1.2</p> <p>how can I do that?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,971,098
1,971,099
Is there is any way to scrape the dynamic content using php or java
<p>I need to scrape some details from a website. It loads certain details in Ajax after a button click. Is it is possible to scrape the details from this <a href="http://www.guruji.com/music/3%20idiots/" rel="nofollow">link</a>?</p> <p>It loads the details when the <code>+</code> button is pressed.</p>
java php
[1, 2]
860,131
860,132
onclick event is not working inside echo
<pre><code>echo '&lt;a onclick="alert(\'alert\');"&gt;&lt;img src= "1.jpeg"&gt;&lt;/a&gt;'; </code></pre> <p>It is working fine, But</p> <pre><code>echo '&lt;a onclick="do();"&gt;&lt;img src= "1.jpeg"&gt;&lt;/a&gt;'; </code></pre> <p>Its not working if i put that alert inside do() like</p> <pre><code>&lt;script type="text/javascript"&gt; function do() { alert("alert"); } &lt;/script&gt; </code></pre> <p>Can any body help on this.</p>
php javascript
[2, 3]
792,866
792,867
How to get the id of next tr in table using jquery?
<pre><code>&lt;table&gt; &lt;tr id ="tr_id_1"&gt; &lt;td &gt; Blah &lt;/td &lt;td&gt; Blah &lt;/td&gt; &lt;/tr&gt; &lt;tr id ="tr_id_2"&gt; &lt;td&gt; Blah &lt;/td&gt; &lt;td&gt; Blah &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>i have got the id of first tr using jquery </p> <pre><code>var first_tr_id = tr_id_1 // id of first tr </code></pre> <p>now by using this id how to get the id of next tr i have tried like this </p> <pre><code>var nextId = ('#'+first_tr_id ).next("tr").attr("id"); </code></pre> <p>but its giving <strong>("#" + row_id).next is not a function</strong> error ..</p>
javascript jquery
[3, 5]
4,126,130
4,126,131
Simple Droid App force closes when switching activities
<p>I new to app development and I have been working on a Flash card app. There is a main screen and the user chooses a button. On the emulator when I touch a button to go to a new activity, my app force closes. I have added the activity in the manifest. The second activity has its own layout (main2.xml). My buttons look like this:</p> <pre><code>Button add = (Button) findViewById(R.id.add); add.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent addIntent = new Intent(view.getContext(), Add.class); startActivity(addIntent); } }); </code></pre> <p>Any ideas of what's going wrong? If more info is needed I can supply it, I've been stuck here for two days. Thanks</p>
java android
[1, 4]
5,664,532
5,664,533
Why all the images in a slider first linup for 1-2 secs before they adjust in a proper position?
<p>if you open this page <a href="http://www.expertforyou.com/" rel="nofollow">http://www.expertforyou.com/</a></p> <p>All the images are like vertical for a second or two, before they line up. Depending on internet speed, it could be a few seconds.</p> <p>How can we remove this?</p>
php jquery
[2, 5]
1,524,348
1,524,349
Why jquery class selector select items that has part of the classname?
<p>if i have :</p> <pre><code>&lt;div class="carBig"&gt;&lt;/div&gt; </code></pre> <p>and</p> <pre><code>&lt;div class="car"&gt;&lt;/div&gt; </code></pre> <p>and $(".car").size();</p> <p>i get 2 items ..</p>
javascript jquery
[3, 5]
2,245,916
2,245,917
How do i reload same page using window.location in jQuery?
<p>I have a JQuery Function </p> <pre><code>(function ($) { jQuery.fn.saveUser = function(destinationUrl) { this.click(function() { var formData = 'option=saveuser&amp;'+$('form#save-user').serialize(); $.ajax({ type: 'POST', url: 'process.php', data: formData, success: function(msg){ if(msg === 'empty') { alert('Required Values Missing'); } else if(msg === 'duplicateEmail'){ alert('Email already exist'); } else { window.location = destinationUrl; } } }); }); } </code></pre> <p>now based on some actions and events, i redirect it to different pages, in this case i need it to redirect it to two different url. </p> <pre><code>1) reload the same page preserving all $_GET variables via URI 2) reload to the specified url. </code></pre> <p>the below jQuery code can redirect me to any specific url.</p> <pre><code>$('form#save-user button[name="save-user-close"]').saveUser(function() { return 'index.php?users'; }); </code></pre> <p>however i am not getting how do i make it redirect to the same page for example.</p> <pre><code>$('form#save-user button[name="save-user-close"]').saveUser(function() { return location.reload(true); }); </code></pre> <p>i know the above code will not work, i am confused on how do i go with this? </p>
php jquery
[2, 5]
796,124
796,125
gmap3 clear marker not working in chrome
<p>Please help resolve this issue.</p> <p>the clear marker is working in FF &amp; IE but not chrome?</p> <pre><code> function addMarker(lati, longi, id, name) { $('#dispatcher').gmap3( { action: 'addMarker', lat: lati, lng: longi, tag: name, options: { icon: new google.maps.MarkerImage('img/pin.png') } } ); } function clearMarker(name) { $('#dispatcher').gmap3({ action: 'clear', tag: name }); } </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
1,878,703
1,878,704
Why is my exception handling code not handling exceptions?
<p>I have some C# code that pulls down a remote website using the HttpWebRequest class. I'm handling errors with a try/catch, but some errors (like Webrequest and IOException) don't seem to be getting "caught" with the way I have it setup:</p> <pre><code>try { StartScrap("http://www.domain.com"); } catch (Exception ex) { LogError(ex.ToString(); } private void StartScrap(string url) { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse(); if (response.StatusCode == HttpStatusCode.OK) { Stream responseStream = response.GetResponseStream(); string responseText = String.Empty; using (StreamReader readerStream = new StreamReader(responseStream, System.Text.Encoding.UTF8)) { responseText = readerStream.ReadToEnd(); &lt;-- I will sometimes get a Webexception error here that won't get caught above and stops the code } } } </code></pre> <p>Update: There is more to the code, so maybe it is something outside of the code I posted? I am basically using this code in a Windows Application on a form that has a NotifyIcon. I'm using the Timer class to run the code at a certain timer interval. This is how I have it setup:</p> <pre><code> public TrayIcon() { InitializeComponent(); } private void TrayIcon_Load(object sender, EventArgs e) { try { StartScrap("http://www.domain.com"); } catch (Exception ex) { LogError(ex.ToString()); } finally { StartTimer(); } } private void StartTimer() { Timer Clock = new Timer(); Clock.Interval = 600000; Clock.Start(); Clock.Tick += new EventHandler(TrayIcon_Load); } </code></pre>
c# asp.net
[0, 9]
1,281,191
1,281,192
How to get the values from Dictionary type SESSION Variable in C#
<p>I am using C#.</p> <p>I have got below format values in my <strong>SESSION variable ["FROMDATA"]</strong>, I am using <strong>DICTIONARY</strong> to store the FORM Posted Data. Please see the related <a href="http://stackoverflow.com/questions/4723240/how-to-store-all-the-form-posted-data-in-asp-net-dictionary">question</a>.</p> <p>Below are the some values in my SESSION Variable.</p> <pre><code>1) key - "skywardsNumber" value-"99999039t" 2) key - "password" value-"a2222222" 3) key - "ctl00$MainContent$ctl22$FlightSchedules1$ddlDepartureAirport-suggest" value-"London" 4) key - "ctl00$MainContent$ctl22$ctl07$txtPromoCode" value-"AEEGIT9" . . ....so on </code></pre> <p>Now I want to <strong>create a CLASS</strong> with <strong>METHOD</strong> in it, in which I will just pass the <strong>"KEY"</strong> and it will first check it for <strong>NULL OR EMPTY</strong> and then it will <strong>return its value from the SESSION Variable ["FROMDATA"]</strong>.</p> <p>Please suggest <strong>using C#</strong>.</p>
c# asp.net
[0, 9]
2,619,785
2,619,786
jQuery dynamic changing image header
<p>Iam trying to write a simple jQuery function to change the image header of my webpage.</p> <p>The HTML looks like this:</p> <pre><code>&lt;div class="slider"&gt; &lt;ul&gt; &lt;li&gt; &lt;img src="img/slide21.png" alt=""&gt; &lt;/li&gt; &lt;li&gt; &lt;img src="img/slide31.png" alt=""&gt; &lt;/li&gt; </code></pre> <p> </p> <p>I just want to fade in the next image every 5 seconds and fade out the old. The position of the image should not change and all images are the same size.</p> <p>My js code looks like this:</p> <pre><code>function menu (obj) { if (!obj.length) { return; } $(obj).find("li").hide(); $(obj).find("li").next().fadeIn(2400); } $(document).ready(function () { menu(".slider"); }); } </code></pre> <p>This code is really not what I want but currently I have no idea how to do this.</p> <p>Any help would be appreciated! Thanks!</p>
javascript jquery
[3, 5]
1,883,739
1,883,740
Remove whitespace after disabled control in asp.net
<p>I have small page, it looks follows:</p> <p>Some header</p> <p>Label with text only for logged users</p> <p>Hyperlink</p> <p>Logout button</p> <p>Here is the behind code:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (User.Identity.Name == "") { Label1.Visible = false; Controls.Remove(Label1); } else { Label1.Visible = true; } } </code></pre> <p>Question is: When non logged user loads page, the label is not shown. But how to move the hyperlink and logOutButton and thus hide the white space on place, where the label is invisible ? </p> <p>Thanks</p>
c# asp.net
[0, 9]
5,574,743
5,574,744
jquery 1.6.2 vanishing 1.9.1 function and vice versa
<p>I am facing this problem and just doing my work by switching either of them.</p> <p>Actually my basic template has been coded in jquery 1.6.2 and now i am using some other jquery function which is based on 1.9.1 library the function gos like this :</p> <pre><code> &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;SCRIPT language="javascript"&gt; $(function () { $(":checkbox").change(function () { // Toggle class of selected row $(this).parent().toggleClass("rowSelected"); // Get all items name, sum total amount var sum = 1500; var arr = $(":checkbox:checked").map(function () { sum += Number($(this).parents('tr').find('td:last').text()); return $(this).parents('tr').clone(); }).get(); // Display selected items and their sum $("#selectedServices").html(arr).find('input').remove(); $("#total").text(sum); }); }); &lt;/script&gt; </code></pre> <p>now since this function is not supported by 1.6.2, when i am using 1.9.1 along with 1.6.2 like this</p> <pre><code>&lt;head&gt; &lt;script src="http://code.jquery.com/jquery-1.6.2.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; </code></pre> <p>only 1.6.2 supported function is working and on removing 1.6.2,console shows me error and function supported by 1.9.1 (given above) is working fine I want to make all the functions supported by both of them work together. How to do?</p>
javascript jquery
[3, 5]
101,637
101,638
If I start a thread in the application startup process, will it keep running?
<p>If I start a thread in the Application_Startup event of my web application in ASP .NET and it contains an infinite loop doing some background work using sleep methods too, will it continue running forever, assuming no exceptions occur?</p>
c# asp.net
[0, 9]
4,908,983
4,908,984
download file to a specific location with Response.BinaryWrite and Server.Mappath possible?
<p>I have varbinary data associated with a file in the DB. This is the code I'm using to download this file on clicking a link -</p> <pre><code>//a is my attachment object var r = context.Response; r.AddHeader("Content-Disposition", "attachment; filename=" + a.FileName); r.Charset = ""; r.ContentType = a.MIME; r.BinaryWrite(a.Content.ToArray()); </code></pre> <p>Currently, this file gets downloaded to the Downloads folder. Is there any way to create a new folder in the users system and have this file download there? I read that <b>server.mappath</b> can be used with r.WriteFile, but I'm not quite sure. Can this be done?</p>
c# asp.net
[0, 9]
225,000
225,001
What does from = mean inside a javascript function?
<p>I have the following call:</p> <pre><code> $.extend($.fn.dataTableExt.oSort, { "datetime-uk-pre": function (a) { from = a.split(' '); var ukDatea = from[0].split('/'); var ukTimea = from[1].split(':'); return (ukDatea[2] + ukDatea[1] + ukDatea[0] + ukTimea[1] + ukTimea[0]) * 1; } </code></pre> <p>Can someone explain what the "from =" is doing here. I note that when I run JSHint then it tells me 'from' is not defined.</p>
javascript jquery
[3, 5]
2,255,541
2,255,542
event handler for input delete/undo
<p>I need to check for all events which will change the contents of my text input. so far I have handlers for keyup, cut and paste. but the content can also be changed by highlighting the text and clicking delete or undo. is there a way to listen for these events?</p> <pre><code>$('#input').on('paste cut keyup ',function() { //add delete and undo to listner }); </code></pre>
javascript jquery
[3, 5]
2,351,300
2,351,301
How to capture exact td value in jquery independent of browser
<p>I have li inside it i contain td. </p> <pre><code> var values = ''; $("#list4 li.add table .mytd").each(function () { values = $(this).html() + '|' + values; }); document.getElementById("MainContent_uscRetailParameters_hdRetailCustomerGroup").value = values; __doPostBack('&lt;%=txtRCCode.ClientID%&gt;', ''); </code></pre> <p>when I capture in hidden field it come like this</p> <pre><code> [alot of spaces]CHARMINSENSITIVE-1 </code></pre> <p>with lot of spaces how can i retrieve the exact value in all browser. this space not found in Internet explorer. but in firefox it comes with spaces how could i capture the exact td value.</p> <pre><code> string lvValues = hdProductGroup.Value; //string trim = lvValues.Replace(" ", ""); string trim = lvValues.Replace("\r", ""); trim = trim.Replace("\r", ""); trim = trim.Replace("\n", ""); trim = trim.Replace("\t", ""); string str = trim; string[] list = str.Split('|'); </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
3,024,621
3,024,622
The application has failed to start because its side-by-side configuration is incorrect
<p>On one server, everything works. I am attempting to call a C++ assembly from C#/ASP.NET application.</p> <p>When I deploy the web application in another server, it fails with the error message: "The application has failed to start because its side-by-side configuration is incorrect"</p> <p>I have copied the dll into the correct folder which has permissions for the user and the application pool identity. The path has been added in the PATH variable. The DLL is fine and is not dependent on any other DLL.</p> <p>What could cause this issue?</p>
c# asp.net c++
[0, 9, 6]
898,953
898,954
How to read files in a concurrency safe manner in an asp.net webpage?
<p>I need an asp.net webpage to read some text from a file stored on the same server as the webpage, will the following code result in a concurrency error if several people visit the webpage at once and thus several requests to read the file are generated:</p> <pre><code>string fileText = System.IO.File.ReadAllText(Request.PhysicalApplicationPath + @"Folder\File.txt"); </code></pre> <p>If it would result in an error, what would be a concurrency safe manner to read a file from an asp.net page? </p> <p>Thanks.</p>
asp.net c#
[9, 0]
2,855,663
2,855,664
Is Dirty in ASP.NET Web Page
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/155739/detecting-unsaved-changes-using-javascript">Detecting Unsaved Changes using JavaScript</a> </p> </blockquote> <p>My Web application has 3 web forms ,I implemented the validations in my webpage.I want to implement isdirty functionality in my web application.I want to pop up a message box in my webpage when a user clicks on sign out(which is a loginstatus control) if there any changes made to the form.</p> <p>Environment: Asp.net VS2008 c#</p>
c# asp.net
[0, 9]
5,749,142
5,749,143
Waiting screen while response is awaited
<p>I have a one iframe in which one webservice has opened .A forms is in that web service.After submitting that form my iframe will close.But before closing iframe I want some waiting screen till the form data is submitted at web service and receieved some response from there(like please wait while your operaion is processed).Can any one suggest me some good code snippet or link.I want to do it with jquery.My application is in .net.Thanks</p>
asp.net jquery
[9, 5]
1,516,724
1,516,725
Draw image using mouse
<p>I need to create a web page where i can draw a image using mouse (similar to paint).is it possible in c# ,asp.net or silver light please help</p>
c# asp.net
[0, 9]
4,735,259
4,735,260
Add image smilies in textbox
<p>Hello i want to add smilies in form of images to the text box in php or javascript. I want it like whats app or facebook. I dont have much idea of javascript or php. So somebody please help me with the code . I want it in a manner as i click on the image it shoulg get inserted in the text field or text area . Thanks in advance . </p>
php javascript
[2, 3]
2,965,876
2,965,877
Pause animation when mousemove event occurs
<p>I have the following code:</p> <pre><code>$(source) .on('mouseenter', start) .on('mouseleave', stop) .on('mousemove', zoom.move); </code></pre> <p>Here I attach few mouse event listeners. When 'mouseenter' event occurs, the following function is executed:</p> <pre><code> automove: function myAutomove() { var xPos = rand(0, outerWidth); var yPos = rand(0, outerHeight); $(img).animate({ 'top': (yPos - offset.top) * -yRatio + 'px', 'left': (xPos - offset.left) * -xRatio + 'px' }, defaults.speed, myAutomove); } </code></pre> <p>It works great for now, but when 'mousemove' event occurs, the following is executed:</p> <pre><code> move: function (e) { var left = (e.pageX - offset.left), top = (e.pageY - offset.top); top = Math.max(Math.min(top, outerHeight), 0); left = Math.max(Math.min(left, outerWidth), 0); img.style.left = (left * -xRatio) + 'px'; img.style.top = (top * -yRatio) + 'px'; }, </code></pre> <p>The problem is that when mousemove event occurs I should clear animation queue, but there I have transition animation that needs to complete first. These both effects are applied to the same element, so if I simple write the following:</p> <pre><code>$img.clearQueue().stop(); </code></pre> <p>... transition animation is not displayed.</p> <p>You can see live example in the following fiddle: <a href="http://jsfiddle.net/SL8t7/" rel="nofollow">http://jsfiddle.net/SL8t7/</a></p>
javascript jquery
[3, 5]
3,561,352
3,561,353
How to set a Javascript-HTML variable from a Android code
<p>I am trying to set the value of a global variable from Android code.</p> <pre><code> mWebView.loadUrl("javascript:(function() { " + "loginID = '"+nicu_app.urlSelected+"'; " + "})()"); </code></pre> <p>but when I load the webpage in a webview and check to see if this variable has been set by the Android code, I don't see any positive results.</p> <p>Any help will be appreciated.</p> <p>Thanks, Sana.</p>
javascript android
[3, 4]
774,486
774,487
javascript not working after php include
<p>I am trying to apply javascript twice to a simple html textarea. I have onfocus and autogrow (which is actually jquery). It seems i can only get one or the other to work but never both at once. </p> <p>My script has an: </p> <pre><code>&lt;?php include 'header.php'; ?&gt; </code></pre> <p>This seems to be the problem. In both the header.php and the index.php (where the header is included) I have loaded jquery.js. when I remove this file from the header, autogrow works but not my onfocus event (which clears the default text). Is there a way to include another file without the two effecting each other. I cant provide the code because it too long.</p> <p>This is my onfocus code:</p> <pre><code>&lt;script type='text/javascript'&gt; function addEvents(id) { var field = document.getElementById(id); field.onfocus = function () { if (this.value == "Answer this problem...") { this.value = ""; } }; field.onblur = function () { if (this.value == "") { this.value = "Answer this problem..."; } }; </code></pre> <p>} addEvents("answerbox"); </p>
php jquery
[2, 5]
1,927,262
1,927,263
Converting toggleClass('hidden') to .toggle() with animation
<p>My first implementation of my personal learning project of dynamically generated webpages and JQuery project utilized checkboxes and toggle("slow") and toggle("fast"). However, being new to CS altogether, managing the state of checkboxes got q bit complex for my first project. So I switched solely to <code>&lt;label&gt;</code>s and <code>.on('click', function(){...})</code> and <code>$('*').click(function(){...})</code> with <code>.toggleClass('hidden')</code> to handle my UX. The CSS for the hidden class is :</p> <pre><code>.hidden { display: none; } </code></pre> <p>The problem now is that the toggling of the class happens instantaneously, and I would like the user to be able to see the <code>.toggle()</code> just as <code>.toggle('slow')</code> or <code>.toggle('fast')</code>. how would I convert the following line to achieve this visual feedback?</p> <pre><code>$(this).toggleClass('hidden'); </code></pre> <p>I have reviewed the APIs for toggle, toggleClass, and slideToggle, and was curious if a certain combination would work. If I have to rewrite it to toggle(), how do I include the showOrHide parameter, along with the "show" or "fast" duration, as I need to verify current state, similar to <code>.toggleClass()</code>'s [switch] parameter. </p>
javascript jquery
[3, 5]
2,115,841
2,115,842
Use ASP.NET in a way similar to PHP
<p>I have been using PHP for a long time, but I want to move to C#. However, I don't care much for web controls and the template system. Don't get me wrong, it is good for many projects, but not all. Sometimes I want to use my own template system </p> <p>I just want to run my code on every page request and print some HTML, CSS or whatever. Just something like Response.Write() or PHPs "echo" without all the templates and controls. What is the best way to achieve this?</p> <p>Edit:</p> <p>This is how I would like it to work:</p> <pre><code>private void Page_Request(object sender, EventArgs e) { // Do my stuff here Response.Write(myhtml); } </code></pre>
c# asp.net
[0, 9]
4,886,974
4,886,975
Browse pictures on Android and move them to specific directory
<p>So I'm building an android application, I want the users to be able to press a button that opens a window/activity. I need the activity to allow the user to browse the pictures saved on the phone and be able to select those that they want. Once they select the pictures and press "ok" the pictures need to be copied to a directory for my application to access them from. So basically does anyone know of any code or help to do this and where would i be able to save user data for my app specifically on the android device. Thanks and let me know if you need any clarification!</p>
java android
[1, 4]
5,534,598
5,534,599
Handling threads in Android
<p>I have an application which has some background processes, like downloading an XML from a server and parsing it, and I am performing these tasks in Threads.</p> <p>The problem comes when sometimes a thread does not get CPU time for long time, it could be anytime between 15 minutes to some hours, and then the thread starts behaving properly.</p> <p>How should I handle this?</p>
java android
[1, 4]
2,811,944
2,811,945
Notify when GPS activated
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/11446428/broadcast-reciever-for-gps-state">Broadcast reciever for GPS state?</a> </p> </blockquote> <p>Is there a listener that can notify me when GPS is activated? (When user enabled "GPS" button from the notification bar)<br> I tried using <code>addGpsStatusListener</code> but it is not what I was looking for.</p>
java android
[1, 4]
1,610,001
1,610,002
get <cite> tag value Onmousedown event
<p>HTML code looks like:</p> <pre><code>&lt;ul&gt; &lt;li class="result"&gt; &lt;h3 class="title"&gt;&lt;a class="someclass" href="url"&gt;Sometext&lt;/h3&gt; &lt;cite class="url"&gt;Cite URL-1&lt;/cite&gt; &lt;/li&gt; &lt;li class="result"&gt; &lt;h3 class="title"&gt;&lt;a class="someclass" href="url-1"&gt;Some more text&lt;/h3&gt; &lt;cite class="url"&gt;Cite URL-2&lt;/cite&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I have to get cite value(cite URL) on click of a href. Something like:</p> <pre><code>$('a[class="someclass"]').mousedown(function() { console.log($('cite').text()) //if first link clicked then Cite URL-1 should get returned } </code></pre> <p>How to get cite tag value in this case?</p>
javascript jquery
[3, 5]
3,087,900
3,087,901
Scrolling div within bounds
<p>I have div with images inside it and need to scroll it left and right. I,ve managed to get the scrolling to work, but now I need it to stay in the displayable area. I need to use jQuery</p> <pre><code>$('#next').click(function() { $('#slides').animate({left: '-=80',}, 2000, function() {}); }); $('#prev').click(function() { $('#slides').animate({left: '+=80',}, 2000, function() {}); }); </code></pre> <p>The two "buttons" is used to scroll. How do I get the slides' position.left to stay between 0 and -1120 ?</p> <p>This will be the bottom of my slideshow. The large images will be at the top. How do I change the z-index of a div ?</p>
javascript jquery
[3, 5]
2,684,074
2,684,075
Want to show Busy Loading message with percentage download when form will load using JQuery
<p>suppose my page content is huge so in my asp.net application i want to show busy icon with percentage downloading the content in client side. i saw many flash and sliver light site that they show busy icon and also they show percentage that means how much content has been loading in client machine. how could i achieve this using JQuery and when page content has been downloaded in client machine the busy icon goes out and actual page content will display.</p> <p>please me with sample code to achieve it. thanks</p>
asp.net jquery
[9, 5]
4,716,426
4,716,427
Loop through all the user controls on a page
<p>Want to loop through all the user controls that exist on the page and get their IDs. How do I do it?</p>
c# asp.net
[0, 9]
1,294,214
1,294,215
setInterval won't get out of loop
<p>The following javascript code takes randomly selected value from a array and types it in the input box. I've used jquery. I want to end setInterval "zaman2", so after It ends I can retype the next random string to the input box. But the loop doesn't end and gets stuck. How can I solve this? Link to jsFiddle: <a href="http://jsfiddle.net/AQbq4/4/" rel="nofollow">http://jsfiddle.net/AQbq4/4/</a></p> <pre><code>var dersler = [...very long list...]; var zaman = setTimeout(function() { var yeniDers = dersler[Math.floor(Math.random()*dersler.length)]; sayac = 0; var zaman2 = setInterval(function() { var harf = yeniDers.slice(0,(sayac+1)); sayac++; $('#main-search').attr('placeholder', harf).typeahead({source: dersler}); if (sayac == yeniDers.length) { clearInterval(zaman2); } },450); },2000); </code></pre>
javascript jquery
[3, 5]
3,448,716
3,448,717
I am having ArrayList containing String[], If i add new string[] into list, it also modifed previously added string [] objects
<p>I am adding string[] into Arraylist, But when i try to retrieve value from it, something wrong happening. and previous values of arraylist getting updated with new entry(String[]) Expected Output :<br> first , sec<br> 1, 2<br> one, two</p> <p>Current Output :<br> one, two<br> one, two one, two</p> <p>below is the code.</p> <pre><code> ArrayList&lt;String[]&gt; list = new ArrayList&lt;String[]&gt;(); String[] temp ={"First","Sec"}; list.add(temp); temp[0] ="1";temp[1]="2"; list.add(temp); temp[0] ="one";temp[1]="two"; list.add(temp); printLog(list); </code></pre> <p>here is the print method</p> <pre><code> private void printLog(ArrayList&lt;String[]&gt; result) { for (int i = 0; i &lt; result.size(); i++) { Log.d(TAG,"I="+i); String[] temp = result.get(i); Log.d(TAG,temp[0]+","+temp[1]+"\n"); } } </code></pre> <p>Any suggessions.</p>
java android
[1, 4]
3,329,275
3,329,276
how to select a particular field using a jquery
<p>my code is</p> <pre><code>&lt;div id="fields"&gt; &lt;form id="question-form"&gt; &lt;input type="hidden" name="question-main" value="&lt;?php echo mysql_prep($_GET['ques']);?&gt;" /&gt;&lt;/form&gt; &lt;a class="vote-up-off"&gt;up vote&lt;/a&gt; &lt;span class="vote-count-post"&gt;&lt;?php echo $row["upvotes"]+$row["downvotes"];?&gt;&lt;/span&gt; &lt;a class="vote-down-off" id="&lt;?php echo mysql_prep($_GET['ques']);?&gt;" &gt;down vote&lt;/a&gt; &lt;a class="star-off" href="#"&gt;favorite&lt;/a&gt; &lt;/div&gt; </code></pre> <p>and my jquery code is </p> <pre><code>$("document").ready(function(){ $(".vote-up-off").click(function(){ // here i want the id of form field and votecountpost field which is up and down to this field }) }) </code></pre> <p>the div field repeats again and again as the field present on database.So i want to get the particular field id using jquery and will perform some action using jquery. How to find this?</p>
php jquery
[2, 5]
1,436,968
1,436,969
Add value to textarea in child window
<p>I have a remote url that is opening with window.open(url), in that page there is a textarea, i want to change the value of that textarea from my parent page.</p> <pre><code>window.open("http://facebook.com/share.php?u= http://something.com&amp;t="+txt,'facebook','height=400,width=550'); $("textarea#u_0_6").val('test'); </code></pre> <p>thank you</p>
php jquery
[2, 5]
5,909,816
5,909,817
How to do something when control is appear in document?
<p>How it possible by javascript? I could't find event like:</p> <pre><code>$(.check-icon).on('loaded', function(){...}); </code></pre>
javascript jquery asp.net
[3, 5, 9]
471,271
471,272
jQuery functions don't work on the elements created 'on the fly'
<p>I created some elements on the fly by JavaScript like this:</p> <pre><code>tmpString += '&lt;a class="small_text add" id="' + variable_id + '_add" href="#" &gt; add &lt;/a&gt;'; $('#mydiv').html(tmpString); </code></pre> <h3>Problem</h3> <p>jQuery functions don't work on these 'on the fly' elements, <strong>but</strong> the same jQuery functions work on other normal elements (like "a" tags in my site menu).</p> <p>This is my jQuery code:</p> <pre><code>$('a').click(function(){ e.preventDefault(); alert(1); }); </code></pre>
javascript jquery
[3, 5]
1,746,348
1,746,349
jquery How do I add a class to span within a dl based on the text it contains?
<p>I want to be able to add the class="st_sharethis" to the menu link: Tell A Friend on this site <a href="http://www.easyspacedesign.com/fh/ConnectBell_/" rel="nofollow">http://www.easyspacedesign.com/fh/ConnectBell_/</a>. There is no way to add a specific class or id to a menu link in the cms we use so going to have to use jquery to do it. </p> <p>So I will have to do it based on the text within the span tag that is within the a tag.</p> <p>So far i have tried:</p> <pre><code> $('.main_menu span:contains("Tell A Friend")').attr('class','st_sharethis'); $('.main_menu span').each(function () { if ($(this).text() == "Tell A Friend") $(this).attr('id','rev3'); } </code></pre> <p>neither has worked.</p>
javascript jquery
[3, 5]
3,837,445
3,837,446
state of listbox not saved
<p>I have wizard control and on second page I have ListBox. Since I have disabled viewstate, I am rebinding data source of ListBox on each button click (prev /next).</p> <p>I can not use Request.Form to get selected values since user can come from first page. </p> <p>I am hoping that even if I set viewstate disabled, I will get selected values of ListBox through viewstate.</p> <p>Please let me know how I can retrive selected values for ListBox through viewstate.</p> <p>Thanks,</p>
c# asp.net
[0, 9]
201,516
201,517
Detect Arabic language using Javascript?
<p>How to detect Arabic language when typed in a Textbox using a Javascript?? Is there any way to do this.</p> <p>I want to do a system where the system automatically detects the Arabic Language written in the textbox of the Webpage.</p>
javascript asp.net
[3, 9]
4,938,470
4,938,471
jQuery prepending and fading in content does not work
<p>So I have an ajax form submission system, and I want to prepend the submitted form directly into the HTML when a successful status response is given. Right now I have,</p> <pre><code>$(".post-submit").click(function(){ var postcontent = $(".post-form").val(); if (postcontent == ""){ return false; } $(".post-form").attr("disabled", "disabled"); $.ajax({ url: "/post", type: "POST", dataType: "json", data: {"post-form":postcontent}, success: function(response, textStatus, jqXHR) { var htmlpost = '&lt;div class="post"&gt; &lt;b&gt;${name}&lt;/b&gt; &lt;/div&gt; \n &lt;p&gt;' + postcontent + '&lt;/p&gt; \n'; $(htmlpost).hide().prependTo(".posts-content").fadeIn("slow"); }, error: function(jqXHR, textStatus, errorThrown){ alert("Unexpected internal server error. Please try again later."); } }); }); </code></pre> <p>But when I submit a form and get a status 200 back from the server, it doesn't do anything, and the form remains disabled.</p>
javascript jquery
[3, 5]
206,629
206,630
focus problem in mozilla
<p>In my application I am using a text box with onBlur property assigned to a function i cant focus by telling the id in Mozilla the code is as follows </p> <blockquote> <p><code>&lt;asp:TextBox ID="txtPassword" AutoCompleteType="Disabled" autocomplete="off" runat="server" MaxLength="25" Width="350px" TextMode="Password" onBlur="return ValidatePassword(this.text);"&gt; &lt;/asp:TextBox&gt;</code></p> </blockquote> <p>Javascript function</p> <p><code>function ValidatePassword(element) { element.focus(); }</code></p>
javascript asp.net
[3, 9]
615,693
615,694
Confirmation message box in webapplication
<p>Am using the below message box in asp.net web application. Now i want to convert this message box as a confirmation message box and do something when it is true else means reject the application.</p> <pre><code> ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "&lt;script language='javascript'&gt;alert('Are you sure, you want to apply?');&lt;/script&gt;", false); </code></pre>
c# asp.net
[0, 9]
1,741,036
1,741,037
Save private data to public location
<p>I am trying to open my PDF file with PDF Reader, I am searching more on how can i done this, a lot of answer found but every answer tells that save that file to "SD Card".</p> <p>Saving file to SD Card is good idea but the problem is if user not installed SD Card in his phone. At present time many phone have large inbuilt memory for example: Samsung galaxy S3, HTC One V, Samsung Galaxy Note, Sony Xperia S and many phone. </p> <p><strong>So my Question is</strong>: These phones already have a large inbuilt memory, so user not need to add SD Card with it (it depends on user). In this case <strong>which location is accessible to other applications</strong> like public location (SD Card).</p> <p>When I searching for my problem i found this <a href="http://developer.android.com/guide/topics/data/data-storage.html" rel="nofollow">link</a> that tell about location for saving application data provided by Android Platform.</p> <p>Android Platform provides these options to save app data:</p> <ol> <li>Shared Preferences</li> <li>Internal Storage</li> <li>External Storage</li> <li>SQLite Databases</li> <li>Network Connection</li> </ol> <p>Android provides a way to expose private data to other applications — with a content provider</p> <p>I read about content provider but i didn't understand how it works.</p> <p>If any tutorial show how it works please provide that tutorial link or if this can done in other way please tell me how.</p> <p>Any help will be appreciated. Thanks! </p>
java android
[1, 4]
5,714,929
5,714,930
ReferenceError: Can't find variable error
<p>I have this code:</p> <pre><code>$(document).ready(function(){ var callPage = function(){ $.post('/pageToCall.php'); }; setInterval('callPage()', 60000); }); </code></pre> <p>and it gives me the error <code>ReferenceError: Can't find variable: callPage</code>. Why?</p>
javascript jquery
[3, 5]