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,873,269
4,873,270
Are there things that JavaScript can do that JQuery can't?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/471597/is-jquery-always-the-answer">Is jQuery always the answer?</a> </p> </blockquote> <p>Now-a-days everyone is talking only about jQuery at my work place, there are some Sr. Developer who work mostly with JavaScript and they have their rights reserved for jQuery. I am kind of little confused between <code>jQuery vs JavaScript</code></p> <p>What are the programming challenges which cannot be solved by jQuery and one has to go to JavaScript only or what are pros and cons of using <code>jQuery vs JavaScript</code> ?</p> <p><strong>Update</strong> - Would it be fair to say that there is no programming issues which can be solved by JavaScript and not solved by using jQuery Framework ?</p> <p><strong>Update 2</strong> - So far from answer I guess it is ok to say that what we can do in JavaScript can be done using JQuery, correct me on this if am wrong listing the programming challenges which can't be dealt with using jQuery as compared to JavaScript ?</p>
javascript jquery
[3, 5]
1,589,207
1,589,208
Equivalent of PHP's 'array_splice' in java
<p>How can I implement <code>array_splice()</code> in java</p> <pre><code>$input = array("red", "green", "blue", "yellow"); array_splice($input, 2); // $input is now array("red", "green") </code></pre> <p><a href="http://php.net/array_splice" rel="nofollow">http://php.net/array_splice</a></p>
java php
[1, 2]
5,690,113
5,690,114
Javascript: Proper way to insert a newline in javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1155678/javascript-string-newline-character">JavaScript string newline character?</a> </p> </blockquote> <p>I am aware that <code>\n</code> is the newline character but it does not work for IE. I have to use <code>\r</code> to get it to work for IE. Is there a javascript or JQuery function to insert a newline no matter the browser type?</p>
javascript jquery
[3, 5]
2,986,057
2,986,058
Trouble showing webview
<p>I need to show a web page for a several amount of seconds, then start another activity. What I am doing is on the onResume() method, I call the Thread.sleep() and then start the new activity, but when I execute it, it doesn't show me webpage. It shows a black screen, and executes the next activity. What could i possibly be doing wrong? Here is my code:</p> <pre><code>public class ShowPortalActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String url = "http://someurl.com"; WebView webview = (WebView) findViewById(R.id.webView); // next line explained below webview.setWebViewClient(new WebViewClient()); webview.getSettings().setJavaScriptEnabled(true); webview.loadUrl(url); } @Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); try { newActivity(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void newActivity() throws InterruptedException { Thread.sleep(3000); Intent intent = new Intent(ShowPortalActivity.this, Inicio.class); startActivity(intent); } </code></pre> <p>}</p>
java android
[1, 4]
4,434,162
4,434,163
Is goto ok for breaking out of nested loops?
<p>JavaScript supports a goto like syntax for breaking out of nested loops. It's not a great idea in general, but it's considered acceptable practice. C# does not directly support the <code>break labelName</code> syntax...but it does support the infamous <code>goto</code>. </p> <p>I believe the equivalent can be achieved in C#:</p> <pre><code> int i = 0; while(i &lt;= 10) { Debug.WriteLine(i); i++; for(int j = 0; j &lt; 3; j++) if (i &gt; 5) { goto Break;//break out of all loops } } Break: </code></pre> <p>By the same logic of JavaScript, is nested loop scenario an acceptable usage of <code>goto</code>? Otherwise, the only way I am aware to achieve this functionality is by setting a <code>bool</code> with appropriate scope.</p>
c# javascript
[0, 3]
111,891
111,892
Make Keyboard keys run JavaScript if the mouse isn't in a Textarea/textbox
<p>Like if they press A regardless of the caps for it to pull up Apps, Pressing D pulls up Dashboard. This should only work if their mouse is not in a area where they can type. How would i do this?</p>
javascript jquery
[3, 5]
4,723,479
4,723,480
I Want to get right time on Android Device, what I do for Expression like 1 * new Date(); in Javascript same in Android?
<p>If I run this in browser; </p> <pre><code>1 * new Date(); </code></pre> <p>I get the time: <code>1369837120265</code>. I want to get same in my Android app.</p> <p>Because Android connects to the internet, is there any guarantee that the time I get will be right? Is there any API to do this? How can I get the same time from Android?</p> <p>My app is Java based, and I want to evaluate the time like how I evaluate in browser using JavaScript. </p> <p>Thanks</p> <p>@Djon</p> <p>I want to know a thing more in my question.</p> <p>As in question if device use internet and it is connect then it will work fine. </p> <p>What about last time When My tablet is offline and have set wrong time. If wrong time happen more time and user not have correct it then.</p> <ol> <li><p>in Case of Phablet (SIM based tablet) Is their Any way to get time. I am not sure but My nokia &amp; samesung phone take time from The Call service provider.</p></li> <li><p>Because the tablet I own not have SIM nor connect to internet. Now is their anyway to get correct time without bother user to change the time correctly.</p></li> </ol> <p>I means in 2nd case offline app. (just for example) is this possible to get right time.</p>
java javascript android
[1, 3, 4]
2,596,889
2,596,890
How to do calculations with autopostback so there's no screen flicker
<p>I have a form that does an autopostback whenever a user select a number from the dropdownlist on the web form. The autopostback runs the code below which calculates the numbers of the form.</p> <p>Screenshot:</p> <p><img src="http://i.stack.imgur.com/VBG6l.jpg" alt="enter image description here"></p> <p>Problem is I get a nasty flicker on the screen everytime is recalculates / autopostback.</p> <p>Is there another way to code this to stop the flicker?</p> <p>C#</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { int intNum1 = 0; int intNum2 = 0; int intNum3 = 0; int totalt = 0; intNum1 = int.Parse(ddlNoadults.SelectedValue); intNum2 = int.Parse(ddlNoseniors.SelectedValue); intNum3 = int.Parse(ddlNochildren.SelectedValue); totalt = (intNum1 * 10) + (intNum2 * 8) + (intNum3 * 6); tbTotal.Text = totalt.ToString(); } </code></pre> <p>Regards</p> <p>Tea</p>
javascript jquery asp.net
[3, 5, 9]
3,212,440
3,212,441
how to set attributes by jquery and access them by c#
<p>I wanna change or add custom attributes in client side by jquery and check them in server side by c#</p> <p>(for example add a custom attributed named "Loaded=1" to an image HTML element when the image is loaded successfully and in server side I access to this attribute through Image control Attributes Collection)</p> <p>Is it possible ??</p> <p>Thanks for your feedbacks</p>
c# jquery asp.net
[0, 5, 9]
3,731,083
3,731,084
Making count reset for each word
<p>In my spelling game there is a grid that is populated with words that are hidden from the user. The aim of the game is to spell these words with the aid of a sound and a picture. The user spells a word by clicking the relevant letters onto the grid.</p> <p>If the user gets a word wrong the word will glow red. If this happens 3 times then the user will be given the opportunity to move onto the next word with the aid of a button that will appear on the 3rd incorrect attempt.</p> <p>At the moment this works but I have just come across an error by which the incorrect count carries over. For example if the user gets 2 incorrect attempts on one word then gets it right it moves on to the next. It will then only take one incorrect answer on that word for the user to be given the move on option. Basically I need a way for the count to reset every time it moves on to the next word.</p> <p>This code counts the number of wrong attempts and then after 3 makes the button (".minibutton") visible.</p> <pre><code> var score = { right: 0, wrong: 0, attempts: 0 }; score.wrong++; if (score.wrong == 3) { $(".minibutton").css('visibility', 'visible'); $('.next').css('visibility', 'visible'); } </code></pre> <p>A fiddle to help - <a href="http://jsfiddle.net/smilburn/7Y7A5/4/">http://jsfiddle.net/smilburn/7Y7A5/4/</a> (Sound warning!)</p>
javascript jquery
[3, 5]
498,098
498,099
Pass javascript variable to php code?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/406316/how-to-pass-a-variable-data-from-javascript-to-php-and-vice-versa">How to pass a variable / data from javascript to php and vice versa?</a> </p> </blockquote> <p>I have a file of php and javascript code. I want to set a php variable to be the result of a javascript function which takes a php variable as a parameter. For example: </p> <pre><code>$parameter = "this is a php variable"; $phpVar = echo "foo(" . parameter . ");"; </code></pre> <p>I know you cannot do a "= echo", is there another way I can do this?</p> <p>Thanks</p>
php javascript
[2, 3]
6,002,953
6,002,954
How to order divs with JQUERY
<p>i have divs like this: </p> <pre><code>&lt;div class="oferta SYB"&gt; &lt;div class="infoferta"&gt; &lt;div class="datosoferta"&gt; &lt;div class="ofertapagas"&gt;Pag&amp;aacute;s&lt;br/&gt; $ 67&lt;/div&gt; &lt;div class="ofertavalor"&gt;Valor&lt;br /&gt; $ 160&lt;/div&gt; &lt;div class="ofertadescuento"&gt;Descuento $ 93&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>i want to order the divs with the class="oferta" by the value in "ofertapagas" or the value in "ofertavalor" or the value in "ofertadescuento", i dont know how to, i cannot use the database, i just can use Jquery, i am using the last version of it. Some Help please!! </p>
javascript jquery
[3, 5]
1,617,595
1,617,596
Store method in hidden field in form
<p>this is properly a very simple question but whatever:</p> <p>why does the following not work?</p> <pre><code>echo '&lt;input type="hidden" name="value" value="return $(\"#compare_bd\").mergely(\"get\", rhs)"&gt;'; </code></pre> <p>it returns: <code>return $(//</code></p> <p>Thanks!</p>
php javascript
[2, 3]
3,150,743
3,150,744
Email sending using ASP.NET
<p>What is the code for E-mail sending using ASP.NET.I have used the code:</p> <pre><code>DataSet ds = new DataSet(); SqlConnection con = new SqlConnection("server=kiran-b946c0f6d;database=EmployeeDatabase;uid=sa;pwd=123"); con.Open(); string str1 = "SELECT * FROM Employee_Table"; SqlCommand com = new SqlCommand(str1, con); SqlDataAdapter da = new SqlDataAdapter(str1,con); da.Fill(ds); MailMessage msgmail = new MailMessage(); msgmail.To = "[email protected]"; msgmail.Cc = "[email protected]"; msgmail.From = "[email protected]"; msgmail.Subject = "hi"; msgmail.BodyFormat = MailFormat.Html; string strbody="&lt;html&gt;&lt;body&gt;&lt;b&gt;Hello World&lt;/b&gt;" + " &lt;font color=\"red\"&gt;ASP.NET&lt;/font&gt;&lt;/body&gt;&lt;/html&gt;"; msgmail.Body = strbody; SmtpMail.Send(msgmail); Response.Write("Emai was quicked to disk"); con.Close(); </code></pre> <p>Is this code is right?please help me.I am new in this mail sending concept </p>
c# asp.net
[0, 9]
1,389,222
1,389,223
How to display count of child record in parent using Javascript or JQuery
<p>In the example below:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="some.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //??? //??? ); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;tr id="parent_1"&gt; &lt;td&gt;Parent 1&lt;/td&gt; &lt;/tr&gt; &lt;tr class="child"&gt; &lt;td&gt;Child 1&lt;/td&gt; &lt;/tr&gt; &lt;tr class="child"&gt; &lt;td&gt;Child 2&lt;/td&gt; &lt;/tr&gt; &lt;tr id="parent_2"&gt; &lt;td&gt;Parent2&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I wanted "Parent 1" text to change to "Parent 1(2)" where '2' is the number of childs for the given parent using Java script or Jquery. How is this possible?</p> <p>I'm new to JQuery and Java script. </p> <p>Please let me know.</p>
javascript jquery
[3, 5]
3,060,026
3,060,027
Session variable does not get updated within javascript code
<p>delete_define.php has the following code snippet:</p> <pre><code>&lt;?php session_start(); ?&gt; &lt;form action="delete_now.php" target="upload_target" onsubmit="return my_func_1();"&gt; &lt;input type="submit" name="my_submit" class="my_submit" value="submit"/&gt; &lt;iframe id="upload_target" name="upload_target" src1111="#" style="width:0;height:0;border:0px solid #fff;"&gt;&lt;/iframe&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function my_func_1(){ //alert("from within my_func() =" +&lt;?php echo $_SESSION['my_session']; ?&gt;); alert(" my_func_1"); return true; } function my_func_2(){ alert("my_func_2 =" +&lt;?php echo $_SESSION['my_session']; ?&gt;); return true; } &lt;/script&gt; </code></pre> <p>delete_now.php has:</p> <pre><code>&lt;?php session_start(); $_SESSION['my_session']=rand(); ?&gt; &lt;script type="text/javascript"&gt; alert("from within delete_now.php = " +&lt;?php echo $_SESSION['my_session']; ?&gt;); window.top.window.my_func_2(); &lt;/script&gt; </code></pre> <p>The problem is my_func_2() does not give the same output for the session variable as the alert box in delete_now.php gives.</p> <p>Why is that?</p> <pre><code>EDIT: CHANGED THE CODE SAID TO BE IN delete_define.php </code></pre>
php javascript jquery
[2, 3, 5]
1,007,642
1,007,643
How to read Session timeout value from web.config using javascript in JS file
<p>Can anyone please guide me to read the value of Session timeout value using javascript contained in a .js file.</p> <p>I need to access the value in a javascript file and process the value.</p> <p>I tried to follow the below approach in a test.js file but it is not working:</p> <pre><code>var sessionTimeout = &lt;%= Session.Timeout %&gt;; alert(sessionTimeout); </code></pre>
javascript asp.net
[3, 9]
1,880,177
1,880,178
How to remove invalid characters from a string?
<p>I have no idea how to remove invalid characters from a string in Java. I'm trying to remove all the characters that are not numbers, letters, or ( ) [ ] . How can I do this?</p> <p>Thanks</p>
java android
[1, 4]
5,499,511
5,499,512
How can I convert the following java function into C++?
<p>If I have the following Java code:</p> <pre><code>int[][] readAPuzzle() { Scanner input = new Scanner(System.in); int[][] grid = new int[9][9]; for (int i=0; i&lt;9; i++) for (int j=0; j&lt;9; j++) grid[i][j] = input.nextInt(); return grid; } public static void main(String[] args) { // Read a Sudoku puzzle int[][] grid = readAPuzzle(); } </code></pre> <p>How can I convert this to C++? I get hung up on passing the array. Here is my attempt:</p> <pre><code>#include &lt;iostream&gt; using namespace std; const int puzzle_width = 9; const int puzzle_height = 9; void readAPuzzle(int (&amp;grid)[puzzle_height][puzzle_width]) { for(int i = 0; i &lt; 9; i++) for(int j = 0; j &lt; 9; j++) grid[i][j] = cin &gt;&gt; grid[i][j]; return; } int main() { int[9][9] grid; readAPuzzle(grid); } </code></pre> <p>What am I doing wrong in general? </p>
java c++
[1, 6]
3,845,115
3,845,116
Jquery list update
<p>I currently have a drag/drop list my problem being I'm trying to detect when a div is dropped via Jquery using mouseup.</p> <p>The problem being the reason I need to do this is so I can update my lists (in MYSQL) - I plan on doing this using a Jquery Ajax post.</p> <p>My problem is I've set up the code and I don't know where I am going wrong - in my code you will see an alert function - I used this to show if the div was updating.</p> <p>So far I am receiving no alert..</p> <p>Here is the jquery at the moment:</p> <pre><code>$(document).ready(){ $(.mouseup).mouseup(function(){ var divparent = $(this).parent().attr("id"); alert(divparent); }); } </code></pre> <p>Any help would be appreciated.</p> <p>Thank you in advance!</p>
javascript jquery
[3, 5]
4,732,322
4,732,323
Basic API that returns longitude and latitude from an address using JavaScript or PHP
<p>I am quite new to JavaScript and I am looking for a basic API or function that I can feed an address as a string value and it returns me the longitude and latitude of that address. I have a series of addresses in a DB and I want to add the longitude and latitude values for each of them.</p> <p>Thanks</p>
php javascript
[2, 3]
4,745,828
4,745,829
jQuery Problem - How to solve?
<p>I have a jQuery requirement like:</p> <p>I have an Image. If I click it once its size will get reduced. If I again click it it will again resize. </p> <p>Do we have any functionality to do it easily in jQuery? Or do I have to set a flag and then work on mouseclick? Something like </p> <pre><code> $("#img1").click(function() { $("#img1").addClass("img1"); }); </code></pre>
javascript jquery
[3, 5]
2,060,924
2,060,925
Can we bind hide event or does jquery have an "onhide" event
<p>So far I tried <a href="http://stackoverflow.com/questions/2857900/onhide-type-event-in-jquery">onHide() type event in jQuery</a></p>
javascript jquery
[3, 5]
1,957,288
1,957,289
Retain url hash value using Request.UrlReferrer
<p>I have an list of paged results that is using AJAX requests to populate next/previous page clicks. I am using the jQuery history plugin to keep track of the page # the user is on. This basically appends <a href="http://site.com?query#pg=5" rel="nofollow">http://site.com?query#pg=5</a> to the url. </p> <p>If I click through to another page, I am trying to implement a Go Back button in the breadcrumb control. In trying to use:</p> <pre><code>Request.UrlReferrer </code></pre> <p>it seems that this does not preserve the # value at all. Is this possible?</p>
c# asp.net jquery
[0, 9, 5]
3,638,695
3,638,696
Check if an object exists by its selector, return a boolean value with jQuery or Javascript
<p>I need to see if an object is present on the page by its selector.</p> <p>This WOULD normally do it:</p> <p><code>startpageentry = $('#' + startpageid)</code></p> <p>But that doesn't return anything. I need a boolean I can put into an if statement like this:</p> <p>if (startpageentry != 'false') {}</p> <p>How can I do this?</p>
javascript jquery
[3, 5]
4,619,158
4,619,159
Error registering client scrip block when using master page in an ASP.NET application
<p>I've got this code from <a href="http://madskristensen.net/post/JavaScript-AlertShow%28e2809dmessagee2809d%29-from-ASPNET-code-behind.aspx" rel="nofollow">Mads Kristensen's blog</a> to display a message box on an ASP.NET client's page using Javascript:</p> <pre><code>public static class Alert { public static void Show(string message) { // Cleans the message to allow single quotation marks string cleanMessage = message.Replace("'", "\\'"); string script = "&lt;script type=\"text/javascript\"&gt;alert('" + cleanMessage + "');&lt;/script&gt;"; // Gets the executing web page Page page = (Page)HttpContext.Current.CurrentHandler; // Checks if the handler is a Page and that the script isn't allready on the Page if (page != null &amp;&amp; !page.ClientScript.IsClientScriptBlockRegistered("alert")) { page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script, false); } } } </code></pre> <p>And it works fine when there is no master page involved. However, when I call it (on the server side) from a master page derived page it doesn't work. I'm guessing it is something related to the RegisterClientScriptBlock() method, but I don't know what. Can someone show me the way to solve this?</p> <p>Thanks.</p>
c# javascript asp.net
[0, 3, 9]
1,964,841
1,964,842
Manipulate form data before it's sent with jQuery
<p>I want to encrypt some data in a form using jQuery before it's sent to the server, it can be a MD5 hash. It is a small project, so I don't really need to use SSL.</p> <p>I have the following JavaScript code where I use <code>$.md5</code> in the password confirmation info:</p> <pre><code> $(document).ready(function() { var dataToSend = {}; dataToSend['action'] = 'signup'; dataToSend['name'] = name.val(); dataToSend['email'] = email.val(); dataToSend['confsenha'] = $.md5(pass2.val()); var options = { target: '#error', url: 'insert.php', beforeSubmit: validate, data: dataToSend, success: function(resposta) { $('#message').html(resposta); } }; $('#customForm').ajaxForm(options); }); </code></pre> <p>The problem is that the data is being duplicated. I tought that overwriting the data being sent by using the var <code>dataToSend</code> would make <code>ajaxForm</code> send only data in that map. But besides sending data from <code>dataToSend</code>, it also sends data from the form, so what I wanted to encrypt using MD5 appears both encrypted and clean. This is an example of what goes in the request:</p> <blockquote> <p>usuario=user&amp;email=user%40email.com&amp;senha=12345&amp;confsenha=12345&amp;send=&amp;action=signup&amp;name=user&amp;email=user%40email.com&amp;confsenha=d41d8cd98f00b204e9800998ecf8427e</p> </blockquote> <p>I know I have to define the a function <code>beforeSerialize</code>, but I don't know how to manipulate form data. Can anyone tell me how to do that?</p>
javascript jquery
[3, 5]
2,685,892
2,685,893
jquery: how to check if all radio buttons in a div are selected
<p>my html looks like this</p> <pre><code>&lt;div id="div1"&gt; &lt;input type="radio" name="r1" value="v1" /&gt; &lt;input type="radio" name="r1" value="v2" /&gt; &lt;input type="radio" name="r1" value="v3" /&gt; &lt;input type="radio" name="r2" value="v1" /&gt; &lt;input type="radio" name="r2" value="v2" /&gt; &lt;input type="radio" name="r2" value="v3" /&gt; &lt;input type="radio" name="r3" value="v1" /&gt; &lt;input type="radio" name="r3" value="v2" /&gt; &lt;input type="radio" name="r3" value="v3" /&gt; &lt;/div&gt; </code></pre> <p>radio buttons are dynamically generated on my html so in that div i don't know how many radio buttons i have.</p> <p>i want to make sure that the user will select a value for each one of them before he submits the form, how can i check that all radio buttons inside my div has a value checked?</p> <p>Thank you</p>
javascript jquery
[3, 5]
3,859,128
3,859,129
System.Data.OleDb.OleDbException: Number of query values and destination fields are not the same
<p>I received some help which I much appreciate to insert info into a database using paramaters as it is better practice I believe to do this. I do however get the following error 'Number of query values and destination fields are not the same'. Not sure as to why it is happening. The code seems perfectly fine and the database.</p> <pre><code>[WebMethod] public void bookRatedAdd(string title, int rating, string review, string ISBN, string userName) { OleDbConnection conn; conn = new OleDbConnection(@"Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("App_Data\\BookRateInitial.mdb")); conn.Open(); OleDbCommand cmd = conn.CreateCommand(); cmd.CommandText = "INSERT INTO bookRated([title], [rating], [review], [frnISBN], [frnUserName])VALUES(@title, @rating. @review, @ISBN, @userName)"; //adding my parameters cmd.Parameters.AddRange(new OleDbParameter[] { new OleDbParameter("@title", title), new OleDbParameter("@rating", rating), new OleDbParameter("@review", review), new OleDbParameter("@ISBN", ISBN), new OleDbParameter("@userName", userName), }); cmd.ExecuteNonQuery(); conn.Close(); } </code></pre> <p>Advice perhaps as to why this error exist?</p> <p>Kind regards Arian</p>
c# asp.net
[0, 9]
2,274,549
2,274,550
Why won't my span do a JQuery event click when I click it?
<pre><code>.tablePlayButton { display: block; width: 16px; background: transparent; margin-top:2px; margin-right: -10px; margin-left: 2px; height:17px; } tr:hover .tablePlayButton { background: url(ton.png) top left no-repeat; } tr:hover .tablePlayButton:active { background-position: bottom left; } tr:hover .tablePlayButton.playing, .tablePlayButton.playing { background: url(ton2.png) top right no-repeat; } tr:hover .tablePlayButton.playing:active, .tablePlayButton.playing:active { background-position: bottom right; } </code></pre> <p>I draw the span like this: <code>&lt;span class="tablePlayButton"&gt;&lt;/span&gt;</code></p> <p>It's got a little button. WHen I click it, nothing happens:</p> <pre><code>$(".tablePlayButton").click(function(){ alert('hi'); }); </code></pre>
javascript jquery
[3, 5]
4,964,193
4,964,194
Converting JavaScript code to PHP
<p>I need help converting this code to PHP. </p> <pre><code>var formula = [10,6.7,3.4]; var user1 = [1,0,2,1,1,0,2,2,2,2]; var user2 = [2,1,2,0,1,2,2,2,0,0]; var result = 0; calculate(); function calculate(){ for(var i=0; i&lt;user1.length; i++){ result +=formula[Math.abs(user1[i]-user2[i])] } } alert(result); </code></pre> <p>PHP code: </p> <pre><code>&lt;?php $formula = array(10,6.7,3.4); $user1 = array(1,0,2,1,1,0,2,2,2,2); $user2 = array(2,1,2,0,1,2,2,2,0,0); $result = 0; function calculate(){ for($i=0, $size = count($user1); $i&lt;$size; $i++){ $result += $formula(abs($user1[$i]-$user2[$i])); } } calculate(); echo $result; ?&gt; </code></pre> <p>PHP code does not work. Help me please.</p>
php javascript
[2, 3]
4,408,553
4,408,554
Can't save image for barcode generation in ASP.NET C# project
<p>I'm trying to save an image using System.Drawing.Save() and I keep getting a Invalid Parameter exception.</p> <p>Can somebody please take a look at my code and tell me what I'm doing wrong.</p> <p>Here is the code that generates the barcode image.</p> <pre><code> public class BarcodeHelper { Font barcodeFont; public BarcodeHelper() { PrivateFontCollection fonts; FontFamily family = LoadFontFamily("~/../fonts/Code128bWin.ttf", out fonts); barcodeFont = new Font(family, 20.0f); // when done: barcodeFont.Dispose(); family.Dispose(); family.Dispose(); } public FontFamily LoadFontFamily(string fileName, out PrivateFontCollection fontCollection) { fontCollection = new PrivateFontCollection(); fontCollection.AddFontFile(fileName); return fontCollection.Families[0]; } public Image GenerateBarcode(string barcodeText) { Image barcodeImage; using (barcodeImage = Image.FromFile(@"C:\Users\Administrator\Desktop\YodelShipping\YodelShipping\images\barcode.bmp")) { using (Graphics g = Graphics.FromImage(barcodeImage)) { g.DrawString(barcodeText, new Font(barcodeFont, FontStyle.Bold), Brushes.Black, barcodeImage.Height /2, barcodeImage.Width / 2); } } return barcodeImage; } } </code></pre> <p>Here is where I call the code to create and save the barcode image. I'm getting the exception, when calling the Save() method.</p> <pre><code>System.Drawing.Image img = barcodeHelper.GenerateBarcode("2lgbub51aj+01000002"); img.Save("~/images/barcode.png"); </code></pre> <p><img src="http://i.stack.imgur.com/7G3rs.png" alt="enter image description here"></p>
c# asp.net
[0, 9]
5,692,672
5,692,673
Is there a place where we can see PHP <=> C++ equilavent libraries/function for a php developer starting with C++?
<p>Is there a place where we can see PHP &lt;=> C++ equilavent libraries/function for a php developer starting with C++?</p> <p>As a PHP developer starting with C++, I often ask myself: what is the equivalent of such-and-such PHP function in C++?</p> <p>The advantage of php, is that we have a very nice site which documents about everything we might want to use. All the commonly used PHP modules are all listed in one place (<a href="http://php.net/manual/en/funcref.php" rel="nofollow">http://php.net/manual/en/funcref.php</a>).</p> <p>One of the difficulties of starting with C++ is that we always have to search all over the web for one (often one of many) equivalent of a php function.</p> <p>It'd be nice to have a place where there is a table with the equivalent C++ library (or header) for each PHP module or group of function.</p>
php c++
[2, 6]
3,094,686
3,094,687
Issue with jQuery ajax post
<p>This is a followup to this <a href="http://stackoverflow.com/questions/10730765/how-to-find-a-sibling-elements-value-using-jquery-upon-click">question</a>. Since the problem that I'm now facing is different from that, I thought I'll pose a new question. </p> <p>I'm having an issue with the following code where in, the request is getting POSTed to the server, but whatever response the server has sent is not visible on the browser (in the form of an alert here).</p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $('#login').delegate('input#submit','click',function(){ var request = $.ajax({ type: "POST", url: "login", data: {userid: $("#userid").val(), password:$("#password").val()}, datatype: "xml", cache: false, success: function(xml){alert(xml);} }); }); }); &lt;/script&gt; </code></pre> <p>I can see that this request is going to the server - can see it in the logs. But I don't see the server's response in the browser. Here's the server's response:</p> <pre><code>&lt;result&gt;&lt;url&gt;landing-page&lt;/url&gt;&lt;/result&gt; </code></pre> <p>Not sure what am I doing wrong, but this seems to be simple stuff that I should get it working without issue. Tried Firebug, but no luck. Any idea as to where am I going wrong here or on how to debug this issue further.</p> <p>Thanks</p>
javascript jquery
[3, 5]
291,916
291,917
Get elements using children length in Jquery
<p>I want to get <code>&lt;td&gt;</code> whose children length(size()) is 2 using Jquery. I am trying this but this returns me only size() &amp; not the <code>&lt;td&gt;'s</code>.</p> <pre><code>grid.find("tr").find("td").children().size(); </code></pre> <p>How can i do this?</p>
jquery asp.net
[5, 9]
3,081,329
3,081,330
c++ function invocation listener
<p>I have a code written in c++ and it's a windows application.</p> <p>i would like to leave the code as is and create another project (C# or C++ - rather C#)</p> <p>that will "listen" to some functions invocations in that windows application.</p> <p>I don't know where even to begin, can it be only dll or must be executable or even how to hook up the listener.</p> <p>any help will be appreciated</p> <p>Thanks in advanced</p>
c# c++
[0, 6]
940,783
940,784
How to add fixed variable name with changing variable name
<pre><code>&lt;script&gt; var data1_1 = $value; var data1_3 = $value; var data1_5 = $value; &lt;/script&gt; </code></pre> <p>The above code is hard-code which is correct. Now I want to make the code more flexiable using for loop. However, there is something wrong on <code>data1_keysArr[i] = $value</code>.</p> <p>Can anyone help me?</p> <p>Thanks in advance!</p> <pre><code>&lt;script&gt; var keysArr = [1, 3, 5]; for(var i=0; i&lt;keyArr.length; i++){ data1_keysArr[i] = $value; } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
6,030,450
6,030,451
Can I assign a value to a variable which Sticks to this variable in every scope?
<p>Can I assign a value to a variable (int) and never lose this value inside any scope ?<br/> the problem is I am assigning the value to the variable in some scopes but the variable returns to its default value (zero) in other scopes.. Example :</p> <pre><code> protected void Button_AddNewCourse_Click(object sender, EventArgs e) { ID = 10; } </code></pre> <p>so when I am trying to use <code>ID</code> in other functions it falls back to zero </p> <pre><code> protected void AnotherFunction(object sender, EventArgs e) { // Variable ID here is zero } </code></pre>
c# asp.net
[0, 9]
1,341,594
1,341,595
Can't set HTML using jQuery
<p>For some reason, my script isn't writing out the text after I remove the textbox element. Am I incorrectly using the <code>.html</code> or is something else wrong?</p> <pre><code> $('.time').click(function () { var valueOnClick = $(this).html(); $(this).empty(); $(this).append("&lt;input type='text' class='input timebox' /&gt;"); $('.timebox').val(valueOnClick); $('.timebox').focus(); $('.timebox').blur(function () { var newValue = $(this).val(); var dataToPost = { timeValue: newValue }; $(this).remove('.timebox'); if (valueOnClick != newValue) { $.ajax({ type: "POST", url: "Test", data: dataToPost, success: function (msg) { alert(msg); $(this).html("88"); } }); } else { // there is no need to send // an ajax call if the number // did not change alert("else"); $(this).html("88"); } }); }); </code></pre> <p>OK, thanks to the comments, I figured out I was referencing the wrong thing. The solution for me was to change the blur function as follows:</p> <pre><code> $('.timebox').blur(function () { var newValue = $(this).val(); var dataToPost = { timeValue: newValue }; if (valueOnClick != newValue) { $.ajax({ type: "POST", url: "Test", data: dataToPost, success: function (msg) { } }); } else { // there is no need to send // an ajax call if the number // did not change } $(this).parent().html("8"); $(this).remove('.timebox'); }); </code></pre>
javascript jquery
[3, 5]
4,065,067
4,065,068
Accessing a public variable from another class?
<p>The app I'm currently developing has more than one class created, with a corresponding .xml file for each. My app requires progressing from one screen to the next after a calculation has been completed.</p> <p>In one class, I have declared a public double called V, which is the result of a voltage calculation.</p> <p>When the user presses "NEXT", a new class (ed: Activity?) is called, and the xml file will change the screen view to a new layout.</p> <p>In this new class, I need to use the variable (double V) for a new calculation.</p> <p>I thought that if a variable was public, it could be used anywhere in the package. Do I need to import this variable, or re-declare it somehow?</p> <p>Any answers would be much appreciated. I've tried everything that I can think of, but Eclipse just keeps saying V cannot be resolved.</p>
java android
[1, 4]
1,472,685
1,472,686
Code Crush Android
<p>I want to crush the code of my android app so that it's very hard to refactor it.</p> <p>Which tool do i use to crush the Javacode?</p> <p>Thanks and best regards, Till</p>
java android
[1, 4]
5,039,070
5,039,071
Different uses of $(document).ready
<p>What is the difference/advantages of using the $(docu...) with your variables and functions defined inside, from using it with a function and then calling it inside the $(docu...)</p> <pre><code>$(document).ready(function (){ initialize(); }); function initialize(){ hello } </code></pre> <p>over using this:</p> <pre><code>$(document).ready(function (){ hello }); </code></pre>
javascript jquery
[3, 5]
3,993,636
3,993,637
How to save pages with unique names?
<p>i am using C# and sql database. In db is stored information about items - id, name, etc.</p> <p>Now i have a page to show items, that i use as a template and pass Item id in the url like /Item.aspx?id=223. I would like to create pages for every item and save them to folder like /Items/Red-Book.aspx. Any suggestions?</p> <p>Thanks, Walt</p>
c# asp.net
[0, 9]
714,119
714,120
Develop android and iphone app
<p>I'm gonna develop a small app both for android and Iphone. The app will contain a simple little online magazine. I have not done any app before. I work with developing Web pages in asp.net c# and I'm familiar with java. So I'm a beginner in terms of mobile apps, and now I'm wondering how to begin and where to find good information about basic app-development.</p>
android iphone
[4, 8]
3,360,912
3,360,913
how can i make simple news calendar on jQuery datepicker
<p>I have code:</p> <pre><code>$(function() { $('#datepicker').datepicker({ beforeShowDay: daysToMarkAndLink }); }); function daysToMarkAndLink(date) { .....(if daysToMarkAndLink matches){ ......(link goes here and also highlight); } return [false]; } &lt;? $sql = mysql_query("SELECT * FROM news"); while ($row = mysql_fetch_array($sql)) { print $row["time_added"]; } ?&gt; </code></pre> <p>i want to do something like, highlight the only days i have in database also and link them on my news page, filter by date_added.</p> <p>i want a very simple news calendar on jQuery datepicker.</p> <p>thanks</p>
php jquery
[2, 5]
5,692,578
5,692,579
How do I put id number from select tag to a php link?
<p><img src="http://i.stack.imgur.com/K4LAx.png" alt="enter image description here"><img src="http://i.stack.imgur.com/Jx11e.png" alt="enter image description here">Currently, this is what I have so far, but it's not working:</p> <pre><code>&lt;form&gt; &lt;select name="patientID" id="patientSelect"&gt; &lt;?php $qPatient = mysql_query("SELECT idpatients, firstName, mi, lastName, suffix FROM patients ORDER BY lastName ASC"); while($rowPatient = mysql_fetch_array( $qPatient )) { if(isset($rowPatient['suffix']) &amp;&amp; !empty($rowPatient['suffix'])){$suffix = " " . $rowPatient['suffix'];}else{$suffix = NULL;} if(isset($rowPatient['mi']) &amp;&amp; !empty($rowPatient['mi'])){$mi = " " . $rowPatient['mi'] . ".";}else{$mi = NULL;} echo "&lt;option value=" . $rowPatient['idpatients'] . $rowPatient . "&gt;" . $rowPatient['lastName'] . $suffix . ", " . $rowPatient['firstName'] . $mi . "&lt;/option&gt;"; } ?&gt; &lt;/select&gt; &lt;a id="updatelink" href=""&gt;....&lt;/a&gt; &lt;a id="deletelink" href=""&gt;....&lt;/a&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#patientSelect").change(function(){ $("#updatelink").attr('href',"update.php?id="+$("#patientSelect").val()); $("#deletelink").attr('href',"delete.php?id="+$("#patientSelect").val()); }); }); &lt;/script&gt; &lt;/form&gt; </code></pre>
php javascript
[2, 3]
798,107
798,108
Java calling c++ method
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3720563/access-c-shared-library-from-java-jni-jna-cni-or-swig">Access C++ shared library from Java: JNI, JNA, CNI, or SWIG?</a><br> <a href="http://stackoverflow.com/questions/6325996/calling-a-c-c-program-from-java">Calling a C, C++ program from Java</a> </p> </blockquote> <p>Is there anyway I could call a c++ method from Java. I have a c++ method in an application that transforms data and I would like the same transformation of data in Java. I am trying to rewrite the code but I was checking if I could somehow send input and get output from the current c++ code. Thanks.</p>
java c++
[1, 6]
4,825,536
4,825,537
How to Access a DIV inside a iframe from a Parent
<p>Hoping someone can assist but I am trying to access a div id="mnuGrp" that resides inside a child iframe(id="iframe2) from the parent window within the document.ready() section but unsure how to access this child div in the parent inorder to apply fadein and fadeout calls.</p> <p>Want to be used within the following call:</p> <pre><code>$(' ???? ').click(function(){ etc </code></pre> <p>where "????" is my means to access the child div within the iframe.</p> <p>Any help would be appreciated.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
67,109
67,110
Pre-filling values of a form using json object
<p>I am using a JSON object something like this <code>{"expiry_year":"15","number":"411111","month":"12","cvn":"456"}</code></p> <p>Now on some callback I am getting this value. My requirement is to put these values in a from by using MAP so in future if some one change DOM id it won't affect the page.</p> <p>To achieve this I am trying like this </p> <pre><code>var domWithValueMap = { "number" : "number", "cnv" : "cnv", "month" : "expiry_month", "expiry_year" : "expiry_year" } </code></pre> <p>In above hash </p> <pre><code>var domWithValueMap = { "keys of json obg" : "id of DOM", } </code></pre> <p>and so on..</p> <p>My div id's are : number,expiry_year,month and cvn.</p> <p>Then after I was trying to match whether the keys are exists or not using this </p> <pre><code> domWithValueMap.hasOwnProperty(key); </code></pre> <p>After this I gets confused how to proceed. Please help me to achieve this.</p>
javascript jquery
[3, 5]
2,655,292
2,655,293
How to unregister SensorEventListener from SensorManaget?
<p>I have been developing the application which uses SensorManager through SensorEventListener. But there is a one problem: when application starts it should remove my listener from SensorManager and create a new Listener, but SensorManager has only 2 methods - registerListener and unregisterListener, but when I execute the application I can't get a reference for last listener and unregister it. Please, tell me any way in order to I can fix it. Thank you. </p>
java android
[1, 4]
5,708,021
5,708,022
asp.net and permissions on a share
<p>I have an app that needs to update a txt file on another server. The asp.net app runs under iis6.0. Ive tried setting the permissions on the share for the server that runs the app. e.g DOMAIN\ServerA$ however it still says access to path blah blah is denied.</p> <p>Any ideas?</p>
c# asp.net
[0, 9]
2,469,251
2,469,252
dynamically set iframe src
<p>I have a program which will dynamically set an iframe src to load pages. I need to hook a event handler for the page completely loaded. How can i do it? Thanks!</p>
javascript jquery
[3, 5]
2,559,341
2,559,342
passing callback function into onclick event
<p>Ive been messing with this a while and have tried numerous ways. It still wont work.</p> <pre><code>function popupConfirm(widtH, texT, callback){ var top=(window.innerHeight/2) - 100; var left=(window.innerWidth/2) - (widtH/2); var r="&lt;div id='standard-modal' style='width:"+widtH+"px;top:"+top+"px;left:"+left+"px;'&gt;"; r+="&lt;div id='standard-modal-header' style='width:"+(widtH-4)+"px;'&gt;"; r+="&lt;strong&gt;&amp;rarr; &amp;nbsp; Icon Box &amp;nbsp; &amp;larr;&lt;/strong&gt;"; r+="&lt;/div&gt;"; r+="&lt;div id='standard-modal-message' style='width:"+(widtH-30)+"px;'&gt;"+texT+"&lt;/div&gt;"; r+="&lt;div id='button_wrapper'&gt;&lt;div id='standard-modal-button' class='left_button' onclick='$(\"#standard-modal\").remove();' &gt;CANCEL&lt;/div&gt;"; // following line attaches callback to onclick event r+="&lt;div id='standard-modal-button' class='right_button' onclick='callback();' &gt;CONFRIM&lt;/div&gt;&lt;/div&gt;"; r+="&lt;div style='clear:both;'&gt;&lt;/div&gt;&lt;/div&gt;"; $('body').append(r); } popupConfirm(300,'blah blah' , function(){alert("finally");}); </code></pre> <p>in theory, i want it to do the alert once the user clicks confirm in my popup... any help is appreciated.</p> <p>its logs to the console 'callback is not defined'</p>
javascript jquery
[3, 5]
2,874,377
2,874,378
Not able to iterate over java collection in jquery
<p>I want to iterate a javascript collection of objects in jquery. when i place an alert I am able to see the collection getting printed but I am not able to iterate over the elements of that collection in jquery. How can I do that? I tried:</p> <pre><code> ${mergedConfirmedTechnologies}.each(function(index,element){ alert("here "+element.product); }); </code></pre> <p>but it did not work though when I do:</p> <pre><code> alert(${mergedConfirmedTechnologies}); </code></pre> <p>then it prints the collection of objects Could anyone suggest how can I iterate over the collection in jquery?</p>
javascript jquery
[3, 5]
2,261,812
2,261,813
Override onclick event in javascript/jquery
<p>I have a table(3 td's) with onclick event and need different onclick event for one td.</p> <pre><code> &lt;table onclick="window.location.href='http://www.google.com?id=12345'"&gt; &lt;tr&gt; &lt;td&gt;text&lt;/div&gt; &lt;td&gt;text1&lt;/div&gt; &lt;td onclick="favTheater('test')"&gt;text3&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;script type="text/javascript"&gt; function favTheater(msg){ var e = window.event; e.stopPropagation(); e.preventDefault(); window.location.href="http://www.yahoo.co.in?msg=msg"; } &lt;/script&gt; </code></pre> <p>I need to override table <code>onclick</code> and need to function <code>favTheater('test')</code> Note: table in loop and each id and msg will change. Please help me on this.</p>
javascript jquery
[3, 5]
3,809,435
3,809,436
Submitting a form when using an onSubmit
<p>My form onSubmit is calling:</p> <pre><code>onsubmit="validate(this); return false;" </code></pre> <p>validate() is as follows:</p> <pre><code>function validate(obj) { $.ajax({ url : "ajax/validate_check.php", type : "POST", data : $("#" + obj.id).serialize(), success : function(data) { $('#' + obj.id + ' :input.form_errors').removeClass('form_errors') data = $.parseJSON(data); if(data['error_count'] &gt;= 1) { $.each(data, function(i, item) { $('#' + i).addClass('form_errors'); }); } else { $('#' + obj.id).submit(); } } }); } </code></pre> <p>When I have 0 errors it's trying to submit the form but I'm getting an infinite loop. I realize it's happening because my onSubmit calls the function again. How do I actually submit the form when I'm ready? What is the proper way to approach this? </p>
javascript jquery
[3, 5]
2,433,740
2,433,741
Generating 2 dom elements in javascript
<p>How do I debug problems like this. I have this code:</p> <pre><code>var index = 0; $('#gen_field').click(function() { var next_row = $('&lt;tr&gt;').attr({ 'id': 'tbl_row' + index }).appendTo('#tbody_coll'); var td1 = $('&lt;td&gt;').attr({ 'id': 'td_collector' + index }).appendTo(next_row); var td2 = $('&lt;td&gt;').attr({ 'id': 'td_rem' + index }).appendTo(next_row); var collector = $('&lt;input&gt;').attr({ 'type': 'text', 'name': 'collector[]' }).appendTo(td1).css('width', '200px'); var rem_btn = $("&lt;input&gt;").attr({ 'type': 'button', 'id': index, 'name': 'rem', 'class': 'rem', 'value': 'del' }).appendTo(td2).addClass('span-2'); console.log(index); index++; }); </code></pre> <p>This is supposed to generate only 1 field at a time. But its generating 2 of the same fields at once. Console.log is also showing 2 zeroes, then 2 ones when I click on the button that generates the fields. But I couldn't get any further into debugging this problem using firebug. Can you tell me what's wrong with my code?</p>
javascript jquery
[3, 5]
3,505,984
3,505,985
Books or/and tutorials for android programming for PHP developer
<p>I am PHP developer and I would like to start programming simple apps for my android smart phone. Any good suggestions on tutorials or books for PHP developer?</p>
php android
[2, 4]
1,178,918
1,178,919
How to populate a String Array from a JSONObject to use in a ListView
<p>I have an android/java task where I want to get JSON values into a String array to display in a ListView and I am not sure where to begin? Thanks. </p> <pre><code>private String[] values; ... // this is what is returned from the web server (Debug view) // jObj = {"success":1,"0":"Mike","1":"message 1","2":"Fred","3":"message 2","4":"John","5":"message 3"}; try { if (jObj.getInt("success") == 1) { . // what i'm trying to do here is iterate thru JObj and assign values to the // values array to populate the ArrayAdapter so that the ListView displays this: // // Mike: Message 1 // Fred: Message 2 // John: Message 3 // . this.setListAdapter(new ArrayAdapter&lt;String&gt;( this, android.R.layout.simple_list_item_1, android.R.id.text1, values)); ListView listView = getListView(); } } catch (JSONException e) { Log.e(TAG, e.toString()); } </code></pre>
java android
[1, 4]
2,574,899
2,574,900
Assignment from unset variable | What is _jQuery for?
<p>This value is set before jQuery has been exposed to the global scope:</p> <pre><code>_jQuery = window.jQuery, </code></pre> <p>Near the end of the IIFE and after the above statement there is</p> <pre><code>window.jQuery = window.$ = jQuery; </code></pre> <p>This is from the <a href="http://code.jquery.com/jquery-latest.js" rel="nofollow">jQuery development source</a>.</p> <p>What compiler mechanism allows jQuery to do an assignment from an unset variable.</p> <p>Also, what is _jQuery for in general?</p>
javascript jquery
[3, 5]
2,481,537
2,481,538
How to get input id of datepicker in c#?
<p>I am using datapicker jquery but it is not able to get Input Id in C#.If i give runat=server ,i can call the input id in c#,but it does not work in page. Can anyone help me for that, I am new to Dnn. Any answer would be appreciated. Thank you.</p> <pre><code>enter code here &lt;div class="demo"&gt; &lt;p&gt;Date: &lt;input id="datepicker" type="text" /&gt; &lt;/p&gt; &lt;/div&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
5,262,458
5,262,459
How to set default ScrollTop and ScrollLeft to a popup window.open
<p>So, I have the code below where I want to open a link with <code>window.open()</code> and I want to set default <code>ScrollTop()</code> and <code>ScrollLeft()</code> to the popup window. thx.</p> <pre><code>function DoLink(){ window.open('http://translate.google.com/#', '_blank'," width=400, height=400") } &lt;input type="button" value="OpenLink" onclick="DoLink()"&gt; </code></pre>
javascript jquery
[3, 5]
3,227,175
3,227,176
jQuery - how to access jQuery object?
<p>I'm struggling to find out when to use #,$ in jquery. i.e. if I have an object</p> <pre><code>var elem{ } </code></pre> <p>How to access this? Whether $('#elem') or $('elem')? May be its too silly. But I cant find out a solution by googling it.</p>
javascript jquery
[3, 5]
3,168,270
3,168,271
Call a javascript function from a link. All possibile methods
<p>I have a div ~ id is <code>slider</code> i want it to animate/hide when a link is clicked. More precisely i want to toggle it open and close from a link.</p> <h1>jQuery</h1> <pre><code>&lt;script type="text/javascript"&gt; $("#toggleslider").click(function () { $(this).hide("#slider", { direction: "up" }, 1000); }); &lt;/script&gt; </code></pre> <h1>link</h1> <pre><code>&lt;li&gt;&lt;a id="toggleslider" href="javascript:void(0);"&gt;toggle&lt;/a&gt;&lt;/li&gt; </code></pre>
javascript jquery
[3, 5]
2,287,482
2,287,483
Removing Controls from asp.net page at runtime
<p>I have an asp.net dashboard site that allows a user to load HTML templates from a dropdownlist. There are multiple types of DevExpress components on the page, including the ASPxDockPanel. If a user changes templates I get an error that the dockpanel already exists, I would like to include a recursive function like the one below that checks to see if any ASPxDockPanels are present on the page, and if they are present remove them. This works for only the first dock panel then bombs out. I think this is because an enumerable set of controls cannot be modified while looping through it. How can I loop though the controls and remove the dock panels at runtime?</p> <pre><code>protected void LoadTableTemplate(string selectedTemplate, int currentMode) { FindAllDockPanels(this); } public void FindAllDockPanels(Control ctrl) { if (ctrl != null) { foreach (Control control in ctrl.Controls) { if (control is ASPxDockPanel) { ctrl.Controls.Remove(control); control.Dispose(); } FindAllDockPanels(control); } } } </code></pre>
c# asp.net
[0, 9]
5,396,933
5,396,934
how can I pass a dataset to an object
<p>I have an object called arr and I want to add a dataset to it , here is my code so far . </p> <pre><code> arr = { date:'222222' } lines = [ { line1:'line1' , name:'paul' } , { line2:'line2' , name:'john' } , ] arr.push( lines ) </code></pre> <p>I want to send arr to handlebars but need the lines adding to arr . </p> <p>I want to end up with </p> <pre><code> arr = { date : '222222' , lines: [ { line1:'line1' , name:'paul' } , { line2:'line2' , name:'john' } ], more etc: 'more vars' } </code></pre> <p>but using push just isn't doing it, can anyone tell me what Iam doing wrong , any help appreciated ! , thanks </p>
javascript jquery
[3, 5]
2,125,321
2,125,322
How to clear clipboard data in Google Chrome,Mozilla Firefox and Safari using java script or j query
<p>I am developing a web site. i want to clear data when print screen is pressed while viewing my site by using JavaScript or j query. can anyone please help me to solve this problem.I successfully handled in IE.</p> <p>Thanks in advance...</p>
javascript jquery asp.net
[3, 5, 9]
170,793
170,794
Why Jquery Input Function doesnt return complete url?
<p>I am trying to make preview to my uploading Images. I have wrote a function its works fine but it doesnt return the complete url of file which is selected locally.</p> <pre><code>function imagePreview(pid, input){ $("#"+pid).attr("src", input.value); $("#"+pid).fadeIn('slow'); } </code></pre> <p>Html is </p> <pre><code>&lt;input type="file" class="round sinput" onchange="imagePreview('img1', this);" name="f_pic" id="f_pic" /&gt; </code></pre> <p>this function loads image.jpg not c:\website\image.jpg (complete path which is required to display image)</p> <p>thank you</p>
javascript jquery
[3, 5]
2,236,164
2,236,165
Jquery to pure javascript and how the intepreter looks up with dom for elements
<p>I have a couple of questions about the inner workings of JavaScript and how the interpreter handles certain queries</p> <p>The following JQuery will correctly get all the images that contain the word "flowers" in the src</p> <pre><code>$("img[src*='flowers']"); </code></pre> <p>Jquery makes this very simple but what the pure javascript version?</p> <p>We have a very large DOM. I take it if I do <code>$("*[src*='flowers']")</code> this will greatly affect performance (wildcard element). I'm interested in what the Javascript interpreter does differently between <code>$("img[src*='flowers']")</code> and <code>$("*[src*='flowers']")</code></p>
javascript jquery
[3, 5]
3,036,830
3,036,831
Pass a full url with Params in PHP
<p>I want to pass a url as a parameter in my PHP script. The URL is coming from my Android app which passes a url and the PHP script custom formats XML to return to the app. So I would pass the url I wanted to format and the PHP script would do stuff and echo the results.</p> <p>For instance I want to pass this url: </p> <blockquote> <p>differentwebpage.com/search/?query=ford%20f150&amp;</p> </blockquote> <p>in my php script (mywebpage.com/script.php):</p> <pre><code>$url = $_GET['url']; $str = file_get_contents($url); echo $str; </code></pre> <p>So the full url would be:</p> <blockquote> <p>mywebpage.com/script.php?url=differentwebpage.com/search/?query=ford%20f150&amp;</p> </blockquote> <p>But this doesn't work. I think I need to URL encode/decode but I haven't had any success. How can I pass a full URL as a parameter?</p>
php android
[2, 4]
5,141,050
5,141,051
call function inside a nested jquery plugin
<p>There are many topics related to my question and i have been through most of them, but i haven't got it right. The closest post to my question is the following:</p> <p><a href="http://stackoverflow.com/questions/1042072/how-to-call-functions-that-are-nested-inside-a-jquery-plugin">http://stackoverflow.com/questions/1042072/how-to-call-functions-that-are-nested-inside-a-jquery-plugin</a></p> <p>Below is the jquery plugin i am using. On resize, the element sizes are recalculated. I am now trying to call the function resizeBind() from outside of the jquery plugin and it gives me error</p> <p>I tried the following combinations to call the function </p> <p>$.fn.splitter().resizeBind()</p> <p>$.fn.splitter.resizeBind()</p> <p>Any ideas, where i am getting wrong?</p> <pre><code>;(function($){ $.fn.splitter = function(args){ //Other functions ...... $(window).bind("resize", function(){ resizeBind(); }); function resizeBind(){ var top = splitter.offset().top; var wh = $(window).height(); var ww = $(window).width(); var sh = 0; // scrollbar height if (ww &lt;0 &amp;&amp; !jQuery.browser.msie ) sh = 17; var footer = parseInt($("#footer").css("height")) || 26; splitter.css("height", wh-top-footer-sh+"px"); $("#tabsRight").css("height", splitter.height()-30+"px"); $(".contentTabs").css("height", splitter.height()-70+"px"); } return this.each(function() { }); }; })(jQuery); </code></pre>
javascript jquery
[3, 5]
3,459,864
3,459,865
Get absolute path and filename from VideoView object
<p>Just started writing java / android and I am trying to use android.widget.VideoView.</p> <p>I set the video by using the setVideoPath('/path/filename') method, but can't seem to figure out how to get the path on an existing object?</p> <p>I'm using methods such as 'getDuration()', and 'getCurrentPosition()' and they work great.. but where is a getPath method?</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,333,927
2,333,928
Slide up div and then append a new div to slide up in its place
<p>Im trying to animate two div boxes when a user has successfully filled out a registration form. The first div that is animated is the registration form itself which will slide up from the bottom into the centre and the slide up and off the screen when a user has filled the form properly. </p> <p>I have that first bit working fine but I then need a second div to slide up from the bottom of the screen into the center that contains a message telling a user to check their emails to activate the account they just made. How can I get this bit working and animating?</p> <p>The code im using is this:</p> <pre><code> $("#registerForm").validate({ rules: { name: { required: true, minlength: 3 }, eMail:{ required: true}, passWord: { required: true, minlength: 5 }, rePassWord: { equalTo: ".passWord" } }, submitHandler: function(form) { // do other stuff for a valid form $.post('../inc/register.php', $("#registerForm").serialize(), function(data) { if(data == "true") { $('#loaderWrap').remove(); $('#reg_dialog').animate({ marginTop : -2000, opacity : 0 }, 400); $.append('&lt;div id="reg_success"&gt;Please check your emails to active your account&lt;/div&gt;'); //Slide Up Success Message $('#reg_success').css({ top : winH / 2 - $this.height() / 2, left : winW / 2 - $this.width() / 2, display : 'block' }).animate({ marginTop : 0, opacity : 1 }, 400); } }); } }); </code></pre>
javascript jquery
[3, 5]
5,096,656
5,096,657
Update binary file information
<p>We have some binary files on windows platform.(dll,exe and arx) But the file version information is wrong.(Right click->Properties->Details. The File version or project version are not correct.) Some of them are written by C#,some are C++. Because we don't have the source code for some of them. Is there any way to change the information without re-compile these files? </p> <p><strong>UPDATE</strong> can you recommend some command tools? I have more than 2 hundred files.I would like to write a script for it. Or can you give me some information about how to write such tool about it. I don't need too much function, only change the file version information.</p> <p>Best Regards,</p>
c# c++
[0, 6]
3,412,213
3,412,214
How to hide an element defined by a variable
<p>I have a variable itemid (which is the id of an element) which I want to hide, but firefox tells me this code is illegal:</p> <pre><code> $(#(itemid)).hide(); </code></pre> <p>Is what I am trying not possible or am I just tring it the wrong way? Also, in terms of debugging, is it possible to use javascript variable in alert boxes?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,271,712
5,271,713
how to iterate through a select object array
<p>i've a few select's with a array as the name attrib. This select can have multiple different values in different parts of the html, so i want to iterate through the values of the stored items in the name array.</p> <p>i've google for a few time and didn't find a good answer (also here in stack...), but does anybody know how can i iterate through the values of the select array with jquery if possible or js if not? I try this but did not work </p> <p>Jquery code :</p> <pre><code>// i get the name of the select correctly var itemName = $(this).find("select#selectToONE").attr("name"); // try to iterate through the values when the array grows... not work $("select[@name='"+itemName+"[]']").each(function() { alert($(this).val());} ); </code></pre> <p>Here some html code maybe inside in one TR,TD :</p> <pre><code>&lt;select name="To[itemsONE][]" id="selectToONE"&gt; &lt;option&gt;....&lt;/option&gt; &lt;option&gt;....&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Other select inside other TR,TD</p> <pre><code>&lt;select name="To[itemsONE][]" id="selectToONE"&gt; &lt;option&gt;....&lt;/option&gt; &lt;option&gt;....&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
3,150,486
3,150,487
how to detect new line in this type of string
<pre><code>String quote = "Now is the time for all good "+ "men to come to the aid of their country."; </code></pre> <p>I want to detect break line in run time when I click on button I want to know new line comes.. because in TEXTVIEW i want output same as like this String nothing change.. so tell me some idea or logic or source code of this....</p>
java android
[1, 4]
1,015,869
1,015,870
Link in the message of jQnotice
<p>How can I make a link that works in the following script. I use it as a pop-up, with the purchase of goods in a shop:</p> <pre><code>$(document).ready(function() { $('a.buy').click(function() { jQnotice('Message..! - here i want to ad a url ex. "link go to shop" '); }); }); </code></pre>
javascript jquery
[3, 5]
1,970,322
1,970,323
jquery remove all child elements and leave text
<p>Whats the best way to remove all child elements from a div but leave any text that is directly inside the div in jquery.</p> <p>I have tried .childre().remove() but this is adding loads of whitespace in firefox and opera. Works fine in ie though.</p>
javascript jquery
[3, 5]
743,458
743,459
Android - WebView reload on change tab
<p>Main activity:</p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources ressources = getResources(); TabHost tabHost = getTabHost(); Intent intentHome = new Intent().setClass(this, Home.class); TabSpec tabHome = tabHost .newTabSpec("Android") .setIndicator("", ressources.getDrawable(R.drawable.home_icon)) .setContent(intentHome); tabHost.addTab(tabHome); } </code></pre> <p>Home.activity:</p> <pre><code>public class Home extends Activity { private WebView browser; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home); this.browser = (WebView) findViewById(R.id.browser); this.browser.setWebViewClient(new WebViewClient()); this.browser.loadUrl("http://google.com"); } } </code></pre> <p>When I change tab my Home.activity and WebView reload, how I can turn off this? Thanks for help :)</p>
java android
[1, 4]
4,439,020
4,439,021
RadTreeView OnClientNodeClicking corfirm
<p>I have problem confirming if node should be changed or not, with jConfirm.</p> <p>This is my js code:</p> <pre><code>function OnClientNodeClicking(sender, args) { var calcelTrue = confirm('Can you confirm this?') if (calcelTrue == false) { args.set_cancel(true); return true; } } </code></pre> <p>and it works fine. But now i want to use jConfirm. And the program does not want to wait for me to click OK or Cancel (it just fire the event). So I am trying to stop the event and if I will click Ok then the event of clicking on node should fire again from js.</p> <pre><code>function OnClientNodeClicking(sender, args) { var node = args.get_node(); jConfirm('Can you confirm this?', 'Confirmation Dialog', function (r) { if (r){ * Fire the event of clicking } }); args.set_cancel(true); } } </code></pre> <p>How can I fire the event from js or how can I prevent jConfirm to wait for me to chose and then triger the event.</p>
c# javascript jquery
[0, 3, 5]
3,882,202
3,882,203
How to determine if it is day or night in javascript or jquery?
<p>Im wanting to apply different CSS sheets to my site depending on the time of the browser. e.g if its day time, display day.css or night.css for night.</p> <p>I can do this with PHP but it is based on the server time, not the browsers local time.</p> <p>Is there a way to tell the time in javascript? I'm probably going to use jQuery to simply initiate the css once its worked out.</p>
javascript jquery
[3, 5]
2,483,103
2,483,104
JavaScript getting strange error when using " ' " + var
<p>when I use the following line in the console (FF &amp; chrome)</p> <pre><code>var stripID = "\'#strip_" + ID + "\'"; console.log(stripID); </code></pre> <p>I get what I wanted: <code>'#strip_126327'</code> But when I put it in the JS file, and the function executing this, is triggered i get</p> <pre><code>uncaught exception: Syntax error, unrecognized expression: '' </code></pre> <p>withut even a file and line reference.</p> <p>Also, the purpose of all this is to get a string to put in <code>$()</code> selector.</p>
javascript jquery
[3, 5]
2,296,135
2,296,136
How can i differentiate items in list in c#
<p>I have one listitem and i am adding this listitem to a list multiple times with one property difference... i.e listitem have DateOfService property..k... then i am adding first item to list... it's fine and i am changing DateOfService property and adding again... but the previous added item DateOfService also changeing.... how can i overcome this problem...</p> <p><strong>sampleCode</strong></p> <pre><code> if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily)) { for (int day = 0; day &lt; remainedDays; day++) { bills[index].DateOfService = DateTime.Now.Date.AddDays(day).Date; remainedBills.Add(bills[index]); } } </code></pre> <p>Hi i did this also but no use...</p> <pre><code>if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily)) { AdmissionEntryVo objAdmissionEntryVo = null; for (int day = 0; day &lt; remainedDays; day++) { objAdmissionEntryVo = new AdmissionEntryVo(); objAdmissionEntryVo = bills[index]; objAdmissionEntryVo.DateOfService = DateTime.Now.Date.AddDays(day).Date; remainedBills.Add(objAdmissionEntryVo); } } </code></pre>
c# asp.net
[0, 9]
1,260,621
1,260,622
Session not saved in android-PHP authentification
<p>I am trying to use a authentification process in android based in a database and some PHP script. When I do the login:</p> <pre><code>... setOnline($username); session_start(); $_SESSION['user']=$username; ... </code></pre> <p>if I print the $_SESSION variable it seems to be correctly saved but when I change the activity and try to logout calling to logout.php:</p> <pre><code>... session_start(); if (strcmp($_SESSION['user'],$user)){ setOffline($user); session_destroy(); echo "DONE"; } ... </code></pre> <p>the variable $_SESSION is empty. In all cases the username ($user) is being correctly identified. Any idea in what am I doing wrong?.</p> <p>Thank you.</p>
php android
[2, 4]
1,065,829
1,065,830
what is the operator be overloading here : String8::operator const char*() const
<p>I know it is used to get the containing c string ,similar to <code>std::string.c_str().</code> But how should I use the operator? </p> <pre><code>//android/frameworks/base/include/utils/String8.h 458 inline String8::operator const char*() const 459 { 460 return mString; 461 } </code></pre>
c++ android
[6, 4]
1,274,065
1,274,066
ASP.NET Sitemap .ResourceKey property is null
<p>I'm using standard ASP.NET and a Web.sitemap file which describes the navigation structure of the site. Now, I want to use my resourceKey attribute as a page identifier in my code, so I can perform eg. authorization checks and similar.</p> <p>Problem is it's always null, for example when retrieving SiteMap.CurrentNode.ResourceKey</p> <p>I have tried to set enableLocalization="true" in the Web.sitemap, and &lt;siteMap enable="true" /&gt; in Web.config but that doesn't help.</p> <p>Any advice?</p> <p>Thanks, Jacob</p>
c# asp.net
[0, 9]
4,616,042
4,616,043
jQuery form validation - Check if emails are the same
<p>I am trying to create a jQuery form validator for my website.</p> <p>My code is in <a href="http://jsfiddle.net/EPu3D/2/" rel="nofollow">this fiddle</a>.</p> <p>The question is, what do I need to do, so that I can check if the email is the same as the email confirmation when both fields have valid email addresses?</p> <p>Also, since I'm currently learning javascript/jQuery, feel free to point out any mistakes|bad practices on my code.</p>
javascript jquery
[3, 5]
5,854,448
5,854,449
allowing input only for float number
<p>I have pain-time when making input that only allows float number with jquery library. my code can't prevent chacacter "." when it's becoming first input, can anyone guide me to solve this problem? </p> <pre><code>$('.filterme').keypress(function(eve) { if ( ( eve.which != 46 || $(this).val().indexOf('.') != -1 ) &amp;&amp; ( eve.which &lt; 48 || eve.which &gt; 57 ) || ( $(this).val().indexOf('.') == 0) ) { eve.preventDefault(); } });​ </code></pre>
javascript jquery
[3, 5]
3,102,769
3,102,770
Call an ASP.NET function from javascript with a client side parameter
<p>Actually the code is self-explanatory.. I am trying to assign a javascript variable the falue of a form element, which needs to be formatted by a function on the server..</p> <p>the below code does not work. it does not get the form element but rather assumes $('#formvalue').val() is the string I am passing in..</p> <pre><code>var myvar = '&lt;%= MyNamespace.MyClass.MyFunction("' + $('#formvalue').val() + '") %&gt;' </code></pre> <p>any ideas?</p>
javascript jquery asp.net
[3, 5, 9]
2,836,141
2,836,142
jQuery $() constructor and strings with a leading backslash
<p>Please, take a look at this code: <a href="http://jsfiddle.net/Bkdgr/1/" rel="nofollow">http://jsfiddle.net/Bkdgr/1/</a> <br>It does not work. However, either of the following two modifications makes it work correctly: <br> <br> Passing the pure <code>newItem</code> string in <code>append</code>, instead of wrapping it with <code>$()</code>:</p> <pre><code>$('button').on('click', function(e){ e.preventDefault(); var newItem = '\ &lt;li&gt;Hello, \ World!&lt;/li&gt;'; $('ul').append(newItem); }); </code></pre> <p><br> Moving the opening <code>&lt;li&gt;</code> tag up to the first line of the string definition:</p> <pre><code>$('button').on('click', function(e){ e.preventDefault(); var newItem = '&lt;li&gt;Hello, \ World!&lt;/li&gt;'; $('ul').append($(newItem)); }); </code></pre> <p><br> Neither does it work when I move up <code>&lt;li&gt;</code> to the same line with the leading <code>\</code> (but without deleting <code>\</code>).<br> To me, it seems like the <code>$()</code> constructor has some problem with the leading <code>\</code> in string definitions. Passing pure string (without <code>$()</code> wrapper) into <code>append</code> doesn't seem to cause any problem.<br> Why does it work like this? Does a leading slash have any special meaning in <code>$()</code>?</p>
javascript jquery
[3, 5]
1,013,039
1,013,040
Ajax upload file error with Google Chrome?
<p>I'm using noswfupload (ajax uploader) with my web application, and it work fine with Firefox and IE, but it's not working with Google Chrome. I found an error which show that "PHP Warning: Missing boundary in multipart/form-data POST data in Unknown on line 0"</p> <p>could anyone tell me how to solve this problem?</p>
php javascript
[2, 3]
1,841,986
1,841,987
Event not getting fired in code behind
<pre><code>PnlImages.Controls.Add(new LiteralControl(" &lt;img id=\"img\" class=\"content\" src=\"" + url + "\" runat=\"server\" name=\"img\" onclick=\"return onClick(this);\" /&gt;")); public void onClick(object sender) { } </code></pre> <p>debugger is not firing instead giving error "object expected".<br> Please help.</p>
c# javascript
[0, 3]
363,890
363,891
Auto link specific words and phrases
<p>Can I use jQuery, another library or standard javascript to list a series of words and phrases that I would like to be auto linked?</p> <p>For example:</p> <p>Word / phrase 1: link to www.something.com <br/> Word / phrase 2: link to www.somethingelse.com <br/> Word / phrase 3: link to www.anotherlink.org</p> <p>And so on.</p> <p>Thanks in advance for your help!</p>
javascript jquery
[3, 5]
618,217
618,218
Label won't show when label hidden via page load
<p>The desired effect is that on page load the label does not display but when the user clicks the check box the label displays. This small code sample is just a sample to illustrate the issue. The code will always return an object reference exception from javascript when the Visible property of the label is set to false. If that line is commented out, it will execute correctly with no object reference exceptions but the label should be hidden at page load. This application does use master pages which is why were are passing the ClientIDs to the javascript Toggle function.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { this.chkSelect.Attributes.Add("onClick", "Toggle('" + this.lblAdd.ClientID + "', '" + this.chkSelect.ClientID + "')"); this.lblAdd.Visible = false; } &lt;script type="text/javascript"&gt; function Toggle(lblAdd, chk) { var ctrlAdd = document.getElementById(lblAdd); var ctrlChk = document.getElementById(chk); if (ctrlChk.checked == true) { ctrlAdd.style.display = 'inline'; } else { ctrlAdd.style.display = 'none'; } } &lt;/script&gt; &lt;asp:Label ID="lblAdd" runat="server" Text="Add" Font-Size="8pt" ForeColor="Blue"&gt; &lt;/asp:Label&gt; &lt;asp:CheckBox ID="chkSelect" runat="server" Text="Check Box1" /&gt;&lt;br /&gt; </code></pre> <p>How can we hide that label in Page_Load so we don't get object reference errors from Internet Explorer?</p> <p>Thanks...</p>
javascript asp.net
[3, 9]
2,780,316
2,780,317
Thread Error needs to be found
<p>I am placing a code below, I have created a local Thread and getting Error at the last Closing Braces, Can anybody please sort it out for me. </p> <pre><code>Thread dt = new Thread(this){ public void run() { Looper.prepare(); GetCurrentLocation loc = new GetCurrentLocation(RestaurantFinder.this); loc.setLocParams(); int counter = 0; String lat = GetCurrentLocation.getCurrentLatitude(); String lon = GetCurrentLocation.getCurrentLongitude(); while (lat == null &amp;&amp; lon == null &amp;&amp; counter &lt;= 1000) { lat = GetCurrentLocation.getCurrentLatitude(); lon = GetCurrentLocation.getCurrentLongitude(); counter = counter + 1; } System.out.println("The Latitude are:" + lat); System.out.println("The Longitude are:"+ lon); if (lat == null &amp;&amp; lon == null) { // another alert for location not found AlertDialog.Builder builder1 = new AlertDialog.Builder(RestaurantFinder.this); builder1.setTitle("Restaurant Finder"); builder1.setMessage("Unable to find the Current Location"); builder1.setPositiveButton("OK",new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog,int which) { dialog.dismiss(); } }); AlertDialog dialog1 = builder1.create(); dialog1.show(); // dismiss ProgressDialog by Handler pd.dismiss(); } else { weather(); // dismiss ProgressDialog by Handler pd.dismiss(); } } });&lt;--(Error:Syntax error on token ")", Delete this token) </code></pre>
java android
[1, 4]
4,896,346
4,896,347
What is the rule? when do i use $(this) and when is "this" enough?
<p>I know that <code>$(this)</code> results in a jQuery object, but i often see (especieally in jQuery plugins) the use of <code>return this.whatever</code> what is the general rule?</p> <p>Thanks</p>
javascript jquery
[3, 5]
791,244
791,245
In Javascript (jquery), is there a way to detect when the page anchor changes?
<p>Basically, I want to have links throughout the page that change the anchor -- the part of the URL after a # symbol. When that part of the URL changes, the JavaScript should respond.</p> <p>I could add an onclick method to every link, but is there a better way?</p>
javascript jquery
[3, 5]
1,111,050
1,111,051
How to show X number of divs at a time in Javascript?
<p>Assuming I have an array of names:</p> <pre><code>var myarray = ["A", "B", "C", "D", ... "J"] </code></pre> <p>Say if I have 10 entries in my array and I only want to show 3 at any given time. How do I make it such that each entry, if shown, is shown in a div of red color with a "Back" link and a "Next" link? When I click next, it will show the next 3; when I click on previous it will show the previous 3.</p> <p>Example:</p> <p>Initially 3 Divs are Shown</p> <pre><code>"A" "B" "C" </code></pre> <p>Clicking on "next" shows</p> <pre><code>"D" "E" "F" </code></pre> <p>Clicking on "previous" shows</p> <pre><code>"A" "B" "C" </code></pre> <p>Clicking on "next" 3 times shows only 1 div "J"</p> <p>How to go about this with Javascript or jQuery? Any sample is appreciated.</p>
javascript jquery
[3, 5]
1,899,121
1,899,122
calling click event of a button serverside
<p>how can i click or load the click() event of a button in codebehind?<br> i already treid</p> <pre><code> btn.Click(); </code></pre> <p>but this gives an error<br> i am using asp.net</p>
c# asp.net
[0, 9]