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 |
---|---|---|---|---|---|
683,345 | 683,346 | Store different passwords in android | <p>I am developing an android app which requires multiple default passwords to be stored</p>
<p>Based on the password entered by the user, he will be shown different forms to be filled.</p>
<p>What is the best solution to store the default passwords if the number of default passwords are more say(10 to 20)?</p>
<p>Thanking you
Yours Sincerely
ChinniKrishna Kothapalli</p>
| java android | [1, 4] |
1,741,342 | 1,741,343 | How to handle Android portrait and landscape in code? | <p>I'm developing an application in two languages (Arabic and English), When the user press on a Button in the first activity it views another activity contains (Timer, array of strings and many different values)<br>
When the user change between portrait and landscape the values lost, How to handle this problem (Keeping the values and the objects)</p>
<p>Kind Regards,</p>
| java android | [1, 4] |
3,102,012 | 3,102,013 | Size of my Spinner too big | <p>My huge spinner: <a href="http://i.stack.imgur.com/zNxdX.jpg" rel="nofollow">http://i.stack.imgur.com/zNxdX.jpg</a></p>
<p>As you can see in the picture, my spinner is way too huge. I can't seem to find the problem.
Here is the code:</p>
<pre><code> RelativeLayout.LayoutParams lpSpinner = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
spTest = new Spinner(this);
String[] spinnerArray={"1","2","3","4","5","6","7","8","9","10"};
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, spinnerArray);
spTest.setAdapter(spinnerArrayAdapter);
spTest.setId(4);
lpSpinner.addRule(RelativeLayout.ALIGN_RIGHT, lblText.getId());
relative.addView(spTest, lpSpinner);
</code></pre>
<p>what am i doing wrong?</p>
| java android | [1, 4] |
830,109 | 830,110 | Jquery Keep Autosuggestion Box Show With Last Input | <p>I have an Jquery auto suggestion box, the function is ok. Now I want to when textbox not empty or last input by user, and when user click that textbox again, the suggestion box will appear.</p>
<p>Here is the JS :</p>
<pre><code>function suggest(inputString)
{
if(inputString.length == 0)
{
$('#suggestions').fadeOut();
}
else
{
$('#de_no').addClass('load');
$.post("autosuggest.php", {queryString: ""+inputString+""}, function(data)
{
if(data.length >0)
{
$('#suggestions').fadeIn();
$('#suggestionsList').html(data);
$('#de_no').removeClass('load');
}
});
}
}
</code></pre>
<p>I have ever put this :</p>
<pre><code>else if(inputString.length != '')
{
$('#suggestions').fadeIn();
}
</code></pre>
<p>But, its not work.
Anyone can give me a suggestions ?
Thanks</p>
| javascript jquery | [3, 5] |
5,872,959 | 5,872,960 | Download file in chunks | <p>I've got the problem as below:
There is some SOAP web service which allows to read stream files. I need to read the whole file divided to chunks and transmit to user. All actions should do not block UI main thread: user presses 'Save' button on save file dialog, and is able to move on to the next page or perform another action. I will be grateful for the sample solution. Note that the solution should work with IIS 5.1.</p>
<p>Regards,
Jimmy</p>
| c# asp.net | [0, 9] |
4,774,518 | 4,774,519 | How to fire a rowclick event | <p>How can i trigger a row click event in ASP.NET GridView</p>
| c# asp.net | [0, 9] |
2,351,000 | 2,351,001 | Why Viewstate can contain only serializable object? | <p>I have a simple class with some properties and other data. Untill i stick serializable attribute to the class, i cannot save the object of the class into the viewstate.</p>
<p>Why Viewstate can contain only serializable objects?</p>
| c# asp.net | [0, 9] |
2,145,492 | 2,145,493 | Are JQuery and its peers helping or hurting JavaScript Knowledge? | <p>I noticed most questions related to client-side script on SO are JQuery related and that got me thinking. I'm wondering what the ease of these libraries is doing to actual KNOWLEDGE of JavaScript and the DOM. </p>
<p>So much is done for you that my fear is there is a growing number of web developers that actually know very little about JavaScript besides how to include the JQuery library and use the plug-ins they download. It's the "fast food" approach to software development and, based on nothing more than anecdotal evidence, I think a lot of web "developers" would be in the dark when it comes to client script if they were suddenly unable to use the JQeury library.</p>
<p>My Question: Are these libraries helping or hurting REAL knowledge of client-side scripting?</p>
| javascript jquery | [3, 5] |
3,383,590 | 3,383,591 | insert text into textarea when option selected | <p>I need your help.
I'm trying to insert some text into a textarea-element when the url contains 'number' and an option with value='option2' of a selectbox is selected.
<code><pre>
var contentToInsert = 'Text';
if (location.href.indexOf("/number")) {
if (value of selectbox == 'option2') {
$("textarea").append(contentToInsert);
}
}
</pre></code></p>
<p>How do I check when the option is selected?
The text to insert shouldn't be shown when another option is selected.
So this would mean that I need on event-handler like onchange.</p>
<p>Have you got an idea?</p>
| javascript jquery | [3, 5] |
4,956,091 | 4,956,092 | How get values from dynamically created textbox's in another click event in asp.net? | <p>I am adding dynamic textbox's to a panel in page load event, But I'm not able to access textbox's in button click event and it is showing panel controls count ZERO(0) in button click event. Please give me solution to access text box values in button click event .</p>
<p>Thanks in advise.</p>
| c# asp.net | [0, 9] |
5,331,981 | 5,331,982 | Jquery problem with plugin | <p>I have PHP page where users can upload photos (using Ajax & PHP script). Those uploaded photos (thumbs) are shown after upload in DIV below upload field and fancybox plugin (I'm using it for popup window for photos) is working ok then.</p>
<p>Then, after hitting send button I want to clone that DIV at that same page at message board, bellow other messages with or without uploaded photos.</p>
<p>When I try to do that with:</p>
<pre><code>var pht = $("#photos").clone().addClass('p_pht');
</code></pre>
<p>and try to display sent photos bellow sent message like this:</p>
<pre><code>$("div#wall").append('<div class=msg>'+ message +'</div><div class=n_pht>'+ pht.html() +'</div>');
</code></pre>
<p>Fancybox plugin don't work. Only the link is working but not with popup window as it should be.</p>
<p>What am I doing wrong?</p>
| php jquery | [2, 5] |
3,626,406 | 3,626,407 | how to show image from server without downloading it android | <p>I am building an Android app that will show images - based on exact GPS location. </p>
<p>My idea is to show these images from server <strong>without downloading</strong> them to phone. That way you can view them only if you have downloaded that app and have internet access.</p>
<p>Is it possible in Android?? </p>
| java android | [1, 4] |
4,663,187 | 4,663,188 | asp.net for finding how long a user spend in a website | <p>How to find how long a user spend in a website . It is to find the time span a user send in a website.</p>
| c# asp.net | [0, 9] |
4,066,159 | 4,066,160 | Multiple Checkbox post | <p>What is the best way to post muliple checkbox value and its siblings in jquery and get the post values in arrays by PHP?I have to get all values of checkbox and td.How can I do this?</p>
<p>Here is my checkbox in a table</p>
<pre><code><form action="test.php">
<table>
<tr><td><input type="checkbox" name="event[]" id="event" value="A">1</td> <td>James</td></tr>
<tr><td><input type="checkbox" name="event[]" id="event" value="B">2</td> <td>Dave</td></tr>
<tr><td><input type="checkbox" name="event[]" id="event" value="C">3</td> <td>Bal</td></tr>
<tr><td><input type="checkbox" name="event[]" id="event" value="D">4</td> <td>Tim</td></tr>
<tr><td><input type="checkbox" name="event[]" id="event" value="E">5</td ><td>Ester</td></tr>
</table>
<input type="submit" name="submit" />
</form>
</code></pre>
<p>I should get all post data of checkboxes like this inlcuding the td values.
[event] => Array
(
[0] => array(A,James)
[1] => array(B,Dave)
)</p>
| php jquery | [2, 5] |
1,893,111 | 1,893,112 | gridview all rows count | <p>I want to retrieve all rows count of Gridview.</p>
<p>When I try this </p>
<pre><code> GridView1.Rows.Count.ToString()
</code></pre>
<p>it returns only active page items count.</p>
<p>I m using generic list of my custom class as my GridView's data source . </p>
<p>How can I do this?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
1,432,382 | 1,432,383 | How do you handle attaching JavaScript to UserControls in ASP.NET and keep multiple instance isolated? | <p>Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?</p>
| asp.net javascript | [9, 3] |
3,759,256 | 3,759,257 | android: call javascript from java problem | <p>I want to know if there is way to call javascript from java on android?
In my program, I interact java and javascript together. I am using java to receive response(json data) from TCP server and save them into a file. In webview I am using javascript jQuery getJSON() function to retrieve that file and using jQuery plot chart library to draw chart. Now, there is no relationship between java and javascript. Every time when I update data and file, I still need to click a button in webview to trigger the draw function. I want the programmes to be smart and handy. Is that a way to call or execute javascript from java. I know one way:</p>
<pre><code>Button update = (Button)findViewById(R.id.update);
update.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
wv.loadUrl("javascript:document.write('hello')");
}
});
</code></pre>
<p>But the problem is I already do a index page by loadurl().</p>
<pre><code>final WebView wv = (WebView) findViewById(R.id.webkankan);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl("file:///android_asset/index.html");
</code></pre>
<p>When I trigger this click event, all contents were gone only a string "hello" there. Another thing is why I need to change webview's type to final to avoid eclipse error. Does this is the problem to trigger my main problem? If so, how can I fix it?
Thanks for you patience.
Cheers!</p>
| java javascript android | [1, 3, 4] |
2,345,761 | 2,345,762 | Save selected value of a dropdown list in a global variable | <p>I am trying to save the dropdown list selected value in a glbal variable .. I have lots of country on the dropdown list , whan I choose one of them and press a button :</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
Button2.Enabled = true;
Button2.Visible = true;
DropDownList1.Visible = true;
DropDownList9.Items.Clear();
if (!Class1.Search_Continent.Equals("-"))
{
SqlConnection conn1 = new SqlConnection(@"Data Source=AK-PC\MSSQLSERVER1;Initial Catalog=DB;Integrated Security=True");
conn1.Open();
SqlCommand cmd1 = new SqlCommand("Select Country_name FROM Country WHERE Continent_name='" + DropDownList1.SelectedValue + "'", conn1);
SqlDataReader dr1;
dr1 = cmd1.ExecuteReader();
while (dr1.Read())
{ DropDownList9.Items.Add(dr1["Country_name"].ToString() + "\n"); }
dr1.Close();
conn1.Close();
</code></pre>
<p>}</p>
<pre><code>protected void Button2_Click(object sender, EventArgs e)
{
// Redirect to Country page
Class1.CountryName = DropDownList9.SelectedValue.ToString();
Response.Redirect("Country.aspx", true);
}
</code></pre>
<p>it doesnt take the selected value ! it always take the first value of the dropdown list !
Please help me !</p>
| c# asp.net | [0, 9] |
2,344,521 | 2,344,522 | no line breaks in firebug when dynamically loading script with jQuery | <p>When I dynamically load a script with jquery</p>
<pre><code>...
options = {
dataType: "script",
cache: true,
url: "...appContr.js"
}
return jQuery.ajax(options);
...
</code></pre>
<p>and I debug the script with firebug, this script has the name "1" and everything is in
one line (or in a few lines). I cannot use this for debugging.</p>
<p>I use Firefox 10.0.2 and Firebug 1.9.1.</p>
<p>When I use LAB.js </p>
<pre><code>$LAB.script("...appContr.js").wait(function() {
...
});
</code></pre>
<p>or require.js</p>
<p>The file has its line breaks and the name of the script is "appContr". </p>
<p>How can I change the jQuery command in order to get the same result?</p>
<p>Thanks a lot in advance</p>
<p>EDIT: </p>
<p>Thank you, Headshota, for your answer, but this does not help.<br>
Besides, getscript does not cache the contents, and this is important for me.</p>
<p>EDIT:</p>
<p>Thank you, Marlin, for your answer:</p>
<p>The whole thing works without firebug enhancements when I load the script with lab.js or require.js, the problem is only with jquery script loading. </p>
<p>In firebug I have the tabs console, html, css, script, dom and network.
If I go - after jquery script loading - to script and view the script, there are no line breaks in the code.<br>
But when I go to the "tab" console, I have one entry for the get request. When I click
"answer" in this get request, the script contains the line breaks. But this does not help me because in the "script" tag the line breaks are missing.</p>
| javascript jquery | [3, 5] |
5,155,051 | 5,155,052 | InnerHtml empty in HtmlContainerControl ASP.NET | <p>I have a rather specific question, that I couldn't find googling.</p>
<p>I have a div with a runat server like this:</p>
<pre><code><div id="Menu" runat="server">
<!--code-->
<div><%= SomeValue %></div>
<!--code-->
</div>
</code></pre>
<p>The problem is that I need the InnerHtml of the element before the page finishes it's life cicle (to globalize it), but when I add the <code><%=%></code> the InnerHtml property comes back as <code>""</code> (if I remove it, it works fine).</p>
<p>For example:</p>
<p>1</p>
<pre><code><div id="Menu" runat="server">
<span>Hi!</span>
</div>
//Menu.InnerHtml == "<span>Hi!</span>";
</code></pre>
<p>2</p>
<pre><code><div id="Menu" runat="server">
<span>Hi!</span>
<div><%= SomeValue %></div>
</div>
//Menu.InnerHtml == "";
</code></pre>
<p>Is there a way to have the InnerHtml and print <code>SomeValue</code> at the same time?</p>
<p>I guess can get around this some other way and this isn't really a good option, but I am dealing with existing code.</p>
<p>Thanks!</p>
| c# asp.net | [0, 9] |
1,633,441 | 1,633,442 | Disable submit button on form submit | <p>I wrote this code to disable submit buttons on my website after the click:</p>
<pre><code>$('input[type=submit]').click(function(){
$(this).attr('disabled', 'disabled');
});
</code></pre>
<p>Unfortunately, it doesn't send the form. How can I fix this?</p>
<p><strong>EDIT</strong>
I'd like to bind the submit, not the form :)</p>
| javascript jquery | [3, 5] |
5,442,887 | 5,442,888 | Unable to load the Javascript calendar on Href by using Jquery function | <p>I have my function as follows</p>
<pre><code> <script type="text/javascript">
$(function() {
$('#ctl00_ContentPlaceHolder1_TextBox2').datepick();
});
function showDate(date) {
//alert('The date chosen is ' + date);
}
</script>
</code></pre>
<p>I need this to be called when i click on <code>Href</code> tag </p>
<pre><code><a onclick="" href="#">
Metaforce as per you said i tried this
<script type="text/javascript">
$(function click() {
$('#ctl00_ContentPlaceHolder1_TextBox2').datepick();
});
function showDate(date) {
//alert('The date chosen is ' + date);
}
</script>
<a onclick="return click();" href="#">
<img alt="cal" src="calendar.gif" style="vertical-align: text-bottom;" border="0" /></a>
</code></pre>
<p>In <code>onclick</code> i have to call that how can i any help please</p>
<p><code>Patrick Kaufmann and Phillip Kovalev</code> as per your said i write as follows</p>
<pre><code> <script type="text/javascript">
function showDate(date) {
//alert('The date chosen is ' + date);
}
$(function() {
$('#ctl00_ContentPlaceHolder1_TextBox2').datepick();
// assign anonimous function as event handler and call showdate from it
$('#clickOnIt').click( function() {
showDate( $(this).val() );
} );
});
</script>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<a href="#" id="clickOnIt">click me</a>
</code></pre>
<p>But i am not getting the desired calendar</p>
| jquery asp.net | [5, 9] |
3,922,281 | 3,922,282 | How do you retrieve the image source of an image that the user has clicked on? (jQuery) | <p>I am trying to retrieve the image source of an image that the user has clicked on.
This is what I have and it doesn't seem to be working:</p>
<pre><code>var imgSrc = getSrc(image)
function getSrc(image) {
$('img').each(function() {
$(this).click(function() {
$(this).attr('src')
}); //end click
}); //end each
} //end getSrc
</code></pre>
| javascript jquery | [3, 5] |
5,953,596 | 5,953,597 | How to format the output of the javascript function date() ? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3552461/how-to-format-javascript-date">how to format javascript date</a> </p>
</blockquote>
<p>I have the following bit of code </p>
<pre><code> $('#ins_date').attr('value', Date());
</code></pre>
<p>What i get is this : Wed Mar 21 2012 17:52:32 GMT+0100 (Romance Standard Time)</p>
<p>How could i format this string to get somethingh like this : 2012-03-01</p>
| javascript jquery | [3, 5] |
4,903,370 | 4,903,371 | Image caching in when using javascript | <p>its common place to use javascript like in this exsample:</p>
<p>Example: <a href="http://www.htmlite.com/JS019.php" rel="nofollow">http://www.htmlite.com/JS019.php</a></p>
<p>My question is: Does the second image download each time or is it cached when the page first loads. If so how does the server know to cache the image?</p>
| javascript asp.net | [3, 9] |
621,248 | 621,249 | Verifying proper transfer of JSON packet to iOS device | <p>I was wondering what is an easy and good way to verify my packet was transferred to the iPad successfully?</p>
<p>What I thought I could do, is pass the file size with the JSON object on the server side, and verify it's the same size on the iPad. On the server side, it's a rest service written in C#. I know I can get the FileInfo(file).length that is being transferred. However, on the iPad, because this packet is being serialized as JSON, my tab-delimited text file now has more characters in it. So if I write that file to disk, the file is much larger than it originally was. </p>
| c# iphone | [0, 8] |
1,295,573 | 1,295,574 | Can "external" javascript functions call "jQuery functions"? | <p>I have this code:</p>
<pre><code>(function ($) {
$(document).ready(function() {
test("hola","caracola");
});
function test(somevar1, somevar2)
{
alert(somevar1+ "" + somevar2);
}
}(jQuery));
function atest2(somevar1, somevar2)
{
test(somevar1+ "" + somevar2);
}
</code></pre>
<p>when executing test2 function the result is:</p>
<pre><code>ReferenceError: test is not defined
</code></pre>
<p>My question is:</p>
<p>How can I call test2 to execute correctly jQuery's inner test function?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,369,945 | 2,369,946 | Passing multiple Eval parameters to a JavaScript function from ASPX | <p>I already know how it works with a single parameter </p>
<pre><code>OnClientClick='<%# String.Format("confirm_ticket({0});return false;",DataBinder.Eval(Container,"DataItem.idAgir"))%> '
</code></pre>
<p>but is it possible to pass 2 parameters?</p>
<p>thanks in advance</p>
| c# javascript asp.net | [0, 3, 9] |
463,193 | 463,194 | Multiple Gradient for single Textview | <p>Refering agradient to textview regard as normal action can be achieved in android ,</p>
<p>as below :</p>
<pre><code> android:background="@drawable/gredient"
</code></pre>
<p>and gradient XML will be as below code :</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#B22222" android:centerColor="#000000"
android:endColor="#B22222" android:angle="0" />
<corners android:radius="15dp" />
</shape>
</code></pre>
<p><strong>what im asking about</strong> is there is away in android to <strong>apply multiple gradients to single textview</strong> consisting of may paragraphs , so each paragraph will has different gradient .</p>
<p>any advice will be appreciated , </p>
<p>thanks</p>
| java android | [1, 4] |
3,175,743 | 3,175,744 | lightweight jQuery countdown | <p>I've seen some really nice looking jQuery plugins to count down the number of day, hours, minutes and seconds. They use images and look great.
But I'm looking for a simple little countdown that populates a div with the number of seconds remaining.
I'm going to use it in conjunction with:</p>
<pre><code>function submitform() {
document.forms[0].submit();
}
jQuery(function($) {
setInterval("submitform()",20000);
});
</code></pre>
<p>I just want something real unobtrusive in the corner somewhere to let them know that the page is about to refresh all by itself.</p>
| javascript jquery | [3, 5] |
4,473,897 | 4,473,898 | Always return true when click on button when use jquery dialog | <p>I am using jquery dialog box. When I click on Button popup is open but it return true and excute server side event of button.</p>
<p>I want when user clicks on yes then return true and else return false.</p>
<pre><code> function btnCancelClick()
{
$("#dialog:ui-dialog").dialog("destroy");
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
width: 400,
modal: true,
buttons: {
"Yes": function ()
{
$(this).dialog("close");
return true;
},
No: function ()
{
$(this).dialog("close");
return false;
}
}
});
}
<asp:Button ID="btnCancel" runat="server" Text="Cancel Appointment" CssClass="cssbutton"
OnClientClick="return btnCancelClick();" OnClick="btnCancel_Click" />
</code></pre>
| javascript jquery | [3, 5] |
4,809,910 | 4,809,911 | How to make Jquery Validation Error Messages Dynamic? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5618499/jquery-validation-in-different-languages">jQuery validation in different languages</a> </p>
</blockquote>
<p>I am using jquery.validate.js. And I need to show up the error messages in two languages. How can I do this? How can I make the error messages dynamic?</p>
| php jquery | [2, 5] |
3,760,647 | 3,760,648 | Check whether radio button is checked or not in jquery | <pre><code> <input type="radio" name="a" />
<input type="radio" name="a" />
<input type="radio" name="b" />
<input type="radio" name="b" />
</code></pre>
<p>I want to make sure that the <code>both group</code> of <code>radiobutton</code> must be checked, for this i tried :</p>
<pre><code>if($("input[type=radio,name=a]:checked").length > 0 &&
$("input[type=radio,name=b]:checked").length > 0)
{
/* do something */
}
</code></pre>
<p>But not working , can anybody tell me why?</p>
| javascript jquery | [3, 5] |
593,993 | 593,994 | append and appendTo working inconsistently | <p>I'm trying to build a small portfolio and I came up with the script below.
The problem I'm facing is the fact that there are times when append() doesn't seem to work. Same with appendTo() that I also tried.</p>
<p>I mean the script works but the append() function is inconsistant. </p>
<p>Any help will be highly appreciated.</p>
<pre><code>function TMP_folio_logo(action) {
var logos = Array(
"logo-1.png",
"logo-2.png",
"logo-3.png",
"logo-4.png",
"logo-5.png",
"logo-6.png",
"logo-7.png",
"logo-8.png",
"logo-9.png",
"logo-10.png"
);
if (action == 'undo') {
$('#fff').stop(true, false);
$('#fff').empty();
hd_folioLEFT = 0;
hd_folioLNUM = 0;
}
if (action == 'do') {
var code = '';
if (hd_folioLNUM >= logos.length) hd_folioLNUM = 0;
for (k=hd_folioLNUM; k < (hd_folioLNUM + 4); k++) {
if (k < logos.length) {
code += "<div style='left:" + hd_folioLEFT + "px'><img src='"+ hd_folioPATH + logos[k] +"'></div>";
hd_folioLEFT += 700;
}
}
//$('#fff').append(code);
$(code).appendTo('#fff');
$('#fff').delay(4000).animate({left: '-=700'}, 1000, 'swing', function () {
TMP_folio_logo('do');
});
hd_folioLNUM = hd_folioLNUM + 4;
}
}
</code></pre>
| javascript jquery | [3, 5] |
1,298,836 | 1,298,837 | What is difference between black and other colors in Android? | <p>Sorry, about my poor English. :c</p>
<p>I'm just trying to draw line by touch event in android.
But some problem is here.</p>
<p>When I try to draw black line, it works normally.
But When I try to draw line using other colors, it makes some kind of shade..</p>
<p>I want to know the reason why.</p>
<pre><code>public void run(){
int tempAngle;
Canvas canvas = null;
while(flag){
canvas = mHolder.lockCanvas();
try{
synchronized (mHolder) {
canvas.drawBitmap(imgBack, 0,0,null);//draw background image(.png)
tempAngle = checkAngle((int)x2,(int)y2);
if(centerFlag2){
// mPaint.setColor(Color.Black) is working normally, but other
// colors(Color.WHITE,RED,.etc) makes some kind of shade.
// It just keep exists past lines on surface view.
// But I don't know the reason why.
canvas.drawLine(width/2, width/2, x1, y1, mPaint);//draw a line.
checkNumber(tempAngle);
}
if(centerFlag){
canvas.drawLine(width/2, width/2, x1, y1, mPaint);
checkNumber(tempAngle);
}
if(hourFlag){
canvas.drawLine(width/2, width/2, tempX, tempY, mPaint2);
}
}
}finally{
if(canvas!=null){
mHolder.unlockCanvasAndPost(canvas);
}
}
}
}
</code></pre>
| java android | [1, 4] |
5,086,169 | 5,086,170 | using php _GET | <p>I am asking two things. </p>
<ol>
<li><p>The first question is am I doing this correctly? I am putting together a link with javascript variables</p>
<pre><code>http://google.com/test.php?var="+class4
</code></pre>
<p>And then I am using php to get the values of the variables from the URL</p></li>
<li><p>Can I use a link at all to do the variables or must I use a button? When using the link nothing shows in the url after the <code>?</code>.</p></li>
</ol>
| php javascript | [2, 3] |
1,676,376 | 1,676,377 | How to get current time of an html video in c# codebehind? | <p>I have added video control in ASP.NET page.</p>
<pre class="lang-xml prettyprint-override"><code><video controls id="movie" width="610" height="344" runat="server" preload="">
</video>
</code></pre>
<p>Javascript version is below:</p>
<pre class="lang-js prettyprint-override"><code>var v = $("#<%=movie.ClientID%>");
var video = v.get()[0];
</code></pre>
<p>I can get current time with below line in Javascript.</p>
<pre class="lang-js prettyprint-override"><code>video.currentTime
</code></pre>
<p>How can I get it from code behind?</p>
| c# javascript | [0, 3] |
2,002,422 | 2,002,423 | PHP and Python static methods in objects, two different worlds...? | <p>i'm php coder, trying to get into python world, and it's very hard for me.</p>
<p>Biggest enjoy of static methods in php is automatic builder of instance. No need to declare object, if you needed it once, in every file (or with different constructor params , in one line)</p>
<pre><code><?php
class Foo {
function __constructor__(){
$this->var = 'blah';
}
public static function aStaticMethod() {
return $this->var;
}
}
echo Foo::aStaticMethod();
?>
</code></pre>
<p>we can call constructor from static method don't we? and we can access everything in class as it would be simple method ... we can even have STATIC CONSTRUCTOR in php class and call it like so: Object::construct()->myMethod(); (to pass different params every time)</p>
<p>but not in python???? @staticmethod makes method in class a simple function that doesn't see totally anything ?? </p>
<pre><code>class socket(object):
def __init__(self):
self.oclass = otherclass()
print 'test' # does this constructor called at all when calling static method??
@staticmethod
def ping():
return self.oclass.send('PING') # i can't access anything!!!
print Anidb.ping()
</code></pre>
<p>I can't access anything from that god damned static method, it's like a standalone function or something like this..??</p>
<p>Maybe I'm using the wrong decorator? Maybe there's something like php offers with static methods in python? </p>
<p>1) Please tell why static methods is isolated
2) Please tell me how to make the same behavior like php static methods have.
3) Please tell me alternative practical use of this, if php static methods behavior is a bad thing</p>
<p>P.s. the goal of all this to write totally less code as much as possible.
P.p.s Heavy commenting of sample code is appreciated </p>
<p>Thank you. </p>
| php python | [2, 7] |
1,370,526 | 1,370,527 | Web Site code process with server side and client side code. When should the client side code be implemented? | <p>I'm developing a web site, which would make use of PHP, Javascript (JQuery) and use AJAX to connect the two. My question is, how should the coding process go.</p>
<p>I know that Javascript is supposed to be used as an extra kick, and should not be relied upon because it can be turned off. So, should I code the entire site in PHP, and then after all of that is done, add the JQuery code, or should I do both side by side?</p>
| php jquery | [2, 5] |
1,641,663 | 1,641,664 | Jquery get each div's sub child divs and grab info into an array | <p>I have a some html that looks like this</p>
<pre><code><div id="main">
<div id="sub_main_1" class="sub_main">
<input type="text" class="sub_name_first" /><br />
<input type="text" class="sub_name_second" /><br />
</div>
<div id="sub_main_2" class="sub_main">
<input type="text" class="sub_name_first" /><br />
<input type="text" class="sub_name_second" /><br />
</div>
</div>
</code></pre>
<p>I would like to pull out each sub_main divs information into an array in javascript. So far I have this as my jquery code</p>
<pre><code>$('#main').find('.sub_main').each(
function() {
alert('hi');
});
</code></pre>
<p>The alert is just a test that it should show "hi" twice. But this is not working. I am also not clear on how I can store the two inputs in a javascript array. Any help would be great! Thanks,</p>
| javascript jquery | [3, 5] |
3,564,534 | 3,564,535 | Remote Service. Rethrow exceptions to UI | <p>How can I catch Connection exception when I am calling WEbService methods from separate process(Remote Service) and how can I transfer information about this exception to UI to show appropriate Dialog message.</p>
<p>I am trying and I am getting:</p>
<pre><code>01-01 01:57:20.028: E/JavaBinder(1215): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
</code></pre>
| java android | [1, 4] |
753,368 | 753,369 | Javascript function and PHP session variable | <p>I have the following script in my Body Tag inside a PHP page:</p>
<pre><code><script type="text/javascript">
function goNext()
{
<?php
if(isset($_SESSION['current']))
{
?>
window.location="step2.php";
<?php
}
else
{
?>
alert('Please select one item to continue.');
<?php
}
?>
}
</script>
</code></pre>
<p>I am setting the session vaible in PHP.
So when I click a link on the page, the session is set.
After that, when I call this function, it still goes to the Alert.</p>
<p>If I refresh the page, then it skips the alert and forwards to the URL mentioned in the function.</p>
<p>Any idea why while I have not refreshed the page, it does not go to the URL?</p>
<hr>
<p>Update</p>
<hr>
<p>I am already setting the Session_start at the begining of the page.
The session is getting set properly, because when I refresh, I can see it working.
Thirdly, I am already using AJAX to set sessions without doing page refresh.
There are other elements on the screen that respond to session change and they are working.
Its only this function where the "issset" function is not detecting the session.</p>
| php javascript | [2, 3] |
5,757,971 | 5,757,972 | Rewrite Java code to C# | <p>We have quiet a few java programs that need to be rewritten to C# simply because we do not have java developers to support the code anymore. It was fine until we needed to edit the code because of new requirenments that were needed. I doubt we can use tools like IKVM because we need the code in C# so our developers can edit and maintain it. </p>
<p>Do any of you guys know of tools that can rewrite the basic structures of java to c#?</p>
| c# java | [0, 1] |
3,461,538 | 3,461,539 | Click event when not clicking on an element | <p>Maybe I'm, just tired but I have a right click menu that I want to close when the user clicks anywhere else than the menu. But I cant figure out how to make it disappear when the user clicks on something else.</p>
<p>Here is the code for showing the menu:</p>
<pre><code>// If mouse click on was pressed
$('#content_list table tr').bind('mouseup', function(event) {
// if right click
if(event.which == 3) {
showRightClickMenu(event);
}
event.preventDefault();
event.stopPropagation();
});
</code></pre>
<p>And this is what I got for hiding the menu</p>
<pre><code>// If mouse click outside document
$(document).bind('blur', function(event) {
hideRightClickMenu();
event.stopPropagation();
});
// If mouse click not on the menu
$('*:not(#rightClickMenu *)').bind('mousedown keydown', function(event) {
hideRightClickMenu();
event.stopPropagation();
});
</code></pre>
<p>The first bind checks if the user clicks outside the document and the second bind checks if the user clicks on everything except the menu.
But the second one doesn't really work. If I click on the menu the menu is hidden.</p>
<p>Shouldn't be so hard imo... Anyone got any ideas?</p>
| javascript jquery | [3, 5] |
201,388 | 201,389 | Dynamically change value of hidden field | <p>For an existing site, I have to pass values in hidden fields from a form that's loaded by different pages (eg. City1.aspx, City2.aspx, City3.aspx, etc.), but they are loaded inside an iframe. I also have to dynamically change the value of at least one of those hidden field (let's call it "source") based on the city page loading it. I am familiar with PHP and JavaScript/JQuery, but I have no idea how to do this in C#.</p>
<p>I've found tutorials on retrieving the file name (sans extension) via JavaScript. I think I can still get the city even if the form is in an iframe, but I'd like to keep to the site's conventions and use C# if possible.</p>
<p>Code snippets or links to possible solutions would be much appreciated.</p>
| c# asp.net | [0, 9] |
1,863,644 | 1,863,645 | Difference between $(document).ready and writing open jQuery statements | <p>What is the difference between writing code with and without <code>$(document).ready</code>?</p>
<p>For example:</p>
<pre><code>$(document).ready(function() {
$("#button").click(function() {
//Code
});
});
</code></pre>
<p>And:</p>
<pre><code>$("#button").click(function() {
//Code
});
</code></pre>
<p>And :</p>
<pre><code> <input id="button" type="button" value="Cancel" onclick="hidedropdown()" />
function hidedropdown() {
//Code
}
</code></pre>
| javascript jquery | [3, 5] |
5,355,374 | 5,355,375 | i have two seperate functions in a php page. while, javacript function is loading correctly and but jquery not? | <p>inside <code><head></code> tag i declare a jQuery function as follows (menu animation function) ;</p>
<pre><code><script type="text/javascript">
$(function() {
$("#top_menu").MenuBar({
fx: "backout",
speed: 700,
click: function(event, menuItem) {
return true;
}
});
});
</script>
</code></pre>
<p>and inside <code><body></code> tag i use javascript function as follows (slideshow function) ;</p>
<pre><code><script type="text/javascript" src="scripts/slideshow.js"></script>
<script type="text/javascript">
$('slideshow').style.display='none';
$('wrapper').style.display='block';
var slideshow=new TINY.slideshow("slideshow");
window.onload=function(){
slideshow.auto=true;
slideshow.speed=10;
slideshow.link="linkhover";
slideshow.info="information";
slideshow.thumbs="";
slideshow.left="slideleft";
slideshow.right="slideright";
slideshow.scrollSpeed=4;
slideshow.spacing=5;
slideshow.active="#fff";
slideshow.init("slideshow","image","imgprev","imgnext","imglink");
}
</script>
</code></pre>
<p>the problem is only <strong>slideshow function excuting</strong> while loading <strong>not menu animation</strong>; if i remove the slideshow function, menu animation script is working!</p>
<p>kindly guide me to sort of the problem</p>
| javascript jquery | [3, 5] |
4,851,911 | 4,851,912 | Best way to handle concatenating string with another function | <p>I am working on cleaning up some adopted code - there is a lot of duplication.</p>
<p>There is a set of jQuery callbacks where we get back JSON like this: </p>
<pre><code>[
{"location":{"id":164,"name":"place 1"},"users":[{"id":1,"name":"joe"},{"id":2,"name":"jack"}]},
{"location":{"id":162,"name":"place 2"},"users":[{"id":3,"name":"joe"},{"id":4,"name":"jon"}]}
]
</code></pre>
<p>I go through with these functions:</p>
<pre><code>function locations_view(r) {
str = "";
$.each(r.data, function(k, v) {
str += v.location.name + "<br />";
iterate_users(v.users);
});
$("#locations").html(str);
}
function iterate_users(users) {
str += '<strong>users:</strong>' + users.length + '<br />';
$.each(users, function(k1, v1) {
str += "<a href='/users/" + v1.id + "'>" + v1.name + "</a> ";
});
str += "<br />";
}
</code></pre>
<p>This seems to work but it looks a little ugly. Is there a better way to do this. Also, I want to minimize memory consumption (returning the string rather than have a global <code>str</code> was causing performance issues). Is there a better, more elegant way to do this? Would having multiple copies of <code>str</code> ever cause a problem? Like if I have products_view that also uses a <code>str</code>?</p>
| javascript jquery | [3, 5] |
4,193,429 | 4,193,430 | Image Photo Gallery ---> Jquery. Next and Prev buttons | <p>As I am having only 4 solutions i.e. 4images/videos and I am clicking on next button then why the empty row is showing, again if am clicking on next then the normal 4 solutions are coming.</p>
<p>Please check it out once. that empty row should not come. I need a help</p>
<p><a href="http://jsfiddle.net/T657N/51/" rel="nofollow">http://jsfiddle.net/T657N/51/</a></p>
| javascript jquery | [3, 5] |
4,991,627 | 4,991,628 | What's a simple way to define multiple jQuery.Callbacks() prerequisites? | <p>What's the simplest way to define multiple jQuery.Callbacks() prerequisites?</p>
<pre><code>// simple pubsub example
var pubsub=(function() {
var callbacksObj={};
return function(id){
if(!id) throw 'callbacks requires an id';
return (callbacksObj[id] = callbacksObj[id] || $.Callbacks('unique memory'));
};
})();
function fn1(){
console.log('fn1');
};
function fn2(){
console.log('fn2');
};
function fn3(){
console.log('fn3');
};
// subscribing
pubsub('foo').add(fn1);
pubsub('bar').add(fn2);
pubsub('foo','bar').add(fn3); // adding a function with multiple dependencies
// publishing
pubsub('foo').fire() // should only log 'fn1';
pubsub('bar').fire() // should log both 'fn2' AND 'fn3' since both have fired
</code></pre>
<p>I can see wrapping each added function in another function that checks each id's fired() state, though this seems like a common enough scenario that perhaps there's a simpler way I'm missing.</p>
| javascript jquery | [3, 5] |
2,489,021 | 2,489,022 | onStop Error, app shuts down | <p>I am trying to stop a melody from playing when user hit the back-button. This code is working when the file is playing, if not there will be an error and the app shuts down. How come it isnt working?</p>
<pre><code>MediaPlayer melodisnutt;
public void onStop() {
super.onStop();
if ( melodisnutt.isPlaying () ) {
melodisnutt.stop();
}
}
</code></pre>
| java android | [1, 4] |
2,024,359 | 2,024,360 | Href and confirm button | <p>have a href as follows:</p>
<pre><code><a class="eLink" href="http:www.abc.com">chk here xyz</a></li>
</code></pre>
<p>and javascript for "eLink" is as follows:</p>
<pre><code> $("a.eLink").click(function link(evt) {
url = evt.target.href;
if (url.toString().toLowerCase().indexOf(".gov") <= 0) {
var tk = "Do you really want to continue?";
if (confirm(tk)) {
window.open(url, 'newwin');
}else{
window.open(url,'_self');
}
}
else
{ window.open(url, 'newwin'); }
return false;
});
});
</code></pre>
<p>Now my issue is when i click the href and click 'cancel' in the confirm button, my page goes to "abc.com", but it shouldnt happen. My browser should remain the same. what script should i use in the else part so i remain the same page. thanks.</p>
| javascript jquery | [3, 5] |
2,340,066 | 2,340,067 | How to store data in an attribute and then parse on click? | <p>My end goal is to be able to send:</p>
<pre><code>$('[data-track]').live('click', function () {
mpmetrics.track("Share", {'method': 'twitter'});
});
</code></pre>
<p>My question is how I can store the Share, method, twitter in the data-bind attribute so that they are dynamic and I can change the variables on any data-track attribute in my app.</p>
<pre><code><a data-track="XXXXXX" href="#">Tweet</a>
</code></pre>
<p>For XXXXXX, how can I set the 3 variables and then parse them in the data-track binding?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
3,297,214 | 3,297,215 | Screenshot effect Android | <p>i want to create an screen efect like when you take an screenshot in the phone, i mean, a little flash in the screen when i click a button, also i want to change the color of that flash. Is that posible? thank you very much in advance ;)</p>
| java android | [1, 4] |
4,550,887 | 4,550,888 | php date convert to javascript date | <p>I have a php date and wish to echo it out in a javascript alert box:-</p>
<pre><code>$day=15;
$month=8;
$year=2012;
$date_display = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
echo $date_display; // 2012-08-15
</code></pre>
<p>Then,</p>
<pre><code><a href="#" onclick="give_date(<?=$date_display;?>)"><?=$day;?></a>
</code></pre>
<p>The javascript function:</p>
<pre><code><script>
function give_date(value){
alert (value);
}
</script>
</code></pre>
<p>Interestingly, the alert box give me "1989", which equals to 2012 minus 8 minus 15!! what shall I do!!</p>
| php javascript | [2, 3] |
5,631,140 | 5,631,141 | Java script how to write an if condition passed to a $.modal() | <p>Hi I have wrote a method like this and i want to include a condition inside the string passed to the model and my method did not work . How to include an if condition? </p>
<pre><code>$.modal("<div id='edit_user_form' class='user_mange_popup' align='center'>/'if(true){//do something}'/</div>")
</code></pre>
| javascript jquery | [3, 5] |
5,698,289 | 5,698,290 | how can i store visitor infomation like reach time ,duration of visit,and exact location of visitor in php | <p>I want to store visitor information like reach time ,duration of visit and also exact location of the visitor.</p>
<p>Can any one give me any ideas about it? Please help me.</p>
| php javascript jquery | [2, 3, 5] |
4,123,295 | 4,123,296 | Downloading a file from a PHP page in C# | <p>Okay, we have a PHP script that creates an download link from a file and we want to download that file via C#. This works fine with progress etc but when the PHP page gives an error the program downloads the error page and saves it as the requested file. Here is the code we have atm: </p>
<p>PHP Code:</p>
<pre><code><?php
$path = 'upload/test.rar';
if (file_exists($path)) {
$mm_type="application/octet-stream";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($path)) );
header('Content-Disposition: attachment; filename="'.basename($path).'"');
header("Content-Transfer-Encoding: binary\n");
readfile($path);
exit();
}
else {
print 'Sorry, we could not find requested download file.';
}
?>
</code></pre>
<p>C# Code:</p>
<pre><code>private void btnDownload_Click(object sender, EventArgs e)
{
string url = "http://***.com/download.php";
WebClient client = new WebClient();
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
client.DownloadFileAsync(new Uri(url), @"c:\temp\test.rar");
}
private void ProgressChanged(object sender, DownloadProgressChangedEventArgs e)
{
progressBar.Value = e.ProgressPercentage;
}
void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
{
MessageBox.Show(print);
}
</code></pre>
| c# php | [0, 2] |
150,130 | 150,131 | Toggle between borders of a image and remove borders of other existing images | <h1>Context</h1>
<p>I want to select only one image and remove borders of other existing images</p>
<p>Now many images can be selected like that:</p>
<p><img src="http://i.stack.imgur.com/hkA1s.png" alt="enter image description here"></p>
<p>I want help on select and deselecting single images.</p>
<h1>My code</h1>
<pre><code>function clickpick(item) {
for ( var i = 5; i < document.images.length; i++) {
document.images[i].onclick = function() {
if (this.style.borderWidth == '5px') {
selectpic = '';
$("#display-frame").find("*").css("border", "0");
} else {
this.style.border = '5px solid blue';
selectpic = $(item).attr("url");
}
};
}
</code></pre>
<p>Images are auto generated</p>
<h1>Html</h1>
<pre><code><div class="mainpic"><img src="';path+=file.filepath+'" class="uploader-thumb-img" style="width: 108px; height: 120px; top: 0px; left: 0px; "/></div>
</code></pre>
<p>update:
i want to select the url of the image sorry forgot to mention that</p>
| javascript jquery | [3, 5] |
3,361,853 | 3,361,854 | Get div from page | <p>I've looked everywhere for a technique, but I failed to find much that suited my needs.</p>
<p>Basically, I would like to utilize JavaScript or jQuery (probably using Ajax) to grab a div that contains a word from a page on my site. </p>
<p>I'm not asking anyone to code this for me, I would just like to be pointed in the right direction.</p>
<p>For example, let's say I have this HTML page:</p>
<pre><code><div class='findfromthis'>hello guys</div>
<div class='findfromthis'>goodbye guys</div>
<div class='findfromthis'>goodbye people</div>
</code></pre>
<p>I would like to display all the <code>divs</code> that contain the word "guys" in them.</p>
<p>Thank you so much in advance!!</p>
| javascript jquery | [3, 5] |
3,181,192 | 3,181,193 | make value of a function global to be called in any other function | <p>hello i want to pass the value of a function to any other function or make the value of a function global so that it can be called in any other function . but i dnt knw how to do it , tried some codes still no sucess . </p>
<p>here is the function code </p>
<pre><code>function newalbum(val1,loginuser)
{
$.ajax({
type:"GET",
url: 'ajax/album.php?val='+val1+'&& loguser='+loginuser,
success: function(data) {
$("#newalbum1").html(data);
var ab=$('#ab').val();
var abc=$('#loginuser').val();
var action=$('#action').val();
alert(ab);
}
});
}
</code></pre>
<p>in this function i want to make the three variables var ab, var abc, var action to be global so that its value can be used in any other function . can any one help?</p>
<p>edit - the value of var ab, var abc, and var action is comming from ajax data that is why i am not able to use those variable directly , it says undefined if i use it directly.</p>
<p>after the varibales value received from ajax in function newalbum . i want to use those varibales inside </p>
<pre><code> (function( $ ){
$.fn.Uploadrr = function( options ) {
</code></pre>
| javascript jquery | [3, 5] |
5,086,029 | 5,086,030 | Compiling android .apk by java code | <p>I would like to create a java app that actually programaticlly compiles a differnt android project - Meaning i'd like to create .apk files by code. How would i go about this??? Is this feasible?</p>
<p>Thanks</p>
| java android | [1, 4] |
1,559,783 | 1,559,784 | Updating TextBox on the client with Javascript and reading the value from the Server | <p>I used Javascript on the client to update an ASP Textbox control which was rendered as an HTML textbox.</p>
<p>When I tried to access the value in the textbox control on the server, I wasn't too surprised that the Textbox's updated value was not accessible through the normal Text property of the TextBox server control, since the state of that value, I assume was probably saved off in the ViewState and the Server was unaware that Client script had changed it.</p>
<p>Is the best way to get the updated value using something like:</p>
<p>Request.Form(TextBox.UniqueID)?</p>
<p>I suspect that because the textbox is populated within a row of a GridView control and the row was added at run time when doing a DataBind, that I may be getting different results than if the TextBox were drawn on the control at Design time. </p>
<p>I confirmed that the value placed into the textbox by the client is accessible via this:</p>
<pre><code>Request.Form( CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).UniqueID)
</code></pre>
<p>but not accessible via this:</p>
<pre><code>CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).Text
</code></pre>
<p>the latter returning an empty string.</p>
<p>I think these two lines tell the whole story.</p>
<p>It seems ugly to have two properties to get the value of the textbox and even uglier when you consider that they return different results.</p>
<p>Is there a better way or is this just client side development in all its glory?</p>
<p>I'm always surprised when people say that web development now days is as easy as client (eg winform) apps now that ASP.NET keeps track of state. To me, web development is always more complex and costly, but I admittedly am not that skilled in web dev.</p>
| asp.net javascript | [9, 3] |
2,491,933 | 2,491,934 | Union on datatable | <p>How I will convert this SQL query in Linq, sorry but I am not that much expert in LINQ</p>
<pre><code>select ConnectionId
from LearnerConnections
where LearnerId = 1
union
select LearnerId
from LearnerConnections
where ConnectionId = 1
</code></pre>
<p>also can I write the DataTable methode to get the result (like DataTable.Select() method)?</p>
<p>thanks in advance</p>
| c# asp.net | [0, 9] |
494,582 | 494,583 | asp.net,c#.net repeated fields | <p>I have a asp.net webpage <code>abc.aspx</code><br>
it contains </p>
<pre><code> <td class="style1">
<asp:TextBox ID="chqdt1" runat="server" Width="71px"></asp:TextBox>
<a href="javascript:OpenCalFuture('ctl00_ContentPlaceHolder1_chqdt1');">
<img border="0" height="16" src="cal.gif" width="16" /></a>
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="add" style="margin-left: 0px" />
</td>
<td>
&nbsp;</td>
</code></pre>
<p>I want on each button click event create new row with new textbok with calender field created</p>
| c# asp.net | [0, 9] |
447,778 | 447,779 | Open a new window for each url created | <p>I want to open a new window for each $url created how could I do that?</p>
<pre><code><?php
require_once('sql.php');
$result = mysql_query("SELECT * FROM gamertags ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($result)){
// Prepare gamertag for url
$gamertag = strtolower($row['gamertag']);
$url = "http://halogamertags.com/tags/index.php?player_name=".urlencode($gamertag);
}
?>
</code></pre>
| php jquery | [2, 5] |
5,494,096 | 5,494,097 | How do I add a callback to a click event | <p>I need to add a callback to the following event.</p>
<p>The callback needs to fire off another function</p>
<pre><code>$("nav.filter a").on('click', function () {
$(this).siblings().removeClass('active');
$(this).addClass('active');
var data = $(this).data('filter');
$("section.our-work article ul li").remove();
if(data == 'branding') {
$("section.our-work article ul").append(
template(ourWorkTemplateData) // underscore template
);
base.loadOurWork({
direction: "backward",
target: "section.our-work article ul li"
});
}
return false;
});
</code></pre>
<p>I can't for the life of me find an example of this.</p>
<p>Any help, greatly appreciated.</p>
<p>I know what my function is going to do, just don't know how to implement it as a callback.</p>
| javascript jquery | [3, 5] |
4,156,271 | 4,156,272 | accessing class that creates list from database | <p>I have the following Class which basically creates a list of categories (called commands, I know it's weird)</p>
<p>Here is CommandDB.cs</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.Common;
using System.Data.Sql;
using System.Data.SqlClient;
namespace TM_non_deploy
{
public partial class CommandDB
{
private static string connectionString = "blah";
public static List<Command> GetCommands()
{
List<Command> commandList = new List<Command>();
DbConnection connection = new SqlConnection();
SqlCommand cmd = (SqlCommand)connection.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_tm_commands";
connection.ConnectionString = GetConnectionString();
connection.Open();
SqlDataReader reader = null;
reader = cmd.ExecuteReader();
Command command;
while (reader.Read())
{
command = new Command();
command.ID = reader.GetOrdinal("id");
command.Name = reader["name"].ToString();
commandList.Add(command);
}
reader.Close();
connection.Close();
return commandList;
}
private static string GetConnectionString()
{
return connectionString;
}
}
}
</code></pre>
<p>my question is hopefully pretty simple, how do I, in my main page, access this list so that it calls the function and returns all the commands so I can iterate thru them? I thought it might be something like <code>List<CommandDB> commandList = new List<CommandDB.>GetCommands();</code> but I haven't really had any luck figuring it out thru the msdn. </p>
| c# asp.net | [0, 9] |
147,341 | 147,342 | Calling a function dynamically | <p>My jQuery function is something like:</p>
<pre><code>$.a.b.c();
</code></pre>
<p>Now I am trying to call it dynamically:</p>
<pre><code>var temp = b;
$.a.temp.c();
</code></pre>
<p>But obviously its not working. How do I get this to work. Please feel free to edit the question title, as am not sure how to really phrase the question.</p>
| javascript jquery | [3, 5] |
140,621 | 140,622 | Toggle Mute Javascript Function with Jquery Toggle | <p>Hi All I am trying to write both an if/else statement along with toggling an image. Basically my goal is to toggle an image (in this case with an id of soundonoff). However I can't seem to figure out where I am going wrong. The issue is the toggle works, but the detect of whether its muted or not does not work. (In my full code for example I have it switch <code>innerHTML</code> of various audio/video files, this is where <code>document.getElementsByName('mymedia')[0]</code> comes in. Any help would be tremendously appreciated I have spent about 4 hours working on this and can't seem to figure it out.</p>
<p>I should add that I do not know where to add an eventlistener for <code>detectmute()</code>, I tried to add it to my video, and to the button soundonoff but neither got working yet.</p>
<p>Here is my code: </p>
<pre><code>function detectmute(){
if(document.getElementById('soundonoff').src == 'images/icons/soundoff.png'){
document.getElementsByName('mymedia')[0].muted = true;
}
else if(document.getElementById('soundonoff').src == 'images/icons/soundon.png'){
document.getElementsByName('mymedia')[0].muted = false;
}
$("#soundonoff").toggle(function(){
this.src = "images/icons/soundoff.png";
document.getElementsByName('mymedia')[0].muted = true;
}, function() {
this.src = "images/icons/soundon.png";
document.getElementsByName('mymedia')[0].muted = false;
});
}
</code></pre>
| javascript jquery | [3, 5] |
3,340,685 | 3,340,686 | How to Passing value javascript variable to php? | <p>Passing value JavaScript variable to PHP.</p>
<p>Example</p>
<p><strong>JavaScript</strong></p>
<pre><code>Var ddd='aaaa'
</code></pre>
<p><strong>PHP</strong></p>
<pre><code>if (ddd="aaaa"){do somehting...}
</code></pre>
| php javascript | [2, 3] |
435,294 | 435,295 | How to use 2 classes for the same function with jQuery | <p>How do I run the same click function for 2 classes ?</p>
<p>I have this :</p>
<pre><code>$('.buythis').click(function(){ blabla }
</code></pre>
<p>And I want to use the same line for a different class like :</p>
<pre><code> $('.anotherclass').click(function(){ blabla }
</code></pre>
<p>Now ... how can I use the same click function without redeclaring it ?
i want something like :</p>
<pre><code> ($('.buythis'),$('.anotherclass')).click(function(){ blabla }
</code></pre>
| javascript jquery | [3, 5] |
4,076,962 | 4,076,963 | How can I add a source code with markup? | <p>Need to add it to textview, for example, standard java-code.</p>
| java android | [1, 4] |
2,846,663 | 2,846,664 | php,java script | <p>i use java script code in print function .i want to , success of the print redirect to another page </p>
| php javascript | [2, 3] |
5,262,627 | 5,262,628 | Can someone explain what the syntax means when defining a jQuery plugin? | <p>I am reading up on creating custom jQuery plugins and am a little confused as to the meaning of the following syntax:</p>
<pre><code>(function($){
$.fn.truncate = function() {
return this.each(function() {
});
};
})(jQuery);
</code></pre>
<p>I understand that function($) is an anonymous function that accepts the $. I just don't quite understand why this function is wrapped in brackets and how the following sets of brackets with jQuery in them...work. </p>
| javascript jquery | [3, 5] |
4,663,319 | 4,663,320 | OnBlur effect for select dropdown | <p>I have a select dropdown and if a user clicks 'outside' of that select dropdown, I want it to disappear. This is what I currently have:</p>
<pre><code>$(this).html($("<select/>", {
id: 'sel',
change: function() {
selectdone(this, title_id, status_type);
},
blur: function() {
selectdone(this, title_id, status_type);
},
</code></pre>
<p>In the above, if I click outside of the dropdown, nothing happens. The only time the function is firing is if I <strong>change</strong> the value of the select dropdown.</p>
<p>How would I accomplish the above, such that when a user clicks anywhere on the document outside of the select dropdown, it fires this function?</p>
| javascript jquery | [3, 5] |
81,350 | 81,351 | Uncaught TypeError: Cannot read property 'firstElementChild' of undefined when expanding posts in a certain order | <p>Can any of you guys help me out with a Javascript problem? I'm trying to write a post expansion feature for my site, and for some reason whenever I expand the first post, the second will no longer expand, and will instead redirect to the full post on the thread page. If I expand the second post and then the first next, I don't have the problem.</p>
<p>Here's the code that runs when the page is loaded:</p>
<pre><code>function postExpansionPrep(){
if(!document.body.className){
var links = document.getElementsByClassName("abbrev");
for (var i = 0; i < links.length; i++ ){
(function(e) {
links[e].firstElementChild.addEventListener("click", function(a){ expandPost(links[e].firstElementChild); a.preventDefault(); }, true);
console.log(links[e].firstElementChild.href);
})(i);
}
}
}
</code></pre>
<p>And here's the code that runs when you click on the link to expand a post.</p>
<pre><code>function expandPost(link){
if(link.hash){
$.get(link, function(data) {
var loadedPost = $(data).find("#reply" + link.hash.replace("#",""));
document.getElementById("reply" + link.hash.replace("#","")).lastElementChild.innerHTML = $(loadedPost).find("blockquote").last().html();
});
}
else{
$.get(link, function(data) {
var loadedPost = $(data).find("#parent" + link.pathname.substring(link.pathname.lastIndexOf("/")+1));
document.getElementById("parent" + link.pathname.substring(link.pathname.lastIndexOf("/")+1)).lastElementChild.innerHTML = $(loadedPost).find("blockquote").last().html();
});
}
}
</code></pre>
<p>You can see the issue in action here: <a href="http://www.glauchan.org/test/" rel="nofollow">http://www.glauchan.org/test/</a></p>
<p>By the way, the feature is opt-in, so you need to enable Post Expansion in the Board Options menu.</p>
| javascript jquery | [3, 5] |
2,186,384 | 2,186,385 | add elements to select html tag with jquery at runtime | <p>I have a select tag that looks like that:</p>
<pre><code><select name="MySelect"></select>
</code></pre>
<p>At runtime, I have a javascript function that composes some HTML and returns a string that looks like this:</p>
<pre><code>TheOptions = <option>Option 1</option><option>Option 2</option><option>Option 3</option>
</code></pre>
<p>I want to add these to the select tag and so far I have:</p>
<pre><code>$('#MySelect').html(TheOptions);
</code></pre>
<p>However, when the code executes, it doesn't load the options in the selector.
Any suggestions would be helpful.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
4,853,034 | 4,853,035 | Testing if a jquery approach worked fine | <p>What's the easiest way to test performance if a jquery piece of code worked better than the other?</p>
<p>Let's say I have written two pieces of code and want to let my team know which one worked better. How can I do it.</p>
<p>Can you give an example of say inserting elements at runtime in the page and demonstrate the techniques?</p>
| javascript jquery | [3, 5] |
3,125,138 | 3,125,139 | How to encrypt web config? | <p>I wanted to encrypt the connection string section in the web config.</p>
<p>I did it using visual studio command prompt using this command.</p>
<p>aspnet_regiis.exe -pef “connectionStrings” C:\Projects\DemoApplication</p>
<p>and it encrypted the section and it worked fine.</p>
<p>and I did the same thing using code behind calling this method.it also worked fine but it give me wrong cipher value and I decripted it and matched with previous decript value and those are different.</p>
<pre><code> string provider = "RsaProtectedConfigurationProvider";
string section = "connectionStrings";
System.Configuration.Configuration confg = ConfigurationManager.OpenExeConfiguration(txtLocation.Text + @"\web.config"); ;
System.Configuration.ConfigurationSection configSect = confg.GetSection(section) as ConnectionStringsSection;
if (configSect != null)
{
configSect.SectionInformation.ProtectSection(provider);
confg.Save();
}
</code></pre>
<p><strong>My question is why the two way of encrypting generate different values. even if both using the same provider "RsaProtectedConfigurationProvider"</strong></p>
| c# asp.net | [0, 9] |
5,340,891 | 5,340,892 | Shopping cart Asp.net | <p>i have a aspx page and inside i have called a .ascx page which is the shopping cart , on the aspx page i have a lot of links to the books and we can add the books to the shopping cart. On clicking the add button i store the bookid,name,price in a cookie and on the ascx page i get the copy and paste the value in the shoping cart using session variable everything is working fine..The code is something like this..on clicking the add btn i call this javascript funtion</p>
<pre><code> function addCookies(typeShopping,id,name,price) {
document.cookie = typeShopping + "=" + id + "," + name + "," + price;
}
</code></pre>
<p>But after this i have to do post back so the ascx page loads and adds this info to the shopping cart. so on the btn which call this function is like this..</p>
<pre><code> <a onclick="addCookies('ShoppingCart',1, 'A summary of the Creed....' ,25);"href=".../ShowBooks.aspx?CategoryName=Qur'an&Mushaf&CatID=1" </a>
</code></pre>
<p>but this as you see cause the page to post back and although the item adds to the shopping cart i move to the top , how can i do that i just click and the item add and the page dont post back and i stay on the same book.
Thank you</p>
| javascript asp.net | [3, 9] |
1,283,021 | 1,283,022 | javascripts arrays | <p>I am playing with my friends on internet</p>
<p>we ask each other to say ( name, or animal, or inanimate) begins with a particular letter</p>
<p>So I am thinking about building a page to help me in training about this game</p>
<p>This is an php code for example:</p>
<pre><code>function getNamesByChars($chars,$type='name'){
$names=array(
'd'=>'Dan',
'j'=>'John',
);
$animals=array(
'd'=>'Dog',
'j'=>'Jar',
);
$chars=explode(' ',$chars);
foreach($chars as $char){
//if it a name
if($type=='name')
$results.=$names[$char];
//if it animal
elseif($type=='animal')
$results.=$animals[$char];
}
}
getNamesByChars('j d','animal');
//results (Jar dog)
</code></pre>
<p>the problem here that i need to make this page faster as much as possible</p>
<p>PHP requires loading the page</p>
<p>i Think javascript is the faster way</p>
<p>but i am very beginner in javascript so i can't build this function</p>
<p>Any help in building this function in javascript?</p>
| php javascript | [2, 3] |
4,546,211 | 4,546,212 | How a class can extend with two different classes While one class is from a external library and other is built in | <p>I am using SherlockActionBar library in my project.And my class is extending an abstract class SherlockActivity </p>
<pre><code>public class AllAppsInfo extends SherlockActivity{}
</code></pre>
<p>In mean while i want to extend my AllAppsInfo with FragmentActivity as well.Which is not allowed due to negligence of multiple inheritance in java.</p>
<p>I have done some search, composition is the solution but how to use it in this Scenario? Neither i can make abstract Sherlock class a interface nor same be done with Fragment Activity class
. </p>
| java android | [1, 4] |
2,569,290 | 2,569,291 | In Javascript (jquery), is there a way to detect when the page anchor changes? | <p>Basically, I want to have links throughout the page that change the anchor -- the part of the URL after a # symbol. When that part of the URL changes, the JavaScript should respond.</p>
<p>I could add an onclick method to every link, but is there a better way?</p>
| javascript jquery | [3, 5] |
123,965 | 123,966 | Android Java Voice Recognition only need 1 result.......How to obtain 1 result? | <p>I have a speech recognition program that displays 5-6 results. I only want the 1st result to appear. Can you help with this please?</p>
<p>code:</p>
<pre><code>@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if (requestCode == check && resultCode == RESULT_OK){
ArrayList<String> results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, results));
}
</code></pre>
<p>Please advise?</p>
<p>Thank you.
FlinxSYS</p>
| java android | [1, 4] |
1,958,979 | 1,958,980 | Store answer with javascript to temp array? | <p>I have 10 questions with "YES" and "No" answers. I need user to answer all of them. If all answers marked as "Yes", "Next" button should be enabled. If at least one answer "No" disabled.</p>
<p>Could you please show me how it can be done with javascript or jquery library?</p>
<p>Here is an example of my HTML, lets assume I have 2 questions</p>
<pre><code><p>
Question?<br />
<input type="radio" name="Question1" value="Yes" />Yes
<input type="radio" name="Question1" value="No" />No
</p>
<p>
Question 2?<br />
<input type="radio" name="Question2" value="Yes" />Yes
<input type="radio" name="Question2" value="No" />No
<p>
<button id="next" type="button">Next</button>
</code></pre>
| javascript jquery | [3, 5] |
4,505,178 | 4,505,179 | UpdatePanel initial call | <p>I am using an UpdatePaenl in an asp.net page.
It has a button to trigger it. I'm able to show "Loading" when the button is pressed.
Here's my issue: I need it to show "Loading" when the page is first called, not just when a button is pressed.</p>
<p>I would imagine that JavaScript would be used to trigger the UpdatePanel when the page is first loaded.</p>
<p>Any ideas are greatly appreciated. Thanks</p>
| asp.net javascript | [9, 3] |
1,122,920 | 1,122,921 | JQuery create a list based on another list | <p>what I am trying to do is generate an html list based from another list on the page. I have a list along the lines of below:</p>
<pre><code><ul>
<li class="chosen">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="something">content</li>
<li class="chosen">content</li>
<li class="chosen">content</li>
</ul>
</code></pre>
<p>Whats the best plan of action to create a jquery function which will find the list items with the class of "chosen" and create another list with just these.</p>
<p>Any help would be great. Thank you.</p>
| javascript jquery | [3, 5] |
124,381 | 124,382 | Android Java Sqlite Exception index 0 requested with size of 0 | <p>I think I understand what this error refers to. Basically as I understand it the cursor is empty. Which means the query is not finding any rows that equal its where statement.</p>
<p>The query is basically </p>
<blockquote>
<p>SELECT * FROM questions WHERE _id=2</p>
</blockquote>
<p>Now the thing I don't understand is that if I user a database with 7 records it is fine then when I change it over to one with 100 it runs this exception. The odd thing is that from other parts of the app I output the entire databases contents referring to specific columns.</p>
<p>All the columns in both db's are called the same and when outputting everything from a table you can refer to everything. The problem seems to be when you query the large db specifically looking for one row. It returns empty.</p>
<p>Is there anything that would be doing this, like special characters or anything else I have over looked?</p>
| java android | [1, 4] |
4,335,725 | 4,335,726 | coloring a substring in a label | <p>I have the following label element where I'd like the asterisk to be colored red.</p>
<pre><code><label> Lastname * </label>
</code></pre>
<p>How can this be done using jQuery, or otherwise?</p>
| javascript jquery | [3, 5] |
456,795 | 456,796 | Show table if a SPAN exists within the first TD | <p>I need to write in either jQuery or Javascript a way of hiding a table if it doesnt contain a specific span:</p>
<p>E.g.</p>
<pre><code><table>
<tr>
<td class="titletext">
<span id="userID">009002</span>
</td>
<tr>
</table>
</code></pre>
<p>So, as a poor psuedo code:</p>
<pre><code>if (td.titletext child has #userID) {
//do nothing
} else {
td.titletext = Display: none;
}
</code></pre>
<p>Any ideas appreciated.</p>
| javascript jquery | [3, 5] |
4,568,969 | 4,568,970 | Online High Scores Solution | <p>Can anybody advise solution for implementing online high scores table for iPhone game ?
I mean simple engine to publish player result by http query and view global high scores table.
I'm weak in PHP so trying to find existing solution first.
Thanks.</p>
| php iphone | [2, 8] |
2,745,382 | 2,745,383 | Displaying a Large amount of text | <p>I'm looking to display a list of email addresses on a page that can then be copied and then pasted into an email client. Why they want it done this way is not my concern, I just have to do it.</p>
<p>What I'm wondering is what's the best way to go about displaying this? I'm not sure if I should use a giant label or a textbox or whether there's even something better.</p>
<p>Any suggestions would be appreciated!</p>
<p>Thanks</p>
<p>EDIT: Not sure if this matters, but the addresses are being pulled from a database so I don't have them ready to simply hard code them into a page. I'm new to ASP.NET stuff and web development in general so please bear with me.</p>
| c# asp.net | [0, 9] |
676,658 | 676,659 | How to translate jQuery .live() to .on() with events bound to this? | <p>I'm in the process of converting code from the deprecated <code>.live()</code> API to <code>.on()</code> (see the <a href="http://blog.jquery.com/2011/11/03/jquery-1-7-released/">jQuery 1.7 release notes</a>)</p>
<p>I have live events attached to <code>this</code> in multiple custom jQuery plugins, e.g.</p>
<pre><code>this.live('click', function() {
...
});
</code></pre>
<p>the <a href="http://api.jquery.com/live/">jQuery .live() doc</a> has some guidance on how to migrate to <code>.on()</code> as follows:</p>
<pre><code>$(selector).live(events, data, handler); // jQuery 1.3+
$(document).on(events, selector, data, handler); // jQuery 1.7+
</code></pre>
<p>however, this doesn't work:</p>
<pre><code>$(document).on('click', this, function() {
...
});
</code></pre>
<p>so... how do I make live events bound to <code>this</code> work with the new <code>on()</code> API?</p>
| javascript jquery | [3, 5] |
1,660,518 | 1,660,519 | android for embedded systems | <p>I know quite a bit of Java, some C, and have released my first app for Android devices. I hear that Android development for embedded systems is becoming a promising area. If someone could kindly let me know where I can start learning Android development for embedded systems, it would be highly appreciated. By the way, I don't have any background on programming embedded systems.</p>
| java android | [1, 4] |
1,248,989 | 1,248,990 | Android (constants) | <p>I've checked the suggested solutions and can't find my answer. If the answer is out there, then I'm sorry for posting it again.</p>
<p>I'm consuming a wcf rest service.</p>
<p>In my test activity I do;</p>
<p>private final static String SERVICE_URI = "http://10.0.2.2/Service1.svc";</p>
<p>This will eventually be used in various activities.</p>
<p>So what I want to do is: private final static String SERVICE_URI = [CONSTANT]</p>
<p>so that if I need to re-point the service somewhere else, a single code update will result in dependent activities pointing to the correct location, allowowing them to work, rather than having to update each activity.</p>
<p>So: how / where would I create such a constant in Android, and how would I reference it?</p>
<p>Many thanks any help.</p>
| java android | [1, 4] |
4,480,687 | 4,480,688 | best method to choose to save huge data from excel to Sql | <p>I have an Excel file from which I have to extract the required data and save it to a database. I know by using <code>Range</code> we can get a particular range of data. But my data that was to be extracted was a bit large. So can anyone suggest which was the best and simple method to retrieve the data and store the information in a database?</p>
<p>I would like to read the data from <code>A10</code> to an unknown range. My data will be as follows </p>
<p><img src="http://i.stack.imgur.com/FLleS.jpg" alt="enter image description here"></p>
<p>As per marked with red after that data should go in to the database <code>column</code> by <code>column</code> I will do that if anyone can suggest the best method to read the remaining columns too.</p>
| c# asp.net | [0, 9] |
4,340,407 | 4,340,408 | can i use a .cc proto file in client side and .java proto file in server side | <p>i'm new one to protobuf<br>
i have searched and learned some things about protobuf and i know that using protobuf package we are able to generate the classes in c++ ,java and phython for proto files and even i learnt some thing about third party library for RPC implementation<br>
now my doubt is, suppose if i want to implement a client and server program where in clint side i'll use a some proto file and i'll generate c++ classes for that proto file and in server side i wish to use the same proto file and their i will generate java classes for that proto file<br>
is it possible to use like this<br>
any suggesstion will be appreciated<br>
Thank you.</p>
| java c++ | [1, 6] |
1,873,641 | 1,873,642 | Trying to add Javascript to PHP file | <p>I am trying to add javascript to a php file and everytime I add the javascript and save, it just displays the javascript and not the rest of the page content.</p>
<p>The code looks like this:</p>
<pre><code><section class="portlet grid_6 leading">
<header>
<h2>Time <script type="text/javascript">
<!--var currentTime = new Date()
var hours = currentTime.getHours()
var minutes = currentTime.getMinutes()
if (minutes < 10){
minutes = "0" + minutes
}
document.write(hours + ":" + minutes + " ")
if(hours > 11){
document.write("PM")
} else {
document.write("AM")
}
//-->
</script></h2>
</code></pre>
<p>Any suggestions?</p>
| php javascript | [2, 3] |
4,721,444 | 4,721,445 | PHP if statement if the page was loaded with ajax | <p>I have a page that loads with a div populated from an include file (pullList.php), but if you click a button (let's say a "re-load" button) the content of the div is reloaded with that same file (pullList.php).</p>
<p>The problem now is that when the page is loaded via ajax (with jquery) I need an include file (function.php) inside the pullList.php file which is already included on the page. </p>
<p>So, ideally I'd like to be able to write a statement that says </p>
<pre><code>if(the page was loaded with ajax) {
include(function.php);
}
</code></pre>
<p>That way the function.php file will only be loaded once, and if the page is requested again via ajax, it has the right functions to display the content properly.</p>
<p>I've tried using include_once, but didn't work - had the same problem. Any suggestions?</p>
<p>Thanks!</p>
| php jquery | [2, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.