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
5,291,646
5,291,647
Box Plot Chart in ASP.NET and C#
<p>Hello I have a question I am trying to generate a Box Plot Chart in ASP.NET with C#. i did the regular bar chart but not the box plot chart the idea is to generate the chart like this ![enter image description here][1] </p> <p><a href="http://imageshack.us/photo/my-images/232/ccxcxc.png/" rel="nofollow">http://imageshack.us/photo/my-images/232/ccxcxc.png/</a></p> <p>I did the search online but there are not any good tutorials about box plot chart and it modification I would highly appreciate if someone could show me how to do this or point me to the right direction. </p>
c# asp.net
[0, 9]
4,848,029
4,848,030
jQuery html(), loading an img tag into a div
<p>When I do the following:</p> <pre><code>var foo = '&lt;p&gt;&lt;img src="tracking.pixel.outside.my.domain /&gt;&lt;/p&gt;'; $("#outputdiv").html(foo); </code></pre> <p>This is what shows up in outputdiv: <code>&lt;p&gt;&lt;/p&gt;</code></p> <p>Is there some reason that this shouldn't work? I'm running out of ideas. I've also tried using innerHTML, to no avail.</p>
javascript jquery
[3, 5]
3,299,206
3,299,207
Program needed to intreract with the browser
<p>I want to write a program so that when ever I open a browser and try to access an address like <em>www.google.com</em>, before sending this information to the server a message should be asked like </p> <p><strong>Do you want to continue</strong>. </p> <p>If I say yes the browser will submit the web page to the server, otherwise nothing will happen.</p>
java javascript jquery
[1, 3, 5]
4,841,689
4,841,690
extract part of URL from parent URL
<p>For this url </p> <pre><code>"http://testsite/sites/TestSubSite/objstrat/CultureConnection/Pages/default.aspx" </code></pre> <p>Trying to extract everything after enterprise/sites. I want <code>"/TestSubSite/objstrat/CultureConnection/Pages/default.aspx"</code></p> <p>I can get the filename like this: </p> <pre><code>var filename = parenturl.substring(parenturl.lastIndexOf("/") + ); </code></pre> <p>But not sure how to extract from the middle..</p>
javascript jquery
[3, 5]
3,295,428
3,295,429
"Function.createDelegate" causes "Error: Object doesn't support property or method 'createDelegate'"
<p>I am trying to get browser back button support in silverlight by following <a href="http://jakkaj.wordpress.com/2008/09/08/control-silverlight-by-using-browser-back-and-foward-buttons/" rel="nofollow">this</a> tutorial. I am using Silverlight 4, Asp and .net4.0.</p> <p>I am not very used to javascript and compared to C# I never really liked working with it.</p> <p>The error message I am reciving is this: "Error: Object doesn't support property or method 'createDelegate'"</p> <p>on this line</p> <pre class="lang-js prettyprint-override"><code>//Create a delegate to preserve scope when the navigation event handler fires. var handler = Function.createDelegate(historyInstance, historyInstance.navigationEventHandler); </code></pre> <p>My first guess is that some reference is missing but when searching I found nothing!</p> <p>What is the cause of this error message? Please look at the tutorial for full source code.</p>
javascript asp.net
[3, 9]
3,906,863
3,906,864
Sliding / following navigation menu
<p>I am looking for a simple jQuery or Javascript solution to make a navigation sidebar smoothly following the user when he scrolls down a page. Something like here: <a href="http://ucon-acrobatics.com/shop/" rel="nofollow">http://ucon-acrobatics.com/shop/</a></p> <p>Any ideas are appreciated.</p>
javascript jquery
[3, 5]
1,812,657
1,812,658
Long integer to 16 character Hex for Google Reader sync
<p>Python Code </p> <pre><code>h = "%s"%("0000000000000000%x"%(i&amp;0xffffffffffffffff))[16:] </code></pre> <p>I'd like to know how this would be done in PHP.</p> <p>The application is for google reader syncronization. An initial sync list comes with numeric values, but the actual article id hex.</p> <p>Example Long Integer = <strong>8643979098044673995</strong></p> <p>Example Google Reader Article ID = tag:google.com,2005:reader/item/<strong>77f5953120daafcb</strong></p>
php python
[2, 7]
1,550,146
1,550,147
How can I use Intent on Java, Android?
<p>I have written the following code for playing video:</p> <pre><code>private void loadPlayer() { Intent youtube=new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=CES7xNy70hU")); startActivityForResult(youtube, 100); } </code></pre> <p>My problem is that when the player finishes showing the video it won't close itself and the user needs to press the back button. I need the player to close itself automatically after the video has finished playing. How can I accomplish this?</p> <p>The target platform is Android - 2.2. </p>
java android
[1, 4]
1,873,827
1,873,828
Will postback in asp.net always causes a "navigate away" warning
<p>I have a pretty simple questions that had stumped me so far .. I am trying to do a one-level cascading drop down in ASP.NET.</p> <p>So, I have two drop down boxes (among other text boxes), after ddlOne is selected, then ddlTwo will be populated.</p> <p>here's my code in aspx</p> <pre><code>&lt;asp:UpdatePanel ID="comboBoxWorkFlowPanel" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:DropDownList ID="ddlPendingUserGroup" runat="server" DataTextField="groupName" DataValueField="groupId" OnSelectedIndexChanged="ddlPendingUserGroup_SelectedIndexChanged" AutoPostBack="true"&gt; &lt;/asp:DropDownList&gt; &lt;asp:DropDownList ID="ddlUserGroupUsers" runat="server" Enabled="false"DataTextField="userName" DataValueField="userID"&gt;&lt;/asp:DropDownList&gt; &lt;/ContentTemplate&gt; &lt;asp:UpdatePanel&gt; </code></pre> <p>and pretty much in the code behind page, the event handler will read from the drop down and then populate the second drop down.</p> <p>my question is, after the selection is made in the first drop down, why am i getting a warning message ("you're about to navigate away from this page")</p> <p>If i click ok on the warning message, the dropdown box will be loaded correctly, and other values that were previously on the page will be preserved. If i click cancel, i get a script error instead.</p> <p>any thoughts on this?</p>
c# asp.net
[0, 9]
5,779,840
5,779,841
Enhancing the SimpleCursorAdapter to check the data in Android?
<p>I have a sqlite database. I am able to query it and get a cursor with results. It populates the data well in a list view which has 1 image view and 2 text views. However the cursor result set which has 2 columns is of text. This is shown in the 2 text views. Everything till here works fine.</p> <p>Now based on the value of one of the column I need to show different images in the image view in the list item. How do I do this. As of now I am using the below code. How do I modify it to get a image view changes based on the column value?</p> <p>Cursor mCursor = mDbHelper.fetchAll(); startManagingCursor(mCursor);</p> <pre><code> String[] from = new String[]{"TITLE","BODY"}; int[] to = new int[]{R.id.text1,R.id.text2}; SimpleCursorAdapter listValues = new SimpleCursorAdapter(this, R.layout.row_item, mCursor, from, to); setListAdapter(listValues ); </code></pre>
java android
[1, 4]
3,291,773
3,291,774
How to get array data passed by .post in jquery into php?
<p>I have a problem regarding on how to get the value of the array variable passed by <code>.post</code> in jquery into my php page</p> <p>this is my jquery code:</p> <pre><code>minDate = []; hoursWork = []; empId = []; $('.minDate').each(function() { minDate.push($(this).val()); }); $('.hoursWork').each(function() { hoursWork.push($(this).val()); }); $('.empId').each(function() { empId.push($(this).val()); }); $.post('rtInsert.php', { minDate: minDate, hoursWork: hoursWork, empId: empId }, function(data) { alert(data); }); </code></pre> <p>How can I get the passed data in my <code>rtInsert.php</code></p> <p>i tried </p> <pre><code>$minDate = $_POST['minDate']; $empId = $_POST['empId']; $workHours = $_POST['hoursWork']; </code></pre> <p>now how will i get the individual value of the array because all the 3 variables is an array</p> <p>All I know is a single array using <code>foreach()</code> but what if there are 3 arrays passed</p> <p>Is there any idea how I can get it or how can I passed into single array.</p> <p>Thanks in Advance.</p>
php jquery
[2, 5]
3,113,431
3,113,432
Using Jquery not able to get correct out put
<p>I did a small style changing app using Jquery in Asp.Net 3.5 .I am having IE7. When i click on button the paragraph color should change. Problem is ,the color is changing,it is not stable.Means just like blinking. Please find the code below</p> <pre><code>&lt;head runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;script type="text/javascript" src="scripts/jquery-1.4.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $("#Button1").click(function() { $("p").css("background-color", "Yellow") }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" /&gt; &lt;p&gt;This Should be in &lt;br/&gt; yellow&lt;/p&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,435,048
1,435,049
JQuery Filter Tag Value
<p>I am trying to select a clicked "a class mail" href value in order to filter it and add a one word string after the text "...subject=[Site]..." to be like this: "...subject=[Site] string..."</p> <p>envie um e-mail para [email protected]</p> <p>This is as far as I can go:</p> <p><code>$('a.mail').click(function(event){ $(this).prop('href',$(this).prop('href').replace('[Curso]', '[Curso] some text')); });</code></p> <p>I replaced prop by attr but it did not work...</p> <p><code>$('a.mail').click(function(event){ $(this).attr('href',$(this).attr('href').replace('[Curso]', '[Curso] some text')); });</code></p>
javascript jquery
[3, 5]
636,678
636,679
Activate android application features by voice comands
<p>I want to create an app for visually impaired individuals where when the user says 'start manual' the help manual (a voice recording) plays, is there any way I can do this using android, I'd be grateful if you can point me towards any tutorials or examples. Thanks.</p>
java android
[1, 4]
2,847,124
2,847,125
Open browser to web page Android App
<p>Trying to grasp Java and Android would like help with a simple task of opening a users browser after they click a button. </p> <p>I have been doing tutorials for the last two days though it might help if I just took a stab at it and got feedback. thanks in advance for any help.</p> <p>main.xml:</p> <pre><code>&lt;AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bgimage2"&gt; &gt; &lt;Button android:id="@+id/goButton" android:layout_width="150px" android:layout_height="wrap_content" android:text="@string/start" android:layout_x="80px" android:layout_y="21px" &gt; &lt;/AbsoluteLayout&gt; </code></pre> <p>GetURL.java:</p> <pre><code>package com.patriotsar; import android.app.Activity; import android.content.Intent; import android.view.View.OnClickListener; String url = "http://www.yahoo.com"; Intent i = new Intent(Intent.ACTION_VIEW); Uri u = Uri.parse(url); i.setData(u); public class patriosar extends Activity { private Button goButton; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); goButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v){ try { // Start the activity startActivity(i); } catch (ActivityNotFoundException e) { // Raise on activity not found Toast toast = Toast.makeText(context, "Browser not found.", Toast.LENGTH_SHORT); } } }); } } </code></pre>
java android
[1, 4]
4,601,450
4,601,451
How do I load data from my database before jQuery formats my listview?
<p>I have used jQuery to format my list view.</p> <p>Because it takes too much time to load data from the database, jQuery will start to format the list view before it completes loading the data.</p> <p>So how do I load data from the database <em>before</em> jQuery formats my listview?</p>
jquery asp.net
[5, 9]
4,374,493
4,374,494
How can I use cookies while screen scraping?
<p>I want to scrape data from PHP web pages that are behind a login page. How can make it so I log in only once and then be able to access data on the subsequent pages without logging in again?</p>
java android
[1, 4]
1,062,311
1,062,312
Execute a PHP function from image OnClick event
<p>I have a PHP class in which there is a <code>delete</code> function. When I click on the image I want to call <code>delete</code>, but this line is not working:</p> <pre><code>echo "&lt;img src='icon/del.gif' onClick='.delete().'/&gt;" </code></pre> <p>I have tried using the <code>href</code> tag but it doesn't work.</p>
php javascript
[2, 3]
1,900,600
1,900,601
Import data from a SQL DB Table's Column (a DataSet) into a TextBox?
<p><em>Using: ASP.NET 4, SQL 2008, C#</em></p> <p>I'm writing a web app for our projects team to keep track of special project users. One thing they have asked is to export quick lists of data that they use often. For instance, what I'm trying to do here is give the team a button which will populate a TextBox with all the various email addresses that are saved in our SQL DB. </p> <p>What I've been trying to do is bind the TextBox to a specific column in the DB. I already have a connection to the DB, and I've built a DataSet that queries for that specific column, and it works normally. </p> <p>My question is, how do I tell ASP.NET to use the data from the DataSet to populate the Textbox? Here is the code I'm working with so far:</p> <pre><code>protected void btnGetNPMEmailAddresses_Click(object sender, EventArgs e) { txbResults.Text = ""; txbResults.DataBind(ObjectDataSource_Designee_EmailAddresses) // ??? My DataSet } </code></pre> <p>I'm definitely crawling my way up the C# learning curve. Any help would be greatly appreciated! </p> <p>Thanks, Paul D. </p>
c# asp.net
[0, 9]
286,422
286,423
Preventing list items from displaying whilst overlay images load
<p>I have created 6 divs .box that contain an unordered list and images with the images being absolutely positioned above each list. Is there a way I can make sure the content under the image isnt revealed whilst the content boxes fade in?</p> <p><a href="http://jsfiddle.net/NKFgC/" rel="nofollow">http://jsfiddle.net/NKFgC/</a></p> <p>Kyle</p>
javascript jquery
[3, 5]
1,771,693
1,771,694
methods in foreach and for loops in java
<p>My question is regarding optimization in java using the Android compiler. Will map.values() in the following be called every iteration, or will the Android compiler optimize it out.</p> <pre><code>LinkedHashMap&lt;String, Object&gt; map; for (Object object : map.values()) { //do something with object } </code></pre> <p>Likewise here is another example. will aList.size() be called every iteration?</p> <pre><code>List&lt;Object&gt; aList; for (int i = 0; i &lt; aList.size(); i++) { object = aList.get(i); //do something with i } </code></pre> <p>And after all this, does it really matter if it calls the methods every iteration? Does Map.values(), and List.size() do much of anything?</p>
java android
[1, 4]
2,249,023
2,249,024
calling master page constructor from content page
<p>I have parameterized constructor for the master page and no default constructor. How can i call the master page constructor from content page constructor.</p> <pre><code>BaseClass(): Master.Master(x) or BaseClass() { Master.Master(x) } </code></pre> <p>both does not work</p> <p>Thanks a lot in advance for help, Harish</p>
c# asp.net
[0, 9]
421,968
421,969
conflict with php zend libs and c++ libs(ctime) to build extension for php
<p>Im going to build an extension for PHP 5.3.x</p> <p>everything is OK when I build without vc++ lib.</p> <pre><code>error C2039: 'clock_t' : is not a member of '`global namespace'' error C2873: 'clock_t' : symbol cannot be used in a using-declaration error C2039: 'asctime' : is not a member of '`global namespace'' error C2873: 'asctime' : symbol cannot be used in a using-declaration </code></pre> <p>and...</p> <p>I include just and got this error. I know this problem is from my include header file in properties that required from PHP zend engine, But I do not know how solve this problem. thanks</p>
c++ php
[6, 2]
5,839,090
5,839,091
Creating a Quiz with jQuery
<p>Does anyone have an example of a quiz made with jQuery, without server-side processing of the results? After answering the questions, the result appears instantly. :)</p>
javascript jquery
[3, 5]
2,346,912
2,346,913
FormsAuthantication sign out
<p>I have an asp.net application, and I am using FormsAuthantication. When the user closes the page, the code located in Global.asax Session_End is executed : FormsAuthantication.SignOut(); But the problem is, session is not ending, if the user tries to open a page with cookie, the page shouldn’t be opened. User must be redirected to login page, but its not. What can I do, what can be the problem?</p>
c# asp.net
[0, 9]
5,756,257
5,756,258
increase response rate to ip log
<p>I am logging visits to several of my pages to determine geographic areas of visitors. I am using the google client location api. I seems to work correctly on my development equipment. However, only a few of my visitors are actually being logged to the database. What can I do to increase the logging percentages?</p> <pre><code>&lt;script src="http://www.google.com/jsapi" language="javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; if (google.loader.ClientLocation != null) { var city = google.loader.ClientLocation.address.city; var region=google.loader.ClientLocation.address.region; var country=google.loader.ClientLocation.address.country; var country_code=google.loader.ClientLocation.address.country_code; var pagetitle=document.getElementById('pagetitle').innerHTML; var ip = "&lt;?php echo $_SERVER['REMOTE_ADDR'];?&gt;"; var url= "&lt;?php echo $_SERVER['REQUEST_URI'];?&gt;"; $(document).ready(function() { var data="city=" + city + "&amp;region=" + region + "&amp;country=" + country + "&amp;country_code=" + country_code + "&amp;ip=" + ip + "&amp;pagetitle=" + pagetitle + "&amp;url=" + url; $.ajax({ url:'somefile.php', type:'post', cache:false, data:data });//end ajax });//end doc ready }//end if not null &lt;/script&gt; </code></pre>
php javascript
[2, 3]
109,644
109,645
Clearing a TextBox in ASP.NET
<p>I have webpage where there is textbox having some default value. </p> <p>I have to clear the value from text box. I have 2 options</p> <pre><code>1. textbox.text=""; 2. textbox.text.remove(0,length); </code></pre> <p>Here i would like to know which one should i use. Does it make any impact on page performance because there are many textbox placed in page.</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,134,089
3,134,090
how to create print preview of the document printed
<p>I am developing a custom pane which will show up when the user presses 'Print'. This custom pane need to have a print preview. Please tell me how to create dynamic print preview of a document/images,etc.</p> <p>Thanks in advance</p>
c# c++
[0, 6]
5,573,725
5,573,726
Append a large li to ul: best way?
<p>I have a li that has numerous nested divs. I am appending to a ul as follows:</p> <pre><code> $("ul#List").append('&lt;li&gt;&lt;div&gt;....many more nested divs...&lt;/li&gt;'); </code></pre> <p>the structure of the li is the same as the other lis in ul but i have to modify some elements. </p> <p>My question is simply am I doing it wrong by manually writing out the entire structure?</p>
javascript jquery
[3, 5]
4,950,386
4,950,387
highlite text parts with jquery, best practice
<p>i have a list of items containig names. then i have a eventlistener, which ckecks for keypress event. if the user types i.g. an A all names starting with an A should be viewed with the A bold. so all starting As should be bold.</p> <p>what is the best way using jquery to highlite only a part of a string?</p> <p>thanks for your help</p>
javascript jquery
[3, 5]
3,438,673
3,438,674
ASP.net Repeater get current pointer/counter
<p>the question is really simple. Is there a way to access the current pointer/counter for an asp Repeater control.</p> <p>I have a list with items and I would like one of the repeaters columns (it repeats and html table) to be something like ...</p> <p>Item 1 | some info</p> <p>Item 2 | some info</p> <p>... and so on</p> <p>1 and 2 being the counter.</p> <p>any help?</p>
c# asp.net
[0, 9]
614,931
614,932
Use of RegisterClientScriptBlock/RegisterStartupScript in asp.net 3.5
<p>i am not able to understand what is the use of it.RegisterClientScriptBlock/RegisterStartupScript</p> <p>when we can direclty write the javascrpt code in.js file then call it on the button</p> <p>ex: 2</p> <pre><code>&lt;script&gt; function ReqField1Validator() { if (document.forms[0].txtField1.value == '') { alert('TextBox cannot be empty') return false } return true } &lt;/script&gt; btnPostback.Attributes.Add("onclick","return ReqField1Validator()"); </code></pre> <p>what will be the use of RegisterClientScriptBlock/RegisterStartupScript ?</p> <pre><code>protected void btnPostback_Click(object sender, EventArgs e) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(@"&lt;script language='javascript'&gt;"); sb.Append(@"var lbl = document.getElementById('lblDisplayDate');"); sb.Append(@"lbl.style.color='red';"); sb.Append(@"&lt;/script&gt;"); if (!ClientScript.IsStartupScriptRegistered("JSScript")){ ClientScript.RegisterStartupScript(this.GetType(), "JSScript", sb.ToString()); } } </code></pre> <p>read few articles but they were not clear</p> <p>any thoughts on this would be great</p> <p>Thanks Prince</p>
c# javascript asp.net
[0, 3, 9]
2,477,895
2,477,896
Find all radio groups which haven't been selected
<p>I have a basic quiz/survey type application I'm working on, and I'd like to give the user a prompt before they submit if they haven't answered all the questions. All the questions are multiple choice using radio buttons:</p> <pre><code>&lt;div class="question"&gt; Q1: What is the second letter of the alphabet? &lt;div class="choices"&gt; &lt;input type="radio" name="question_1" value="1" /&gt; A &lt;input type="radio" name="question_1" value="2" /&gt; B &lt;input type="radio" name="question_1" value="3" /&gt; C &lt;/div&gt; &lt;/div&gt; &lt;div class="question"&gt; Q2: Which out of these is a berry? &lt;div class="choices"&gt; &lt;input type="radio" name="question_2" value="1" /&gt; Apples &lt;input type="radio" name="question_2" value="2" /&gt; Bananas &lt;input type="radio" name="question_2" value="3" /&gt; Carrots &lt;/div&gt; &lt;/div&gt; &lt;div class="question"&gt; ...etc </code></pre> <p>How do you find which groups haven't got an option ticked? Or at least, if there are any which haven't been answered?</p> <p>jQuery is ok, and even preferred.</p>
javascript jquery
[3, 5]
2,342,278
2,342,279
Jquery dynamic TextBoxes with Request.form Iteration
<p>i am Adding multiple TextBoxes with Jquery in my Application, then in code behind file i want can access the values by Request.form[name]. I want o iterate these textboxes and read values of whatever Text is entered by the user, so i can store it in database. any idea how can i save the value of these textboxes in Database, i am working in asp.net 2.0</p> <pre><code>$(document).ready(function () { var counter = 2; $("#addButton").click(function () { if (counter &gt; 10) { alert("Only 10 textboxes allow"); return false; } var newTextBoxDiv = $(document.createElement('div')).attr("id", 'TextBoxDiv' + counter); newTextBoxDiv.html('&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;input type="text" name="textbox' + counter + '" id="textbox' + counter + '" value="" &gt;&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="textbox' + counter + '" id="textbox' + counter + '" value="" &gt;&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="textbox' + counter + '" id="textbox' + counter + '" value="" &gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;'); newTextBoxDiv.appendTo("#TextBoxesGroup"); return false; counter++; }); }); </code></pre>
c# jquery asp.net
[0, 5, 9]
3,304,866
3,304,867
Best way to save a little amount of data
<p>I'm currently developing an Android application where OAuth will be in use. In order to use OAuth, I need to be able to save the consumer's private key to access the protected resources. My question is, where would I want to save this tiny piece of data? I know that for most Android applications, data would be stored in a SQLite database. But for only a little bit of information, a string containing random letters and numbers, would SQLite be the best way to go? Or would it just be better to write the data to a file and save it on the file system? I don't know what the best practice for this would be, so hopefully I'll be able to get some insight.</p> <p>Thanks a bunch guys!</p>
java android
[1, 4]
2,345,156
2,345,157
Why doesn't file_get_contents load phpscript properly in this example?
<p>I wrote a bit of code, that in essence does the following:</p> <pre><code>&lt;div id="thisDiv"&gt; &lt;/div&gt; &lt;?php echo "&lt;script&gt;document.getElementById('thisDiv').innerHTML = '".addslashes(str_replace(array("\n", "\r"), "", file_get_contents('/path/to/file/example.php'')))."';&lt;/script&gt;"; ?&gt; </code></pre> <p>However, I noticed that this doesn't work: nothing enclosed in <code>&lt;?php ?&gt;</code> tags inside example.php makes their way to the div. Why is this and is their a way around it?</p>
php javascript
[2, 3]
675,634
675,635
Getting commands from string input
<p>I have a program which gets commands as a string. Each character in the string represents a command. An example of command is given below</p> <pre><code>OBIPC </code></pre> <p>O - Open a file</p> <p>B - Make the text in Bold</p> <p>I - Make the text in italics</p> <p>P - Print the text</p> <p>C - Close the file</p> <p>My program has to parse this string and do respective job. Each command is executed sequentially. I came up with the following idea to do this.</p> <ol> <li>Create action classes for each command. Each will have a <em>Execute()</em> method and implements an interface <em>IExecutable</em>. So if I have 5 commands, I will have 5 classes each for processing each command. </li> <li>Keep the command and associated object that can perform action in an associative container (<em>std::map</em> in C++ and <em>Dictionary</em> in .NET).</li> <li>Loop through each character in the input string. Check any action associated for each character. If yes, get the action object and call <em>Execute()</em>. Some sort of command design pattern. If some charcters don't have action associated, throw error or skip. </li> </ol> <p>Will this approach be the best for my problem or do you see any easy/efficient method to do this? This is not specific to any programming language, I am OK with any programming language. All I am looking for is ideas to do this.</p> <p>Any thoughts?</p>
c# c++
[0, 6]
4,855,659
4,855,660
What are some FOSS libraries for reading epub, mobi, pdf, or other eBook formats for Android or Java?
<p>What are some FOSS libraries for reading epub, mobi, pdf, or other eBook formats for Android or Java?</p>
java android
[1, 4]
2,292,416
2,292,417
How select element in previously generated html code using jQuery?
<p>I'm generating a options elements for select el. And after document ready, I need do each() for all this elements. How can I do this?</p> <p>ps I know how select this elements after some events, live(). But now, it's impossible.</p>
javascript jquery
[3, 5]
4,717,963
4,717,964
Assets @ Android
<p>I am having problems listing assets in my apk file, my aim is to be able to get the direct path of one of my assets and pass it to native code using JNI<br/> 1. I have added a file to the assets folder of my project<br/> 2. <strong>I have verified that the file exist in the '/assets' folder</strong> of the apk file resulting of compilation of my project<br/> 3. at the 'onCreate' function of my Activity I do the following:<br/>   AssetManager am = this.getApplicationContext().getAssets();<br/>   String strAssets[] = am.list("/assets");<br/> 4. strAssets.length is always zero<br/> 5. I was getting the same for "./assets" and "assets"<br/> <br/> What am I doing wrong here? why can't I list the available assets?<br/> <br/> Any help will be appreciated.<br/> <br/> ~Nadav at sophin<br/></p>
java android
[1, 4]
2,117,984
2,117,985
How to rebind checkboxlist
<p>I have a checkboxlist which contain 3 checkboxes whose values are check1,check2,check3. In database, in table, there is a field to save the values of checked checkboxes.</p> <p>If that field conatins values check1, check2, check3 and if I use following code to bind checkboxlist, only check3 gets checked, but check1 and check2 is unchecked</p> <pre><code> string[] strSourceOfInformation = dtEnquiry.Rows[0]["SourceOfInformation"].ToString().Split('&amp;'); for (int i = 0; i &lt; strSourceOfInformation.Length; i++) { if (strSourceOfInformation[i].ToString() != "") { foreach (ListItem htlRmItem in chkSourceOfInformation.Items) { if (htlRmItem.Value == strSourceOfInformation[i].ToString()) { htlRmItem.Selected = true; } } } } </code></pre> <p>how can I modify the code to get check1, check2 and check3 gets checked?</p>
c# asp.net
[0, 9]
395,202
395,203
Retrieve images in Android
<p>I have an app containing a large number of HD images , so my app is too big (over 150 MB) when I put images in app resource. If there is alternative way to retrieve images remotely and not include them inside the app ,i saw some images apps when open it start download images then appear in app , its downloaded from some where i dont know really.am new to android so if any one help me ,where i have to put images and how to retrieve it to app when it open ,finally i will have resnable sized app also i will including all images in app by remote download. thanks in advance</p>
java android
[1, 4]
4,625,780
4,625,781
How do I pass a method through another method without it being called, and pass a variable object into it?
<p>Sorry for my last question. This is the question with better formatting.</p> <p>I have a method that I am passing a method through :</p> <pre><code>method("my_passed_method()") function method(passed_method){ eval(passed_method.replace('()', + '(' + obj + ')' ); } </code></pre> <p>But this returns :</p> <p><code>SyntaxError: missing ] after element list</code></p> <p>I'm assuming this is just some simple JSON syntactical error.</p>
javascript jquery
[3, 5]
3,382,982
3,382,983
Most efficient way to use inheritance in this example?
<p>So I've been messing around with some JavaScript inheritance techniques and here's one case in which I'm trying to derive a strong solution.</p> <p>Here's a simple example: <a href="http://jsfiddle.net/JgrYu/" rel="nofollow">http://jsfiddle.net/JgrYu/</a></p> <p><strong>The Issue:</strong> Logically we'd expect the two div's to be both 0's. But since we're just newing the extended class we don't re-generate our "c" variable.</p> <p>A potential fix for this is to use Functional inheritance: <a href="http://jsfiddle.net/h8xtz/" rel="nofollow">http://jsfiddle.net/h8xtz/</a></p> <pre><code>function mybase() { var that = {}; var c = 0; that.hi = function() { var ele = $('&lt;div&gt;&lt;/div&gt;'); ele.html(c++); $('body').append(ele); } return that; } function myextended() { var that = mybase(); that.hi(); return that; } myextended.prototype = new mybase(); $(document).ready(function() { var a = myextended(); var b = myextended(); })​ </code></pre> <p><strong>However</strong> the issue with this is that we clutter the global namespace and each object duplicates the functional properties when in reality we just want duplication of the private variables. </p> <p><strong>So,</strong> what I'm looking for is a better approach than functional inheritance to solve this issue. I've thought about making a psuedo classical inheritance structure where I separate the private and public variables/functions but I haven't been able to come up with a version with less overhead than the functional inheritance.</p>
javascript jquery
[3, 5]
921,590
921,591
setup format for columns of DataTable or GridView
<p>How can I setup some format for cells in some column in my DataTable or GridView ?</p> <p>I need to make some double columns rounded , for example :</p> <p>3.564643 -> 3.56</p> <p>3.546723 -> 3.55</p> <p>6.654644 -> 6.65</p> <p>thank you.</p> <p>DataFormatString ? where ?</p> <p>Question still active, I didn't solved the problem :-/</p>
c# asp.net
[0, 9]
5,781,888
5,781,889
getting value from popup window
<p>is this code is write or wrong?</p> <pre><code>imgbtnProdSearch.Attributes.Add("onclick", "window.open('popUp.aspx?name=" +txtSelectProdName.ClientID+"','_new','width=1000px,height=1000px');return false"); </code></pre>
javascript asp.net
[3, 9]
467,827
467,828
How to modify XML with JQuery
<p>I am trying to modify a status flag in an XML structure using Javascript. Using examples found on the internet I believe this should work: </p> <pre><code>test = "&lt;?xml version='1.0' encoding='utf-8' standalone='no' ?&gt;" + "&lt;resultaat&gt;" + "&lt;type&gt;6&lt;/type&gt;" + "&lt;status&gt;I&lt;/status&gt;" + "&lt;start_datum&gt;2012-06-16 00:00:00&lt;/start_datum&gt;" + "&lt;eind_datum&gt;&lt;/eind_datum&gt;" + "&lt;/resultaat&gt;" </code></pre> <p>To change the content of the status field: </p> <pre><code>$(test).find("status").text("D") </code></pre> <p>The result is however that test is not modified and still contains the old status <code>I</code></p> <p><strong>Thanks for the answers</strong></p> <p>The correct insight is that you need to convert to an XMLObject first and modify this.</p> <p>Below is how I ended up doing it: </p> <pre><code>/* Convert Text to XML Object */ doc = $.parseXML(test) /* Change the fields required */ $(doc).find('status').text('D') /* Back to Text */ str = (new XMLSerializer()).serializeToString(doc); </code></pre>
javascript jquery
[3, 5]
5,883,760
5,883,761
Getting an error when I copy files image files to drawable
<p>I copied two images in the folder <code>drawable-hdpi</code>,<code>-ldpi</code>,<code>-mdpi</code> and referenced that image to a button.</p> <p>I'm getting following error in my console: <strong>" No resource found matching the give name"</strong>.</p> <p>What am I doing wrong?"hello" is the name of the image i referenced from the resource folder.i m getting the error the moment i add the image in the resource folder even before referencing the image to the button.</p> <pre><code> &lt;Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/button2" android:text="" android:background="@drawable/hello" android:layout_x="190dp" android:layout_y="220dip"&gt; &lt;/Button&gt; </code></pre>
java android
[1, 4]
873,198
873,199
Problem in exporting Chart to excel
<p>I have dynamically created table in which some data rows and one MS Chart is there. How can I send that table to excel including chart .</p> <p>I am using the fallowing code to export but it unable to render chart.</p> <pre><code> protected void btnGetExcelReport_Click(object sender, EventArgs e) { Table tblDealsRep = new Table(); tblDealsRep = (Table)Session["tblReport"]; if (tblDealsRep.Rows.Count &gt; 0) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=LeadsReport.xls"); Response.ContentType = "application/ms-excel"; string k = GetGridViewHtml(tblDealsRep); Response.Write(k); Response.End(); } } public string GetGridViewHtml(Control c) { System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); c.RenderControl(hw); return sw.ToString(); } </code></pre>
c# asp.net
[0, 9]
5,336,074
5,336,075
What's the best choice for developing real time form validation in ASP.NET
<p>I want to make a real time form validation in asp.net form in which when i lost focus a field it show an error or success of field entrance data <BR/> i search for best way to do that ..<BR> and if i want to do the same by validating data from SQL Database ... what's the best choice for doing that ?</p>
asp.net javascript jquery
[9, 3, 5]
5,922,562
5,922,563
Can't open Websphere Portal 7.0 Login Page after its integration with a custom user registry?
<p>I am currently working on a project related to Websphere Portal 7.0 on Windows Server 2008 R2,64 bit. I am trying to integrate websphere portal with my custom user registry.I have completed all the steps required to implement custom user registry in portal as given in IBM documentation.I am adding my custom repository to the default federated repositories of Portal 7.0.I have made the required changes under VMM Federated CUR Properties section in wkplc.properties.I am using configengine.bat file to configure Portal with user registry. But even completing all the steps,when I am trying to open the Portal Login Page through <a href="http://ip-address:port_of_portal/wps/portal" rel="nofollow">http://ip-address:port_of_portal/wps/portal</a> ,it is throwing an exception on the console: "Error 500: com.ibm.wps.resolver.data.exceptions.URIProcessingIOException: EJCBD0021E: The URI dav:fs-type1/themes/PageBuilder2/theme.html and parameters [['themeURI'=, 'mime-type'= could not be processed: [EJCBD0021E: The URI dav:fs-type1/themes/PageBuilder2/theme.html and parameters [['themeURI'=, 'mime-type'= could not be processed: EJPSG0002E: Requested Member does not exist.uid=portal,o=defaultWIMFileBasedRealm/null] " and in logs Systemout.log "EJPSB0005E: Exception occurred during creation of the principal with Name uid=portal,o=defaultWIMFileBasedRealm and Principal Type USER caused by com.ibm.portal.puma.MemberNotFoundException: EJPSG0002E: Requested Member does not exist.uid=portal,o=defaultWIMFileBasedRealm/null".</p> <p>Here,"portal" is administrative user in my custom user registry.I am able to access WAS using /ibm/console through user "portal".Please suggest some way to handle this issue.</p>
java c++
[1, 6]
3,001,159
3,001,160
Sequence of running code in jQuery
<p>This is a part of my code:</p> <pre><code>$.post('category.php',{datatosend : datatosend},result); function result(data) { $('#placeHolder').append('&lt;select onchange="loadcats();" id="categoryPID" name="categoryPID" &gt;').append(data).append('&lt;/select&gt;'); alert($('#placeHolder').html()); }); } </code></pre> <p>and I want to have this HTML in alert:</p> <pre><code>&lt;select onchange="loadcats();" id="categoryPID" name="categoryPID"&gt; &lt;option value="37"&gt;computer&lt;/option&gt;&lt;option value="38"&gt;mobile&lt;/option&gt; &lt;/select&gt; </code></pre> <p>but the result is:</p> <pre><code>&lt;select onchange="loadcats();" id="categoryPID" name="categoryPID"&gt;&lt;/select&gt; &lt;option value="37"&gt;computer&lt;/option&gt;&lt;option value="38"&gt;mobile&lt;/option&gt; </code></pre> <p>why and what should I do?! Thanks.</p>
javascript jquery
[3, 5]
118,848
118,849
Android in Eclipse autocompletes arg0, arg1,
<p>Come on, I know this is simple, but I can't find an answer. When I autocomplete in Android in Eclipse, the methods get param names like arg0, arg1, etc. Presumably, this would be better if I had source or something for Android located somewhere, but there are 14,000 git repositories for it and I don't know which to grab or what to do after.</p> <p>Can someone help?? I don't want "View arg0" I want "View v" or something. :-)</p>
java android
[1, 4]
2,961,491
2,961,492
Class inside a function causing null pointer exception
<p>The following code causes null-pointer exception during execution. It just said null pointer exception.</p> <p>When I put the hotItem class outside of the function, it works without any problem.</p> <p>Once I put it into the function, it will cause null pointer exception.</p> <p>I just want to know why this would happen and what is the life cycle of the class inside a function.</p> <pre><code>private void getHotItem() { Gson gsonAdapter = new Gson(); class hotItem { private String hotItemPK = ""; } Type hotItemType = new TypeToken&lt;List&lt;hotItem&gt;&gt;(){}.getType(); List&lt;hotItem&gt; hotItemList = new ArrayList&lt;hotItem&gt;(); try { itemAccess.getHotItemList(); itemAccess.start(); itemAccess.join(); hotItemList = gsonAdapter.fromJson(returnData, hotItemType); if(!hotItemList.isEmpty()) { testText.setText(hotItemList.get(0).hotItemPK.toString()); } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } </code></pre>
java android
[1, 4]
2,830,152
2,830,153
Plotting Realtime Graph in visual studio c++
<p>I am a new to windows programming. I am developing a application to process the measurement data from a laser sensor. I have got the data from the sensor and did some calulations and I need to plot the data which are in the double arrays say afx[81] and afy[81].. I have been browsing since yesterday to plot the 2-D graph.I found out the options I have are,</p> <ol> <li>using a third party library like gnuplot.</li> <li>using standard graphic library like PGL. <a href="http://www.codeproject.com/Articles/1546/Plot-Graphic-Library" rel="nofollow">http://www.codeproject.com/Articles/1546/Plot-Graphic-Library</a></li> <li>using C# or visual basic to do the plot and using it from c++.</li> </ol> <p>My requirements are</p> <ol> <li>I need to do real time plotting.the max scanning frequency of the sensor is 50hz.</li> <li>I want the application to run in all windows computers as a single application.</li> </ol> <p>Can someone provide me the best possible solution that I can approach.</p>
c# c++
[0, 6]
2,123,577
2,123,578
Jquery image fade effect
<p>I am using this code, but when it changes the image, the image fades out and then the other image fades in, meanwhile I can see the background color, I dont want to see the background color, is there any simple way to fade images but at the same time to fade in the next image, or another jquery effect like slide the images, its just that I dont want to see the background color:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ var imgArr = new Array( // relative paths of images 'css/images/main_img.jpg', 'css/images/main_img_2.jpg', 'css/images/main_img_3.jpg', 'css/images/main_img_4.jpg', 'css/images/main_img_5.jpg' ); var preloadArr = new Array(); var i; /* preload images */ for(i=0; i &lt; imgArr.length; i++){ preloadArr[i] = new Image(); preloadArr[i].src = imgArr[i]; } var currImg = 1; var intID = setInterval(changeImg, 6000); $('#main_content').css('background','url(' + preloadArr[0].src +') top center no-repeat');//added this so that the first image is always the first from the array /* Main IMG */ function changeImg(){ $('#main_content').animate({opacity: 0}, 1000, function(){ $(this).css('background','url(' + preloadArr[currImg++%preloadArr.length].src +') top center no-repeat'); }).animate({opacity: 1}, 1000); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,105,058
3,105,059
jQuery each function only returning last result of total results
<p>I have an object with key : value pair. I'm looping through this object and if the key matches the value that's passed into my function I add it to another variable. The problem is that my code ends up looping through the results and only adding the last match to my new variable.</p> <pre><code>function DirectoryOfBusinessSubs(parentID) { var myOpt = {"1":"&lt;option&gt;sub1&lt;/option&gt;","1":"&lt;option&gt;sub2&lt;/option&gt;"}; var myList; $.each(myOpt, function(key, value) { if(key == parentID){ myList += value; } }); alert(myList); c.append(myList); } </code></pre> <p>If I am passing in <code>1</code> for the key, <code>myList</code> should get both sub1 and sub2, but this code is only storing sub2 in <code>myList</code>.</p>
javascript jquery
[3, 5]
1,479,606
1,479,607
I need help with these two functions
<p>The first one displays the div, the second one hides the dive up on clicking anywhere else in the document. the problem i have is, when i click the button to show the div, it also counts as a document click so it hides the div. how can i it make not hide the div when i click to show the div</p> <pre><code>&lt;script type="text/javascript"&gt; function test22(){ var links = document.getElementById('links_safari'); if(links.style.display == "none"){ document.getElementById('links_safari').style.display=""; var content = $('#links_safari').html(); var words = content.split(','); for (var i = 2; i &lt; words.length; i += 3) { words[i] += '&lt;br&gt;'; } content = words.join(' '); $('#links_safari').html(content); $('#links_safari').css("margin-top", -322); $('#links_safari').css("margin-left", 180); safariPopupStatus++; } else{ links.style.display="none"; } } &lt;/script&gt; &lt;script type="text/javascript"&gt; $(function (){ $(document).click( function (e){ var links = document.getElementById('links_safari'); links.style.display="none"; } ) }) &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
5,369,095
5,369,096
jQuery adding 2 numbers from input fields
<p>I am trying to add two values of alert boxes but I keep getting a blank alert box. I don't know why.</p> <pre><code>$(document).ready(function(){ var a = $("#a").val(); var b = $("#b").val(); $("submit").on("click", function(){ var sum = a + b; alert(sum); }) }) </code></pre>
javascript jquery
[3, 5]
1,340,085
1,340,086
How to close Browser Tab After Submitting a Form?
<pre><code>&lt;?php /* ... SQL EXECUTION TO UPDATE DB ... */ ?&gt; &lt;form method = "post" action = "&lt;?=$_SERVER['php_self']?&gt;" onSubmit= "window.close();"&gt; ... &lt;input type="submit" value="submit" /&gt; &lt;input type="reset" value="reset" /&gt; &lt;/form&gt; </code></pre> <p>I would like to close page after submitting the form. After running the above code the page is closed after clicking submit button, but the SQL doesn't execute.</p> <p>Can anyone help me? Thanks in advance!</p>
php javascript
[2, 3]
5,961,165
5,961,166
jquery deleting a table row help
<p>I have some code like this to delete a row then display a dialog.</p> <p>the first time i click delete id removes the row straight away. but on any subsequent rows i try to delete i sometimes need multiple clicks before it removes the row.</p> <p>sometimes the dialog shows and the row is still there!</p> <p>what is the matter?</p> <p>EDIT - The db gets updated correctly but the row still remains. its quite erratic sometimes it removes sometimes i have to click twice.</p> <pre><code>$(".delete-item").click(function () { var itemId = $(this).attr("id").split('-')[1]; var iType = $(this).attr("id").split('-')[0]; $.post('/User/Delete/', { id: itemId, itemType: iType },function (json) { if (json.success) { console.log("#row-"+itemId); $("#row-"+itemId).hide('slow', function(){ $(this).remove(); }); //$("#dialog-success-delete").dialog("open"); } else { if(json.error=="unknown"){ $("#dialog-unknown-error").dialog("open"); } if(json.error=="unauthenticated"){ $("#dialog-unauthenticated").dialog("open"); } } }); </code></pre>
javascript jquery
[3, 5]
2,909,741
2,909,742
Jquery to iterate through a list
<p>Following jQuery is not working on given select box.</p> <p>I want to iterate through all the options of select box.</p> <p>Where am I going wrong?</p> <p>Am not getting <code>alert("hi")</code>, I.E. <code>$("#FileType").find('x:option').each(function(){</code> is not executing.</p> <pre><code>&lt;x:select id="FileType" width="210px"&gt; &lt;x:option value="JPG"&gt;JPG&lt;/x:option&gt; &lt;x:option value="PNG"&gt;PNG&lt;/x:option&gt; &lt;x:option value="PDF"&gt;PDF&lt;/x:option&gt; &lt;x:option value="TIF"&gt;TIF&lt;/x:option&gt; &lt;x:option value="BMP"&gt;BMP&lt;/x:option&gt; &lt;/x:select&gt; $("#FileType").find('x:option').each(function(){ alert("hi"); if($(this).val() == AttachmentExtension) $("#FileType").val(AttachmentExtension); }); </code></pre>
javascript jquery
[3, 5]
5,046,382
5,046,383
Android Execute External .sh - Max Number of Commands?
<p>I'm calling a natively compiled executable via my Android application.</p> <p>I need to call it multiple times, and to make sure the commands are executed sequentially I append them all to a script and then call this via /system/bin/sh. </p> <pre><code>Runtime.getRuntime ().exec ("/system/bin/sh /path/to/script.sh"); </code></pre> <p>All fine. </p> <p>However, in certain situations I need to run quite a large number of commands. I'm noticing that there is an upper limit to the amount of commands in the .sh that will actually get executed. </p> <p>Is there a max processes limit barrier I am hitting? I would expect executing them sequentially should keep this number low, i.e. run them in series. </p> <p>The reason I think I'm hitting some kind of limit is that it never makes it past a certain number of commands around 20. (I have checked the actual command syntax and it is fine). I also get no output from the Process object when this mysterious limit is reached. </p> <p>I'm kind of stumped as to why this is happening, and can't find any information on how to proceed. Any ideas? </p> <p>Thanks </p>
java android
[1, 4]
3,999,047
3,999,048
Setting Default URL in Web.Config for website
<p>When users navigate to my site, I want it to display :</p> <pre><code>http://example.com </code></pre> <p>and not: </p> <pre><code>http://example.com/default.aspx </code></pre> <p>How can I do that?</p>
c# asp.net
[0, 9]
5,008,514
5,008,515
jQuery Check if String Contains Word
<p>I'm working on an application where you can click on user names to add them to the reply list. If the username is already added, it doesn't add their username again. The problem I'm having is that if the user @assassin is added, and I try to add the user @ass, it finds @ass-assin and thinks that @ass is already added. Here's my code:</p> <pre><code>$('#mentions a.mention_user').live('click', function(e){if($('textarea#message').val().toLowerCase().search('@'+$(this).text().toLowerCase()) &lt; 0){ $('textarea#message').val('@'+$(this).text()+' '+$('textarea#message').val()); } e.preventDefault(); }); </code></pre> <p>Thanks in advance!</p> <p>EDIT: The text it'll be matching the usernames against will look similar to this: @user @joe @adam this is a message @someone</p>
javascript jquery
[3, 5]
4,797,832
4,797,833
asp:linkbutton inside gridview
<p>I have a serverside dropdownlist and I am accessing it's id in jquery like this</p> <p>$('#&lt;%=ddldropdownlist.clientID%>')</p> <p>I have a asp:LinkButton inside a gridview and I want to access it's client ID.</p> <p>when I do as above in jquery it doesn't work</p> <p>I think that's not the correct way since the server control is inside another server control</p> <p>Could someone please help</p>
asp.net jquery
[9, 5]
804,374
804,375
Loading local files via jQuery
<p>Spent 3 hours reading reference, but still no effect, so asking here.</p> <p>OS: Windows 7 (is it relevant?)<br> Browser: Opera 11.51<br> jQuery: 1.6.2</p> <hr> <p>Two files on a local machine, <strong>main.html</strong> and <strong>menu.html</strong> in the same folder.</p> <p>main.html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="js/jquery-1.6.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ // append contents $('#menu').load('menu.html'); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr&gt; &lt;td id="menu"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>menu.html:</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; menu tree &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As I guess, when I open main.html, there should be one table with one cell containing "menu tree" string. And it works, for example, in IE. But Opera doesn't show any result.</p> <p>I debugged the stuff with optional callback for load(), it shows that result status for load() is "error".</p> <p>What am I doing wrong?</p>
javascript jquery
[3, 5]
1,388,653
1,388,654
Unbind an element and add back after animation stops
<p>I am trying to <code>unbind</code> an element, an then <code>bind</code> it back after a page scroll animation completes:</p> <pre><code>$(".trigger").click(function(){ $(".class1 a, .class2 a").unbind(); $('html, body').stop().animate({scrollTop: $('#container').offset().top}, 1000); $(".class1 a, .class2 a").bind(); }); </code></pre> <p><code>.class1 a</code> and <code>.class2 a</code> never get binded back, however?</p>
javascript jquery
[3, 5]
1,609,322
1,609,323
How to print a page content (div, form, jqgrid) using a single button click?
<p>i.e. When I click the button from my page, the desired page content should get printed in a sheet. The main goal over here is, it should not show me with the print dialog box/print preview of the page asking for OK or CANCEL button where we can also choose for multiple prints of a particular page. Thanks in advance.</p>
java javascript jquery
[1, 3, 5]
4,152,560
4,152,561
jquery restricting numbers greater than required
<p>Need to restrict typing more than 20 numbers in a text box in jquery. How to implement it.</p> <p>Any help is appreciated.</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt; &lt;h:inputText id="Actualcard" styleClass="input-text-bx"&gt;&lt;/h:inputText&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
3,817,129
3,817,130
How do I stop a element hit area from moving off the screen when window is scrolled, JavaScript/Jquery?
<p>When I scroll the window/page the hit area denoted by the 100 value in <code>n.mousePositionY('.nav', 100);</code> moves off the page/screen. Is there a way of always having that 100 value stay on the screen irrespective of scrolling...it's for a navigation menu I'm working on. Here's the code so far:</p> <pre><code> //$('.nav').hide(); var n = new Object(); n.mousePositionY = function(className, y){ $(window).mousemove(function(e){ if(e.pageY &lt; y){ $(className).fadeIn(200); } if(e.pageY &gt; y){ $(className).fadeOut(200); } }); } n.mousePositionY('.nav', 100); </code></pre> <p>Any help would greatly be appreciated, thanks</p>
javascript jquery
[3, 5]
1,125,147
1,125,148
apk download issue
<p>Hi I am trying to download apk file from https and http ,I am not able to proceed. What wrong i may be doing.When trying on https I have added .htaccess file on apache server containing the AddType for android. When tried on http it didnt worked.</p> <p>Any help is appreciated. Thanks in advance.</p>
java android
[1, 4]
5,248,026
5,248,027
jquery beforeunload messages depending on button clicked
<p>Im having problem altering jQuerys <code>beforeunload()</code> functionality, depending on user actions.</p> <pre><code>$(document).ready(function() { $(window).bind('beforeunload', function() { if (billChanged == false) { return false; } else if ( savebutton was clicked ) { return false; } else { return "refreshing page without saving, huh? you're a bad boy!"; } }); }); </code></pre> <p>The issue im having, that i can't come up with a way to check if 'savebutton' was clicked, as typed in <code>else if</code> clause in the snippet above.</p> <p>The form itself is quite complicated, and i'm not able to alter it that much. </p>
javascript jquery
[3, 5]
2,496,052
2,496,053
select mutiple items from listbox
<p>I have a string as</p> <pre><code>var selected_values = '1#2#3#4#5'; </code></pre> <p>Now these are all values for &lt;option&gt;, which are separated by # (so final selected values would be 1 2 3 4 5), I need to select only those "options" whose value is mentioned in above string</p> <p>How can I achieve this? 1. I need to split string 2. select only those options whose values are mentioned</p> <p>For single value I am using following code</p> <pre><code> var selObj = document.getElementById('list1'); len = selObj.length; selected_value = '1'; for (i = 0; i &lt; len; i++) { if (selObj[i].value == selected_value) { selObj[i].selected = true; } } </code></pre>
javascript jquery
[3, 5]
3,723,477
3,723,478
Calling Codebehind .cs file method in Javascript method in asp.net
<p>I am trying to do the page level validation in javascript for and element and if the validation is passed i want to call the codebehind method .cs file method of .aspx.cs file method. Can anyone please provide any details / code which will make this requirement work in an easy way. I am trying to do this in C# .net. Thanks, </p>
c# javascript asp.net
[0, 3, 9]
707,150
707,151
"Function.createDelegate" causes "Error: Object doesn't support property or method 'createDelegate'"
<p>I am trying to get browser back button support in silverlight by following <a href="http://jakkaj.wordpress.com/2008/09/08/control-silverlight-by-using-browser-back-and-foward-buttons/" rel="nofollow">this</a> tutorial. I am using Silverlight 4, Asp and .net4.0.</p> <p>I am not very used to javascript and compared to C# I never really liked working with it.</p> <p>The error message I am reciving is this: "Error: Object doesn't support property or method 'createDelegate'"</p> <p>on this line</p> <p>//Create a delegate to preserve scope when the navigation event handler fires. var handler = Function.createDelegate(historyInstance, historyInstance.navigationEventHandler);</p> <p>My first guess is that some reference is missing but when searching I found nothing!</p> <p>What is the cause of this error message? Please look at the tutorial for full source code.</p>
javascript asp.net
[3, 9]
3,925,363
3,925,364
How to form this kind of graph?
<p>I want to create this kind of graph on the basis of user entered data. the main issue is regarding the display of boxes on the point. Let me explain you a bit,background does contain a gradient image which resembles to the color of urine the patient want to mention.</p> <p>Please suggest me something to create this graph.Whole data is need to be fetched dynamically.</p> <p><img src="http://i.stack.imgur.com/6p3OX.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
2,723,318
2,723,319
How can I highlight a sentence that is spread over more than one tag
<p>If i have text some thing like below.. </p> <pre><code>var str="Hi, How are you"; </code></pre> <p>If i want to highlight this text in the below HTML in a single attempt rather than spliting it into an array. In document if my HTML is like below.. </p> <pre><code>&lt;div&gt; Hi, &lt;span&gt;How are&lt;/span&gt; you&lt;/div&gt; </code></pre> <p>Please help me on this..I want to search the sentence in document and want to add highlighted effect to it.</p>
javascript jquery
[3, 5]
1,138,369
1,138,370
Open a new window/tab
<p>I am working on a donations website. In my page, I have a textbox which accepts a numeric value from the user (that is, money to be donated).</p> <p>In my code-behind, I have a method which checks whether the value in the textbox is numeric. The method generates an error message if the number is invalid.</p> <p>I also have a JavaScript which, after checking that the value in the textbox is numeric, opens a new tab to the website confirmation page, thanking the user for his donation. Here is the code of the javascript:</p> <pre><code>&lt;script type="text/javascript"&gt; function Open_Window() { var textbox = document.getElementById('DonationTextBox'); if (textbox.value != "") { if (isNan(textbox) == false) { window.open("DonationConfirmation.aspx") } } } &lt;/script&gt; </code></pre> <p>The problem is that the tab is NEVER opened, even if the number is valid. Can you please help me solve this problem? Thank you.</p> <p>P.S.</p> <p>Here is the code of the button that initiates the validation:</p> <pre><code>&lt;asp:ImageButton ID="PayPalButton2" runat="server" ImageAlign="Middle" ImageUrl="Resources/Icons/PayPalCheckOut.gif" onclick="PayPalButton2_Click" OnClientClick="Open_Window()"/&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
2,266,847
2,266,848
How to load the web page content based on user scrolling
<p>How to load the content while user scroll the web page. How to implement this?</p>
javascript jquery
[3, 5]
1,915,279
1,915,280
Is there a place where we can see PHP <=> C++ equilavent libraries/function for a php developer starting with C++?
<p>Is there a place where we can see PHP &lt;=> C++ equilavent libraries/function for a php developer starting with C++?</p> <p>As a PHP developer starting with C++, I often ask myself: what is the equivalent of such-and-such PHP function in C++?</p> <p>The advantage of php, is that we have a very nice site which documents about everything we might want to use. All the commonly used PHP modules are all listed in one place (<a href="http://php.net/manual/en/funcref.php" rel="nofollow">http://php.net/manual/en/funcref.php</a>).</p> <p>One of the difficulties of starting with C++ is that we always have to search all over the web for one (often one of many) equivalent of a php function.</p> <p>It'd be nice to have a place where there is a table with the equivalent C++ library (or header) for each PHP module or group of function.</p>
php c++
[2, 6]
4,867,767
4,867,768
Using jQuery or JavaScript to Add Attribute to Anchors After DOM Already Loaded
<p>I have an application that requires the "ontouchstart" attribute to be added to each and every anchor in order to have the anchor:active CSS state to work on iOS devices.</p> <p>Trouble is that the entire application loads content via AJAX after the DOM has already loaded, which means any <code>$(selector).attr('ontouchstart','')</code> call will only work on the initial screen, not content added later via AJAX.</p> <p>Because each screen is being loaded by separate functions (in some cases being constructed by the function itself) I would like to find a solution that allows a single jQuery or JavaScript call that applies to all anchors, even those added after the DOM is loaded rather than going through each and every function and adding in the call individually (there are hundreds of them).</p> <p>Is this even possible? Any help would be greatly appreciated.</p>
javascript jquery
[3, 5]
2,529,760
2,529,761
double click needed to activate binded mousedown/up
<p>this is part of my code:</p> <pre><code>$('.toggle_box').each(function (){ var timeout, longtouch; $(this).bind('mousedown', function() { timeout = setTimeout(function() { longtouch = true; }, 1000); $(this).bind('mouseup', function(){ if (!longtouch) { clearTimeout(timeout) var state = $(this).find('.switch').attr('data-state'); if(state == "off"){ $(this).find('.switch').attr('data-state','on'); } else{ $(this).find('.switch').attr('data-state','off'); } var choice = $(this).parent(); ckbmovestate(choice) } else{ alert("3") }; }); }) }); </code></pre> <p>when I click an element (mousedown and up) it works fine, but the 2e time I have to double click the element for it to fire. It looks like the second click resets the bind so that the 3e can use it again. just weird.</p> <p>Here is a demo: Not valid anymore... It is the orange checkbox :) (please check in safari/chrome)</p> <p>thank you for your help :)</p>
javascript jquery
[3, 5]
3,803,182
3,803,183
Use jQuery to set background color with value from database
<p>I'm looking for an example of how I would read a value from a database and use it in a jQuery script to set the background color of a control. I'm still learning jQuery, and it's not clear to me how to get a value from the database. I'm using ASP.NET MVC, and my form is already pulling the value - do I need to put it in a hidden field and use it that way, or is there a better/different way to communicate the color value to jQuery?</p>
asp.net javascript jquery
[9, 3, 5]
5,631,946
5,631,947
Binding a php variable with Jquery slider
<p>I have two JQuery sliders, value of "Second_Slider" gets updated and a div named "amount2" as well as it should.</p> <p>Now i want to update an php variable to the value of "Second_Slider" also. how can i achieve this?</p> <pre><code> $( "#Slider" ).bind( "slide", function(event, ui) { $("#Second_Slider").slider({ value:300 }); $( "#amount2" ).val( "$" + $( "#Second_Slider" ).slider( "value" ) ); &lt;?php $Php_Var_I_Want_to_Change = "what-do-i-put-here? ?&gt; }; </code></pre>
php javascript jquery
[2, 3, 5]
2,113,521
2,113,522
using tree node class in c#
<p>I have a tree node and the tree node can be checked. The thing is that I need to be able to gray out or disable a specific node programmatically. So for instance</p> <pre><code> [] Head Node [sub Node] [sub Node] [] another node 1 [] another node 2 </code></pre> <p>So lets say that I check "another node 2" then it should not dissapear but instead appear grayed out or disabled but still visible</p> <p>so it would look like this</p> <pre><code> [] Head Node [sub Node] [sub Node] [] another node 1 [X] another node 2 //and this would be disabled but still visible </code></pre> <p>I hope you understand what I want to do just not sure how to disable it and still keep it visible.</p> <p>Thank you</p>
c# asp.net
[0, 9]
2,916,187
2,916,188
Javascript for check and uncheck detection for the checkbox list control
<p>I want to write javascript logic for the check box list asp.net control, that if some condition in check box selection is true then select all, else deselect all. How to figure out this check uncheck and there value using javascript? </p>
javascript asp.net
[3, 9]
3,857,438
3,857,439
redirect to the same page without changes in that page
<p>i have a web page with a hyperlink that set target to a _blank page. In that page if i click a button i need to get the text generate in that button to the previous page without changing the details on the previous page. </p> <p>this is the parent text code.</p> <pre><code>&lt;asp:TextBox id="txtMatId" runat="server" &gt;&lt;/asp:TextBox&gt; target _blank page code; &lt;asp:GridView id="grdMaterial" runat="server" AllowPaging="True" BackColor="Lime" DataKeyNames="item_Id" AutoGenerateColumns="False" BorderColor="Red" OnSelectedIndexChanged="grdMaterial_SelectedIndexChanged"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt;&lt;ItemTemplate&gt; &lt;asp:LinkButton id="lnkSelect" onclick="lnkSelect_Click" runat="server" __designer:wfdid="w102" PostBackUrl="~/Merchandiser/MNewOrder.aspx"&gt;Select&lt;/asp:LinkButton&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:BoundField DataField="item_Id" HeaderText="Item Id"&gt;&lt;/asp:BoundField&gt; &lt;asp:TemplateField&gt;&lt;ItemTemplate&gt; &lt;asp:Image id="imgItemImage" runat="server" ImageeUrl='&lt;%# Eval("mat_Image") %&gt;' &gt;&lt;/asp:Image&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>want to redirect to the parent page by setting the itemid value to the parent page text field without changing the selected dropdownlist values. </p>
c# asp.net
[0, 9]
2,104,156
2,104,157
Unresponsive Fade-In Fade-Out in Jquery
<p>I am implementing a twitter-style follow/unfollow functionality with the following jquery.</p> <pre><code>$(function() { $(".follow").click(function(){ var element = $(this); var I = element.attr("id"); var info = 'id=' + I; $("#loading").html('&lt;img src="loader.gif" &gt;'); $.ajax({ type: "POST", url: "follow.php", data: info, success: function(){ $("#loading").ajaxComplete(function(){}).slideUp(); $('#follow'+I).fadeOut(200).hide(); $('#remove'+I).fadeIn(200).show(); } }); return false; }); }); </code></pre> <p>I have a similar unfollow function. However i have the following problem:</p> <p>When I have <code>N</code> items <code>{1,2..i.N}</code> each with <code>id = followi</code> and I click on the follow button. I find that some of the items respond while others do not. I suspect it is a pure javascript issue...otherwise i figure none of the buttons would respond at all.</p> <p>Is it a timing issue...all help is appreciated. Also i'd appreciate it if you could point me to a simpler method.</p> <p>Thanks!</p>
php javascript jquery
[2, 3, 5]
2,594,939
2,594,940
generate php in javascript?
<pre><code>var page_my_code_is_on = (document.referrer); document.write("&lt;?php echo '" + page_my_code_is_on + "'; ?&gt;"); </code></pre> <p>how can I write the above php as a var within the js, as opposed to <code>echo</code> ?</p> <p>I read the following but it did not work for me</p> <p><a href="http://www.webcheatsheet.com/PHP/passing_javascript_variables_php.php" rel="nofollow">http://www.webcheatsheet.com/PHP/passing_javascript_variables_php.php</a></p>
php javascript
[2, 3]
5,238,928
5,238,929
form validation using javascript in changing input tags
<p>I need to validate a form using JavaScript. The form keep changes since I am using data from a field name table to print each field (like name, address, phone no.). I'm using a loop to print the label for field and corresponding text input tag. (eg. name : textbox to enter name, phone no : textbox to enter phone no.) And at last getting these values in an array when submitting the form and entering into details table.</p> <p>Following is the code for printing each field and text box:</p> <pre><code>while ($row=mysql_fetch_array($result)){ echo'&lt;labelfor='.$row['field_name'].'name=field_id&gt;'.$row['field_name'].':&lt;/label&gt;'; echo'&lt;inputtype="text" name=field_name[]id="'.$row['field_id'].'":value="'.$row['field_value'].'" size="20" class = "inpBox" &gt;'; } </code></pre> <p>Now I need to check whether these fields are empty using JavaScript and then change the style of that particular text box. Any help will be greatly appreciated.</p>
php javascript
[2, 3]
3,937,536
3,937,537
How to execute JavaScript on UserControl PostBack in asp.net?
<p>We have an asp.net page that consists of multiple user controls, many of which have the <code>visible</code> attribute set to <code>false</code>. By selecting a radio button, one of the user controls is shown by setting the <code>visible</code> attribute to <code>true</code> in the code-behind. When this happens, we want a JavaScript function to be run. The script has been registered using <code>ScriptManager.RegisterStartUpScript</code> in the <code>Page_Load</code> method of the page.</p> <p>How can we make this work?</p> <p>Things we've tried:</p> <ul> <li>Register script in the user control (both code-behind and markup)</li> <li>Trying some of the other methods available on the <code>ScriptManager</code></li> <li>Using jQuery <code>$(document).ready()</code></li> </ul> <p>But in all cases the script is only executed when the page is loaded/reloaded. The only <em>hack</em> that seems to work, is calling the function inside the <code>pageLoad()</code> function as this function gets called after every PostBack.</p>
javascript asp.net
[3, 9]
395,252
395,253
Restrict single and double quotes in textbox in ASP.NET
<p>I want to restrict sinqles qoutes and double quotes to enter to a Textbox in Asp.net. How can i achieve it? How can i validate the textbox?</p>
c# asp.net
[0, 9]
1,675,181
1,675,182
Is there a way to set a asp.net button's CommandArgument in javascript?
<p>I have a GridView that lists a bunch of items and one of the columns has a link that displays a modal (AjaxToolkit ModalPopupExtender). Let's call that link "Show". In that modal, I have a asp:button for saving the data entered in that modal. Let's call that button "Save"</p> <p>So when the user clicks on a "Show" link in a certain row, I'd like write some javascript that sets something in the "Save" button, so that in my code-behind, I can handle "Save".Command and use the CommandEventArgs parameter to get the value.</p> <p>Is this possible, or do I just need to use a hidden input tag and set its value? </p>
asp.net javascript
[9, 3]
2,423,481
2,423,482
use jquery functions on PHP string
<p>I'm searching for a php library which i can use like jquery on a php string. I have a string in php</p> <pre><code>$html = "&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;&lt;span&gt;test&lt;/span&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;"; </code></pre> <p>Now I want to use functions like $("body").find("div span").text();</p> <p>Is there something like this available? I know you can solve this with regular expressions but the html -string is more complex than this example so I don't think this is a proper solution.</p> <p>Already thanks!</p>
php jquery
[2, 5]
1,387,643
1,387,644
How to show the Birthdate in mm/dd/yyyy format if year is separated from it?
<p>I have a modalpopup inside it I have checkboxes,when I check the checkboxes and save the changes there is a dynamically created table with dynamically generated labels.I have a checkbox Birthdate inside the modal popup which shows the mm/dd only.And another checkbox below it that will show the year only, and will be visible if Birthdate checkbox is checked. I want to show that if Birthdate checkbox is checked and the save button is clicked then insisde the dynamic table it will show the mm/dd only.And if year checkbox is checked ,and the save button is clicked, then it will show the Birthdate inside the dynamically created table as mm/dd/year.</p>
c# asp.net
[0, 9]
5,318,977
5,318,978
client side validation and server side validation in java script and asp.net respectively?
<p>hi all i want to know that can we validate a control which is out side a form element in asp.net(server side validation)and outside a form element in html(client side validation) let's take a closer look </p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;input type="text" name="first name"/&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>can we apply clien side validation on above text box by java script ?</p> <p>in asp.net </p> <pre><code>&lt;form runat="server"&gt; &lt;/form&gt; &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>here i have written textbox after the form will it validate at server side ?</p>
javascript asp.net
[3, 9]
3,755,373
3,755,374
How to get all elements within a div
<p>How can i get all the elements inside a div except some specific div For eg if the structure is as follows</p> <pre><code>&lt;div id="abc"&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="pqr"&gt; patil&lt;/div&gt; &lt;div class="pqr"&gt; sagar patil&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="pqr"&gt; rocky&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; &lt;div class="pqr"&gt; sfs&lt;/div&gt; &lt;div class="def"&gt; sagar patil&lt;/div&gt; </code></pre> <p></p> <p>Now suppose i want the html structure of main div i.e. div abc but without the content of div pqr i.e. i want all the stuff inside div abc but without div pqr</p> <p>Thanks in advanced</p>
javascript jquery
[3, 5]
3,606,994
3,606,995
controlling vibration intensity in android phones? is it possible?
<p>I am developing a game. In which, i want do set different vibration intensities for different events. I just want know if its really possible to control the vibration intensity and duration. Any advice or reference links, could be very helpful. Thanks in advance.</p>
java android
[1, 4]
3,250,742
3,250,743
JQuery remove selected rows from a table
<p>Suppose I have a table:</p> <pre><code> &lt;table id="mytable"&gt; &lt;tr&gt;1&lt;/tr&gt; &lt;tr&gt;2&lt;/tr&gt; &lt;tr&gt;3&lt;/tr&gt; &lt;tr&gt;4&lt;/tr&gt; &lt;tr&gt;5&lt;/tr&gt; &lt;tr&gt;6&lt;/tr&gt; ... ... &lt;/table&gt; </code></pre> <p>I know you can use <code>('#mytable').find("tr:gt(n)").remove();</code> to remove all rows after nth row. But is there a similar function to let you specify a range of rows you want to remove? say I want to remove row 2 to row 5? or I just want to remove row 2?</p> <p>do i have to add an id to each row to achieve this?</p> <p>thanks</p>
javascript jquery
[3, 5]