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,219,860
4,219,861
Remove JavaScript comments from string with C#
<p>I am trying to remove javascript comments (<code>//</code> and <code>/**/</code>) from sting with C#. Does anyone have RegEx for it. I am reading list of javascript files then append them to string and trying to clean javascript code and make light to load. Bellow you will find one of the RegEx that works fine with <code>/* */</code> comments but I need to remove <code>//</code> comments too:</p> <pre><code>content = System.Text.RegularExpressions.Regex.Replace(content, @"/\*[^/]*/", string.Empty); </code></pre>
c# javascript
[0, 3]
5,449,643
5,449,644
jQuery hint plugin and problem with $_POST
<p>I'm using <a href="http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/" rel="nofollow">remy sharp's hint plugin</a>. </p> <pre><code>&lt;input type="text" title="hint" name="names" class="input" /&gt; </code></pre> <p>But when I post the form without filling the fields, input still has </p> <pre><code> $_POST['names'] = 'hint'; </code></pre> <p>How can I prevent this issue?</p> <p>Thanks in advance.</p> <p>EDIT : jQuery Code: </p> <pre><code>$(".input").hint(); $(".lSubmit").click(function(e){ e.preventDefault(); $.post('form.php',decodeURIComponent($("#forms").serialize()) , function(data) { $('.result').html(data); }); }); </code></pre>
php jquery
[2, 5]
5,347,286
5,347,287
Pause a running setInterval function?
<p>I have 4 functions running on setInterval (tscrolls) which just animate a div's top location every couple of seconds as soon as the document is loaded.</p> <pre><code>var intervalFunctions = [ tScroll1, tScroll2, tScroll3, tScroll4 ]; var intervalTimer = 3000; window.setInterval(function(){ intervalFunctions[intervalIndex++ % intervalFunctions.length](); }, intervalTimer); </code></pre> <p>Is there a way to pause this on mouseenter or hover?</p>
javascript jquery
[3, 5]
3,747,999
3,748,000
Connecting to URL from iPhone and persisting php session
<p>I have an iphone app that sends and retrieves data from a php script.</p> <p>I would like to connect to that script once, save some data into a $_SESSION variable. Then on subsequent calls be able to retrieve the content of that $_SESSION vars.</p> <p>Is this possible?</p> <p>Thanks</p>
php iphone
[2, 8]
3,033,664
3,033,665
C# display pdf document in iframe in asp.net page
<p>how can i display pdf document in iframe in c# web page:i have a drowpdownlist linked with pdf files,what i need is when i select one item from this list ,iframe will populated with the corresponding pdf document</p>
c# asp.net
[0, 9]
1,281,472
1,281,473
Javascript - How to get number of characters in textbox and use substring to delete
<p>I want to get the number of characters in a textbox and use substring to remove characters if the number of characters is >= 255</p> <p>I have the following javascript:</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function CheckMaxLength(Object, MaxLen) { if (Object.value.length &gt;= MaxLen) { //find textbox and use substring } return (Object.value.length &lt;= MaxLen); } &lt;/script&gt; </code></pre> <p>What javascript should I use?</p>
javascript asp.net
[3, 9]
1,693,641
1,693,642
get current user Asp. Net C#
<p>Is there is a way to get the current user in the <code>aspx</code> page,the page with the <code>html</code> definitions? (i know how to get it in the <code>aspx.cs</code> page)</p>
c# asp.net
[0, 9]
3,569,421
3,569,422
switch over tab previous data is coming
<p>I have added tab bar in my application with four tab like home stock etc .In that tab bar i have used nested activity using activity group for all tabs .The home page will default show to the user.If I swith stock tab I am calling stock activity group class from stock activity class .In stock activity I have edittext view with list view If user give 'a' or 'A' value in textwatcher listenere I am listing the value in listview .If i click home tab and come again stock tab that value in listview is coming again can anybody tell how to avoid that?</p>
java android
[1, 4]
758,802
758,803
Passing Arraylist between activities? Using Parcelable
<p><strong>EDIT:</strong> I've updated my question considerably and am now going with Parcelable as my method.</p> <p>I'm attempting to a pass an ArrayList from one activity to another. I've been reading around and can't seem to find any answers to my problem.</p> <p>I've got an <code>ArrayList&lt;SearchList&gt;</code> which <code>implements Parcelable</code> SearchList has the following code...</p> <pre><code> public class SearchList implements Parcelable { private String title; private String description; private String link; public SearchList(String name, String phone, String mail) { super(); this.title = name; this.description = phone; this.link = mail; } public SearchList(Parcel source){ /* * Reconstruct from the Parcel */ title = source.readString(); description = source.readString(); link = source.readString(); } public String gettitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getLink() { return link; } public void setLink(String link) { this.link = link; } public int describeContents() { // TODO Auto-generated method stub return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeString(title); dest.writeString(description); dest.writeString(link); } public static final Creator&lt;SearchList&gt; CREATOR = new Creator&lt;SearchList&gt;() { public SearchList createFromParcel(Parcel source) { return new SearchList(source); } public SearchList[] newArray(int size) { return new SearchList[size]; } }; } </code></pre> <p>However, when I try and do...</p> <pre><code> List&lt;SearchList&gt; listOfResults = new ArrayList&lt;SearchList&gt;(); intent.putParcelableArrayListExtra("results", listOfResults); </code></pre> <p>I get <code>not applicable for type (String, List&lt;SearchList&gt;</code> why?</p>
java android
[1, 4]
3,772,140
3,772,141
Change Font color of tr with jQuery after click on image
<p>I search for a way to change the font color of a tr with jQuery. There is an icon in the last cell of every tr. I want if I click it that the font color of the tr is changed. I used this:</p> <pre><code>$('#documentsTable tr').live('click', function(){ </code></pre> <p>but it is for clicking on the whole row. What is the best way to manage this?</p> <p>Best regards</p>
javascript jquery
[3, 5]
3,681,692
3,681,693
Do I need to tell jslint about functions that have not yet been defined inside another function?
<p>I have code like this:</p> <pre><code>function dialog($link) { "use strict"; function doDialogAjax() { $.ajax({ cache: false, url: url, dataType: 'html' }) .done(onDialogDone) .fail(onDialogFail); } function onDialogDone(data) { content = data; // ... } } </code></pre> <p>jslint complains that the onDialogDone has not yet been defined. Do I really need to define it as a global at the top of my code. The reason I am asking is because I don't think the function onDialogDone is a global. It's just a function not yet defined within the outer function. </p> <p>Also am I correct in saying that a function defined this way should not have a semicolon at the end after the last curly brace?</p>
javascript jquery
[3, 5]
4,853,516
4,853,517
I want to refer to a non-final variable inside an inner class defined in a different method
<p>I'm writing an Android app, in which I have several buttons laid out in a grid. I want to set the onClick method of each button, so I wrote this:</p> <pre><code>for (int i = 0; i &lt; button.length; i++) { for (int j = 0; j &lt; button[0].length; j++) { button[i][j].setOnClickListener(new View.OnClickListener() { public void onClick(View v) { press(i, j); } }); } } </code></pre> <p>where <code>press(int i, int j)</code> is implemented elsewhere. I get the error, "Cannot refer to a non-final variable i inside an inner class defined in a different method".</p> <p>So, right now I just have each function written out, like this:</p> <pre><code>button[0][0].setOnClickListener(new View.OnClickListener() { public void onClick(View v) { press(0, 0); } }); button[0][1].setOnClickListener(new View.OnClickListener() { public void onClick(View v) { press(0, 1); } }); // more like this... </code></pre> <p>This works, but it seems silly. Is there a better way?</p>
java android
[1, 4]
278,195
278,196
How to hide browser's menu?
<p>I am developing an ASP.NET application for an online quiz test. The set of questions would be randomly selected from a pool of questions. The application works fine, but I want to hide the browser menu option (so that user cannot save or print the test) when the quiz page is shown. I do not want to open a new popup window. So how do I do this for the active window.</p> <p>The application consists of around 5 web pages, and the test is on pages 3 and 4. So I want the menu to be hidden only on pages 3 and 4. Is this possible and how do I do this? Thanks in advance</p>
asp.net javascript
[9, 3]
1,367,688
1,367,689
Android: keep alert in front, so that the user must respond
<p>My application shows an alert that the user must respond to before continuing to do other things. I'm trying to figure out the best way to implement this. Using an Activity for the alert isn't quite working.</p> <p>In my current implementation, the alert is activity (A). When another activity from the same package is started and onStop is called, it starts itself again using FLAG_ACTIVITY_REORDER_TO_FRONT so that it's always at the top of the stack. This works as described, unless Activity A uses Theme.Dialog or Theme.Translucent.</p> <p>Modified log:</p> <pre><code>Activity A created Activity A started Activity A resumed Activity A paused Activity B created Activity B started Activity B resumed Activity B gains window focus Activity A stopped Top activity in stack is Activity B, so Activity A relaunches itself Activity B paused Activity A started Activity A resumed </code></pre> <p>The top activity in the stack should be Activity A, however Activity B remains in the foreground.</p> <p>Another implementation detail: my application is not for a phone, so I'm not concerned with a back button finishing the activity or interactions with other apps. Still, I agree that on principle I should prevent such problems anyway, so in my code I check whether the activity that has come in front is from the same package (i.e. from our code base). This should work around the theoretical problem of interfering with other apps.</p> <p>Is there a way to bring Activity A into focus? I understand that this is unusual behavior, but it is necessary for Activity A to remain in the foreground until it is deliberately finished.</p> <p>I'm also open to suggestions about a completely different and better approach!</p> <p>FWIW, I'm running 2.2.</p> <p>(Cross-posted from <a href="http://groups.google.com/group/android-developers/browse_thread/thread/d46fd7d59abe15a0" rel="nofollow">http://groups.google.com/group/android-developers/browse_thread/thread/d46fd7d59abe15a0</a>, where we got no response.)</p>
java android
[1, 4]
4,709,255
4,709,256
Example code in both android and iphone?
<p>I'm working on an app that I'm trying to convert from iphone to android using phonegap. Most of it is thankfully done in js, but there are still some classes written in objective-C (appDelegate, myTapgestureRecognizer) that I'm uncertain how to transfer over to android SDK correctly. I was hoping someone might know of a tutorial or sample code for a simple app written in both android and iphone so I can observe the differences.</p> <p>thanks! </p>
android iphone
[4, 8]
507,773
507,774
microsoft chart control (VS 2008) - how to show the value when cursor is moved in the chart area - just like yahoo finance shows on any ticker symbol
<p>I have a simple chart control on my form. it displays data fine in X and Y axis. On X axis, i have time period (1 day,1 week, to 30 Years- total of 27 points on x axis) and Y axis has interest rate.</p> <p>when the cursor is moved in the chart area, I want to show the exact value of Y axis. Just like yahoo finance shows when we click on a graph of a stock symbol. Say on my chart, when user hovers on say 2 Y on the graph, it should show the exact interest rate which is on the Y axis.</p> <p>Any suggestions on how this can be done. Thanks</p>
c# asp.net
[0, 9]
4,580,506
4,580,507
Why is this POST variable sent via AJAX Null? (jquery/php)
<p>This javascript is for a "load more" functionality. That grabs a fixed number of elements from load.php when a button #moreg is clicked. </p> <pre><code>$(function(){ $("#moreg").click(load); var countg = -1; load(); function load() { var num = 1; countg += num; $.post( "load.php", {'start_g': 'countg', 'name':'&lt;?=$name?&gt;' }, function(data){ $("#posts").append(data); } ); } }); </code></pre> <p>in load.php simply doing a <code>var_dump($_POST['start_g']);</code> yields a null variable.</p> <p>Not too helpful...what am I doing wrong?</p>
php javascript jquery
[2, 3, 5]
3,739,256
3,739,257
Focus on element triggers browser menu
<p>I'm use jQuery 1.9. When I programmatically set focus on input element (textbox) in Firefox or any other browser and press T it activates Tool menu in menu browser (similiar is for B(Bookmark) and so on). When I try to write K... text starts inside focused input element. Element has a focus, I see cursor. When I click with the mouse and try to write T or B is appears inside textbox.</p> <p>So, I want to write any combination inside textbox after programmatically set focus on element. Where is the problem? What to do?</p>
javascript jquery
[3, 5]
4,858,985
4,858,986
jQuery in console not working properly
<p>I'm using the jQueryify bookmarklet on a page so that I can call jQuery functions from the console. But everytime I invoke a jQuery function on a selected object, I get the error: </p> <pre><code>"TypeError: jQuery("li")[0].children[0].html is not a function [Break On This Error] jQuery('li')[0].children[0].html(); </code></pre> <p>I have tried this in FireBug as well as Google Chrome's Webkit console.</p>
javascript jquery
[3, 5]
3,740,689
3,740,690
clearInterval() Undefined Error After Using setInterval()
<p>I know this isn't supposed to be inline, but YUI library's dialogs force me to. My issue is that whenever I hover over this div, the margin-left scroll activated but it does not stop when I move the mouse out of the div. The JS console reports that:</p> <blockquote> <p>Uncaught ReferenceError: timerID is not defined</p> </blockquote> <p>And here's the code:</p> <pre><code>&lt;div class="span1" onmouseover=" var timerID; $(document).ready(function(){ timerID = setInterval(scrollLeft, 10); function scrollLeft(){ $('.inner_wrapper').animate({ marginLeft: '-=30px' }); } }); " onmouseout="clearInterval(timerID)"&gt; &lt;/div&gt; </code></pre> <p>EDIT: The thing is that I can NOT run SCRIPT tags inside dialogs (they are already created via scripts, which filter any javascript besides inline one like onmouseover and onmouseout). So your suggestions of encapsulating the onmouseover and onmouseout handles in a single function will not work in this case.</p>
javascript jquery
[3, 5]
3,165,894
3,165,895
What is the best way to accumulate items' IDs before sending them to the server?
<p>I have a ListView its item is selectable. I want after select some items (Client side using JQuery) to send their IDs the selected elements to the server for saving them.</p> <p>What is the best way to accumulate them in the client side?</p> <p>Is it using a Hidden field with a seperator between IDs ?</p> <p>Or is there a better approuch?</p> <p><strong>Edit:</strong></p> <p>Notes: ID's are integers, The server side technology is ASP.Net.</p>
javascript jquery
[3, 5]
1,701,220
1,701,221
How I can forefully fire the rowcommand event when grid data is changing on every postback?
<p>My requirement is to refresh the data on every postback but if I do so my rowcommand event doesnot get fired on link button click in gridview? How I can achieve it?</p> <p>I am changing the row order using jquery and saving the new order in hidden variable. on page postback I get the new order from hidden variable and rebinds the grid with new order.</p> <p>I need to rebind the grid with new order everytime page postback. postback occurs when I click on edit/delete linkbuttons in grid but the rowcommand event doest not get fired.</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { string order = hdnOrder.Value.ToString(); if (order != string.Empty) { ReOrder(); } } } protected void ReOrder() { DataTable dt = new DataTable(); if (ViewState["data"] != null) { dt = (DataTable) ViewState["data"]; string[] order = hdnOrder.Value.Split(','); for (int i = 0; i &lt; order.Length; i++) { DataRow[] keyRows; keyRows = dt.Select("ID='" + order[i] + "'"); if (keyRows.Length &gt; 0) { int index = dt.Rows.IndexOf(keyRows[0]); dt.Rows[index].SetField("Precedence", i + 1); } } DataView dv = dt.DefaultView; dv.Sort = "Precedence ASC"; ViewState["data"] = dv.ToTable(); grd.DataSource = ViewState["data"]; grd.DataBind(); hdnOrder.Value = string.Empty; } } </code></pre>
jquery asp.net
[5, 9]
3,687,458
3,687,459
How to distinquish concurrent progress bar requests on server side in asp.net
<p>I implemented progress bar to show completing status to users when video processes in background. it works well on single instance. but mixed it up when two concurrent video process started.</p> <p>When two video processes initiated by two different users at same time, both users will see mixed progress status sometimes from video process 1, sometimes from another.</p> <p>Video process on server side initiated with static variable.</p> <pre><code>public static MediaHandler _mhandler = new MediaHandler(); </code></pre> <p>Progress indication sent to page via</p> <pre><code>[WebMethod] public static string GetProgressStatus() { return Math.Round(_mhandler.vinfo.ProcessingCompleted, 2).ToString(); } </code></pre> <p>Progress request sent by progress bar after every few seconds.</p> <p>Now my question is how i can set mediahandler object which can target only one instance at a time. </p> <p>e.g progress bar 01 shows status of video process 01 only</p> <p>and</p> <p>progress bar 02 shows status of video process 02 only</p>
c# asp.net
[0, 9]
4,319,803
4,319,804
Tab to beginning of text input
<p>I have a login form:</p> <pre><code>&lt;form&gt; &lt;div class="username"&gt; &lt;label for="username"&gt;Email&lt;/label&gt;&lt;br /&gt; &lt;input type="text" class="field" value="Enter your email" name="email" id="id_email"&gt; &lt;/div&gt; &lt;div class="password"&gt; &lt;label for="password"&gt;Password&lt;/label&gt;&lt;br /&gt; &lt;input type="password" class="field" name="password" id="id_password"&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>I want to make it such that when a user tabs from one field to another it sets the selection at the beginning of the field, instead of highlighting the entire field's text. An example can be seen on the login form here: <a href="https://squareup.com/" rel="nofollow">https://squareup.com/</a>.</p> <p>I have a function that sets the cursor at the beginning of the text input, <code>setCursorAtBeginning</code>, how would I accomplish the above using js or jQuery (preferable, if it can be done in it)?</p>
javascript jquery
[3, 5]
986,409
986,410
Why does the click function not work after I change the class of a button?
<p>I have a set of buttons(previous &amp; next) that the user clicks.</p> <pre><code>&lt;a id="prev_btn" class="prev_1" href="#"&gt;Previous&lt;/a&gt; &lt;a id="next_btn" class="next_1" href="#"&gt;Next&lt;/a&gt; </code></pre> <p>When the user clicks on the next button(.next_1), it changes the class name of the button to next_2 and changes the the previous button(.prev_1) to prev_2. Once the class name is changed, the click function that is set for prev_2 doesn't work.</p> <pre><code>$('.next_1').click(function() { $('#next_btn').removeClass('next_1').addClass('next_2'); $('#prev_btn').removeClass('prev_1 inactive').addClass('prev_2'); }); $('.prev_2').click(function() { alert('this works'); }); </code></pre> <p>Why does the click function not work after I change the class using jquery?</p>
javascript jquery
[3, 5]
660,767
660,768
jQuery function not working with another function
<p>I have two functions that loads on document ready. They work fine when they are ran individually. But when both functions are called on the same document ready js. One of them(second one) doesn't work. Please help. The files are set up at: <a href="http://jsfiddle.net/rexonms/FXPhu/15/" rel="nofollow">http://jsfiddle.net/rexonms/FXPhu/15/</a></p> <p>The basic code is following which is called on document ready. And it calls jQuery 1.2.6 - it's a closed CMS and I cannot change the version of jQuery:</p> <pre><code>// Sidebar Accordion Nav $("#linkListSub3 li li").hide(); $("#linkListSub3 li").hover(function() { if ($("li", this).is(":hidden")) { $("#linkListSub3 li li").next().slideUp(); $("li", this).next().slideDown(); } return false; }); //Hide And show Toggle Bar animation $(".toggleContainer").hide(); //Hide (Collapse) the toggle containers on load //Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state) $("a.trigger").click(function() { $(this).toggleClass("active").next().slideToggle("slow"); return false; //Prevent the browser jump to the link anchor }); </code></pre>
javascript jquery
[3, 5]
5,850,339
5,850,340
Converting binary data to image in C#
<p>I was stuck with how to retrieve an image from MySQL database and convert it from Binary format to Bitmap Image to display it in <code>ASP:Image</code> or <code>HTML Image</code>. I am able to upload image but its being converted to Binary data and I couldn't understand how to convert it back to Bitmap format :(</p> <pre><code>protected void Button2_Click(object sender, EventArgs e) { cmd = new OdbcCommand("SELECT picture from profile limit 1", MyConnection); MyConnection.Open(); OdbcDataReader dr = cmd.ExecuteReader(); if (dr.HasRows == false) { Response.Write("No rows"); } if(dr.Read()) { // WHAT TO CODE HERE? } } </code></pre> <p>Anybody please help me in fill the code with <strong>WHAT TO CODE HERE</strong> part.</p>
c# asp.net
[0, 9]
3,531,226
3,531,227
Display Fees details from database In Table Format
<p>I am using a website(C#) for inserting fees details for I std to V std into a database... next i want to display in that details in next page as a table format which is mentioned below..... </p> <p>ClassName Class I ClassII ClassIII ClassIV ClassV</p> <p>TutionFees 1000 1000 1100 1100 1100</p> <p>ExamFees 500 500 500 550 600</p> <p>Bookfees 200 200 300 300 300</p> <p>How shall i Do like this format? can any one tell me the solution Of this? plz.. Thanks in advance..</p>
c# asp.net
[0, 9]
4,856,669
4,856,670
Customer Validation ASP.Net C#
<p>I am having the same problem as someone else in this forum. My validation control is not firing...and not sure where I have gone wrong. Could someone please take a look and let me know what obvious error I have here...thanks</p> <p>I have set up a customer validator in my aspx page using the following:</p> <pre><code> &lt;asp:TextBox ID="EmployeeNumber2TextBox" runat="server" Text='&lt;%# Bind("EmployeeNumber") %&gt;'Visible='&lt;%# AllowEmployeeNumberEdit() %&gt;' /&gt; &lt;asp:CustomValidator ID="ValidateEmpNumber" runat="server" onservervalidate="ValidateEmpNumber_ServerValidate" controltovalidate="EmployeeNumber2TextBox" ErrorMessage="You Must Enter an Employee Number" Text="*" /&gt; </code></pre> <p>and the code behind:</p> <pre><code> protected void ValidateEmpNumber_ServerValidate(object sender, System.Web.UI.WebControls.ServerValidateEventArgs e) { int SiteCompanyID = System.Convert.ToInt32(Session["SiteCompanyID"]); SiteCompanyBLL SiteCompany = new SiteCompanyBLL(); SiteCompanyDAL.SiteCompanyRow ScRow = SiteCompany.GetCompanyByID(SiteCompanyID); bool AutoGenerate = ScRow.AutoGenNumber; // result returning true or false if (AutoGenerate == false) { if (e.Value.Length == 0) e.IsValid = false; else e.IsValid = false; } } </code></pre>
c# asp.net
[0, 9]
5,782,562
5,782,563
How can I scale my font with different types of screen?
<p>I have made an Android application, but it must work on different types of screen, and I have done that too. But it is 1 thing - for creating scaling screen I use layout_weight and dp instead px. But how can I scale my fonts in .xml files? Thank you. </p>
java android
[1, 4]
2,691,819
2,691,820
JQuery: $.get is not a function
<p>I'm having a problem doing something very basic in jQuery. Can someone tell me what I'm doing wrong exactly?</p> <p>If I run the code below, the function $.get seems to be missing (getJSON and others missing too). But $ itself and other functions do exist, so I know JQuery is loading.</p> <pre><code>google.load("jquery", "1.3.2"); function _validate(form, rules_file) { $.get('/validation_rules.json',function(data) { alert("hello") }) } </code></pre> <p>Any ideas would be much appreciated. </p> <p>Thanks, Rob</p> <p>Edit: here is some additional info:</p> <pre><code> &lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script&gt; google.load("prototype", "1.6"); google.load("scriptaculous", "1.8"); google.load("jquery", "1.3.2"); &lt;/script&gt; &lt;script&gt; jQuery.noConflict(); // prevent conflicts with prototype &lt;/script&gt; &lt;script src="/livepipe/src/livepipe.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/livepipe/src/window.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/livepipe/src/tabs.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/jquery.maskedinput-1.2.2.js" type="text/javascript"&gt;&lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
5,554,466
5,554,467
Single mechanism for reversible encryption in PHP and JS
<p>The problem arose to encrypt data transmitted between client and server using a key without using https (the key is transmitted separately, that's another story.) So. Are interested in the mechanism. I know that there is no built-in JS encryption functions, and PHP are many, but not all normal decode UTF8.</p> <p>Question: Is there a ready-made solutions (if possible with examples) of such a problem?</p>
php javascript jquery
[2, 3, 5]
944,020
944,021
Refactoring and DRYing up jQuery code
<p>What I'm doing is adding a class to all elements who have the same class name as the id I'm hovering over. For example when I hover some list item with the id of vowel, then all the span elements with the class of the name vowel get acted upon (adding a class).</p> <p>I can do that with no problems. But I want to do the same thing for many other id names with corresponding class names. Examples: consonants, semi-vowels, gutturals, palatals, etc.</p> <p>I could do all these with different functions but I want to do is to call a function which will perform the same tasks but will be smart enough to find the name of the id and to generate the class name from that.</p> <p>How do I extract the id name into a variable and assign it to the class name.</p>
javascript jquery
[3, 5]
5,300,182
5,300,183
Exception class java.util.concurrent.RejectedExecutionException only on galaxy s3
<p>I am having problems with my live wallpapers but only on galaxy s3. I get the following error</p> <pre><code>java.util.concurrent.RejectedExecutionException: Task com.ls.fs.Wallpaper$MyEngine$1@418f2030 rejected from java.util.concurrent.ThreadPoolExecutor@418f1978[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 87] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1967) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:782) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1303) at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:600) at com.ls.fs.Wallpaper$MyEngine$1.run(Wallpaper.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) </code></pre> <p>This is the code around line 266</p> <pre><code>@Override public void onCreate(final SurfaceHolder holder){ super.onCreate(holder); Executor = Executors.newSingleThreadExecutor(); drawCommand = new Runnable(){ public void run(){ glRenderer.onDrawFrame(gl); egl.eglSwapBuffers(glDisplay, glSurface); if(isVisible() &amp;&amp; egl.eglGetError() != EGL11.EGL_CONTEXT_LOST){ executor.execute(drawCommand); } } }; setTouchEventsEnabled(true); } </code></pre>
java android
[1, 4]
1,642,116
1,642,117
Timer with multiple things to do
<p>I am making an android app which reminds people via notifications of events they have to do over the course of a day. The way I currently do this is have each event on a seperate timer using the Timer class. However, I don't think this is great way of doing things. Is there any way maybe to have just one timer which will trigger an event at each time interval I pass in? Or is there any other way of scheduling a notification?</p>
java android
[1, 4]
1,334,396
1,334,397
jquery display + delay strategy
<p>The following javascript displays the final result (instead of updating every second). How can I iterate through the result of the getJSON call, display that result, and delay until I display the next element?</p> <pre><code>function display(state) { for (var i=0; i &lt; state.length; i++) { $('#someDiv' + i).text(state[i]); } } $.getJSON('/getdata', function(data) { $.each(data, function(key, val) { setTimeout(function(){display(val)}, 1000); }); } </code></pre>
javascript jquery
[3, 5]
3,569,606
3,569,607
get dimensions of an image on the web - avoid memory hog?
<p>Im getting some images from a webpage at a specified url, i want to get their heights and widths. I'm using something like this:</p> <pre><code> Stream str = null; HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create(ImageUrl); HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse(); str = wRes.GetResponseStream(); var imageOrig = System.Drawing.Image.FromStream(str); int height = imageOrig.Height; int width = imageOrig.Width; </code></pre> <p>My main concern with this is that that the image file may actually be very large,</p> <p>Is there anything I can do? ie specify to only get images if they are less than 1mb? or is there a better alternative approach to getting the dimension of an image from a webpage?</p> <p>thanks</p>
c# asp.net
[0, 9]
3,216,110
3,216,111
Get url without querystring
<p>I have a url like this :</p> <p><a href="http://www.somesite.com/mypage.aspx?myvalue1=hello&amp;myvalue2=goodbye">http://www.somesite.com/mypage.aspx?myvalue1=hello&amp;myvalue2=goodbye</a>.</p> <p>I want to get <a href="http://www.somesite.com/mypage.aspx">http://www.somesite.com/mypage.aspx</a> from it . Can you tell me how can I get it ?</p>
c# asp.net
[0, 9]
5,430,491
5,430,492
total up json data?
<p>[UPDATE]</p> <p>Thanks guys,final code:</p> <pre><code> var EUR_share_cost = 0; var USD_share_cost = 0; var GBP_share_cost = 0; var EUR_total_cost = 0; var USD_total_cost = 0; var GBP_total_cost = 0; $.ajax({ url: '/producer/json/index/period/month/empties/'+empties+'/fields/'+fields+'/start/'+start+'/end/'+end+'', async: false, success: function(returned_values) { $.each(returned_values.aaData, function(index, item) { if (item[2] == 'EUR') { EUR_share_cost += parseFloat(item[5]); EUR_total_cost += parseFloat(item[3]); } else if (item[2] == 'USD') { USD_share_cost += parseFloat(item[5]); USD_total_cost += parseFloat(item[3]); } else if (item[2] == 'GBP') { GBP_share_cost += parseFloat(item[5]); GBP_total_cost += parseFloat(item[3]); } }); } }); $('#EUR_share_cost').html(EUR_share_cost); $('#USD_share_cost').html(USD_share_cost); $('#GBP_share_cost').html(GBP_share_cost); } }); </code></pre>
javascript jquery
[3, 5]
2,764,577
2,764,578
Opening a file of any extension in an iframe
<p>I have a web application in which i need to open any files in standard formats such as .doc/docx/.csv/.txt/.xls in an iframe . How can I achieve this ? I tried using the sample code below but it is not opening all the file formats in the iframe. I am getting some XML error.</p> <pre><code>var ext = GetExtension(fileName); switch (ext) { case "pdf": Response.ContentType = "Application/pdf"; break; case "htm": case "html": Response.ContentType = "text/html"; break; case "txt": Response.ContentType = "text/plain"; break; case "doc": Response.ContentType = "Application/vnd.ms-word"; break; case "xls": case "csv": Response.ContentType = "Application/vnd.ms-excel"; break; case "ppt": case "pps": Response.ContentType = "Application/vnd.ms-powerpoint"; break; default: Response.ContentType = "Application/unknown"; break; } if (Response.ContentType != "Application/unknown") { Response.Flush(); Response.WriteFile(fileName); Response.End(); } </code></pre>
c# asp.net
[0, 9]
3,419,094
3,419,095
How to hide the button
<p>I write the some code in button event I used the javascript and call the button event it is working fine here my problem is i want hide the button i do this ways visible=false this time the button event is not firing enable =false this time also button event is not firing how can isolve this problemA</p>
c# asp.net
[0, 9]
5,425,843
5,425,844
how to wait until page redirect finishes
<p>I'm trying to do a redirect, then perform additional operations on the markup of the new page. How can I make sure that the additional stuff I want wait until the redirect is <strong>finished</strong>?</p> <pre><code>window.location.replace(url); //call additional stuff here </code></pre> <p>I'm hoping for something that's more reliable than just waiting by x number of seconds. </p>
javascript jquery
[3, 5]
3,535,323
3,535,324
Fancybox image gallery with ratings and comments
<p>I have a photo website which gathers images from a folder with PHP, displays their thumbnails on a page and, when clicked, opens a fancybox (fancybox.net) to display the full image. I am pretty satisfied with the result but as users start posting, they start asking for new features, and problems come out since I'm not a programmer. <br> What I would like to do is a photo commenting/rating system (like the one on facebook to get the idea, but obviously not as complex): I've been trying to add a Disqus code to each picture, but it won't get displayed in my fancyboxes...So the question is, can you give me any (easy-to-implement) ideas on how to achieve this? I don't mind using already existing softwares like disqus for comments and polldaddy for ratings, since I guess it would require me to setup a mysql database to do it on my own...<br><br></p> <p>To brief it again: I have a "thumbs" folder which are gathered on a page.<br> I have an "originals" folder with the full size images that are called back by the fancybox.<br> I would like to have comments+rating in the fancybox.</p> <p><br><BR>Thanks in advance for any advice you can give me.</p>
php jquery
[2, 5]
4,423,072
4,423,073
Using SimpleDateFormat in a for loop on a list of objects
<p>My app crashes whenever I try to do this:</p> <pre><code>for (CalendarEvent event : this.ListofEvents){ String myDate = new String(event.getDate()); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); try { theDate = format.parse(myDate); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println(theDate.getDate()); } </code></pre> <p>If I just print event.getDate() as a test, it displays all the dates. But when I try to format each date I'm assuming it locks up the phone resources. It's a fairly large List with many entries. </p> <p>Perhaps there's a better method of getting the day, month, and year without taking up all the resources.</p>
java android
[1, 4]
1,673,344
1,673,345
How to use boolean value returned by a method
<p>I just want to know how to use a boolean value returned from a method.This is the method which is returning the value:</p> <pre><code> public boolean hasConnection() { ConnectivityManager cm = (ConnectivityManager) MCQ.this.getBaseContext().getSystemService( Context.CONNECTIVITY_SERVICE); NetworkInfo wifiNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifiNetwork != null &amp;&amp; wifiNetwork.isConnectedOrConnecting()) { return true; } NetworkInfo mobileNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); if (mobileNetwork != null &amp;&amp; mobileNetwork.isConnectedOrConnecting()) { return true; } NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); if (activeNetwork != null &amp;&amp; activeNetwork.isConnectedOrConnecting()) { return true; } return false; } </code></pre> <p>This is the method where i want to use this value:</p> <pre><code>public void setScrollViewLayoutMarginBottom() { Resources resources = this.getResources(); DisplayMetrics metrics = resources.getDisplayMetrics(); Boolean b = hasConnection(); if(b == true) { px = 90 * (metrics.densityDpi/160f); } else px = 60 * (metrics.densityDpi/160f); layoutParams.bottomMargin = (int) px; layoutParams.setMargins(0, 0, 0, (int) px); sv.setLayoutParams(layoutParams); } </code></pre> <p>Please help me.Thanks in advance.</p>
java android
[1, 4]
958,512
958,513
Triggering Click Event on File Input with jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/793014/jquery-trigger-file-input">Jquery trigger file input</a> </p> </blockquote> <p>I'm developing an app that needs the user to specify a file from the very beginning. I would like to have the file input box display immediately, instead of requiring the user to click an upload button.</p> <p>Can someone explain to me why the third option works in my jsfiddle example while the others don't? Links to official specs would be most appreciated.</p> <p><a href="http://jsfiddle.net/vnS3k/" rel="nofollow">http://jsfiddle.net/vnS3k/</a></p> <pre><code>// Trigger Click Event at Load - Doesn't Work $('#a').click(); // Trigger Click Event at Timeout - Doesn't Work window.setTimeout(function() { $('#a').click(); }, 3000); // Trigger Click Event at User Click *On Something Else* - Works $('#b').click(function() { $('#a').click(); }); </code></pre>
javascript jquery
[3, 5]
4,022,542
4,022,543
Can't append HTML code into one div by using jQuery
<p>I have one div id=userinfo</p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;/head&gt; &lt;body&gt; &lt;div id=userinfo&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And now I want to append something into this div, depending on the localStorage.</p> <pre><code>if (localStorage==0){$("#userinfo").append("&lt;p&gt;Test&lt;/p&gt;");} else {$("#userinfo").append("&lt;p&gt;Hello&lt;/p&gt;");} </code></pre> <p>But it failed, no matter I input this script into separate JS file or add them into the head of the html file. I tried exclude this with Google chrome developer tool's console, it works as expected.</p> <p>I've tried another way round change the script into:</p> <pre><code>if (localStorage==0){alert("Test");} else {alert("Hello");} </code></pre> <p>And add this into JS file, it works!</p> <p>So, now I'm stacked why my jQuery code not work? </p>
javascript jquery
[3, 5]
2,213,786
2,213,787
Need some help on jQuery sliding box script to set the height equal to text
<p>I have updated the code I am working on here <a href="http://jsfiddle.net/dFfJm/" rel="nofollow">http://jsfiddle.net/dFfJm/</a></p> <p>At the first sliding box where there is only 1 line of text. On the second box there are 3 lines of texts.</p> <p>As you can see it does not look right, there is a large empty sliding area in box 1. </p> <p>My question is how to keep it showing one row by default and when the user hovers the sliding part will be as high as the title length?</p> <p>Thank you. </p>
javascript jquery
[3, 5]
4,919,970
4,919,971
Calling C++ exe functions from C#
<p>I'm trying to monitor a running application written in C++ using a different C# application.</p> <p>In my C++ code I have defined an API:</p> <pre><code>_declspec(dllexport) //is this even possible when compiling an .exe? int getSomething(); </code></pre> <p>Is there a way to call this function from the C# code?</p> <p>Will the classic approach work:</p> <pre><code>[DllImport("myexe.exe", CharSet = CharSet.Auto)] public static extern int getSomething(); </code></pre>
c# c++
[0, 6]
4,887,189
4,887,190
Leonardo connectivity with Android
<p>I want to connect the Leonardo Arduino board to an Android device. Is there a library like the MAX3421 for use with the MEGA that is usable and provides AndroidAccessory connectivity for the Leonardo? </p> <p>Cheers, Doug</p>
android c++
[4, 6]
2,911,171
2,911,172
What is the correct string format of the datetime with milliseconds from JavaScript to C# code
<p>This will result to an error because C# variable testDate is different in format from the JavaScript variable testDate:</p> <p>jquery:</p> <pre><code>$.getJson url= "/Home/GetJasonData" testDate = '1/1/2009 10:01:01:123' </code></pre> <p>controller:</p> <pre><code>void GetJasonData(DateTime testDate) { } </code></pre>
c# javascript
[0, 3]
1,944,141
1,944,142
Using string format for Url.Content doesn't work
<p>I have this little foreach statement in an ASPX page: </p> <pre><code>&lt;% foreach(string path in pathList) { %&gt; &lt;img src="&lt;%=Url.Content(string.Format("~/Content/Images/{0}", path))%&gt;" /&gt; &lt;% } %&gt; </code></pre> <p>I want that to display all images using <code>Url.Content</code> from the list of paths.</p> <p>But my code doesn't work.</p> <p>In the generated HTML, the above code returns me <code>&lt;img src='/Content/Images/' /&gt;</code> instead of <code>&lt;img src='/Content/Images/page.png' /&gt;</code> and others.</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,399,166
3,399,167
MediaPlayer array causing null pointer in Android
<p>Can anyone see why I would be getting a NullPointerException with this code? The code is basically to create a MediaPlayer array so that I can loop through it and stop/start all of the mediaplayers at once. They are also linked to seekbars to control volume.</p> <pre><code>private MediaPlayer[] media; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //media players media[0] = MediaPlayer.create(this, R.raw.drums); media[1] = MediaPlayer.create(this, R.raw.bass); media[2] = MediaPlayer.create(this, R.raw.synth); media[3] = MediaPlayer.create(this, R.raw.snare); media[4] = MediaPlayer.create(this, R.raw.wobble); for(int i=0;i&lt;media.length;i++){ media[i].start(); media[i].setLooping(true); media[i].setVolume(0,0); } //drums seekbar final SeekBar volControl = (SeekBar)findViewById(R.id.volbar); volControl.setMax(maxVolume); volControl.setProgress(0); volControl.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar arg0) { // TODO Auto-generated method stub } @Override public void onStartTrackingTouch(SeekBar arg0) { // TODO Auto-generated method stub } @Override public void onProgressChanged(SeekBar arg0, int arg1, boolean arg2) { // TODO Auto-generated method stub media[0].setVolume(arg1, arg1); } }); </code></pre>
java android
[1, 4]
4,795,097
4,795,098
Not allow more than 5 digits after decimal. in on javascript "OnKeyUp"?
<p>I have a javascript code for textbox that will put commas on in digits like (11,23,233)</p> <pre><code> mTextbox.Attributes.Add("OnKeyUp", "javascript:this.value=Comma(this.value);") function Comma(Num) { Num += ''; Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); Num = Num.replace(',', ''); x = Num.split('.'); x1 = x[0]; x2 = x.length &gt; 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) x1 = x1.replace(rgx, '$1' + ',' + '$2'); return x1 + x2; } </code></pre> <p>Now same here I need to restrict user to enter not morethan 5 digits after decimal (ex: </p> <pre><code>Allow: 12,23,221.34323 Not Allow: 12,23,232.232423 </code></pre> <p>I can change above javascript to work that?</p>
asp.net javascript
[9, 3]
1,608,749
1,608,750
asp.net c# better way to Parse numbers and datetimes from query string then try/catch
<p>is there a better way then a try/catch to parse numbers and datetimes without crashing the page?</p> <p>if they are not valid numbers/datetimes they should be null.</p> <p>here is what I've got so far:</p> <p><code></p> <pre><code>long id = null; try{ id = Int64.Parse(Request.QueryString["id"]); }catch(Exception e){} DateTime time = null; try{ time = DateTime.Parse(Request.QueryString["time"]); }catch(Exception e){} </code></pre> <p></code></p>
c# asp.net
[0, 9]
2,705,598
2,705,599
How to open rad window popup on click of link button
<p>I want to open popup on click of link button to edit the record. This my code.</p> <pre><code> protected void btnEdit_Click(object sender, EventArgs e) { LinkButton linkButton = sender as LinkButton; if (linkButton != null) { string buyerId = linkButton.CommandArgument.ToString(); WinBuyers.NavigateUrl = "../Popups/Buyer.aspx?buyerID=" + buyerId; WinBuyers.VisibleOnPageLoad = true; } } </code></pre>
c# asp.net
[0, 9]
2,929,695
2,929,696
JavaScript: Cut URL after nth slash
<p>I have URLs like</p> <pre><code>http://www.domain.com/dir/dir2/dir3/dir4/#tag </code></pre> <p>or</p> <pre><code>http://www.domain.com/dir/dir2/dir3/dir4 </code></pre> <p>Now I need to get only the url till dir3 and nothing after that… (or «everything till the sixth slash in the string»)</p> <pre><code>http://www.domain.com/dir/dir2/dir3/ </code></pre> <p>How can this be accomblished with JavaScript?</p>
javascript jquery
[3, 5]
2,470,426
2,470,427
Make Notification Div Fade Out When User Click Anywhere Outside The Notification Div
<p>I'm making website that have notification 'button'. When user click this button, notification div will appear at the bottom of the button.</p> <p>I want to make its behaviour like notifacation in facebook. the notification will disappear when user click anywhere outside the notification div element.</p> <p>So far, i've succeed to make the notification div to fade in and fade out when the notification button clicked. i'm using jquery to do this.</p> <p>but, i don't know how to make it fade out when user click anywhere outside the notification div.</p> <p>Can anyone help me?</p> <p>Here is my code that i've made:</p> <pre><code>&lt;div id="notifikasi" style="position:relative; cursor:pointer"&gt;Notification&lt;sup style="padding: 2px 4px 2px 4px; background: red"&gt;&lt;/sup&gt; &lt;div id="theNotif" style="position: absolute; top: 20px; left: 0px; background: #fff; color: #000; border: solid 1px #999; z-index: 999; padding: 10px 20px 10px 0px; width:200px; display:none"&gt; &lt;ul&gt; &lt;li&gt;Some Notification&lt;/li&gt; &lt;li&gt;Some Notification&lt;/li&gt; &lt;li&gt;Some Notification&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; $('#notifikasi').click(function(){ if($('#theNotif').css('display') == 'none'){ $('#theNotif').fadeIn('fast'); } else{ $('#theNotif').fadeOut('fast'); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,068,077
2,068,078
How to get attributes of container in jquery?
<p>How can I get attributes values from an container using jquery ?</p> <p>For example:</p> <p>I have container div as:</p> <pre><code>&lt;div id = "zone-2fPromotion-2f" class = "promotion"&gt; </code></pre> <p>here how can I get attribute id value using jquery and than how can I trim the value to get component information ?</p> <p>update : how can i get attribute values ?</p> <p><strong>UPDATE</strong>: If I have multiple components on page with same div information than how would I know what attribute value is for which component ?</p> <p>Thanks. </p>
javascript jquery
[3, 5]
3,715,527
3,715,528
what is the difference between CharSequence[] and a String[]?
<p>What is the difference between <code>CharSequence[]</code> and <code>String[]</code>?</p>
java android
[1, 4]
195,893
195,894
Access Javascript from Java
<p>I m trying to access JavaScript function from Servlet code. But I'm getting the error shown below. Here is the code:</p> <pre><code>out.println("&lt;FRAME src=\"javascript:parent.newWindow('" + URL+ "') \" scrolling=No noresize /&gt;"); </code></pre> <p>And this is the error that occurs in JavaScript:</p> <blockquote> <p>Object does not support this property or method;</p> </blockquote>
java javascript
[1, 3]
3,419,191
3,419,192
Check if content in DIV has changed
<p>I'm loading some content inside a div with <code>setInterval</code>, and I don't want it to run everytime so I need to check if the content has changed from the last time it ran.</p> <p><strong>Here's what I'm currently using that's not working</strong></p> <pre><code>var auto_refresh = setInterval( function() { $('#loaddiv').load('/wzha/reload.php'); $('#loaddiv').change(function() { var dddd = $('#loaddiv').text(); alert(dddd); }); }, 1000); </code></pre> <p><strong>Example:</strong> </p> <p>reload.php is just <code>&lt;?php echo 'something here'; ?&gt;</code>. When I save reload.php, it needs to put <code>something here</code> in to the <code>#loaddiv</code>. It should not load the div anymore until I re-save reload.php to something else.</p>
javascript jquery
[3, 5]
5,543,549
5,543,550
Problem with jquery :not selector
<p>I'm having an issue trying to NOT select a tablerow with the function:</p> <pre><code>$("tr").click(function(e) { var row = jQuery(this) //rest of code left off }); </code></pre> <p>Basically it finds all tablerows and adds click functionality that will open a edit modal that has a row with textboxes that are populated with info from the tablecells. The problem is that the tablerow in the modal is also getting the functionality so when a user goes to edit a value in a text box the all the values disappears...</p> <p>So what I have been trying and failing is to filter the tr by id several way by using: </p> <pre><code>$("tr").not('trEdit').click(function(e) { var row = jQuery(this) </code></pre> <p>and</p> <pre><code>$("tr not:'trEdit').click(function(e) { var row = jQuery(this) </code></pre> <p>I've also played around with trying the second table and then not selecting it's table rows, but the tables aren't besides each other &amp; the example I had was...no I haven't tried table[1] tr yet(now that I think about it)...</p> <p>Please help...I'm going nuts trying to figure this out..</p> <p>Thanks!!!!!</p>
javascript jquery
[3, 5]
3,243,610
3,243,611
How to call Asp.Net Button click event when Browser Close or(ALT+F4)
<p>I need to call Asp.net button click event When browser is manually closed or(ALt+F4). I have tried the below,</p> <p>First of all, create a new ASP.NET page in your favorite IDE and add an instance of the ScriptManager to it. Make sure you configure the ScriptManager to enable Page Methods. Listing 1</p> <pre><code>&lt;asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true" /&gt; </code></pre> <p>Next, we will subscribe to the unload event of the body tag of the ASP.NET page and assign a callback method to be called when this event fires. Listing 2</p> <pre><code>&lt;body onunload="HandleClose()"&gt; </code></pre> <p>The HandleClose function is placed within the Head section of the page. Listing 3</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function HandleClose() { alert("calling button click event"); PageMethods.call();} &lt;/script&gt; </code></pre> <p>in aspx.cs Page:</p> <p><code>[WebMethod]</code> </p> <pre><code>public static void call() { --Btn_click(object sender,e); Tried to call button event; } </code></pre> <p>But obviously I cant achive it in static method....Is it any other way to achive my scenario....</p>
c# asp.net
[0, 9]
4,717,398
4,717,399
JQuery Element Display / Hiding and Control Flow
<p>I am working on displaying a progress bar using JQuery during a long running function. My plan is to simply show the div containing the progress bar before calling the function, and then hiding the div after the function is finished. The following code example demonstrates what I am trying to accomplish.</p> <pre><code>$(document).ready(function() { $(document).click(function() { $("#progress").show(); slowFunction(); $("#progress").hide(); }); }); function slowFunction() { for (var i = 0; i &lt; 50000; ++i) { var t = Math.sin(i) + Math.cos(i); console.log(t); } } </code></pre> <p>Example on JSFiddle <a href="http://jsfiddle.net/MT25x/4/" rel="nofollow">http://jsfiddle.net/MT25x/4/</a></p> <p>The problem is that the div is not being displayed at all even though the function takes ~10 seconds on my machine to run.</p> <p>If however I just try to show the div after the function it works fine, coming up in ~10 or so seconds after the click occurs. Can anybody help me shed some light on this issue?</p> <p>Edit: Further testing seems to show that if you remove the hide call all together the div isn't even showing until after the function has finished running. This seems like very odd behavior.</p>
javascript jquery
[3, 5]
2,229,990
2,229,991
Override all requests from javascript
<p>I have an asp.net application. I need to implement that every request to the server for a page will contain an additional parameter in query string. My idea was to capture all reqests in javascript and add this parameter.</p> <p>I might use jQuery selector for every link and change it href and override jquery ajax to add this parameter to request but this is not the best solution.</p> <p>Is this possible in JS ?</p> <p>Thanks, Bartek</p>
javascript jquery asp.net
[3, 5, 9]
4,466,329
4,466,330
Given a start and end date, create an array of the dates between the two
<p>Right now, I have this on my page:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { var days = [ { Date: new Date($('#hfEventStartDate').val()) }, { Date: new Date($('#hfEventEndDate').val()) } ]; }); &lt;/script&gt; &lt;asp:HiddenField ID="hfEventStartDate" runat="server" /&gt; &lt;asp:HiddenField ID="hfEventEndDate" runat="server" /&gt; </code></pre> <p>I'm setting hfEventStartDate and hfEventEndDate when the page loads. With my code right now, it creates an array with two values: the start date and the end date. But I'd like to also have the array contain all the dates in between. How can I do that?</p>
javascript jquery
[3, 5]
4,049,978
4,049,979
What's the Java equivalent to C++'s for_each template?
<p>In the following code you're able to apply any Function f (e.g., add, subtract, etc.). How do I do that through Java?</p> <pre><code>template&lt;class InputIterator, class Function&gt; Function for_each(InputIterator first, InputIterator last, Function f) { for ( ; first!=last; ++first ) f(*first); return f; } </code></pre>
java c++
[1, 6]
3,659,145
3,659,146
how to detect blocked address from within php
<p>so here is my problem; we are trying to setup the facebook like and twitter tweet button on our website but it is causing browsers to become unresponsive when facebook and twitter are blocked on their computers. so what i would like to do is detect if facebook or twitter are blocked and then remove the buttons for those computers, while allowing all others to load them.</p> <p>is this possible in php or in javascript?</p> <p>i haven't been able to locate any information about testing if a link is blocked or not.</p>
php javascript
[2, 3]
3,827,871
3,827,872
bridge language between PHP and Objective-C
<p>i want to show php page in iphone application. I have also used webview to display page but not able to know how to apply slide effect on page please help me...</p> <p>i am working with one application in which i m working with php listing page and then i want to show detail page but how to show slide transition effect.</p>
php iphone
[2, 8]
3,032,507
3,032,508
How do you programmically execute javascript as if from the browser bar?
<p>For example if you type in the browser bar <code>javascript:alert('hai');</code> it shows a pop up. Is that possible to do in a programming language?</p> <p>For example in java would I be able to connect to a website, and execute it's javascript somehow in my program?</p> <p>Example:</p> <p>Javascript in website:</p> <pre><code>function setStatus(a) { if (a == 1) status1 = true; else if (a == 2) status2 = true; else if (a == 3) status3 = true } </code></pre> <p>Java program:</p> <pre><code>URL site = new URL("http://somesite.com/page.html"); URLConnection siteConnect = site.openConnection(); siteConnect.connect(); </code></pre> <p>Would I be able to execute <code>setStatus(1)</code> <code>setStatus(2)</code> <code>setStatus(3)</code> inside the java program? How could it be done?</p>
java javascript
[1, 3]
1,334,192
1,334,193
Selecting text in div on mouseover
<p>How can I select text when I mouse over a div?</p>
javascript jquery
[3, 5]
3,633,340
3,633,341
How to implement this keyboard hooking function in javascript/jquery?
<p>I need to implement a keyboard for my language. For example, I want that if you type <code>"a"</code> then in the textbox or input box will show: <img src="http://cl.cooltext.com/rendered/cooltext530153213.png" alt="ka">.....If i press "m" it will show: <img src="http://i.stack.imgur.com/5hL2n.png" alt="enter image description here"></p> <p>Now, this is not possible in current webbrowsers because there is no hooking functionality here. For this,I have decided that this algorithm:</p> <ol> <li>Detect keycode of the typed letter (in this case <code>"a"</code>)</li> <li>Maintain a keymap and found from the keycode (in step1) which key will be replaced by <code>"a"</code></li> <li>Replace the textarea/textInput as: "string before --a--"+ replaced key from step2 + "rest of the portion after --a--"</li> <li>return false so that "a" is not written into the textarea/textInput by the browser.</li> </ol> <hr> <p>I am searching for a better idea than running <strong>substring</strong> method after keystroke...Please help.</p>
javascript jquery
[3, 5]
883,334
883,335
Get images width on .load() doesn't work on all browsers except firefox
<p>I post my question here because I haven't find an answer to my issue. I load some image in JavaScript. Each of them are in its own div. And I want to get the width of the div.</p> <pre><code>this.biggerElmts.find('img').each(function(){ var div = $('&lt;div/&gt;', {'class': this.divMinPic}).appendTo(divMinPics); var img = $('&lt;img/&gt;', { 'class': this.minPic, alt:'Miniature '+$(this).attr("alt"), src:this.urlPic($(this).attr("src"), this.minPicFolder) }) // if image not found, we put de default file .error(function(){console.log("error loading image");$(this).attr("src", this.minPicFolder + this.defaultMinPic);}) .load(function(){ console.info($(this).width()); }) .appendTo(div);}); </code></pre> <p>My problem is that it works fine on Firefox, but it doesn't on all other browser. Firefox return me 185 and each other return me 0.</p>
javascript jquery
[3, 5]
5,433,399
5,433,400
How to increment a numeric string by +1 with Javascript/jQuery
<p>I have the following variable:</p> <pre><code>pageID = 7 </code></pre> <p>I'd like to increment this number on a link:</p> <pre><code>$('#arrowRight').attr('href', 'page.html?='+pageID); </code></pre> <p>So this outputs 7, I'd like to append the link to say 8. But if I add +1:</p> <blockquote> <p>$('#arrowRight').attr('href', 'page.html?='+pageID+1);</p> </blockquote> <p>I get the following output: 1.html?=71 instead of 8.</p> <p>How can I increment this number to be pageID+1?</p>
javascript jquery
[3, 5]
4,030,178
4,030,179
Server Side vs. Client Side Processing?
<p>I have some structured data...in this case mysql data.</p> <p>I need to display it to the user. I can convert it to HTML on the server (PHP) or the client (Javascript).</p> <p>Which one should I use?</p> <p>Pros for Server : ?</p> <p>Pros for Client : 1. Bandwidth is reduced because I send only data over the network. 2. Processing is delegate to the client so less tax on server. 100 to 1. If say 100 clients are accessing.</p> <p>I'm talking about the HTML that is added into the structured data, you can do this on the client or the server. Not both </p> <p>I'm don't care about whether javascript is enabled or disabled. Thanks.</p>
php javascript
[2, 3]
1,483,805
1,483,806
how to make Dynamic Scrolling list in asp.net
<p>how to make Dynamic Scrolling list in asp.net ?</p> <p>i have a text file that contain sentences, and i want</p> <p>to show those sentences in dynamic scrolling list in my webform (like news)</p> <p>how to do it ?</p> <p>can i get any sample code ?</p>
c# asp.net
[0, 9]
1,009,013
1,009,014
JQuery Dialog auto focuses input field
<p>I created a dialog and when I open it by clicking a button the first input field in the dialog's container gets focused. How can I avoid it?</p>
javascript jquery
[3, 5]
5,916,853
5,916,854
Javascript running improperly?
<p>I have a Javascript function that is called from the onchange method in a DropDownList. However I'm getting the error "Cannot have multiple items selected in a DropDownList." on line 14. This happens when the page is reloaded for other purposes. Why is it getting hung here when the method shouldn't even be getting called?</p> <pre><code>Line 12: { Line 13: var hfSelected = document.getElementById("&lt;%=hfSelectedValue.ClientID%&gt;"); Line 14: var ddlExposure = document.getElementById("&lt;%=ddlExposure.ClientID%&gt;"); Line 15: hfSelected.value = ddlExposure.options[ddlExposure.selectedIndex].text + "|" + ddlExposure.options[ddlExposure.selectedIndex].value; Line 16: } </code></pre>
asp.net javascript
[9, 3]
5,348,313
5,348,314
How do you configure SWFUpload to work with an ASP.NET C# WebService?
<p>I'm trying to use SWFUpload with an ASP.NET Web Forms project. I need to get at Request.Files[0] But I can't do that in my WebService! </p> <p>Anyone know a way around this?</p> <p>Thanks in advance.</p>
c# asp.net
[0, 9]
1,575,823
1,575,824
How can I put JavaScript code at the bottom of an ASP.NET page?
<p>In my ASP.NET page, I am referring to an external JavaScript file.</p> <p>As per my learning in the web, it's recommended always to put inline JavaScript code at the bottom of the page. There is no information about how to do it for an external JavaScript reference.</p> <p>I want to know, if I am referring to an external JavaScript file, where should I write it?</p> <pre><code>&gt; 1. Inside &lt;Head/&gt; top of the page &gt; 2. bottom after closing tag of &lt;/form&gt; </code></pre>
javascript asp.net
[3, 9]
121,910
121,911
Detecting Data changes in Forms using JQuery
<p>I'm using ASP.NET 2.0 with a Master Page and I was wondering if anyone knew of a way to detect when the fields within a certain <code>&lt;div&gt;</code> or <code>fieldset</code> have been changed (e.g., marked '<code>IsDirty</code>')?</p>
javascript jquery
[3, 5]
4,845,997
4,845,998
How can i add double quotes to a string?
<p>I want to add double quotes for a sting . I know by using /" we can add double quotes . My string is</p> <pre><code>string scrip = "$(function () {$(\"[src='" + names[i, 0] + "']\"" + ").pinit();});"; </code></pre> <p>When i do this on the browser i am getting &amp;quot instead of " quotes . How can i overcome with the problem ?</p>
c# asp.net
[0, 9]
5,453,038
5,453,039
Maxlength check using JQuery For multiline text box
<pre><code>&lt;asp:TextBox ID="txtPurpose" CssClass="dd" runat="server" MaxLength="500" OnKeyUp="return maxlength();" OnPaste="return maxlength();" TextMode="MultiLine" Width="70%" Rows="4" ValidationGroup="tool"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>in javascript</p> <pre><code>function maxlength() { var max = 500; if ($('.dd').focus().val().length &gt; max) { $('.dd').val($('.dd').val().substr(0, max)); } $('.charsRemaining').html('You have ' + (max - $('.dd').val().length) + ' characters remaining'); } </code></pre> <p>it is working fine but when copying something and pasting it in textarea using mouse right click $('.dd').focus().val() is coming as empty string. what to do </p>
javascript asp.net
[3, 9]
3,232,796
3,232,797
Trying to pass in a callback function fails
<p>I am trying to create some functionality when a user clicks on an element on the webpage. The callback function executes as soon as the page is executed. It is only supposed to execute when the user clicks on an element. Here is the code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Javascript Test&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-latest.pack.js"&gt;&lt;/script&gt; &lt;script&gt; $("#clickMe").one('click', printThis("Hello All")); function printThis(msg) { console.log(msg); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="clickMe"&gt;Click me!&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
215,961
215,962
javascript async woes
<p>This is a newbie JavaScript question, but something I'm not quite sure how to google for help because I'm not sure how to describe the problem in an easy way.</p> <p>I have a large, somewhat complex JSON that I need to manipulate so that I could reshape the JSON in a way that I get a list of only countries, cities, and sales.</p> <p>The JSON itself isn't the issue for me, it's what I would like to do with it once I've received it. Basically, I'd like to create 3 separate objects/arrays from a large received JSON and have those 3 separate objects/arrays accessible for usage OUTSIDE of the <code>$.ajax</code> call. Yes, I think I could do all of this inside of the <code>$.ajax</code> success callback, but I'd rather have all the JSON processing done elsewhere. My pseudo JavaScript looks something like this:</p> <pre><code>var model = { countries: [], cities: [], sales: [], set: function(data) { //manipulate data here so that model.countries, model.cities, model.sales are populated } }; $.ajax({ url: 'example.com/sample.json', success: function(data) { model.set(data); //is this the right way to do this? } }); $('#countries').html(model.countries); $('#cities').html(model.cities); $('#sales').html(model.sales);​ </code></pre> <p>But because JavaScript executes asynchronously, the last 3 lines are always blank because the JSON hasn't been received yet.</p> <p>So I guess my question is, how do I bind the results of my received JSON to a variable outside of the <code>$.ajax</code> scope so that I could use it wherever on the page?</p>
javascript jquery
[3, 5]
4,643,052
4,643,053
how to set login control to compare the credentials stored in web.config?
<p>I have set my credential in web.config as :</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="Login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20"&gt; &lt;credentials passwordFormat="MD5"&gt; &lt;user name="Nayeem" password="pwd"&gt;&lt;/user&gt; &lt;/credentials&gt; &lt;/forms&gt; &lt;/authentication&gt; &lt;authorization&gt; &lt;deny users="?"/&gt; &lt;/authorization&gt; </code></pre> <p>and have my login control as :</p> <pre><code>&lt;asp:Login ID="LoginEmployees" runat="server"/&gt; </code></pre> <p>I want my login control to authenticate with the credentials given in the web.config file</p>
c# asp.net
[0, 9]
1,455,928
1,455,929
How make jquery loop over with number
<p>I am trying to assign a number to my variable i.e. colorswap1, colorswap 2, colorswap 3</p> <p>I have the following</p> <pre><code>var i = 1-36; // Get current image src var curSrc = $('#colorswap'[i]).attr('src'); </code></pre> <p>It doesn't seem to be putting the desired: colorswap1, colorswap2</p>
javascript jquery
[3, 5]
3,777,578
3,777,579
check to see if the Chapter Title has been referenced two or more times before a different Chapter Title is referenced? then apply a different class
<p>I have a bunch of divs sprinkled throughout a long article. Each one, when clicked, shows a <code>span</code> of hidden text within the div. They're made up of </p> <p>1) chapter title<br> 2) section number<br> 3) point number</p> <p>eg: government 3:15 OR whitehouse 15:27 OR legislation 1:38 (there are over 90 chapters).</p> <p>Using jQuery, i'm trying to see if a chapter title occurs two or more times in a row, if it does, apply a specific class to every one except the first.</p> <p>Reason being: when referencing these chapter titles, i've placed an icon at the beginning: </p> <p>eg: <code>(icon)Whitehouse 29:8</code>, but I don't want every single chapter title to have an icon, if that chapter title is referenced two or more times before another chapter title is referenced, then I want the second third forth(etc.) to not have the icon.</p> <p><strong>Does anyone know how I would go about checking to see if the Chapter Title has been referenced two or more times before a different Chapter Title is referenced?</strong></p> <p><strong>example:</strong> </p> <p>He spoke of the many injustices in <code>(icon)Whitehouse 3:15</code>, but the president wasn't speaking of mountains <code>whitehouse 4:2</code> and <code>whitehouse 4:9</code>. When he saw they were ready to begin <code>(icon)congress 19:4</code>, he said "welcome all to this session" <code>(icon)legislation 9:41</code>, then smacked the prime minister in the face <code>legislation 3:8</code></p>
javascript jquery
[3, 5]
2,301,404
2,301,405
Count instances of string in an array
<p>I have an array in jQuery, and I need to count the number of "true" strings in that array, and then make the "numOfTrue" variable equal the number of true strings. So in the below array, there are 2 "true" strings, so numOfTrue would be equal to 2.</p> <pre><code>var numOfTrue; var Answers = [ "true", "false", "false", "true", "false" ]; </code></pre> <p>I'm not sure how to do a loop through the array in jQuery to count the strings. Or is a loop even necessary?</p> <p>The number of true strings could change from anywhere between 1 to 5.</p>
javascript jquery
[3, 5]
2,964,638
2,964,639
Which is faster when reading large amounts of data: XML or SQLite
<p>I will be developing a dictionary app for both Android and iPhone. The data will be embedded within the app, and it consists out of approximately 100000 words, with genus and plural form. Is it better to use a SQLite database or can I just stick to XML? Somehow SQLite sounds more efficient, but I thought let's just ask.</p> <p>Thanks!</p>
iphone android
[8, 4]
3,266,841
3,266,842
javascript: how do I make one element visible relative to an element I hover over?
<p><a href="http://jsfiddle.net/awfex/4/" rel="nofollow">http://jsfiddle.net/awfex/4/</a></p> <p>HTML:</p> <pre><code>&lt;div class="section-header section-header-on" id="section_header_289" style="left: 50px;"&gt; &lt;span class="collapse"&gt;&lt;/span&gt; &lt;div class="section-name"&gt; &lt;span class="name"&gt;Testing Facebox suff&lt;/span&gt;&lt;/div&gt; &lt;ul class="tools"&gt; &lt;li&gt; &lt;a class="trash" href="#"&gt;&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#" class="edit"&gt;&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>js:</p> <pre><code>$j = jQuery.noConflict(); $j(".section-header").hover(function(){ $j(this).find("ul").show(); }); </code></pre> <p>So, I need this to be relative, because there are multiple "section-header"s and the ID is generally unknown / generated by the app. But, basically, I want to be able to hover over the section-header, and then have ul.tools change from display: none; to display: block. So I figured .show() could do that. but.. I guess my selector is wrong. =\</p>
javascript jquery
[3, 5]
2,166,213
2,166,214
jQuery CSS animation for background image
<p>I have this javascript code :</p> <pre><code>$(".linksColl a li").hover(function () { $(this).css({ "background-image" : "url(images/links/linkHover1.png)", "background-position" : "center center", "background-repeat" : "no-repeat"}); }); $(".linksColl a li").mouseout(function () { $(this).css({ "background-image" : "", "background-position" : "", "background-repeat" : ""}); }); </code></pre> <p>I want to add animation to it like <code>fadeIn</code> and <code>fadeOut</code> for the background image so when hover <code>fadeIn</code> effect apply for the background image and on mouseout <code>fadeOut</code> effect apply for the background image</p> <p>How I can do it?</p>
javascript jquery
[3, 5]
5,398,827
5,398,828
jquery fading border not working
<p>I just want some simple links where if it's hovered over, instead of having a line appear under it suddenly, it should fade. I'm trying this, but to no avail:</p> <pre><code>$(document).ready(function(){ $('#footer a').mouseover(function(){ $(this).animate({ border-bottom: 'border-bottom: 1px solid #D8D8D8' }, 1000, function() { // Animation complete. }); }); }); </code></pre> <p>What should I be doing?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,217,527
4,217,528
Can't change innerHtml neither with plain JavaScript not with jQuery
<p>Here is source code of the simple page:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;script src="jquery-1.4.2.js" type=text/javascript&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="divText"&gt;Original&lt;/div&gt; &lt;script type="text/javascript"&gt; var vText = document.getElementById('divText'); vText.innerText = 'Changed'; alert(vText.innerHTML); $('divText').text = 'Changed with jQuery'; alert(vText.innerHTML); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>"jquery-1.4.2.js" file is in the same folder.</p> <p>Both alerts display "original" text, text in browser also "Original"...</p> <p>What is wrong with my code? Any thoughts are welcome.</p>
javascript jquery
[3, 5]
5,978,948
5,978,949
Access Controls from UserControls in ASPX page
<p>How to Access Controls from UserControls in ASPX page? For example: I want to access gridview which is in usercontrol on ASPX page.</p> <p>Please help me.</p>
c# asp.net
[0, 9]
305,460
305,461
Jquery get parent of li href
<p>Hi I want to get the parent of this li </p> <pre><code> &lt;li&gt;&lt;a href="/panasonic/index.php/en/site/wheretobuy" class="WTB"&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="/panasonic/index.php/en/showroom/index" id="myid" &gt; testing&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre> <p>How can I get the parent href of "myid".</p> <p>All I have is this </p> <pre><code>document.write($('#myid').parent('li').find('a').attr('href')); </code></pre> <p>Which displays ".../showroom/index", I use document.write() just to test. </p> <p>I want it to display ".../wheretobuy" and it has to be accessed via "myid"</p> <p>here it is here </p> <p><a href="http://fiddle.jshell.net/86powers/YLYxF/" rel="nofollow">http://fiddle.jshell.net/86powers/YLYxF/</a></p> <p>Thanks</p>
javascript jquery
[3, 5]
541,099
541,100
Check datatable columns against list
<p>Let's say I have a list of values. (Currently on a piece of paper, but this could be List or whatever you suggest).</p> <p>As follows:</p> <pre><code>Name, Type, Phone, Contract, Remark </code></pre> <p>Now I have a datatable which is imported from a file. I need to check if datatable contains the same columns from my list. (So my datatable should have 5 columns <code>Name, Type, Phone, Contract, Remark).</code> I'd like to check regardless of position, but if persisting position of columns is faster, I would prefer faster solution. i know you can something like </p> <pre><code>Foreach column in datatable if columnname exist in list and ListSize ==Datatable.Columns.Count then continue else return false`. </code></pre> <p>but I'd like a faster solution.</p>
c# asp.net
[0, 9]
292,831
292,832
how to change the value in the html tag using jquery
<p>I want to change the param value of the applet tag based on the value from the dropdown. I am new to jquery .can someone tell me how can i do it using jquery . </p> <p>My applet code :</p> <pre><code>&lt;applet id="decisiontree" code="com.vaannila.utility.dynamicTreeApplet.class" archive="./appletjars/dynamictree.jar, ./appletjars/prefuse.jar" width ="1000" height="500" &gt; &lt;param name="dieasenmae" value="Malaria"/&gt; &lt;/applet&gt; </code></pre> <p>My dropdownc code :</p> <pre><code>&lt;html:select name="AuthoringForm" property="disease_name" size="1" onchange="javascript:showSelected(this.value)"&gt; &lt;option&gt;Malaria&lt;/option&gt; &lt;option&gt;High Fever&lt;/option&gt; &lt;option&gt;Cholera&lt;/option&gt; &lt;/html:select&gt;&lt;/p&gt; </code></pre> <p>javascript:</p> <pre><code>function showSelected(value){ alert("the value given from dropdown is "+value); $("#decisiontree param[name='dieasenmae']").val(value); } </code></pre>
javascript jquery
[3, 5]
4,102,560
4,102,561
Swapping gems in bejeweled android clone game?
<p>I want to swap two jewels in a bejeweled clone game. My logic for the game works, but I am having a hard time getting the touch events to work. I want to be able to touch a jewel and touch another one around it to "swap" them in a grid. I have an onTouch method that will get the x and y coordinates of the jewel when it is pressed. How would I go about swapping them?</p>
java android
[1, 4]