Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
4,326,576 | 4,326,577 | Limiting a textarea to a fixed number of chinese characters | <p>I had been given a requirement from client saying limit the textarea – 200 characters in English, it is approximate 66 Chinese characters for UTF8.</p>
<p>I wonder how do I check them whether it is chinese character or english character and calculating them in the sense of maximum length ?</p>
| php javascript | [2, 3] |
3,311,625 | 3,311,626 | Python and C++ code comparison | <p>I have the following <code>python</code> code</p>
<pre><code>for m,n in [(-1,1),(-1,0),(-1,-1)] if 0<=i+m<b and 0<=j+n<l and image[i+m][j+n] == '0']
</code></pre>
<p><code>image</code> is array defined and <code>i</code> and <code>j</code> is also defined.</p>
<p>Following is how I have converted this into <code>C++</code></p>
<pre><code>std::vector<std::pair<int,int> > direction;
direction.push_back(std::make_pair(-1,1));
direction.push_back(std::make_pair(-1,0));
direction.push_back(std::make_pair(-1,-1));
for ( std::vector<std::pair<int,int> >::iterator itr = direction.begin();
itr != direction.end(); ++itr) {
int m = (*itr).first;
int n = (*itr).second;
if ( (0 <= i + m && i + m < width ) &&
(0 <= j + n && j + n < width ) &&
image[i + m][j + n ] == 0) {
}
</code></pre>
<p>Is this conversion correct?</p>
| c++ python | [6, 7] |
1,402,012 | 1,402,013 | Jquery Quoting String | <p>I cannot seem to get the quotes around this statement right. No matter what combination I try.
I am really confused on how it should be quoted.</p>
<pre><code>$(#imagearea).append("<img id='"+theWord.charAt(i).toUpperCase+"'.png'" src='images/'+theWord.charAt(i).toUpperCase+"'.png'/>");
</code></pre>
| javascript jquery | [3, 5] |
5,574,314 | 5,574,315 | get text node of an element | <pre><code><div class="title">
I am text node
<a class="edit">Edit</a>
</div>
</code></pre>
<p>I wish to get the "Iam text node" do not wish to remove the "edit" tag and need a cross browser solution.
it might be something simple, but I can't think of another way of getting to it.</p>
| javascript jquery | [3, 5] |
1,939,736 | 1,939,737 | How to pass a variable className to my object function, using JQuery? | <p>I'm new to Object-Orientated-Programming. I am trying to pass a element class as a parameter to a function. I know I've missed something...see code below:</p>
<pre><code>var n = new Object();
n.mousePosition = function(class, y){
$(document).mousemove(function(e){
if(e.pageY < y){ $(class).slideDown(200); }
if(e.pageY > y){ $(class).slideUp(200); }
});
}
n.mousePosition('.nav', 100);
</code></pre>
<p>The <code>.nav</code> is the element class name which I'm trying to pass to my function as the <code>class</code> parameter, the <code>$(class).slideDown...</code> is not picking it up</p>
<p>Any help would be greatly appreciated, thanks</p>
| javascript jquery | [3, 5] |
1,103,333 | 1,103,334 | "this" reference best-practices | <h2>Duplicate</h2>
<blockquote>
<p><a href="http://stackoverflow.com/questions/23250/when-do-you-use-the-this-keyword">When do you use the “this” keyword?</a></p>
</blockquote>
<p><hr /></p>
<p>What is the best practice case of referencing "this" in any given class?</p>
<p>Basic C# Forms example:</p>
<pre><code>class SomeForm : Form
{
public SomeForm() {
Text= "Hey, I'm a new form.";
Size= new Size(400,350);
SetupButtons();
}
private void SetupButtons() {
Button btn1= new Button();
//...
Controls.Add(btn1);
}
public static void Main() {
Application.Run( new SomeForm() );
}
}
</code></pre>
<p>vs:</p>
<pre><code>class SomeForm : Form
{
public SomeForm() {
this.Text= "Hey, I'm a new form.";
this.Size= new Size(400,350);
this.SetupButtons();
}
private void SetupButtons() {
Button btn1= new Button();
//...
this.Controls.Add(btn1);
}
public static void Main() {
Application.Run( new SomeForm() );
}
}
</code></pre>
| c# java | [0, 1] |
3,350,527 | 3,350,528 | How do i get Client Id of usercontrol which is inside a tabconatiner? | <p>I have a tabcontainer which contains tabpanel which in turn contains a usercontrol. If i try to get usercontrols id using </p>
<pre><code><cc1:TabContainer ID="tabContainer" runat="server" ActiveTabIndex="0" Width="100%"
OnClientActiveTabChanged="tabChanged" onChange="tabChanged">
<cc1:TabPanel ID="tabGeneral" runat="server" HeaderText="General">
<HeaderTemplate>
General
</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanelGeneralTab" runat="server">
<ContentTemplate>
<POGen:POProcessingGeneral ID="POProcessingGeneral1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</cc1:TabPanel>
</code></pre>
<p></p>
<p>This statement returns 0</p>
<pre><code> alert($('#<%=tabGeneral.ClientID %> #<%=POProcessingGeneral1.ClientID%>').length);
</code></pre>
<p>How do i get clientid of usercontrol?</p>
| jquery asp.net | [5, 9] |
4,395,359 | 4,395,360 | How to add more than one List<String> in Android? | <p>How to assign more than one List in Android?</p>
<pre><code>List<String> inc = dh.selectInct1();
ArrayAdapter<String> inc1 = new ArrayAdapter<String>(this,R.layout.list,R.id.textViewx,inc);
lvinc.setAdapter(inc1);
lvinc.setOnItemClickListener(this);
</code></pre>
<p>Here <code>dh.selectInct1();</code> returns a list that is assigned into <code>inc</code>. Now I need to add one more list from database to this already existing <code>inc</code>. How to achieve it?</p>
| java android | [1, 4] |
5,986,364 | 5,986,365 | Java c++ Reference question | <p>In c++ we use & to represent pass by reference. Since objects are always passed by reference you do not need to use this &? Or does it not matter?</p>
<p>How do java and c++ differ in pass by value and reference. Everything in java I thought is pass by reference but it is pass by value? Why is this? So is it primitives are pass by value while class objects are pass by reference?</p>
| java c++ | [1, 6] |
4,053,518 | 4,053,519 | To get controls inside static function | <p>I am calling function in codebehind from javascript using webservice.</p>
<pre><code>function GetAdmissionType()
{
InitComponents();
var type="";
type=document.getElementById(dlAdmissionType.id).value;
document.getElementById(hdnAdmissionType.id).value=document.getElementById(dlAdmissionType.id).value;
else if(type=="2")
{
InitComponents();
ViewResettingPanel()
makeFavorite(1);
}
}
function makeFavorite(id) {
PageMethods.SaveInfo(id, CallSuccess, CallFailed);
}
// This will be Called on success
function CallSuccess(res, id) {
alert(destCtrl);
}
// This will be Called on failure
function CallFailed(res) {
alert(res.get_message());
}
</code></pre>
<p>Following is my code in codebehind</p>
<pre><code>[System.Web.Services.WebMethod]
public static void SaveInfo(String Id)
{
//to get textbox in form
}
</code></pre>
<p>Problem is iam not getting controls in aspx page in SaveInfo.Can anybody help to access controls in form inside saveinfo?</p>
| c# asp.net | [0, 9] |
305,967 | 305,968 | updating config file | <p>I am trying to update the app.config file of another application from my project both are in c#. I know how to update it for the project in memory but not sure how to access the app.config file of my other project. I have following code but that will change the app.config file of my current project not the other one ....thanks for the suggestions or ideas </p>
<pre><code> XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
foreach (XmlElement element in xmlDoc.DocumentElement)
{
if (element.Name.Equals("appSettings"))
{
foreach (XmlNode node in element.ChildNodes)
{
if (node.Attributes[0].Value.Equals("Setting1"))
{
node.Attributes[1].Value = "New Value";
}
}
}
}
</code></pre>
| c# asp.net | [0, 9] |
851,155 | 851,156 | cm to inch converter, two textboxes multply a value | <p>I Have a problem to make a cm to foot/inch converter in C#, this is what a got:</p>
<pre><code><asp:textbox id="txtFoot" runat="server"></asp:textbox>
<asp:textbox id="txtInches" runat="server"></asp:textbox>
<asp:Button id="btnAdd" runat="server" text="Count" onclick="btnAdd_Click" />
<br />
<asp:Label ID="lblResult" runat="server"></asp:Label>is<asp:Label ID="lblFootAndInches" runat="server"></asp:Label>cm
<%--I try to get a result "10'1" is 3,939 cm"--%>
protected void btnAdd_Click(object sender, EventArgs e)
{
lblResult = (txtFoot.Text + "," + txtInches.Text) * 0,39; //I would like to get 10,1 * 0,39 = 3,939 (10 foot and 1 inch)
lblFootAndInches = txtFoot.Text + "'" + txtInches.Text + '"'; //I'm looking for a result like 10'1"
}
</code></pre>
| c# asp.net | [0, 9] |
467,249 | 467,250 | How to extract a string from a url | <p>I have url that looks like this...</p>
<pre><code>http://www.example.com/accounts/?token=111978178853984|683b8096732be7fd725d3332-557626087|m9lSbmoYhZ6Yut4OC3smY1fRf1E.
</code></pre>
<p>from the token </p>
<p>111978178853984|683b8096732be7fd725d3332-<strong>557625434</strong>|m9lSbmoYhZ6Yut4OC3smY1fRf1E</p>
<p>557625434 is the id number. How can I extract the Id no from token using javascript.</p>
<p>I appreciate any help.</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
634,036 | 634,037 | When we use a thread, will it work as a parallel process or a serial process in C#? | <p>When we use a thread, will it work as a parallel process or a serial process in C#?</p>
| c# asp.net | [0, 9] |
2,695,481 | 2,695,482 | Jquery: If form is blank load this query | <p>I've got some JQuery which monitors a form. Basically, for every keyup it will call a php file to search the database.</p>
<pre><code>$(document).ready(function() {
$("#faq_search_input").watermark("Begin Typing to Search");
$("#faq_search_input").keyup(function() {
var faq_search_input = $(this).val();
var dataString = 'keyword='+ faq_search_input;
if (faq_search_input.length > 2) {
$.ajax({
type: "GET",
url: "core/functions/searchdata.php",
data: dataString,
beforeSend: function() {
$('input#faq_search_input').addClass('loading');
},
success: function(server_response) {
$('#searchresultdata').empty();
$('#searchresultdata').append(server_response);
$('span#faq_category_title').html(faq_search_input);
}
});
}
return false;
});
});
</code></pre>
<p>This works fine, however it filters the results in <code>#searchresultdata</code> depending on the query. The only thing is, if nothing is in the form, I want it to load everything - the user should not have to click the form to do this, therefore a <code>.blur</code> would not work.</p>
<p>The PHP file is simply:</p>
<pre><code>if(isset($_GET['keyword'])){}
</code></pre>
| php jquery | [2, 5] |
2,657,939 | 2,657,940 | Required textbox in javascript | <p>I have this code </p>
<pre><code>$(document).ready(function () {
$("#<%= chkSpecialIntegration.ClientID %>").click(function () {
if (this.checked) {
document.getElementById('<%=ddlTypeSpecialIntegration.ClientID %>').style.visibility = 'visible'; }
});
});
</code></pre>
<p>When this is checked then a textbox is no longer required. How can I do this?</p>
| c# javascript jquery | [0, 3, 5] |
452,678 | 452,679 | Controls dissapearing in frames | <p>I have an aspx page which contains some drop down box, text box and a link button and a frame on the same page.
The frame loads another aspx page say Page2.aspx.
When I click the link button, the data from the drop down and text boxes are added to database and the Page2.aspx reads that data from database and displays it in the frame. I have a delete button which is programatically added in the frame.
Problem: The moment I click the delete button, the entire controls in the frame vanishes and the event handler of link button also doesn't get fired. The web application is being tested in mozilla.
What could be the problem?</p>
| c# asp.net | [0, 9] |
1,351,299 | 1,351,300 | Clicking a Dynamically Generated div that opens another dynamically generated Div | <p>ok, Im going to pass on submitting how I would do this...because I dont want a patch to an otherwise crappy piece of code. Heres what Im trying to do: I use php to output some divs. A corresponding set of divs is generated with the first divs. The whole idea is that when the first div is clicked, the corresponding div slides down. My attempts at this so far have been unsuccessful. Im guessing the id is going to have to correspond with the class of the other div or something to that affect. I've been baking on this one for awhile. Any help is really appreciated!</p>
| php jquery | [2, 5] |
2,752,030 | 2,752,031 | GridViewRowCommand keep fire | <p>by right my label1.text will be display by each clicks, however my label was fire during page load, and this is not what i want, so any idea can perform fire event per clicks?</p>
<p><strong>gridview property</strong></p>
<p>asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnRowDataBound="abcde"</p>
<p><strong>link button that inside gridview</strong></p>
<p>asp:LinkButton ID="lnkname" runat="server" Text='<%#Eval("movieTitle") %>' Width=500 CommandName="cmdLink">
<p><strong>code behind for link button</strong></p>
<p>protected void abcde(object sender, GridViewRowEventArgs e)</p>
<pre><code>{
Label1.Text = ((LinkButton)e.Row.FindControl("lnkname")).Text;
}
</code></pre>
| c# asp.net | [0, 9] |
5,824,830 | 5,824,831 | Making browser vertical scrollbar return to top in ASP.NET code | <p>Does anybody know how to make the vertical scrollbar the browser window return to the top in code? Either javascript or code-behind would be fine.</p>
| asp.net javascript | [9, 3] |
2,170,711 | 2,170,712 | .Net form controls drop by one "line" after selection | <p>Yes, I realize that's a bit of a vague title but I'm having a hard time stating the problem. I have a .Net .aspx page that has a Master page, some Ajax, and an updatepanel. My problem occurs on 2 different pages but in both cases I'm either selecting a radio button or a checkbox when the behavior occurs. Immediately after selection the entire page moves down. It does not scroll but instead it is like an extra <br> tag was inserted into the source. I have done HTML source comparisons before and after this change and nothing is different. I can only assume it is related to the updatepanel but I cannot determine where this may be happening.<br>
I'd be happy to provide more information if you can direct me towards a solution.
Thanks!</p>
| c# asp.net | [0, 9] |
4,519,205 | 4,519,206 | Detect if certain db table rows are set? | <p>Hi I want to create a script which detects if certain rows in a mysql table no longer are empty. </p>
<p>I guess i need to run a php script every 5th second which checks certail table rows. If any of them are empty it should continue updating. If not it should redirect to another php page which shows the updated/filled tables. </p>
<p>Any ideas on how to do this?</p>
<p>It is kind of like the game "who wants to be a millionaire" where x persons gets the same question which they need to answer. Answering them will store their answers in certain table rows. When these rows are not empty the main page needs to show all answers and how long time they have spent answering them. </p>
<p>I just need the updste each 5th second script which returns "true" or "false" (if any of the rows are empty). </p>
<p>Cheers,</p>
<p>Mads</p>
| php jquery | [2, 5] |
1,060,602 | 1,060,603 | Selection does not contain a main type. Eclipse error | <p>I've made an AVD (android virtual device).
But when i try to run my application, this shows up:</p>
<p>Your project contains error(s), please fix them before running your application.</p>
<p>The error log shows the following:
NUMBER 1: res\drawable-mdpi\testbackg.png:0: error: Resource entry testbackg is already defined.
NUMBER 2: res\drawable-mdpi\testbackg.jpg:0: Originally defined here.
NUMBER 3: C:\Users\Svein Inge\Android Eclipse\Test 1\res\layout\main.xml:2: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/testbackg.png').</p>
<p>Here's my code (main.xml)</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/testbackg.png"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/open" />
</LinearLayout>
</code></pre>
<p>help</p>
| java android | [1, 4] |
2,971,305 | 2,971,306 | How to animate a div at the same time as slideToggle hide/show | <p>I'm working on a new website, where I have a contact 'tab' coming from the top of the browser window. Here's the link: <a href="http://www.stefanhagen.nl/testlab/" rel="nofollow">http://www.stefanhagen.nl/testlab/</a>. If you click the tab, a contact form will appear (using slideToggle). But while the contact form appears, I want the tab to slide down with the contact form, as if the user 'pulls' the form inside the browser window. I now use slideToggle to show the contact form on clicking the tab. Where do I put the code to animate the tab itself? By the way: I have a liquid layout, so the tab isn't 'pushed down' like normal, because I use absolute positioning for every div. Thanx in advance, and here's my JQuery so far:</p>
<pre><code>$('div.contacttab').click(function(){
$('div.contactform').slideToggle('slow', function(){
});
</code></pre>
| javascript jquery | [3, 5] |
1,741,191 | 1,741,192 | Is there a way for an ASP.NET app to show a wait screen to the user that kicks off the Application_Start event? | <p>Greetings folks,</p>
<p>The ASP.NET application I'm maintaining has a fairly long start up procedure. A number of data files are updated, etc. I've been asked if there is a way for the application to return a wait screen (static if necessary) while Application_Start is running?</p>
| c# asp.net | [0, 9] |
854,490 | 854,491 | disabled control being reenabled but still not posting back contents to server | <p>I have a couple of radio buttons that are controlling text entry into a textarea.</p>
<pre><code><tr id="trTextNote" runat="server">
<td colSpan="2"></td>
<td class="IndentedCell" noWrap colSpan="2">
<asp:textbox id="txtIncludeNote" runat="server" Width="352px" Height="46px" TextMode="MultiLine" MaxLength="250">
</asp:textbox>
</td>
</tr>
</code></pre>
<p>during the .ready, the textarea is being disbled with this</p>
<pre><code>var textNote = $("[id$='txtIncludeNote']");
$(textNote).attr("disabled", "disabled");
$("[id$='lblHeaderNote']").addClass("disabledFont");
</code></pre>
<p>Also, in the .ready I am attaching this to the click handlers of the radio buttons ...</p>
<pre><code>$("input[id*='optIncludeNoteYes']").click(function() {
$("[id$='lblHeaderNote']").removeClass("disabledFont");
$("[id$='txtIncludeNote']").removeAttr("disabled");
});
$("input[id*='optIncludeNoteNo']").click(function() {
$("[id$='lblHeaderNote']").addClass("disabledFont");
$("[id$='txtIncludeNote']").attr("disabled", "disabled");
});
</code></pre>
<p>On the client side, this all seems to be working perfectly, the text area is disbled when it should, and enabled/disabled when the clicks of the radio buttons happen. The issue is that when the user clicks the optIncludeNoteYes radio button, types in some data, and submits the page ... that data is not available on the server side. If they immediately post back again (with no changes) that data is then available. I put the autopostback = true on the radio buttons, just playing around, with no code behind it, and that fixes the issue as well.</p>
<p>What am I missing?</p>
| javascript asp.net jquery | [3, 9, 5] |
2,544,496 | 2,544,497 | (Label)this.FindControl("lbl") not working | <p>I have a script that runs and tries to input a value in a label but when ever I run it I get the following error even though the label is there and the id is correct.</p>
<blockquote>
<p>Object reference not set to an instance of an object. </p>
</blockquote>
<p>Code:</p>
<pre><code>string answerLbl = "q" + reader["QuestionId"].ToString()
+ "_" + reader["AnswerId"].ToString();
Label lbl = (Label)this.FindControl(answerLbl);
lbl.Text = "label text";
</code></pre>
| c# asp.net | [0, 9] |
515,642 | 515,643 | Debug-only methods or interface in Java/Android | <p>I'm a newbie to Android and Java--lots of experience with C/C++/C#.</p>
<p>I have in interface that looks like this:</p>
<pre><code>class WellNamedClass {
void greatMethodToCallWhenever() { /*...*/ }
void debugOnlyMethod() { /*...*/ }
}
</code></pre>
<p>In the the languages mentioned above, I would either #ifdef the entire debugOnlyMethod method out or #ifdef the implementation out so it simply does nothing, but Java doesn't have a preprocessor.</p>
<p>I'm totally comfortable with having the code there and checking at run-time whether we are in a debug build, but I can't even find a way of doing that.</p>
<p>I've found suggestions like <a href="http://stackoverflow.com/questions/32041/how-to-remove-debug-statements-from-production-code-in-java">this one</a> where you create a class with a constant indicating whether debug (or whatever else you want) is enabled. This could work, but then you have to manually change code to get a debug vs. a release build.</p>
<p>Has anyone else solved this problem? Thanks.</p>
| java android | [1, 4] |
1,795,735 | 1,795,736 | c# - How to get reference to object A inside A's class? | <p>In my SharePoint 2010 c# / asp.net site, I have a class defined like</p>
<pre><code>namespace PDF_Library.VisualWebPart1
{
public partial class PDF_Library : Usercontrol
{
public static PDF_Library current;
protected void Page_Load(object sender, EventArgs e)
{
current = (PDF_Library)this;
}
}
}
public static class Page_State
{
public static Page is_display()
{
return PDF_Library.current.Page; // didn't work...
}
}
</code></pre>
<p>It doesn't have a constructor.
How can I get the reference to <code>the current instance of this class</code>? </p>
<p>I tried something like this in the top</p>
<p><code>public static PDF_Library current;</code></p>
<p>Then in a function it had</p>
<p><code>current = (PDF_Library)this;</code></p>
<p>But that didn't work...</p>
| c# asp.net | [0, 9] |
1,141,577 | 1,141,578 | How to get the selected-row count from a list box in asp.net | <pre><code>int countSelected = ListBoxMembers.Items.Cast<ListItem>().Where(i => i.Selected).Count();
string groupName = txt_GroupName.Text;
for (int counter = 0; counter < ListBoxMembers.Items.Count; counter++)
</code></pre>
<p>I have 20 items in the list, when I select only 2 ListBoxMembers.Items.Count shouws 20 and Countselected is 0</p>
<p>i tried this int count = ListBoxMembers.GetSelectedIndices().length;
system.web.ui.controls.listbox does not contain a definition for selected items and no extension method selevted items acceptin first argument error</p>
<pre><code> <asp:ListBox ID="ListBoxMembers" runat="server" SelectionMode="Multiple" CssClass="style102"
ToolTip="Press ctrl to select multiple users" DataValueField="FirstName"></asp:ListBox>
</code></pre>
| c# asp.net | [0, 9] |
1,597,232 | 1,597,233 | Event handler reference from utility class | <p>I have this method that I'm currently putting in each page I make, I know there should be a good way to move it to a single place for ease of maintenance and simplicity. I'm just not sure how I should handle the event handler. The event handler needs to be on each page, so how would I pass in a reference to the page properly so I can reference the event handler?</p>
<pre><code>private void InsertLinkButton(string text, string id, UpdatePanel updateSummary)
{
LinkButton link = new LinkButton();
link.Text = text;
link.Click += new EventHandler(link_Click); <------
link.CausesValidation = false;
AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
trigger.ControlID = link.ID = "link" + id;
trigger.EventName = "Click";
Utils.Tag(link, placeHolderSummary);
updateSummary.Triggers.Add(trigger);
}
</code></pre>
| c# asp.net | [0, 9] |
4,996,615 | 4,996,616 | displays the message box two times in a row | <p>I have a problem with making message box. Here is the code:</p>
<pre><code><? php
echo "<script language=\"Javascript\"> \ n";
echo "Confirmed = window.confirm ('Are you sure you want to store data ?');";
echo "if (confirmed)";
echo "{";
echo "window.confirm ('Do you want to add any more data');";
echo "document.location.href = 'index.php';";
echo "}";
echo "else";
echo "{";
echo "window.confirm ('you press the CANCEL button');";
echo "}";
echo "</ script>";
?>
</code></pre>
<p>Above code can only link to a page only while that I need links to each page. please help n_n</p>
<p>Translated from original:</p>
<p>saya mempunyai masalah dengan membuat message box.saya mempunyai kode:</p>
<pre><code>enter code here
<?php
echo "<script language=\"Javascript\">\n";
echo "confirmed = window.confirm('Anda yakin akan menyimpan data ?');";
echo "if (confirmed)";
echo "{";
echo "window.confirm('Apakah anda ingin menambah data lagi');";
echo "document.location.href='index.php';";
echo "}";
echo "else ";
echo "{";
echo "window.confirm('Anda menekan tombol CANCEL');";
echo "}";
echo "</script>";
?>
</code></pre>
<p>kode diatas hanya bisa link ke 1 halaman saja sedangkan yang saya butuhkan link ke setiap halaman. mohon bantuannya n_n</p>
| php javascript | [2, 3] |
1,444,550 | 1,444,551 | Can i access internal memory of Application of A using another apllication B? | <p>I have two applications.</p>
<p>Application - A and Application - B</p>
<p>Application - A download songs from the server and stored into the internal memory . I want to read those download files using Application - B.</p>
<p>Is it possible ? If yes then how can i do this ?</p>
<p>Thanks In Advace.</p>
| java android | [1, 4] |
1,371,474 | 1,371,475 | How to trigger a toggle function by click another click-event-handler? | <p>I have already searched the google oracle etc and found this <a href="http://stackoverflow.com/questions/3370934/trigger-second-function-in-toggle">Trigger second function in toggle()</a> similar article, but it doesnt helps me.</p>
<p>My pricip is the same, i have a toggle function which includes two other functions.</p>
<pre class="lang-sql prettyprint-override"><code>$('#master').toggle($.proxy(this.fnctA,this), $.proxy(this.fnctB,this));
</code></pre>
<p>within the #click element i have some necessary attributes which i need in the functions <code>fnctA</code> or <code>fnctB</code>.</p>
<p>my new task is that i create two buttons (one for <code>fnctA</code> and one for <code>fnctB</code>) out of these area. and they should do the same as i clicked the #master.</p>
<p>i.e. what I want is:</p>
<pre class="lang-sql prettyprint-override"><code> $('.fnctA').bind('click', $.proxy(this.testA, this));
$('.fnctB').bind('click', $.proxy(this.testB, this));
testA:function(){
$("#master").toggle('firstToggle');
},
testB:function(){
$("#master").toggle('lastToggle');
}
</code></pre>
<p>can any give me any tips etc?</p>
| javascript jquery | [3, 5] |
3,291,554 | 3,291,555 | creating a plugin return this question | <p>it says in the documentation to allways return the this object in all cases i've seen so far you return this.each() function. So are there anyother cases other than this.each that you would return</p>
| javascript jquery | [3, 5] |
5,434,842 | 5,434,843 | asp.net error: Parser Error | <p>I'm suddenly getting below message in browser when debugging application out of Visual Studio 2008 target .net fw 3.5</p>
<p>Research online lead me to confirm the following:
The "Inherits" in markup page matches code-behind namespace class reference: "USFBugTracker.UpdateContracts". I also checked that the target CPU (x86) is correct.</p>
<p>I'll gladly post some code but when debugging not even getting to the point of running anything. I'm getting this debugging. I've not yet published this anywhere.</p>
<p>Any ideas? Thanks.</p>
<h2>Server Error in '/' Application.</h2>
<p>Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. </p>
<p>Parser Error Message: Could not load type 'USFBugTracker.UpdateContracts'.</p>
<p>Source Error: </p>
<pre><code>Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdateContracts.aspx.cs"
Line 2: Inherits="USFBugTracker.UpdateContracts" %>
Line 3:
</code></pre>
| c# asp.net | [0, 9] |
1,022,640 | 1,022,641 | Invalidate method to update interface | <p>I have the following code in the OnCreate to show a ListView with data:</p>
<pre><code>obtenerDatosTareas();
int tamaño;
tamaño = Integer.parseInt(jsonTareas.getString("tamaño"));
ArrayList<Tarea> items = new ArrayList<Tarea>();
int j =0;
while(j<tamaño){
items.add(new Tarea(j,claves_tareas.get(j), prioridades_tareas.get(j),descripciones_tareas.get(j)));
++j;
}
adapter = new ItemTareaAdapter(this,items);
lstOpciones.setAdapter(adapter);
</code></pre>
<p>In addition, every five seconds I check if a task is assigned to the user so that the ListView that task should be added and displayed on screen:</p>
<pre><code>class MyTask extends TimerTask {
public void run() {
if (reunionInactiva()) {
Log.i("Prueba","Dentro del if de reunionActiva. Reunion finalizada");
}
Message msg = new Message();
puente.sendMessage(msg);
Log.i("Prueba","Dentro de MyTas");
}
}
private Handler puente = new Handler() {
public void handleMssage (Message msg) {
lstOpciones.invalidate();
}
};
MyTask miTarea = new MyTask();
timer.schedule(miTarea, 0,5000);
</code></pre>
<p>As I read the internet for ListView to refresh and display the new data should call the Invalidate method because if I update the interface in the run() method of MyTask would fail.
But when I run this code does not update the ListView.</p>
<p>What am I doing wrong? Thanks</p>
| java android | [1, 4] |
3,392,650 | 3,392,651 | How jQuery Snap To Elements Works? | <p>I was puzzled when I saw jQuery "Snap to element". Does anyone know how can I implement it without jQuery, with just raw javascript.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,176,092 | 2,176,093 | Passing a querystring value through a javascript window.open | <p>I need to pass the pass value stored in a asp hiddenfield to a querystring using the window.open.</p>
<pre><code>onclick="window.open('../New/FeedbackV4.aspx','FeedbackWindow','width=960,height=640,scrollbars=yes,resizable=yes,status=yes')"
</code></pre>
<p>I need to get the value of the hidden field and pass it as a querystring</p>
| javascript asp.net | [3, 9] |
76,004 | 76,005 | How to develop application for both 320x480 and 480x854? | <p>i to implement my same application for both 320x480 and 480x854 resolutions. For this purpose i copied my images in hdpi and mdpi drawable folders but still it is not working with480x854 resolution. What i must do other than this to solve my problem?
Thanks</p>
| java android | [1, 4] |
495,044 | 495,045 | setting stack size to thread seems to make no difference in android | <p>I using following thread api to set stack size , say i am assigning 1 or 64 or some small value so that i can simulate a stackoverflow exception but the value set does not seem to make any difference.</p>
<pre><code>Thread(ThreadGroup group, Runnable target, String name, long stackSize)
</code></pre>
| java android | [1, 4] |
5,737,303 | 5,737,304 | Removing Numbers from a String using Javascript | <p>How do I remove numbers from a string using Javascript?</p>
<p>I am not very good with regex at all but I think I can use with replace to achieve the above?</p>
<p>It would actually be great if there was something JQuery offered already to do this?</p>
<pre><code>//Something Like this??
var string = 'All23';
string.replace('REGEX', '');
</code></pre>
<p>I appreciate any help on this.</p>
| javascript jquery | [3, 5] |
3,323,147 | 3,323,148 | PHP and jQuery function—only works once? | <p>I have the following function. When I click the first time, it returns a random number, but all subsequent clicks always return the same number. How come it doesn't refresh?</p>
<pre><code><script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#btn-get-random-image').click(function () {
$('#my-img').attr('src', '<?php echo $pics[array_rand($pics, 1)]; ?>');
});
});
</script>
</code></pre>
| php jquery | [2, 5] |
2,037,317 | 2,037,318 | is it a good idea to put all javascript file's content into one file to reduce server request and keep at bottom to increase performance? | <p>I use simple javascripts, jquery library and many plugins , should i make one file for all if yes then what we need to "just copy and paste and code from all file into one in needed order" or any thing else need to be considerd.</p>
<p>as stated here <a href="http://developer.yahoo.com/performance/rules.html#num_http" rel="nofollow">http://developer.yahoo.com/performance/rules.html#num_http</a></p>
<blockquote>
<p>Combined files are a way to reduce the
number of HTTP requests by combining
all scripts into a single script, and
similarly combining all CSS into a
single stylesheet. Combining files is
more challenging when the scripts and
stylesheets vary from page to page,
but making this part of your release
process improves response times.</p>
</blockquote>
<p>and this <a href="http://developer.yahoo.com/performance/rules.html#js_bottom" rel="nofollow">http://developer.yahoo.com/performance/rules.html#js_bottom</a></p>
<blockquote>
<p>The problem caused by scripts is that
they block parallel downloads. The
HTTP/1.1 specification suggests that
browsers download no more than two
components in parallel per hostname.
If you serve your images from multiple
hostnames, you can get more than two
downloads to occur in parallel. While
a script is downloading, however, the
browser won't start any other
downloads, even on different hostname</p>
</blockquote>
<p>It these are god practices then </p>
<h2>How to combine multiple javascript ito one without getting any conflict?</h2>
<p><strong>Is it just same as i copy all css code from all files into one or it's tricky?</strong></p>
| asp.net javascript jquery | [9, 3, 5] |
934,658 | 934,659 | create guid and send with confirmation link | <p>I create guid using the code this</p>
<pre><code>sGuid = System.Guid.NewGuid().ToString();
</code></pre>
<p>And passing it with the confirmation link using this:</p>
<pre><code>const string body = "To confirm 'http://www.mysite.com/verify.aspx?sGuid'Verify your account";
</code></pre>
<p>But, I find that in my email inbox massage it looks like</p>
<pre><code>http://www.mysite.com/verify.aspx?sGuid
</code></pre>
<p>The confirmation link shows no guid. I can't find what is wrong. I am using localhost .<strong>Is there anyway to test the confirmation link at using localhost?</strong></p>
| c# asp.net | [0, 9] |
5,225,103 | 5,225,104 | console.log says object is undefined when I call any of its members | <p><strong>The Environment</strong></p>
<p>Mozilla Firefox 11 Running MAMP and testing on localhost</p>
<p><strong>The Error</strong></p>
<p>dirObject[data] is undefined<br>
h t t p : / / localhost:8888/framework/<br>
Line 34</p>
<p><b>The Symptom</b> </p>
<p>console.log(<strong>object</strong>[<em>member</em>]); produces expected results (returns the <strong>object</strong>), but console.log(<strong>object</strong>[<em>member</em>][<em>member</em>]); returns that <strong>object</strong> is undefined.</p>
<p><strong>dirObject</strong></p>
<pre><code>var dirObject ={
'directoryName' : {
directory : 'path/to/the/directory',
txt : 'textFileInDirectory.js',
css : 'styleSheetFileInDirectory.css',
js : 'javaScriptFileInDirectory.js'
}... // There are currently 27 of these structures in my object.
}
</code></pre>
<p><strong>My Code</strong></p>
<pre><code>for(var count = 0; count <= size; count++){
var data = keys[count];
console.log(dirObject[data]['directory']);
}
</code></pre>
<p>-- Returns 'dirObject is undefined' and references the console.logs line number.</p>
<pre><code>for(var count = 0; count <= size; count++){
var data = keys[count];
console.log(dirObject[data]);
}
</code></pre>
<p>-- Returns the multi-dimensional object (Contains root link paths and file names for items listed in my plugins directory. The object exists).</p>
<p>I'm sure this is something dirt simple, and I'm just not get it. Can someone explain what I'm missing, or point in a good direction to figure this stuff out.</p>
<p>Thanks in advanced</p>
<p>Cix</p>
| javascript jquery | [3, 5] |
4,277,232 | 4,277,233 | Jquery Change background color of DIV to #333 only when all checkbox is not checked | <p>I have 5 <code>div</code> with <code>class .thumb-folder</code> and inside each contains a <code>checkbox</code>.
I also have another <code>div</code> with a class <code>.alarm</code>.</p>
<p>When 1 or many <code>checkboxes</code> is checked the <code>div</code> with <code>.alarm class</code> changes background to red.</p>
<p>How to change the <code>div</code> with the <code>.alarm class</code> to <code>background #333</code> only when no <code>checkboxes</code> are checked?</p>
<p>Here is <a href="http://jsfiddle.net/bhykT/" rel="nofollow">a link</a> to jsfiddle of my current code.</p>
| javascript jquery | [3, 5] |
3,021,819 | 3,021,820 | Extract Address component from given address text in javascript | <p>I need to extract the address component from the given address line on web. A example of address type is given below.</p>
<pre><code>CHRIS NISWANDEE
SMALLSYS INC
795 E DRAGRAM
TUCSON AZ 85705
USA
</code></pre>
<p>I need to extract the all Address component like zipcode, street no, direction , home number etc from this text by using javascript or jquery. </p>
<p>Please help to resolved my issue, thanks in advance</p>
| javascript jquery | [3, 5] |
427,349 | 427,350 | How to get selected value of this? | <p>I have a select tag. </p>
<p>Here is the jquery:</p>
<pre><code>$('#offer').change(
function(){
alert($(this + "option:selected").val());
});
</code></pre>
<p>I want to get the value of the option:selected of this. The above code dose not work. But if I pas a id it works <code>"#idofselecet option:selected"</code></p>
| javascript jquery | [3, 5] |
4,922,984 | 4,922,985 | Selecting range of items in unordered list | <p>I want to allow user to select range of items in my unordered list by allowing him to press cntrl key and then select first & last item, all items in between would be selected.
I'm using JQuery, Any suggestion how to approach this problem?
Here is html:</p>
<pre><code> <ul id="ulList_1">
<li>
<a href="#">item 1</a>
</li>
<li>
<a href="#">item 2</a>
</li>
<li>
<a href="#">item 3</a>
</li>
<li>
<a href="#">item 4</a>
</li>
<li>
<a href="#">item 5</a>
</li>
<li>
<a href="#">item 6</a>
</li>
<li>
<a href="#">item 7</a>
</li>
</ul>
</code></pre>
<p>So if user press cntrl key and select "item 2" and then select "item 6" I want all items between "items 3,4,5" to be selected as well.
Thanks</p>
| javascript jquery | [3, 5] |
5,015,798 | 5,015,799 | link with onclick and _dopostback and jquery click event | <p>I have a link (a tag) which is given an onclick event and has dopostback enabled, when generated server-side.
To this link, I later bind a jquery click event.</p>
<p>The onclick event has <code>return false;</code> at the end of the function and the anonymouse function binded by jquery has <code>return true;</code></p>
<p>When I click on the link the jquery function is run and the postback happens, but the code in the inline onclick event is not working.</p>
<p>I tried flipping around the return false and return true.</p>
<p>When the jquery function returns false, the code works in Chrome and FF, but not IE.</p>
<p>When the jquery function returns true, the code works in IE, but not in FF or Chrome.</p>
<p>I have also tried adding the inline code to the onmouseup event, but that does not help either.</p>
| javascript jquery asp.net | [3, 5, 9] |
4,608,303 | 4,608,304 | PHP / jQuery : Loading browser specific page | <p><strong>UPDATE:</strong></p>
<p>The issue is that I am using a lot of Javascript & CSS3 enabled modules which also contain a lot of heavy javascript and images. If it is IE6 to 8 and in some cases even 9, I dont want to display those modules or display them using someother method. Using CSS property <code>display:none</code> or conditional stylesheets using <code>Conditional Comments</code> is not solving my problem as the page still remains heavy loading all the javascript and images.</p>
<p>Hiding them is not the resolution.</p>
<p>Hence I want to load a very diferrent layout with a very diferrent <code><div></code> and module position structure.</p>
<p>and that is why I want to load all together a diferrent page.</p>
<p>Kindly help with some code snippets.</p>
<hr>
<p>I am a newbie at programming and need help. The issue is like this:</p>
<p>I have developed a template for my site and I am using many jQuery and CSS3 functions in it.</p>
<p>Obviously I am having challenges specially with IE. Hence I am seeking help in serving a browser specific page. What I want to do is:</p>
<ol>
<li><p>Identify the browser and IF it is IE then it loads a variable page called ie.php similarly for iphone, chrome, safari, firefox and so on.</p></li>
<li><p>It will be great if you cansuggest me a php solution, However i am also using jQuery hence if there is a simpler and shoter method in jQuery even that is fine.</p></li>
</ol>
<p><strong>PLEASE NOTE :</strong> I am a very novice at programming, hence please help explaining a bit about the functions.</p>
| php jquery | [2, 5] |
1,733,494 | 1,733,495 | When I click "other" radio button nothing happens. Why? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/14482174/a-small-modification-needed-in-html-script-using-javascript-i-m-not-able-to-sor">A small modification needed in html script using javascript, i m not able to sort out</a> </p>
</blockquote>
<p>HTML:</p>
<pre><code><div class="rButtons">
<input type="radio" name="numbers" value="10" onclick="uncheck();" />10
<input type="radio" name="numbers" value="20" onclick="uncheck();" />20
<input type="radio" name="numbers" value="other" onchange="blahblahblah();"/>other
<input type="text" id="other_field" name="other_field" onblur="checktext(this);"/>
</div>
</code></pre>
<p>CSS:</p>
<pre><code><style type="text/css">
#other_field{
visibility: hidden;
width:40px;
height:14px;
border:1px solid #777;
background-color:#111;
font-size:10px;
color:#666;
}
</style>
</code></pre>
<p>jQuery:</p>
<pre><code><script>
function blahblahblah()
{
var $radios = $('input:radio[name=numbers]');
if ($radios.is(':checked') === true) {
$("#other_field").show();
}
else
{
$("#other_field").hide();
}
}
</script>
</code></pre>
<p>All is well.. but the problem is this.. when I click "other" radio button nothing happens.. while it should be opening other field.</p>
| javascript jquery | [3, 5] |
1,330,777 | 1,330,778 | Using jQuery, how do I pass arg to function and then display a message from predefined variable | <p>I want to call this function, pass which type of error it is as an arg, and then display the message.</p>
<pre><code>function msgDialog(msg) {
// Define messages
var errorMsg = "There has been an error. We are sorry about that.";
var loginMsg = "Something went awry with the login. Please try again.";
var uploadMsg = "Your upload failed. Please try again.";
var networkMsg = "You currently are not connected to the internet. Please connect and try again.";
alert(msg);
}
</code></pre>
<p>How do I call that function msgDialog(loginMsg) and have a var which I can assign to the correct message, then do something with that? Here I am alerting it, but I will really display it differently. I know that I need to create a new var with the value of the arg value, but not sure how. Thank you.</p>
| javascript jquery | [3, 5] |
2,129,228 | 2,129,229 | How to pass( Windows credantial) authentication from site A to site B (Publish with Windows authentication) | <p>I have 2 publish website A and B.</p>
<p>B site with windows authentication</p>
<p>I want to open B site as new window from A site, so its ask for windows credential. I have credential in A site. I am opening B site using Javascript.window.open.</p>
<p>Can you pls guide me how i can set window credential for B site from A site.</p>
<p>or is any other way to achieve this. </p>
<p>Please guide me</p>
| c# asp.net | [0, 9] |
2,472,552 | 2,472,553 | How do i get these values to save? | <p>I need the inserted values in this edittext to show up after i quit the application. I currently have it set up so it'll set new default values if this is the first time for a user to set up the settings page but i can't get the set values to save and load the same values. Here is my code.</p>
<pre><code> if (res.equals("555")) {
//post the saved text
} else if (res.equals("510")) {
editTextname.setText("Firstname Lastname", TextView.BufferType.EDITABLE);
editTextphone.setText("XXX-XXX-XXXX", TextView.BufferType.EDITABLE);
editTextemail.setText("[email protected]", TextView.BufferType.EDITABLE);
editTextaddress.setText("Street, City, State, Zip", TextView.BufferType.EDITABLE);
//save the entered text above and show it
}
</code></pre>
| java android | [1, 4] |
3,047,788 | 3,047,789 | List Items not working | <p>I made a simple list which calls other activities when a ListItem is clicked, but it is not working for me. When I click, nothing shows up. WHat is wrong ? Here is the code:</p>
<pre><code> String classes[]={"StartingPoint","Splash", "ex1","ex2"};
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classes));
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
super.onListItemClick(l, v, position, id);
String cheese = classes[position];
try
{
Class ourclass = Class.forName("com.alfred.splashscreenwithsound." + cheese);
Intent myintent = new Intent(this,ourclass);
startActivity(myintent);
}
catch(ClassNotFoundException e)
{
e.printStackTrace();
}
}
</code></pre>
<p>}</p>
| java android | [1, 4] |
3,847,909 | 3,847,910 | Android, collections | <p>I have a generic list in android.</p>
<p>for other hand i have a listview.</p>
<p>How i could bind the generic list into the listview?</p>
<p>Thanks in advance.
Best regards.
Jose</p>
| java android | [1, 4] |
2,423,263 | 2,423,264 | need to reset the function how do i do it | <p>I want to reset this flash in between so that i need not have to wait till the end to restart the flash, how do i reset this?</p>
<pre><code>function flash() {
var arrayId = 0,
splitSet = $('#text_original').html().split(" "),
splitSetLength = splitSet.length;
function flashWord() {
$("#flash_word").html(splitSet[arrayId]);
arrayId += 1;
var t = setTimeout(remove, 1000);
}
function remove() {
if (arrayId < splitSetLength) {
$("#flash_word").html(" ");
flashWord();
} //else reset_flash();
}
flashWord(); }
</code></pre>
<p>please see the <a href="http://jsfiddle.net/HcDfS/" rel="nofollow">http://jsfiddle.net/HcDfS/</a></p>
| javascript jquery | [3, 5] |
3,033,977 | 3,033,978 | Countdown timer get time from client's machine, need server time | <p>I'm using this javascript code in order to calculate the difference between the current time and targeted time.</p>
<p>the counter is working fine, but according to client time, not Server side time.</p>
<p>Here is the code I'm using:</p>
<pre><code> function StartCountDown(myDiv,myTargetDate)
{
var dthen = new Date(myTargetDate);
var dnow = new Date();
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
CountBack(myDiv,gsecs);
}
</code></pre>
<p>how to get the server time, not client local machine time?</p>
| php javascript | [2, 3] |
4,021,485 | 4,021,486 | php page redirect after operation | <p>I have a page (index.php) which has a php grid with subpages(<<1,2,3,4>>). An operation on any page takes you back to index.php. Using $_GET['prd_p'] or $_REQUEST['prd_p'] gives you the page number. I want users to stay on a page after an operation, that means i have to use redirects. </p>
<pre><code><form name="frmSearchMe" action="<?php echo $page_name; ?>" method="POST">
<tr>
<input class='form_button' type='submit' name='btnSubmit' value=' Save ' onclick='return checkerrors();' /></td>
</tr>
//php codes here
</form>
</code></pre>
| php javascript | [2, 3] |
5,712,039 | 5,712,040 | Checking if browser is in fullscreen | <p>Is there a way to check if a browser is currently in fullscreen mode (after the user pressed f11)?</p>
<p>Something like:</p>
<pre><code>if (window.fullscreen) {
// it's fullscreen!
}
else {
// not fs!
}
</code></pre>
<p>Thanks.</p>
<p>Steerpike's answer is pretty good, but my comment:</p>
<blockquote>
<p>Thanks a lot, but this answer is not
sufficient for FF. In Chrome I can set
a small tolerance, but in FF the
urlbar and tabs takes a while to
disappear, which means after pressing
f11, the detected window.innerWidth is
still too small.</p>
</blockquote>
| javascript jquery | [3, 5] |
3,187,085 | 3,187,086 | Port of php str_word_count to c# | <p>I'm migrating a legacy PHP application to .net, and one of the requirements is that the URLs stay exactly as before. </p>
<p>To generate friendly URLs the legacy application uses <a href="http://php.net/manual/en/function.str-word-count.php" rel="nofollow"><code>str_word_count</code></a>, I was wondering if there is a port of this function to C#?</p>
| c# php | [0, 2] |
1,236,272 | 1,236,273 | Question regarding benifits of using one over other regarding function syntax | <p>I was reading the difference between Function Declaration and Function Expression at here </p>
<p><a href="http://stackoverflow.com/questions/1013385/what-is-the-difference-between-a-function-expression-vs-declaration-in-javascript">What is the difference between a function expression vs declaration in Javascript?</a></p>
<p><a href="http://stackoverflow.com/questions/336859/javascript-var-functionname-function-vs-function-functionname">Javascript: var functionName = function() {} vs function functionName() {}</a></p>
<p>I came to know about the difference that one is defined at parse time and the other one at run time. But my curiosity is regarding which to use and which not to use and why one will be preffered over other.</p>
| javascript jquery | [3, 5] |
4,881,497 | 4,881,498 | How to get attributes values separately for each container present on the webpage in jquery? | <p>This question is in continuation to <a href="http://stackoverflow.com/questions/2768580/how-to-get-attributes-of-container-in-jquery">How to get attributes of container in jquer</a>, I have different containers on my webpage and all of them have <code><div id = "some values"></code> now how can I get attributes values separately for each component ? </p>
<p>Is there any way I can know which attribute id belong to which container div ?</p>
<p>Currently I am using :</p>
<pre><code>var id = $( '.promotion' ).attr( 'id' );
</code></pre>
<p>But if I have multiple promotional components on page and all have same div attribute as id than how can I relate that this particular attribute id belonged to this specific container ?</p>
<p><strong>Update</strong>: I am having a function which is called for each container present on the page and so if I am using above mentioned code than will it not always return me the first match for id in the div and would never go to other divs and so I will always get same value for id which is for the first container ? If so than what is the work around for this ?</p>
<pre><code>var id = $( '.promotion' ).this.attr( 'id' );
var id = $( '.promotion' ).$this.attr( 'id' );
var id = this.$( '.promotion' ).attr( 'id' );
</code></pre>
<p>How would I know if the attribute value is for current container, so how should I use this properly to get this information ?</p>
<p>Hope this question is clear.</p>
| javascript jquery | [3, 5] |
2,852,364 | 2,852,365 | FileUpload.HasFile give always false | <p>this is my code where my FileUpload control is outside of update panel but when I click on save button which is under update panel give fileUploadAttachment.HasFile = false</p>
<p>ASPX </p>
<pre><code><asp:Literal runat="server" ID="lblAttachment" Text="Attachment:" /><asp:FileUpload
ID="fileUploadAttachment" runat="server" Width="488px" />
<asp:UpdatePanel ID="updatePanelAction" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" ValidationGroup="Save" />
<asp:Button ID="btnTest" runat="server" Text="Test" Enabled="false" OnClick="btnTest_Click" />
<asp:Button ID="btnConfirmTest" runat="server" Text="Confirm Test" Enabled="false"
OnClick="btnConfirmTest_Click" />
<asp:Button ID="btnSend" runat="server" Text="Send" Enabled="false" OnClick="btnSend_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>CS</p>
<pre><code>protected void btnSave_Click(object sender, EventArgs e)
{
CampaignBAL campaignBAL;
string tmpFileName = "";
User user;
Campaign campaignDetail = new Campaign();
int? campaignID;
if (fileUploadAttachment.HasFile) // return always false
{
tmpFileName = string.Format("{0}\\{1}{2}", Server.MapPath("TempUpload"), Guid.NewGuid(), Path.GetExtension(fileUploadAttachment.PostedFile.FileName));
fileUploadAttachment.PostedFile.SaveAs(tmpFileName);
}
}
</code></pre>
<p>please help me how can I fix it</p>
| c# asp.net | [0, 9] |
3,994,222 | 3,994,223 | getting id passed through a href link in click function | <p>I've got a fairly straight forward question. Why can't I use <code>$('a.view').attr('id')</code> (Ref //1 in code) in my click function? I tried it and it failed to work but <code>this.id</code> works. I guess I primarily want to know the difference in the context of the code below:</p>
<p><strong>displayRecord.php (The following link calls the click function):</strong></p>
<pre><code>echo '<td><a href="#" style="text-decoration: none;" id="'.$data['id'].'" class="view" ><input type="button" value="View" /></a></td>';
</code></pre>
<p><strong>editTicket.php:</strong></p>
<pre><code>$('a.view').click(
function(e)
{
//1
var ticket_id = this.id;
dlg.load('displayRecord.php?id='+this.id, function(){
var escalationValue = '';
$.post('escalateValue.php',{post_ticket_id:ticket_id},
function(data) {
if (data == 'No'){
showCount();
}
});
dlg.dialog('open');
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,031,004 | 4,031,005 | Converting PHP code into JS | <p>I have this PHP code - </p>
<pre><code> <?php
for($i=1; $i<=1000; $i++) {
$array=array();
$array[$i]=54*$i;
$arr=array($array[$i].",");
foreach ($arr as $value) {
echo $value;
}
}
?>
</code></pre>
<p>I tried with:</p>
<pre><code>var i;
for(i=1;i<=1000;i++) {
var array = new Array();
array[i] = 54*i;
var arr = new Array();
arr.push(array[i]+",");
}
alert(arr)
</code></pre>
<p>But it doesn't work.
Where's the mistake?</p>
| php javascript | [2, 3] |
1,452,954 | 1,452,955 | converting template field from integer to hh:mm | <p>I am currently working with a gridview and would like to convert my total minutes field into hh:mm</p>
<p>This is what my code looks like now, it is taking the total minutes and giving back hh.00</p>
<pre><code> </asp:TemplateField>
<asp:TemplateField HeaderText="Hours" HeaderStyle-Width="88px">
<ItemTemplate>
<%# (((PendingApprovalListData)Container.DataItem).TotalMinutes / 60.00).ToString("N2")%>
</ItemTemplate>
</code></pre>
| c# asp.net | [0, 9] |
4,864,682 | 4,864,683 | from WPF to ASP.NET where do I start? | <p>I've been developning c# app in WPF for a few years now and I wanna start doing webapps in ASP.NET but I've now Idea where to start. Can anyone gimme some gudiance on where to start?</p>
| c# asp.net | [0, 9] |
388,661 | 388,662 | Run a function as far as a variable reaches specific values | <p>I have a canvas game which calls a function incScore every time an action is performed in the game to increase the score.</p>
<p>Inside incScore I have a few if statements to draw a particular image to represent a level number on the canvas.</p>
<p>I also want to have a sound play once per level up. The way I've gone about things the lvlup sound will play every time the score matches the if statement.</p>
<p>Can anyone please help me get this so that the sound will only play once when the level changes and not again until the next level change? I'm also mention I'm using jQuery incase it has anything that could help me. </p>
<pre><code>incScore(); //everytime an action in the game causes the score to increase
function incScore(){
if (scoreTotal < 500){
lvlimg = "L01";
drawLevel(lvlimg);
lvlupSound();
}
else if (scoreTotal > 500 && scoreTotal < 1000){
lvlimg = "L02";
drawLevel(lvlimg);
lvlupSound();
}
else{
lvlimg = "L03";
drawLevel(lvlimg);
lvlupSound();
}
}
</code></pre>
| javascript jquery | [3, 5] |
1,586,599 | 1,586,600 | Calling a method in another class to convert an object to that class | <p>I was wondering about something very basic but that I haven't been able to figure out. I've read the similar questions, but they don't particularly answer my question.</p>
<p>Let's say I have a string. I want to convert it into a double. Now I see that there is a function known as parseDouble in java.lang.Double. However, how do I call it? The string is in my Android strings.xml file if that's any help.</p>
<p>Thanks.</p>
| java android | [1, 4] |
1,073,832 | 1,073,833 | How to read all the values inside an multiple form with jquery | <p>I'm trying to get my uploading script to work with jquery but having problems with fetching the values (files) that are queued up in a multiple form.</p>
<p>I can get it to work so i can select like 10 files in a single input but when i'm trying to fetch those values i only get the first file of the 10 i added simultaneously. I can upload the files and fetch its values but i want to make it to work with jqeury as well something i can't get to work. Here is the code:</p>
<pre><code> <!DOCTYPE html>
<html lang="en-us">
<head>
<script src="jquery-min.js"></script>
<script>
$(document).ready(function() {
$("form").change(function() {
var form = $(".forms").val();
$(".files").append("Files:"+form);
});
});
</script>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" class="forms" value="" name="upload[]" multiple>
<button type="submit">Upload!</button>
</form>
<div class="files"></div>
<?php var_dump($_FILES);?>
</body>
</html>
</code></pre>
<p>So when i drag and select the files and adds them then only the first value gets assigned to "div.files". So my question is how do i read the array of the files inside of it so i just don't get the first one?</p>
<p>Here is an image that displays the problem: <a href="http://i.stack.imgur.com/lOAvk.png" rel="nofollow">http://i.stack.imgur.com/lOAvk.png</a></p>
| php jquery | [2, 5] |
130,451 | 130,452 | dll of flexpaper | <p>I want to use flexpaper in asp.net but don 't want to install exe of swftools (used in flexpaper to convert pdf to swf), anyone knows where to find dll of swftools used in flexpaper.also dll is compatible with flexpaper?</p>
| c# asp.net | [0, 9] |
4,687,583 | 4,687,584 | Javascript/jQuery undefined | <p>The reason that the title is named "jQuery / Javascript undefined" isn't because that I assume jQuery is a language, I do know that jQuery is a library of javascript language, just in case if some pedantic readers read this. The reason why I wrote that as the title is because I don't know what is wrong with the code, the jQuery or the Javascript (all jQuery's code compiled) is wrong.</p>
<p>Okay, back to the question, take a look at the following code, they give me an undefined value</p>
<pre><code>//username validation
function username_val(){
username_value = $("input[name='username']").val();
span_error = "span[name='username_error']";
$(span_error).load('ajax_signup_username', {php_username_error:username_value}, function(){
return true;
});
}
</code></pre>
<p>I alerted this, and then an "undefined" is returned. I assumed that a true would be returned instead.</p>
<pre><code>function final_val(){
alert( username_val() );
}
</code></pre>
<p><strong>EDIT:</strong> Some of you guys said that I can only return true on the success param, but I need this for validation, so if all of the validation methods are true, in the final_val will return true. The point is that I needed a true value in the final_val() or if you guys have other method to validate it, please tell me. Note: I'm in a hurry, so if I misunderstand your answer, please forgive me. I'll be gone for a few hours, until then I'll check your answers.</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
5,126,625 | 5,126,626 | Is it possible to share ONE file with strings between ASPX, C# and JavaScript? | <p>I'd like to externalize all of the strings used in the project into one file and be able to use it inside aspx, C# code behind and on the client side in JavaScript.<br />
The reason I want to do it is because many strings are shared, i.e. the same in two places. </p>
<p>Is it possible? Is there a better way?</p>
| c# asp.net javascript | [0, 9, 3] |
1,081,981 | 1,081,982 | Jquery function to detect cookies and set focus | <p>I have an asp.net login control and I have implemented the user name to be remembered using cookies. How can I use Jquery(javascript) function to detect cookies and set the focus on the password field?</p>
| javascript asp.net jquery | [3, 9, 5] |
2,025,770 | 2,025,771 | Infinite Horizontal Scrolling Div | <p>I need to have a div that will scroll horizontally as you move your mouse further to the right or the left of the div.</p>
<p>I found the Smooth Div Scroll plugin (http://www.smoothdivscroll.com/) that is really close to what I need. However, there are a couple problems with this.</p>
<ol>
<li><p>I need to be able to make the scrolling element start at a set position (i.e. left:-340px). This plugin only allows you to be able to set a starting element, not an actual position.</p></li>
<li><p>I need the scrolling element to be infinite. So, if I'm scrolling to the right, when it gets to the end, it should keep going to the right and repeat the element from the beginning.</p></li>
</ol>
<p>If someone could help me find a solution for these items or at least point me in the right direction, I would be very appreciative.</p>
| javascript jquery | [3, 5] |
5,998,545 | 5,998,546 | Developing Java, C#, and .NET on the same machine | <p>I found a couple of threads that touch on development of C#/Java apps but I don't think they go along with this question.</p>
<p>I was wondering if it was a good idea to be developing Java, C#, and .NET applications on one computer. That means there's ## .NET versions installed at one time, ### Java JRE's installed at any given time. Is that a good idea? I'm just thinking there is eventually going to be a huuuuuuuge conflict and the computer is going to say "I'm done. Poof".</p>
| c# java | [0, 1] |
633,143 | 633,144 | .delay() function doesn't work on attr() function | <p>I have some images in my website and with this code I would like to hide them, change the shown image and show them back, but the new picture shows instantly. I don't know what to do.</p>
<p>This is the javascript:</p>
<pre><code>$(document).ready(function() {
$('.show').click(function() {
$(this).removeClass("show").addClass("clickedShow");
$('.show').animate({opacity: 0}, 1000);
$(this).delay(1000).animate({opacity: 0}, 1000);
$(this).animate({opacity: 1}, 1000).attr("src", "pic2.png");
$('.show').delay(1000).animate({opacity: 1}, 1000).attr("src", "pic2.png");
});
});
</code></pre>
| javascript jquery | [3, 5] |
5,104,895 | 5,104,896 | Passing two values to jQuery Animate for backgroundPosition | <p>I need to animate a background image using backgroundPosition.</p>
<p>The problem is, if I animate on the X axis, the value passed by default to the Y Axis is CENTER.</p>
<p>This causes the image to jump vertically. I've seen some plugins to help alleviate that, but I'd like to keep the code as lean as possible.</p>
<p>Now that jQuery 1.8 includes new animation options, is there an easier way to do this? I need to apply easing.</p>
| javascript jquery | [3, 5] |
3,686,565 | 3,686,566 | is it possible refresh gridview when change table in DB? | <p>Refresh the Grid Automatically when table changes in the DB </p>
<p>like twitter and other facebook .</p>
<p>how to do this using any asp.net controls using c#</p>
| c# asp.net | [0, 9] |
3,522,010 | 3,522,011 | asp .net out of memory problem | <pre><code> private void GenerateThumbnails(double scaleFactor, string sourcePath,
string targetPath) {
int wi = Convert.ToInt32(Request.QueryString["dim2"]);
int hi = Convert.ToInt32(Request.QueryString["dim1"]);
using (var image =
System.Drawing.Image.FromFile(sourcePath))
{
var newWidth = (int)(wi);//(image.Width *
scaleFactor);
var newHeight = (int)(hi);// (image.Height *
scaleFactor);
var thumbnailImg = new Bitmap(newWidth, newHeight);
var thumbGraph = Graphics.FromImage(thumbnailImg);
thumbGraph.CompositingQuality =
CompositingQuality.HighQuality;
thumbGraph.SmoothingMode = SmoothingMode.HighQuality;
thumbGraph.InterpolationMode =
InterpolationMode.HighQualityBicubic;
var imageRectangle = new Rectangle(0, 0, newWidth,
newHeight);
thumbGraph.DrawImage(image, imageRectangle);
int getwal = newWidth - 108;
int gethi = newHeight - 30;
SolidBrush brush = new SolidBrush(Color.FromArgb(113,
255, 255, 255));
thumbGraph.DrawString("myfile", new Font("Arial", 12,
System.Drawing.FontStyle.Bold), brush, getwal,gethi);
thumbnailImg.Save(targetPath, image.RawFormat);
} }
</code></pre>
<p>hi i am getting error while uploading pics</p>
<p>i get the error of</p>
<p>Out of memory. Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack
trace for more information about the error and where it originated in
the code. </p>
<pre><code>Exception Details: System.OutOfMemoryException: Out of memory.
Source Error:
Line 177: thumbGraph.InterpolationMode =
InterpolationMode.HighQualityBicubic; Line 178: var
imageRectangle = new Rectangle(0, 0, newWidth, newHeight); Line 179:
thumbGraph.DrawImage(image, imageRectangle); Line 180:
thumbnailImg.Save(targetPath, image.RawFormat);
</code></pre>
| c# asp.net | [0, 9] |
5,715,419 | 5,715,420 | Using jQuery to bind a click to the unused part of a page | <p>I'm stuck trying to bind a click redirect to the body tag on a page where there's not already another div. I have a typical header, container and footer layout but I want to place a site skin in the background for users to click on to register. </p>
<p>Here's what I have so far to target the body element:</p>
<pre><code>$('body').bind({
click: function() {
window.location = 'https://example.com/';
},
})
</code></pre>
<p>The background image displays fine and the redirect works but if I click on somewhere in the header, container or footer it will perform the redirect which is not what I want. I'd prefer it ignore those divs for purpose of the redirect.</p>
<p>Thanks for any suggestions!</p>
| javascript jquery | [3, 5] |
5,237,674 | 5,237,675 | ASP.NET missing javascript name=form1 attribute | <p>I have a server that is not generating the Javascript name attribute. Is only happening on this one server all other servers return the javascript with name attribute. I already try removing the Web.Config setting and the server still wont return a javascript with name attribute. Server is IIS6 the Site is ASP.Net 3.5, any ideas are welcome.</p>
| javascript asp.net | [3, 9] |
4,172,780 | 4,172,781 | Apply class to body while watching videos | <p>Is there a way to first check if the browser is webkit or not, and then apply a class to the body when a user clicks on a video to play it? If the browser is webkit, I'd like to apply the class .blur, and if the browser is not webkit, i'd like to add a dark overlay, so the user can focus on the video. I would have NO clue whatsoever how to do this except for apply the blur, hehe. Any help would be awesome!</p>
| javascript jquery | [3, 5] |
5,239,725 | 5,239,726 | How to hide a div with asp:ListView | <p>I have a < div> with < asp:ListView>- with results of searching. I want to hide this div, and show it when ListView will be full (or better - when this part of code will be completed)</p>
<pre><code> lvSearchResult.DataSource = getSearchResult();
lvSearchResult.DataBind();
</code></pre>
<p>How can I do this? Meanwhile when this < div> with listview will be not visible, I want to show another div with information "Loading". When ListView will be ready, < div> with results will show up, and < div> with "loading" will be hidden.</p>
| c# javascript asp.net | [0, 3, 9] |
4,447,521 | 4,447,522 | Links and docuementation to learn android programming | <p>I would like to learn the android programming. Could you guys suggest me some useful links and documentation?</p>
| java android | [1, 4] |
56,737 | 56,738 | Jquery - how to load everything except the images? | <p>I'm currently working on a WordPress addition which loads full post content (normally it shows exceprts) when asked to. I did my code like this:</p>
<pre><code>$(".readMore").click(function() {
var url = $(this).attr("href");
$(this).parent("p").parent("div").children("div.text").slideUp("slow", function () {
$(this).load(url + " .text", function(){
$(this).slideDown("slow");
});
});
$(this).parent("p").fadeOut();
return false; });
</code></pre>
<p>And it works. But I don't want images to be loaded. I tried .text:not(img), but it didn't worked. How can I do this?</p>
| javascript jquery | [3, 5] |
1,218,534 | 1,218,535 | jQuery.Form wont submit | <p>Im´trying to submit a form without refreshing the page, but I´m having a problem.
When I click submit the page refreshes and anothing gets posted.
Here is the code, what am I doing wrong? (I´m a newbie)</p>
<p>jQuery 1.4.2 and the jQuery Form Plugin 2.43 is present.</p>
<p>tnx</p>
<pre><code>$(document).ready(function() {
var options = {
target: '#output2',
url: https://graph.facebook.com/<%=fbUid%>/feed,
type: post,
clearForm: true // clear all form fields after successful submit
//dataType: null // 'xml', 'script', or 'json' (expected server response type)
//resetForm: true // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000
};
// bind to the form's submit event
$('#fbPostStatus').submit(function() {
// inside event callbacks 'this' is the DOM element so we first
// wrap it in a jQuery object and then invoke ajaxSubmit
$(this).ajaxSubmit(options);
// !!! Important !!!
// always return false to prevent standard browser submit and page navigation
return false;
});
});
</code></pre>
| javascript jquery | [3, 5] |
404,250 | 404,251 | Fading out everything except the element that's being pointed by the mouse | <p>Sort of like a "Lightbox 2" effect but only on the elements pointed by a mouse. I don't even know how to start. Any advice would be awesome, thanks.</p>
| javascript jquery | [3, 5] |
1,024,360 | 1,024,361 | HSVToColor in Android works kinda strange | <p>Here's my code that is supposed to take a color int, convert it to HSV, add 0.5 to hue and convert back to int. But in the output, instead of 0xFF00FFFF gives -64768 ... any ideas what might be the problem?</p>
<pre><code> int c = 0xFFFF0000; /// RED
float[] hsv = new float[3];
Color.colorToHSV( c, hsv ); /// splitting "c" into hsv
hsv[0] = hsv[0]+0.5f; /// adding 0.5 to Hue
int c1 = Color.HSVToColor( hsv ); /// converting hsv back to int
Log.e("color: ", String.valueOf(c1) ); /// outputting new color int
// should be "0xFF00FFFF" (light bule) , but is "-64768" hmm...
</code></pre>
<p>Thanks!</p>
| java android | [1, 4] |
604,369 | 604,370 | Highlight search text in textarea | <p>I have to highlight the search terms in the text area.</p>
<p>I have one text Filed,search Button and text area.</p>
<p>Quote ...</p>
<pre><code>After i have enter the search string in the text field whenever i click the search button it highlight the search terms which is available in the text area and focus the search term in text area.
I have try to do this by using jquery.
But in mozilla,I can't get the focus to the search term at the time of search.
I have to scroll down the text area for find the focused search term.
In I.E. also it doesn't work properly.
</code></pre>
<p>Otherwise if any post related to highlight search term in text area is also appreciable.</p>
<p>Please guide me to achieve this. </p>
| javascript jquery | [3, 5] |
13,799 | 13,800 | JavaScript tutorials for Kids | <p>Could you recommend fun resources to teach JavaScript/jQuery to kids (10-12 yo)? I am looking for the next step after "Hello World".</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
1,191,564 | 1,191,565 | jQuery check external link | <p>Using Javascript or jQuery, how can I check if an external link is available? </p>
<p>An <code>$.ajax()</code> call is not available as it violates <a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="nofollow">SOP</a> (same problem as <a href="http://stackoverflow.com/questions/7234297/jquery-not-working-for-external-domains">here</a>). I have read about <a href="http://en.wikipedia.org/wiki/JSONP" rel="nofollow">JSONP</a>, but I would like to know if there is a more straight solution, as I don't want to load any data from the external server; what I need is only to check if it is reachable.</p>
<hr>
<p>EDIT (answer)</p>
<p>I solved it with the following code:</p>
<pre><code>$.ajax({url: 'http://www.example.com',
type: 'GET',
dataType: 'jsonp',
complete: function(jqXHR, textStatus) {
console.log(jqXHR.status); // '200' = url reachable
},
timeout: 2000
});
</code></pre>
<p>The only problem now is that I get a <code>Parse error</code>, but in any case it can be checked if the external link is working.</p>
| javascript jquery | [3, 5] |
2,583,434 | 2,583,435 | Dynamic text in textarea - getting value | <p>My text/value in textarea it's not static - I'm chaning it. I can't get the current value.
E.g
1</p>
<pre><code><textarea>
Lorem ipsum
</textarea>
//it's defalut in html file
</code></pre>
<p>2</p>
<blockquote>
<pre><code>Putting into textarea:
Dolores is lorem ipsum
</code></pre>
</blockquote>
<p>Alert is only showing 1 version("lorem ipsum"), but not second ("Dolores is lorem ipsum"). I'm trying to do it in jquery:</p>
<pre><code>var variable = $("#selector").val();
alert(variable);
</code></pre>
<p>What I'm doing wrong?</p>
<h1>EDIT</h1>
<p>I want to catch it to variable :) Not to alert. Alert is only my test :) </p>
| javascript jquery | [3, 5] |
4,969,801 | 4,969,802 | Get the first textbox/checkbox/dropdown/file control on page and set focus | <p>How to get the first form element (input element) that occurs on a page and set focus to it?
I would like to change the practice where I have to set focus manually in every single page to a certain element like this</p>
<pre><code>$("#Clients").focus()
</code></pre>
<p>I want something universal, something that will figure out the first input automatically and put that code into a master page.</p>
| javascript jquery | [3, 5] |
5,800,307 | 5,800,308 | DragHandle Not working in TableDnD JQuery Plugin | <p>I am using tablednd plugin to drag and drop my table rows everything works fine for me but when I try to use the DragHandle property then neither the rows are dragable nor the hander comes </p>
<p>My Script is as </p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
$('#sort').tableDnD({
onDrop: function(table, row) {
alert(row.id);
},
dragHandle: ".dragHandle"
});
});
</script>
</code></pre>
<p>When I remove the drag handle then it works and when I include it it does not work.</p>
<p>Any Ideas why its not working </p>
<p>Thanks</p>
| php jquery | [2, 5] |
5,120,271 | 5,120,272 | Passing Array of string from C# application to C++ DLL | <pre><code>string []URL = {"www.facebook.com","www.orkut.com","www.yahoo.com"};
Int32 result = URL.Length;
SetPolicyURL( URL,result );
</code></pre>
<p>this is my C# code where i am trying to pass the array of string to C++ Dll which is imported like this</p>
<pre><code> [PreserveSig]
[DllImport("PawCtrl.dll", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void SetPolicyURL( string []policy, Int32 noURL);
</code></pre>
<p>but i am not able to receive it in my c++ DLL .</p>
<pre><code> PAWCTRL_API void __stdcall SetPolicyURL( char ** URLpolicy, __int32 noURL)
{
for ( int i = 0; i < noURL; i++)
{
URLvector.push_back(URLpolicy[i]);
}
}
</code></pre>
<p>Please can any one help me how i should pass the function</p>
<p>thanks InAdvance</p>
| c# c++ | [0, 6] |
3,230,108 | 3,230,109 | Disable input type submit when input text is empty | <p>I have this code:</p>
<pre><code>setInterval(function(){
if($("#username_error").val() == "" && $("#password_error").val() == "" && $("#email_error").val() == ""){
$('input[type="submit"]').removeAttr('disabled');
} else {
$('input[type="submit"]').attr('disabled','disabled');
}
}, 10);
</code></pre>
<p>I need to disable the submit button if there are no errors for three divs. When I run this code, nothing happens. But if I do an <code>alert()</code> this <code>if</code> statement runs correctly. What am I doing wrong here?</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.