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,182,986
4,182,987
PHP how to call function onClick
<p>I need to call this function Hello() before load the page, what happen is : function is done but location.href don't work, i need it to work how?</p> <pre><code>&lt;input type=button onClick="return Hello(this);location.href='go.php?f_name=&lt;?php echo $_POST['f_name']; ?&gt;&amp;job=&lt;?php echo $_POST['job']; ?&gt;&amp;id_up=&lt;?php echo $count1;?&gt;'" value='Save'&gt; </code></pre>
php javascript
[2, 3]
4,758,419
4,758,420
InputStream Non Blocking read operation
<p>I have the scenario where i need to confirm that either the server side socket closed the connection or not.So for this i am checking if(in.read() ==-1) if true ,it means that server side closed the connection. But problem is that if it does not it blocks here as it is blocking call.i need such a solution where i can read non blocking in perticular time or cancel the reading if server end closed the connection. i am creating like </p> <pre><code>socket = new Socket(); // if server is not available 3 seconds blocking call other wise Exception socket.connect(new InetSocketAddress(serverAddress , serverPort),3000); </code></pre> <p>Any help would be appreciated.</p> <p>Regards, Aamir</p>
java android
[1, 4]
165,010
165,011
PHP read Javascript array
<p>I am passing an array from Javascript to PHP page, as below.</p> <pre><code>var arrF1 = [{"Item":"item1no", "Desc":"item1desc", "Remarks":"item1note"}, {"Item":"item2no", "Desc":"item2desc", "Remarks":"item2note"} ]; $.ajax({ type: "POST", url: "http://www.mydomain.com/pdfs/flist.php", data: { favArray : arrF1 }, success: function() { alert('ok, sent'); } }); </code></pre> <p>In my PHP page, I read the array as below.</p> <pre><code>$fArray = json_decode($_POST['favArray']) </code></pre> <p>And I tried to access the arrays value like this.</p> <pre><code>$fArrav[0]-&gt;{'Item'} $fArrav[0]-&gt;{'Desc'} $fArrav[1]-&gt;{'Item'} </code></pre> <p>Is this correct? I am generating a PDF on the server using FPDF. But with the above, its not reading the array.</p> <p>I must not be doing this right. Please help.</p> <p>Thank you.</p>
php javascript
[2, 3]
522,382
522,383
Hide everything between 2 h2 tags?
<p>I have the following html snippet;</p> <pre><code>&lt;h2&gt;Headline 1&lt;/h2&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; &lt;h2&gt;Headline 2&lt;/h2&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; &lt;h2&gt;Headline 3&lt;/h2&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; &lt;p&gt;Lorem ipsum bla bla&lt;/p&gt; </code></pre> <p>I wish to somehow, via jquery, target each "block" so i can append a div arround it. By "block" i mean all the code between h2 start-tag and down to the last p-tag, before the next h2 start-tag. The last h2-tag within the section, should just take the last p-tag.</p> <p>Any suggestions as to how i best do this?</p>
javascript jquery
[3, 5]
1,505,489
1,505,490
Any alternative of Turn.js(Its not working on IE8/7)
<p>There is any alternative of Turn.js. It's not working on IE8/7. I need flip effect on IE7\8. Please help.</p>
javascript jquery
[3, 5]
3,373,984
3,373,985
Android activity/task order issue
<p>I have an app with 2 main activities and a service. The app starts with activity 1, and the service launches activity 2 via an intent upon detection of an app launch A. Activity 2 then does some stuff and calls finish(), returning to app A.</p> <p>However, if I launch app A when I'm in activity 1, activity 2 appears and returns to activity 1 once it's done instead of returning to app A. If I then tap on the back button, I return to app A.</p> <p>On the other hand, if I go back to the home screen when I'm on activity 1 and start app A, activity 2 appears, and now returns to app A once it's done. This is the behavior I'm looking for, but it only happens when I'm not starting out from activity 1.</p> <p>Why does this happen? I'm launching activity 2 via an intent in the service with the FLAG_ACTIVITY_NEW_TASK flag.</p> <p>Thanks.</p>
java android
[1, 4]
5,259,326
5,259,327
why an object created in the code behind is not available in the aspx page?
<p>I have a simple question. When we create an object in the code behind(".aspx.cs"), why is it not available in the aspx page.</p> <p>For example, if I have a class(present in another .cs file and not in the code behind) and in that class I have a property declared, lets say "Name". </p> <pre><code>namespace BLL.SO { public class SOPriceList { private string _name; public string Name { get { return _name;} set { _name = value; } } } } </code></pre> <p>Now when I create an object, lets say "obj" in the code behind(".aspx.cs"), with scope within the partial class.</p> <pre><code>namespace Modules.SO { public partial class PriceListRecordView : PageBase { SOPriceList obj = new SOPriceList(); protected void Page_Load(object sender, EventArgs e) { } } } </code></pre> <p>Using this object "obj" I can access the property. Then why can't I use the same object "obj" to get the property in the aspx page in this manner,</p> <pre><code>&lt;%= obj.Name%&gt; </code></pre>
c# asp.net
[0, 9]
3,919,303
3,919,304
Jquery: How do you strip out form and div tags to isolate a piece of content?
<p>I want to strip this block of html:</p> <pre><code>&lt;form&gt; &lt;h3&gt;Some Title&lt;/h3&gt; &lt;div class="grab_this_content"&gt; This sentence is what I want remaining. &lt;/div&gt; &lt;/form&gt; </code></pre> <p>into this just this:</p> <pre><code>This sentence is what I want remaining. </code></pre> <p>I know how to strip the form tags like so:</p> <pre><code> $form = $('form'); $form.replaceWith($form.html()); </code></pre> <p>...which results in:</p> <pre><code> &lt;h3&gt;Some Title&lt;/h3&gt; &lt;div class="grab_this_content"&gt; This sentence is what I want remaining. &lt;/div&gt; </code></pre> <p>But that still leaves me with the h3 tag as well as the div (div class="grab_this_content") tags inside the html block, which I want to also strip away. Any ideas on how to strip the above HTML block and just leave the sentence I want remaining?</p>
javascript jquery
[3, 5]
1,050,465
1,050,466
Multiple user control instances and ClientID in JS
<p>I am using &lt;%= ClientID %> in the javascript to get the ID of a dynamically loaded user control. </p> <p>Everything works fine until multiple instances of the same control are loaded. The ID points to the ClientID of the user control that was added last.</p> <p>How do I solve this issue?</p> <p><strong>EDIT: I am doing a: var clID = &lt;%= ClientID %> in javascript. The problem is clID is being overwritten everytime the same UC is loaded</strong></p>
asp.net javascript
[9, 3]
2,151,648
2,151,649
Object doesn't support property or method 'removeClass'
<p>Im trying to do a simple removeClass and addClass to change styles on an Img.</p> <pre><code> &lt;div id="Pic_Viewer"&gt; &lt;div id="Main_Pic_Viewer"&gt; &lt;div class="Not_Selected" &gt; &lt;img src='#' alt="PicURL_1" /&gt; &lt;/div&gt; &lt;div class="Not_Selected" &gt; &lt;img src='#' alt="PicURL_2" /&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="Small_Pic_Viewer"&gt; &lt;ul&gt; &lt;li&gt; &lt;img class="Small_Pic" src'#' alt="PicURL_1" /&gt; &lt;/li&gt; &lt;li&gt; &lt;img class="Small_Pic" src='#' alt="PicURL_2" /&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I have tried doing this with the #Main_Pic_Viewer img inside div and without.</p> <p>js:</p> <pre><code>$('#Small_Pic_Viewer ul li').click( function () { var ThisLI = this.firstElementChild.alt; var BigImgDiv = $('#Main_Pic_Viewer div'); var CurDiv; for (var i = 0, l = BigImgDiv.length; i &lt; l; i++) { CurDiv = BigImgDiv[i]; if (BigImgDiv[i].children[0].alt === ThisLI) { CurDiv.removeClass('Not_Selected').addClass('Selected'); } else { CurDiv.removeClass('Selected'); }; }; } ); </code></pre> <p>Not sure why im getting this error message, as removeClass() is working fine in other methods.</p>
javascript jquery
[3, 5]
3,008,148
3,008,149
while( var row = fn() );
<p>Is there any equivalent metod to make like an php mysql_fetch_array while loop in js?</p> <p>in php you can do: </p> <pre><code>&lt;?php while ($row = mysql_fetch_array($result)) { echo "my name is " . $row['name'] . " and i'm " . $row['age'] . " yeas old"; } ?&gt; </code></pre> <p>i have this object/array:</p> <pre><code>function fetch_array(arr) { // My magic fn that dose not work well, b/c it change the orginal refence return arr.shift(); } var result = [{ name: "Bob", age: 12 }, { name: "Jim", age: 18 }] // And want to do: while (row = fetch_array(result)) { alert("my name is " + row["name"] + " And I'm " + row['age'] + " years old"); } // returns zero :(​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ dont want that console.log(result.length); </code></pre>
php javascript
[2, 3]
3,380,113
3,380,114
Need to create a service to collect data and send to clients as it is received
<p>I currently have a Windows Form application that receives data through a socket, asyncronously. The data coming through the socket can be new data, or updates to previous data. This data is coming off of a production line, tracking different aspects of the pieces running through that line. The data is updated very quickly and sent out to the clients. The Windows Forms application takes that data and places it into a table in memory. If it is new data, it inserts a new row. If the record is just being updated, it updates that row. The application has 20 graphs and 8 datagridviews that are then updated by the data in the table. The updates to the GUI have to be continuous and "real-time", because they are monitoring the production process. We may have 10 - 20 users using this program at the same time in various places in the production process.</p> <p>The problem that is coming up now, is that we are adding much more data display to the GUI, and it is becoming a threading nightmare, not to mention a maintanence nightmare as well.</p> <p>What I am hoping to do is separate the socket collection portion of the program to a service or something that would collect the data, store it in a table and notify any clients connected that they have data. Then allow the client to consume that data and display it to the GUI.</p> <p>Does this sound possible? Is there a more graceful way of handling these situations? Looking for detailed suggestions.</p>
c# asp.net
[0, 9]
4,322,703
4,322,704
Android Image Fade In-Between Gray-Scale and Color
<p>I have an app that gets the mic level through a method which I can repeatedly call. What I have is an ImageView that I want to fade in-between gray-scale and its normal color. Ultimately I want the image to turn its normal color when speaking (different intensity depending on the mic level).</p> <p>I also thought that having the gray-scale image behind the colored image and the colored image would change opacity depending on the sound level. I think this is the less elegant way to do it, but it seems like the one that I could manage the best.</p> <p>This is the code for the idea above.</p> <pre><code>public static void updateColor() { // ImageView color starts with alpha of 0; ImageView gray = (ImageView) findViewById(R.id.gray); ImageView color = (ImageView) findViewById(R.id.color); color.setAlpha(getMaxAmplitute()); // Part of the problem is that getMaxAmplitude() doesn't exactly return what I want // It usually returns something between 30-90 // (30 being ambient sound level, 90 when talking) } </code></pre> <p>Thanks in advance.</p>
java android
[1, 4]
4,206,488
4,206,489
Not geting a calender in jquery page load
<p>I have two asp web forms and i am using the jquery load method to load the page.it gets loaded but the date picker it contains is not displayed.the code by which i am calling the load method is</p> <pre><code>&lt;script type="text/javascript" src="scripts/jquery-1.2.6.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#&lt;%= AddProj.ClientID %&gt;").click(function (event) { event.preventDefault(); //preventing button's default behavior //call GetProducts.aspx with the category query string for the selected category in radio button list //filter and get only the #tableProducts content inside #products div $("#products").load("AddProject.aspx" + " #form2"); }); }); &lt;/script&gt; </code></pre> <p>thanks in advance...</p>
c# jquery asp.net
[0, 5, 9]
4,230,425
4,230,426
Pass value from parent to iframe dropdown box
<p>I need to pass a value from a parent to an iframe (on a different server, not in my control) and have the value make a selection in a dropdown in the iframe.</p> <p>Example: mydomain.com/?agent=12345 (target will be the iframe)</p> <p>In the iframed page, the dropdown has several choices, I need to have the value in the url be the selected the choice corresponding to the selection when the link is clicked and the page is loaded in the iframe.</p> <p>Is passing in the URL possible or do I use JS, PHP? If JS or PHP, how?</p> <p>Thanks.</p>
php javascript
[2, 3]
5,925,534
5,925,535
single quote in php from java string
<p>I have a java (android) application that uses php to talk to the MS database. The problem is one part in my app. I have a string that is a sql statement, and that string will not insert into the database with the single quotes</p> <pre><code>String sql = "select * from table where col = 'testing' AND Col2 = 'Tester'"; </code></pre> <p>I get that in the php script by using: <code>$script = $_REQUEST['Script'];</code></p> <p>2 things, I want to insert that script into a a column with the datatype char and i also want to run that script as well. Thanks!</p> <p>I am not having the users run there own scripts on my DB. as they check a checkbox it a StringBuilder builds a script upon what they select. So if they check Female or male The String add the Select * from Table where Gender = 'Female' etc. </p>
java php
[1, 2]
198,821
198,822
Jquery best practice for speeding up animation
<p>What are some of the more practiced methods of speeding up jquery animations across all browsers? I'm currently using jquery with a GridView(Table) and it's lagging and lagging making the slideUp() slideDown() unusable.</p> <p>Links other then jquery.com are greatly appreciated. </p> <pre><code>$(document).ready(function(){ $("#GridTable td").click(function() { $(this).parent.slideToggle("normal"); }); }); </code></pre> <p>Not complicated code. Just very sloooow. Mind you I have a gridview with millions of records. It would be nice to find out some alternatives. </p>
c# asp.net jquery
[0, 9, 5]
4,276,551
4,276,552
slider active state in jquery
<p>i have a slider whose code is</p> <pre><code>var jq = jQuery.noConflict(); jq(document).ready(function(){ jq("a.zootoggle").click(function () { jq(this).parent().next('div.zoocontent').slideToggle('slow', function() { jq("a.zootoggle").parent().toggleClass('active', jq(this).is(':visible')); }); return false; }); }) </code></pre> <p>the html</p> <pre><code> &lt;h3&gt;&lt;a class="zootoggle"&gt;openme&lt;/a&gt;&lt;/h3&gt; &lt;div class="zoocontent&gt;content here&lt;/div&gt; &lt;h3&gt;&lt;a class="zootoggle"&gt;openme&lt;/a&gt;&lt;/h3&gt; &lt;div class="zoocontent&gt;content here&lt;/div&gt; </code></pre> <p>this works in that it opens the correct box when clicked (the next sib of the clicked h3 containing a) but it then applies the active class to all the h3's not just the one clicked. i would like the active class to only apply to the current h3.</p>
javascript jquery
[3, 5]
2,203,650
2,203,651
jQuery - script tags in the HTML are parsed out by jQuery and not executed
<p>I have an HTML page like so:</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;div id='something'&gt; ... &lt;script&gt; var x = 'hello world'; &lt;/script&gt; ... &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>On another page, I am doing this:</p> <pre><code>$.ajax({ url: 'example.html', type: 'GET', success: function(data) { $('#mydiv').html($(data).find('#something').html()); alert(x); } }); </code></pre> <p>jQuery, however, is not executing the javascript in the first file, even though the documentation says it does. How can I make it do that?</p> <p>EDIT: Unfortunately in the real world application I am working on I don't have control over what the "included" page has. We are on the same domain, but I can't modify the code that it outputs as it is a packaged product our IT department will not let us modify.</p>
javascript jquery
[3, 5]
651,612
651,613
Could not extract public data pygame android
<p>I have written a pygame script for an Android game. The code is perfect and is correctly executing on my desktop PC. But when I try to install it on my device it installs properly but on executing it gives a toast message 'Could not extract public data' I changed the storage data to internal memory then it toasts 'Could not extract private data'</p> <p>I'm posting the logcat for the external storage issue. I tested another simple script from <a href="http://pygame.renpy.org/writing.html" rel="nofollow">here</a> and this executed perfectly on my device.</p> <p>Here is the screenshot for the error:</p> <p><img src="http://i.stack.imgur.com/Nl5gr.png" alt="enter image description here"></p> <p>Update: I tried using pgs4a and was getting this above error. Then I tried using RAPT and now getting a new error:</p> <p><img src="http://i.stack.imgur.com/2TOH3.png" alt="enter image description here"> Now since my game is not a ren'py game therefore RAPT won't work.</p> <p>Therefore I have to configure and build with pgs4a only. </p> <p>Problem with the extracting the public/private data still persists. </p>
python android
[7, 4]
1,109,902
1,109,903
Copy uploaded image to my physical directory in ASP.net
<p>I'm creating a user profile for my website and I need to allow user to upload his image to be his profile picture, I used the ASP.net upload control and I need to copy the image he uploaded to a physical directory called Images on the server.</p> <p>Does any one has idea if that is possible using ASP.net?</p>
c# asp.net
[0, 9]
1,755,658
1,755,659
Replacing body.onload in a user control
<p>I am refactoring a page that uses <code>&lt;body onload="myJS();"&gt;</code> to a user control. I understand I can do it using server side script registration on load.</p> <p>If I want to do it on the client side (ascx), how would I do this?</p>
asp.net javascript
[9, 3]
2,147,161
2,147,162
Wait for click event to complete
<p>I add click events handler to elment</p> <pre><code> $(".elem").click(function(){ $.post("page.php".function(){ //code1 }) }) </code></pre> <p>And trigger click event</p> <pre><code>$(".elem").click(); //code2 </code></pre> <p>How i make sure that code2 executes after code1 executes</p>
javascript jquery
[3, 5]
6,004,095
6,004,096
Breaking Change in .net 4.5 Callcontext when doing a HTTP Post to an ashx?
<p>I've just installed .Net 4.5 and noticed that an existing web application, that is still running under .Net 4, is failing when I'm trying to retrieve an item from the CallContext, when before the install was working perfectly and has done for the last year.</p> <p>On the AuthenticateRequest event of the application, we use the Identity of the user to load more security information about the user. This is then added to the CallContext for later use.</p> <p>e.g.</p> <pre><code> protected void Application_AuthenticateRequest(object sender, EventArgs e) { if (HttpContext.Current.User != null &amp;&amp; HttpContext.Current.User.Identity.IsAuthenticated) { // set someValue CallContext.SetData(ContextIdentifier, someValue); } } </code></pre> <p>The value in the callcontext is retrieved at later points in the lifecycle. e.g CallContext.GetData(ContextIdentifier)</p> <p>However, when requesting an .ashx from a http "POST" request, the value is now null but on a "GET" request the value is correct.</p> <p>I can't find an documented reason why this has suddenly changed or whether this is now by design and why it would affect existing .Net 4 applications?</p> <p>My obvious fix is to also put the data on the HTTPContext, yet without understanding the reason why I'm unsure if using the CallContext will cause issues elsewhere!</p> <p>Any help / understanding would be gratefully recieved</p>
c# asp.net
[0, 9]
695,090
695,091
PopUp at the end of button's operations
<p>in my aspx page I have a button that save several values in the database. </p> <p>I need to insert a popuup at the end of the operation. </p> <p>At the moment the code is: </p> <pre><code>protected void btnSendRequest_Click(object sender, EventArgs e) { var myDbAccess = new DBAccess(); Event newEvent = (Event)Session["NewEvent"]; myDbAccess.SaveEvent(newEvent); // Insert here a PopUp like "Successfully saved!" } </code></pre> <p>How can I accomplish this? </p> <p>Luigi</p>
c# asp.net
[0, 9]
2,764,391
2,764,392
Find Divs with Class x but should not have class y
<pre><code>&lt;ul&gt; &lt;li class="clsLi"&gt; &lt;div class="abc xyz"&gt;&lt;/div&gt; &lt;div class="arrow"&gt;&lt;/div&gt; &lt;div class="abc xyz"&gt;&lt;/div&gt; &lt;div class="abc"&gt;&lt;/div&gt; &lt;div class="abc"&gt;&lt;/div&gt; &lt;div class="abc xyz"&gt;&lt;/div&gt; &lt;/ul&gt; &lt;/li&gt; </code></pre> <p>I am trying to select the divs that have the class "abc" but not "xyz"</p>
javascript jquery
[3, 5]
2,716,590
2,716,591
What is wrong with this javascript
<p>ARGH! What's wrong with this??</p> <pre><code>$(document).ready(function() { var monkeyTrouble = $('#monkeyTrouble').attr('rel'); if (monkeyTrouble = "banana") { alert("oooh oooh ahh ahhh"); } }); </code></pre>
javascript jquery
[3, 5]
4,543,505
4,543,506
How to send key event to an edit text in android app
<p>For example, send a backsapce key to the edit text control to remove a charactor or send a char code like 112 to append a charactor in the edittext control programatically.</p> <p>Actually I need a method like</p> <pre><code>onKeyReceived(int keyCode) { // EditText to append the keyCode, I know how to add a visible charator, but what about some special keys, like arrow key, backspace key. } </code></pre>
java android
[1, 4]
3,744,733
3,744,734
Execute javascript/jquery code OnClick and conditional post back to ASP function
<p>jQuery newbie question here... I have a jQuery dialog that displays a warning with a "OK" or "Cancel" and based on what they click the result needs to then execute the server side ASP onClick event. </p> <p>I've attempted to write it along these lines:</p> <pre><code> "OK": function () { $(this).dialog("close"); return true; }, Cancel: function () { $(this).dialog("close"); return false; </code></pre> <p>But it never posts back to the asp server side method.</p> <p>Am I off base in what I am trying to accomplish here, and is there standard 'best practice' type of way of implementing this type of functionality?</p>
javascript jquery asp.net
[3, 5, 9]
5,400,990
5,400,991
cant change variable
<p>I'm trying to make a navigation area and am trying to switch tabs with the active variable. This is just for the nav button, but later I'd like to make a rotator too by switching the variable.</p> <p>Here is my code:</p> <pre><code> active = 1; function hover() { $(nav1).live('mouseenter', function() { active = 2; }); if ( active == 1) { $(tab1).fadeIn('fast'); } else if ( active != 1) { $(tab1).fadeOut('slow'); } if ( active == 2) { $(tab2).fadeIn('fast'); } else if ( active != 2) { $(tab2).fadeOut('slow'); } } hover(); </code></pre>
javascript jquery
[3, 5]
486,429
486,430
Loading of Master pages dynamically?
<p>Can we have the Masterpage loaded dynamicallu. I have a page that must be used in 2 different scenarios ie., using two different master pages. </p> <p>Appreciate all your help. </p> <p>Thanks, </p>
c# asp.net
[0, 9]
5,409,771
5,409,772
jquery onhover works, onclick does not
<p>I've added a liking/disliking function my comics website.</p> <p>I've made custom graphics for it. </p> <ul> <li><p>When a user hovers over selection, it will change, then swap back off hover... </p></li> <li><p>When a user clicks, it will swap images until they click the same vote again, where it will switch back to the original.</p></li> </ul> <p><img src="http://i.stack.imgur.com/OKMRB.png" alt="enter image description here"></p> <p>The on hover works, but the on click does not... I'm trying to implement this with Jquery:</p> <pre><code>&lt;script type="text/javascript"&gt; var images = { "like": [ "./images/SiteDesign/like_hover.png", "./images/SiteDesign/like.png", "./images/SiteDesign/liked.png" ], "dislike": [ "./images/SiteDesign/dislike_hover.png", "./images/SiteDesign/dislike.png", "./images/SiteDesign/disliked.png" ]); jQuery(document).ready(function($) { $("#like, #dislike").hover(function(e) { // mouseover handler if (this.id in images) // check for key in map this.src = images[this.id][0]; }, function(e) { // mouseout handler if (this.id in images) this.src = images[this.id][1]; }); $("#like, #dislike").click(function(e) { alert("clicked"); if (this.id in images) // check for key in map this.src = images[this.id][2]; }, function(e) { // mouseout handler if (this.id in images) this.src = images[this.id][1]; }); }); &lt;/script&gt; </code></pre> <p>Any thoughts? I've even put a alert("clicked") within the click function, but it's not even calling that.</p>
php javascript jquery
[2, 3, 5]
2,004,447
2,004,448
Assign input field value from previous page to a session and access with PHP
<p><strong>My Question</strong></p> <p>I have a contact form and it has a input field called </p> <pre><code>&lt;input type="text" name="subject" id="subject" value="Car"&gt; </code></pre> <p>and the second form with a input field called</p> <pre><code>&lt;input type="text" name="subject" id="subject" value="Home"&gt; </code></pre> <p>When someone clicks submit, the user is directed to a generic thank you page with a div in it as follows</p> <pre><code>&lt;div class="lead_form_thankyou"&gt;Thank you message&lt;/div&gt; </code></pre> <p>What I am trying to do is, assign the input field value to a session and access it while on the thank you page to display a customised Thank you message. </p> <p><strong>My Code</strong></p> <p>I have this code now </p> <pre><code>$subjectForThankYouMsg = $("#subject").val(); if($subjectForThankYouMsg == "Home"){ $(".lead_form_thankyou").text("Thank you for choosing our Car."); } else if($subjectForThankYouMsg == "Car"){ $(".lead_form_thankyou").text("Thank you for choosing our Home.'+\n+' We will be in touch with you shortly."); } </code></pre> <p><strong>My Issue</strong></p> <p>Im finding it hard to mix jQuery and PHP and assign <code>$subjectForThankYouMsg</code> value to a session. Can someone please guide me? Let me know if this is not clear. Thanks</p>
php jquery
[2, 5]
20,402
20,403
Russian character not showing well in java but is ok in php?
<p>We have a web application where the can insert russian character and in the mysql db it looks like this Γβ€ΓΒΎΓ‘Γ‘β€šΓΒ°ΓΒ²ΓΒΊΓΒ° груза. But when is viewed on the web is shows correctly in the russian character form. But when we do it in java application it showing up in this format Γβ€ΓΒΎΓ‘Γ‘β€šΓΒ°ΓΒ²ΓΒΊΓΒ° груза? Any help? </p> <p>Part of the java codes are below.</p> <pre><code>Statement stmt1 = null; //System.out.println("\n\nSELECT selectOTACommand : "+selectOTACommand); String select1 = "Select locName from tblLoc where locID=2280" ResultSet rs1= stmt1.executeQuery(select1); while(rs1.next()) { System.out.println("Loc Name : "+rs1.getString("locName")); } try{ if ( rs1 != null ){ rs1.close(); } else{ System.out.println("MyError:rs1 is null in finally close"); } if ( stmt1 != null ){ stmt1.close(); } else{ System.out.println("MyError:stmt1 is null in finally close"); } } catch(SQLException ex){ System.out.println("MyError:SQLException has been caught for stmt1 close"); ex.printStackTrace(System.out); } </code></pre>
java php
[1, 2]
4,498,426
4,498,427
jQuery - get the selected options of a listitem collection?
<p>I have fields that a user would enter and i would pass it into jQuery and pass to a web service. </p> <p>I can get textboxes values by:</p> <p>var name = $("#MainContent_txtName").val() </p> <p>The problem I'm having is a multi-select that comprises of a list item collection. If I was to do this server side, I would do something like:</p> <pre><code>foreach (ListItem li in listTitles) { if (li.Selected) { selectedValue += li.Value + ","; } } </code></pre> <p>And this would give me the string of selected values from the select list. I'm having trouble getting it out from jQuery. If I do </p> <pre><code>var titles = $("#MainContent_selectListTitles").val() </code></pre> <p>That is obviously incorrect because it won't bring back the selected list items. I saw a post that suggested that I could retrieve it if I say option selected. So I tried this:</p> <pre><code>var titles= $('#MainContent_selectListTitles option:selected'); </code></pre> <p>The next thing I did was pop an alert to see what the titles were. It just said [object, object]. </p> <p>So my questions are:</p> <ol> <li><p>Is it possible to get the selected items from the list item collection concatenated into a string? </p></li> <li><p>Or is it better that I get all the form values from a postback even on my code behind and then call the jquery function? If this is an option, i've attempted to do this but have failed. It tells me that it can't find the method. So i'm definitely not calling the jquery function correctly on postback of the button event.</p></li> </ol> <p>THanks.</p>
javascript jquery asp.net
[3, 5, 9]
1,502,947
1,502,948
Killing The Application In Android
<p>I have an application which shows a notification in the status bar for users to click to get resumed into the activity.</p> <p>In the application, I will also have a close application button which runs:</p> <pre><code>android.os.Process.killProcess(android.os.Process.myPid()); </code></pre> <p>When I click the close app button, the app will get killed as long as I didn't enter the app through clicking on the notification.</p> <p>If I have entered the app by clicking on the application, the application will "blink" for a second and a new copy is shown. I suppose a new copy is shown.</p> <p>Do anyone happen to know what's causing this?</p>
java android
[1, 4]
357,350
357,351
Cannot implicitly convert type 'System.Uri' to 'System.Collections.Generic.List<string>' ERROR
<p>I am using HTML Agility to get all the images since image dont always have absolute path i am trying to do following. But line marked below in the code generates error</p> <p>Cannot implicitly convert type 'System.Uri' to 'System.Collections.Generic.List' </p> <p>I am not sure how to fix this i tried so many option but keep on getting one or the other error</p> <pre><code>List&lt;String&gt; imgList = (from x in doc.DocumentNode.Descendants("img") where x.Attributes["src"] != null select x.Attributes["src"].Value.ToLower()).ToList&lt;String&gt;(); List&lt;String&gt; AbsoluteImageUrl = new List&lt;String&gt;(); foreach (String element in imgList) { AbsoluteImageUrl = new Uri(baseUrl, element); //GIVES ERROR } </code></pre>
c# asp.net
[0, 9]
5,118,638
5,118,639
How to generate a exe program through programming?
<p>I want to write a application which can use to generate .exe program automatically from some word and txt files. How can I implement this ? Is it possible to generate a exe program with programming ?</p>
c# java c++
[0, 1, 6]
3,863,579
3,863,580
Language options in Android
<p>I am developing an android application in which there is a drop down button,drop down is having 3 languages as option,on selecting a particular language,the entire application should change to that language.My application is ready with drop down button having 3 languages as its option,but i don't know how to change entire application in that particular chosen language.Please help me on this....</p>
java android
[1, 4]
3,776,647
3,776,648
Replacing contents inside docx and pdf file using asp.net c#
<p>In my application I am using some templates in docx and pdf format. I am storing this docs to DB as Bytes.</p> <p>Befor showing/sending this docs back to user or application I need to replace some contents inside the doc. eg:if the doc contain @@username@@ I need to replace this with the exact username of the customer. I am not getting a proper solution for this. Any good ideas?</p>
c# asp.net
[0, 9]
1,158,738
1,158,739
Call function when we click the html button
<p>How to call function in .cs file when we click the html button in aspx file.</p>
c# asp.net
[0, 9]
4,425,182
4,425,183
Javascript: How to get the ClientID of the button that was clicked?
<p>Here's the button.</p> <pre><code>&lt;asp:Button ID="_btnSearch" Text="Search" onclientclick="return CheckForEmptySearchBox(this.ClientID)" /&gt; </code></pre> <p>And here's the Javascript function</p> <pre><code>&lt;script type = "text/javascript"&gt; function CheckForEmptySearchBox(id) { alert("The ID of the button is: " + id) return false; } &lt;/script&gt; </code></pre> <p>I'm getting a alert box, saying "The ID of the button is: <strong>undefined</strong>"</p> <p>Thanks for helping</p>
javascript asp.net
[3, 9]
3,215,888
3,215,889
Asp.net reset fields and ConfirmCancel
<p>Am using master page in my asp.net application, and I want to reset the fields when I click the <code>Cancel</code> button.</p> <p>I can achieve this by adding the onClientClick event as</p> <pre><code>OnClientClick="this.form.reset();return false;" </code></pre> <p>its working but, I already used this function for showing the confirm cancel popup like,</p> <pre><code>OnClientClick="return confirmCancel()" </code></pre> <p>this confirmCancel() is written in the js file called <code>Custom.js</code> and its under the folder called <code>Script</code>.</p> <p>I need to show this <code>confirmCancel()</code> pop up and if I give ok it should clear the form, how can I achieve this, can anyone help me here...</p> <p>this is the confirmCancel() method</p> <pre><code>function confirmCancel() { var c = confirm("Confirm Cancel?"); if (c) { return true; } else { return false; } } </code></pre>
jquery asp.net
[5, 9]
5,043,400
5,043,401
JQuery - How do I count the number of elements selected by a selector?
<p>I am using $().fadeOut() to fade items out in a list ( &lt; li> &lt; /li>). When the list is empty I wish to hide a parent object.</p> <p>I plan on doing this by checking in my trigger event that fades the list if the count of the objects is 0 then hide the parent element. I can use the fadeOut callback to remove the elements if necessary.</p> <p>The to the point question: <strong>How do I select li tags inside a ul and then get the total count of them using jquery?</strong></p>
javascript jquery
[3, 5]
370,640
370,641
Master page - Only one instance of a ScriptManager can be added to the page
<p>I am using ajax toolkit in my project. My project is having a master page and i am inheriting this master page in my web pages.I am using Script manager on every page but now requirement came to display a real time clock also on the master page.I had written the code using Timer to display real time clock on master page but i am getting error "Only one instance of a ScriptManager can be added to the page. ".</p> <p>How to fix this problem as i don't want to remove script manager from the webpages.</p>
c# asp.net
[0, 9]
3,018,475
3,018,476
access ajax data in closure
<p>I want to populate a "private" variable in my function with some data loaded by ajax, so it can be accessed within the function. What I currently have:</p> <pre><code>var foo = (function(){ var ajaxData; var useAjaxData = function(data){ }; })(); </code></pre> <p>I suppose that I need to do something similar to this, since it's an async call? Are there any prettier solutions for this?</p> <pre><code>var foo = (function(){ $.ajax({ url: 'something', success: function(data){ var ajaxData = data; var useAjaxData = function(data){ }; } }); })(); </code></pre>
javascript jquery
[3, 5]
597,485
597,486
improveddown causing scrollbar flickering
<p>I have used improveddropdown jquery plugin... my page has 10-20 dropdowns.. when the page loads the vertical scrollbars starts flickering.. it flickers because the improveddrodown jquery runs on dropdowns which takes some time... how to avoid this flickering of the scrollbar?</p>
jquery asp.net
[5, 9]
2,411,627
2,411,628
Passing an Id to a AlertDialog click event
<p>I have a mapview with pointers, when a pointer is clicked I show an alertdialog. In this dialog I have a bit of text and two buttons, a positive and negative. When the positive is clicked I want to open a new activity based on the id of the pointer clicked.</p> <p>I am new to Android and java and I am having trouble passing the ID to the click event.</p> <p>My code so far..</p> <pre><code> List&lt;myItemType&gt; myItems= //code to get list of items final ArrayList&lt;OverlayItem&gt; items = new ArrayList&lt;OverlayItem&gt;( ); for (myItemType item : myItems) { Double lat = Double.parseDouble(item .Lat); Double lng = Double.parseDouble(item .Long); items.add(new OverlayItem(item .ID, item .Name, item .Description .substring(0, 20) + "...", new GeoPoint(lat, lng))); } ItemizedOverlay&lt;OverlayItem&gt; myOverLay = new ItemizedOverlay&lt;OverlayItem&gt;( this, items, this.getResources().getDrawable(R.drawable.standard_pointer), new Point(5, 5), HotspotPlace.BOTTOM_CENTER, new ItemizedOverlay.OnItemGestureListener&lt;OverlayItem&gt;() { @Override public boolean onItemSingleTapUp(final int index,final OverlayItem item) { AlertDialog.Builder dialog = new AlertDialog.Builder(MapActivity.this); dialog.setTitle(item.mTitle); dialog.setMessage(item.mDescription); dialog.setPositiveButton(R.string.View,new DialogInterface.OnClickListener() { //********************CLICK EVENT HERE @Override public void onClick(DialogInterface dialog,int which) { Intent i = new Intent(MapActivity.this,POI.class); i.putExtra("Id", item.mKey); //&lt;------ item.mKey is null! startActivity(i); } }); dialog.setNegativeButton(R.string.Cancel, null); dialog.create(); dialog.show(); return true; } </code></pre> <p>The Id is stored in the "item.mKey", I know I can't access it directly, but I can't work out how to pass it in. Can anyone point me in the right direction?</p> <p>Bex </p>
java android
[1, 4]
746,156
746,157
ExecuteNonQuery()
<p>Hey, this is my (rough)code (DAL)</p> <pre><code>int i; // some other declarations SqlCommand myCmdObject = new SqlCommand("some query"); conn.open(); i = myCmdObject.ExecuteNonQuery(); conn.close(); </code></pre> <p>so the problem is even though there is a record present on my <code>SELECT</code> query, the value in <code>i</code> remains <code>-1</code></p> <p>what could be the problem</p> <p>thanks in advance.</p>
c# asp.net
[0, 9]
3,018,691
3,018,692
How do I access a public property of a User Control from codebehind?
<p>I have a user control in a repeater that I need to pass data to during the databound event, so I've created two public properties in the control. How do I access these properties from the page's codebehind class?</p>
c# asp.net
[0, 9]
4,474,115
4,474,116
Legal use of creating a new object on a global namespace
<p>Would this be a legal use of creating an object on a global namespace? My goal is to create 1 global namespace for this application. Also how would I alias MYNYTE.app? Could I do something like this with out polluting the Global namespace: <strong>var b = MYNYTE.app;</strong></p> <pre><code>if( ! MYNYTE ) MYNYTE = {}; if( ! MYNYTE.app ) MYNYTE.app = {}; MYNYTE.app.Playbook = function(){ this.change = ''; this.boo = function(){alert('boo');} this.setChange = function( v ) { this.change = v; } this.getChange = function( v ) { return this.change; } } var test = new MYNYTE.app.Playbook(); var test2 = new MYNYTE.app.Playbook(); test.boo(); test.setChange( 'Change is bad' ); test2.boo(); test2.setChange( 'Change is great' ); console.log( test2.getChange() ); console.log( test.getChange() ); </code></pre>
javascript jquery
[3, 5]
3,556,558
3,556,559
Changing button text with Javascript
<p>I have the below code:</p> <pre><code>&lt;asp:Content ID="HeadContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;script type="text/javascript"&gt; function SetText(id) { if (Button2.value == "Disable automatic page refresh") Button2.value = "Automatic Refresh Disabled"; return false; } &lt;/script&gt; &lt;/asp:Content&gt; &lt;asp:Button ID="Button2" runat="server" Text="Disable automatic page refresh" OnClick="Button2_Click" OnClientClick="return SetText(this)" /&gt; </code></pre> <p>When I click the button though, the button name does not change, but the code behind C# does still work as normal. Can anyone point me in the right direction? I thought it might have been the OnClick event, but after removing it, it still didn't work. I also tried changing the OnClick to OnServerClick just in case but to no avail.</p>
javascript asp.net
[3, 9]
4,978,384
4,978,385
How many document.ready in single html file or javascript file?
<p>How many <code>$(document).ready()</code> function can we use in a single html file or in a single javascript file?</p> <pre><code>$(document).ready(function(){ alert("first document ready"); //do some action here }); $(document).ready(function(){ alert("second document ready"); //do some action here too }); </code></pre> <p>If we can use infinite, how will they be invoked? Will they execute line by line or is there any algorithm for calling this?</p>
javascript jquery
[3, 5]
204,964
204,965
Is it possible to create ASP.NET pages without the autogenerate javascript?
<p>As a test, I wanted to have an ASP.NET page rendered without the auto-generated javascript. Is this possible?</p>
asp.net javascript
[9, 3]
4,511,776
4,511,777
passing url in another url
<p>i have this snippet:</p> <pre><code>$('#button1').click(function(){ window.location = "details.php?trans=Automatic&amp;&amp;mileage=19,695&amp;&amp;eng=6&amp;&amp;ext=White Platinum Metallic&amp;&amp;stock=45411&amp;&amp;vin=2FMGK5D89DBD08967&amp;&amp;location=Palm Beach, FL&amp;&amp;price=$28,999&amp;&amp;photo=http://content.homenetiol.com/1535/67692/165x10000/2013-Ford-Flex-Limited/d0dbf839ecc3492a850bfc73a6d9099d.jpg"; }); </code></pre> <p>i want to pass the url of image <code>photo</code> in the url but it didn't work</p> <ul> <li>why?</li> <li>how can i fix it?</li> </ul>
javascript jquery
[3, 5]
2,493,832
2,493,833
currency converter project on android
<p>I try to do currency converter project on android i got these errors</p> <pre><code>currencyConverter cannot be resolved or is not a field R.string.convert_failure cannot be resolved </code></pre> <p>the following code files are here</p> <p><a href="http://pastebin.com/QcHjXGQQ" rel="nofollow">http://pastebin.com/QcHjXGQQ</a></p> <p><a href="http://pastebin.com/J7tWW3wH" rel="nofollow">http://pastebin.com/J7tWW3wH</a> </p>
java android
[1, 4]
1,265,437
1,265,438
Proper syntax for ASP.NET hyperlink
<p>I am trying to send an ASIN number into the querystring from a hyperlink and I'm having trouble getting the correct syntax. Any ideas?</p> <pre><code>&lt;asp:HyperLink ID="hlProductPage" Enabled="true" runat="server" NavigateUrl="ProductPage.aspx?ASIN=&lt;%# Eval("ASIN")%&gt;"&gt;Read More...&lt;/asp:HyperLink&gt; </code></pre> <p>Thanks so much!</p>
c# asp.net
[0, 9]
208,255
208,256
View overlapping issue-SingleTop Declaration
<p>I have a game application where user has option to go to new game or review the game user just played. New game and Review are defined in same activity, with Review being handled in onNewIntent(). The issue is, when I click both buttons at same time / touch New game and quickly touch Review - then "New Game" and "onNewIntent" views overlap! </p> <p>per logs, onPause is called on Newgame and then Review view is drawn. I have this activity launchMode as "singleTop" in Androidmanifest. Has anyone faced this issue?</p> <p>Thank you.</p>
java android
[1, 4]
893,702
893,703
Best way of getting a a series of custom fields into an array?
<p>I've a series of custom fields attached to certain pages. These fields are named slide1, slide2, side3, slide4, slide5, slide6. </p> <p>These are images which are going to be used as a slideshow (I'm using jflow slider for this - <a href="http://net.tutsplus.com/articles/news/using-the-wonderful-jflow-plugin-screencast/" rel="nofollow">http://net.tutsplus.com/articles/news/using-the-wonderful-jflow-plugin-screencast/</a> )</p> <p>(I don't want to call them all 'slide' and put them in an custom field array because there may be captions for each slide, and when both slides and captions are custom field arrays, the order may not match up)</p> <p>Now, sometimes there will be only 3 slides entered (slide1 to slide3), and sometimes all 6 slides (slide1 to slide6).</p> <p>Not being very PHP savvy, I wonder what the best way best way to stick these custom fields into a PHP array, and then iterate thru them to print out the code, which looks a bit like the below?</p> <pre><code>&lt;div id="slides"&gt; &lt;div&gt;&lt;img src="qwerty.jpg"&gt; &lt;/div&gt; &lt;div&gt;&lt;img src="foo.jpg"&gt; &lt;/div&gt; &lt;div&gt;&lt;img src="test.jpg"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The code to print, for instance slide1's image, would be something like:</p> <pre><code>&lt;img src="&lt;?php echo wp_get_attachment_url($slide1); ?&gt;"&gt; </code></pre>
jquery php
[5, 2]
4,659,620
4,659,621
How to solve this string literal error
<p>This code below is giving me a unterminated string literal error, how can this be fixed?</p> <p>below is javascript code (QandAtable.php).</p> <pre><code>$(".imageCancel").on("click", function(event) { var image_file_name = "&lt;?php echo str_replace("\n", "", $image_file_name); ?&gt;"; $('.upload_target').get(0).contentwindow $("iframe[name='upload_target']").attr("src", "javascript:'&lt;html&gt;&lt;/html&gt;'"); jQuery.ajax("cancelimage.php" + image_file_name) .done(function(data) { $(".imagemsg" + _cancelimagecounter).html(data); }); return stopImageUpload(); }); </code></pre> <p>below is imagecancel.php script where the ajax links to:</p> <pre><code>... $image_file_name = $_GET["fileImage"]["name"]; echo "File Upload was Canceled"; $imagecancelsql = "DELETE FROM Image WHERE ImageFile = 'ImageFiles/". mysql_real_escape_string($image_file_name)."'"; mysql_query($imagecancelsql); </code></pre> <p>In error console it is showing it as: <code>var image_file_name = "&lt;br /&gt;</code></p>
php javascript jquery
[2, 3, 5]
2,176,006
2,176,007
'how to instruction' using javascript/jquery for first signed up users
<p>Can anyone please tell me some tips to create a 'how to use this website' instruction using javascript/jquery for those first signed up users (like the ones you see when you first sign up for facebook or twitter)? And my website is based on php/mysql. Thanks so much in advance!</p>
php javascript jquery
[2, 3, 5]
2,530,893
2,530,894
PHP server for Android turn based multiplayer game?
<p>I developed a turn based game for Android, and now I want to add multiplayer gaming. I don't want to use providers like "skiller", I would like to develop my own server. </p> <p>I don't have a dedicated server, but I have a php hosting with "1 and 1". Would be a good idea to use this hosting like a game server? My idea is that my Android game polls server every X seconds waiting for opponent move.</p> <p>What do you think about it?</p>
php android
[2, 4]
2,622,319
2,622,320
Hover set timeout doesn't work
<p>I want to <code>display:none</code> if user hovers my banner for 500ms, but the following JQuery code is not working. Where is mistake?</p> <pre><code>$('.banner').hover(function() { setTimeout(function(){ $(this).css('display','none'); }, 500); }); </code></pre>
javascript jquery
[3, 5]
5,046,987
5,046,988
How can I upload a J2EE/Android hybrid application to Google Play?
<p><strong>I made a Java EE Hybrid application and I want to upload it to Google Play !!</strong></p> <p>My application interface worked well in the emulator. I really want to upload the application. I could not find a good guide to help me.</p> <p>Can anyone can give me a full guide step by step? </p>
java android
[1, 4]
3,682,968
3,682,969
jQuery $.get() Memory Usage
<p>This is the jQuery method that I have at my webpage, it refreshes a image every 5 seconds by loading the same page and replacing the image.</p> <pre><code>$(document).ready(function () { var refreshId = setInterval(function () { $.get('default.aspx', function (data) { var page = data; var image = $(page).find("img"); var fecha = $(page).find("div #fecha"); $("#Chart1").attr("src", image.attr("src")); $("#fecha").text(fecha.text()); }); }, 5000); }); </code></pre> <p>I saw that everytime it loads the img, the data get stored somewhere in the browser and it doesnt cleans.. And when I open the task manager, I can see the memory usage growing up..</p> <p>and heres a screenshot of the image axd..</p> <p>Should I worry about freeing memory? Or everything is working as its supposed to..</p> <p><img src="http://i.stack.imgur.com/N6Y8I.png" alt="enter image description here"></p>
javascript jquery asp.net
[3, 5, 9]
5,528,841
5,528,842
In my android project there are two classes and there is a button on first class,i need to view next page when i click on the button.
<p>In my android project there are two classes and there is a button on first class,i need to view next page when i click on the button. </p> <p>package com.example.restaurantapp;</p> <pre><code>import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.view.View.OnClickListener; import android.support.v4.app.NavUtils; public class RestaurantActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_first); Button orderbutton=(Button)findviewById(R.layout.activity_first); orderbutton.setOnClickListener(new View.OnClickListener()); } private Button findviewById(int activityFirst) { // TODO Auto-generated method stub return null; } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_first, menu); { public void onClick(View v) { Intent intent = new Intent(RestaurantActivity.this,SecondActivity.class); startActivity(intent); } return true; </code></pre>
java android
[1, 4]
74,868
74,869
Extracting elements from a variable
<p>I have a string '<a href="http://this.is.my.url:007/directory1/directory2/index.html" rel="nofollow">http://this.is.my.url:007/directory1/directory2/index.html</a>' and I need to extract the string as below. Please advice the best way </p> <p>var one = <a href="http://this.is.my.url:007/directory1/directory2/index" rel="nofollow">http://this.is.my.url:007/directory1/directory2/index</a></p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
3,685,546
3,685,547
a jQuery image-group animation
<p>I've got a div with three same images.</p> <pre><code>&lt;div&gt; &lt;img class="movlights" src="files/images/movelights.png" alt="10 years logo" /&gt; &lt;img class="movlights sec" src="files/images/movelights.png" alt="10 years logo" /&gt; &lt;img class="movlights third" src="files/images/movelights.png" alt="10 yearslogo"/&gt; &lt;/div&gt; </code></pre> <p>Each has different "absolute" position in a way that all form a row and their parent div is overflowed - hidden.</p> <p>So I animate them moving together simultaneously as a group from left to right with this code:</p> <pre><code> $(function(){ movelights(); }); function movelights(){ for(x=0;x&lt;3;x++) { $('div img:eq('+x+')').animate({left: (1400 - x*800)},24000); } }; </code></pre> <p>My problem is: How to return an image on a certain starting position before the others by queuing it again when it passes the div's right edge so that the animated pattern repeats itself!</p> <p>So I'm interested in both:</p> <ul> <li>how to queue image from end of the line to beginning</li> <li>how to loop the animated pattern</li> </ul> <p>Hope I was clear enough English isn't my native language.</p> <p>Here's some additional code:</p> <pre><code>div{ width:1000px; overflow:hidden; position:relative; } all img{ display:block; position:absolute; left:120px; } img2{ left:-678px; } img3{ left:-1400px; } </code></pre>
javascript jquery
[3, 5]
4,609,439
4,609,440
Max length for bound field in gridview in ASP.Net
<p>I have to set maximum length for bound field in an editable gridview. For this i have used data format string property and also given ApplyFormatInEditMode="true" still it accepts invalid input. The gridview does not have template field, it contains bound fields only. I have written OnRowEditing and RowUpdating events. The dataformat string is DataFormatString="{0:N0}" but it accepts '2352345234523454352345' input also and displays server error while updating in database. I want to spcify maximum length for the textboxes generated dynamically when Edit button is clicked. </p>
c# asp.net
[0, 9]
4,435,839
4,435,840
Android-java vs PC-Java
<p>This simple line of code gives the error "The method getTextContent() is undefined for the type Element":</p> <pre><code>String color_string = ( ( Element )( ( Element )inner_node ).getElementsByTagName( "color" ).item( 0 ) ).getTextContent(); </code></pre> <p>I get the error in my Android-java version, but not in my PC-Java which I use for testing and debugging Java code before I run it on the phone.</p> <p>I have</p> <pre><code>import org.w3c.dom.Element; </code></pre> <p>on both versions. And I copied the code from the PC-Java to the Android-Java so I am 100% sure I have the same syntax on both.</p>
java android
[1, 4]
966,837
966,838
Can I run this nested functions in a better way?
<p>I was just wondering if I could run this functions in a better way, I mean I don't like the collection of functions in there :</p> <pre><code>setTimeout(function() { $(self.header_buttons_classes[0]).addClass(self.animations[15]); setTimeout(function() { $(self.header_buttons_classes[1]).addClass(self.animations[15]); setTimeout(function() { $(self.header_buttons_classes[2]).addClass(self.animations[15]); setTimeout(function() { $(self.header_buttons_classes[3]).addClass(self.animations[15]); setTimeout(function() { $(self.header_buttons_classes[4]).addClass(self.animations[15]); setTimeout(function() { $(self.header_buttons_classes[5]).addClass(self.animations[15]); }, 500); }, 500); }, 500); }, 500); }, 500); }, 500); </code></pre>
javascript jquery
[3, 5]
2,110,732
2,110,733
Script tag in ASPX page is not written
<p>I have an aspx page with the following code (partial and simplified):</p> <pre><code>(beginning of page) &lt;body id="body" runat="server"&gt; &lt;form id="form1" runat="server"&gt;some HTML&lt;/form&gt; &lt;script type="text/javascript"&gt; window.addEvent('domready', function() { var x = "nothing"; &lt;% if(someCondition){%&gt; x = "2"; &lt;%} else {%&gt; x = "3"; &lt;%}%&gt; }); &lt;/script&gt; &lt;/body&gt; </code></pre> <p>Now, the thing is that this script sometime appears in the output, and sometimes not.<br> It's not conditional, and supposed to be written every time the page is rendered. Why does it do that?</p> <p>I'd be happy to get your help. Thanks!</p>
c# asp.net javascript
[0, 9, 3]
210,307
210,308
Hide/show text box using jQuery
<p>I am using jquery for the first time ,so please help me out here. I've searched a lot but haven't found the answer to my question. I want it so that the text box is visible if the score value is not blank and for it to be hidden when the score value is null. The score value is inserted in the input field. Thanks in advance. This is my current code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $('#click').raty({ click: function(score) { //alert(score); } }); }); &lt;/script&gt; &lt;div class="inputs"&gt; &lt;div id="click"&gt;&lt;/div&gt; &lt;input type="text" name="type" id="type" style="display:none;" value="" /&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
2,196,428
2,196,429
generate age using calendar
<p>I have two Textboxes. In one Textbox I used an ajax calendar to find the date of birth and in the second Textbox I want to generate the age dynamically before submitting the form. I am using asp.net and c#. Could anyone please tell me how to do it?</p>
c# asp.net
[0, 9]
2,685,825
2,685,826
How easy/difficult is it to start using something like Python/Django in an existing Java project?
<p>I have a Java project which uses Java to access some 3rd party libraries. For other things I'd like to use something newer like Python maybe. Is it easy to incorporate into an existing project? How do people usually do that?</p> <p>Thanks, Alex</p>
java python
[1, 7]
5,231,608
5,231,609
Reload a .js file on selectedindex change event of dropdown in asp.net
<p>I have a dropdown inside update panel. On the selected index change event, i need to execute a .js file using c# or javascript How can i do this ?</p> <pre><code>&lt;asp:UpdatePanel ID="UP_Social_Ddl" runat="server"&gt; &lt;ContentTemplate&gt; &lt;div class="styled-select"&gt; &lt;asp:Label runat="server" ID="Label2" Font-Size="Small" ToolTip="Social : 'ON' will post your activity on this page to your FaceBook Wall." Text="Social :" Style="vertical-align: bottom;" /&gt; &lt;asp:DropDownList ID="ddlSocialSwitch" runat="server" AutoPostBack="true" Style="vertical-align: middle;" ToolTip="Social : ON will post your activity on this page to your FaceBook Wall." OnSelectedIndexChanged="ddlSocialSwitch_SelectedIndexChanged"&gt; &lt;/asp:DropDownList&gt; &amp;nbsp;&lt;a valign="bottom" onclick="logout_fb" href="#" id="auth-logoutlink"&gt;&lt;img valign="bottom" src="facebookLogOutButton.png"/&gt;&lt;/a&gt; &lt;asp:Label ID="lbl" Visible="false" runat="server"&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;/ContentTemplate&gt; </code></pre> <p></p>
c# javascript asp.net
[0, 3, 9]
718,026
718,027
Send commands between two computers over the internet
<p>I wish to control my computer (and usb devices attached to the computer) at home with any computer that is connected to the internet. The computer at home must have a program installed that receives commands from any other computer that is connected to the internet. I thought it would be best if I do this with a web interface as it would not be necessary to install software on that computer. For obvious reasons it would require log in details.</p> <p>So basically the problem is sending encrypted commands from a web interface to my computer at home. What would be the best method to achieve this and what programming languages should I use? I know Java, Python and C quite well, but have very little experience with web applications, such as Javascript and PHP.</p> <p>I have looked at web chat examples as it is sort of similar concept to what I wish to achieve, except the text can be replaced with commands. Is this a viable solution or are there better alternatives?</p> <p>Thank you</p>
php java python javascript
[2, 1, 7, 3]
2,577,366
2,577,367
File input: Compare file type and accept only picture formats (jpg, bmp, etc)
<p>I am currently trying ot find a way to use jquery to validate if a a file is in picture format <code>(jpeg,jpg,bmp,gif,etc)</code>. I have been able to figure out if the input is empty or not with simple <code>.length</code> comparison. How would I be able to check the file type and only accept valid picture formats.</p> <p><strong>Emtpy or not input:</strong></p> <pre><code>if ($.trim($('#textInput').val()).length == 0) { alert("Should Not Be Empty!"); } </code></pre>
javascript jquery
[3, 5]
1,350,156
1,350,157
java or php for developing database driven android app
<p>I have an existing PHP MySQL web app that I want to make an android app for to look up account info, get status info for work orders, upload photos, etc. </p> <p>I'm new to Android Dev and found a site phpforandroid.net that says I can use PHP to build android apps. 6 years ago I did a basic Java class n learned a little about Java, but not much. </p> <p>I want to have a login to the app, then present a menu to drill further into heir account info.</p> <p>My first choice would be PHP if the database interaction can happen, but I don't really know. Anyone else gone down the PHP db driven route, or is Java the way I should go? Any tutorials you would recommend?</p> <p>What are the community thoughts? THanks.</p>
java php android
[1, 2, 4]
3,848,922
3,848,923
How to find an object in an array of objects if some array elements are undefined?
<p>I have an array of objects with the following format:</p> <pre><code>obj = { ref: 8, id: "obj-8" } </code></pre> <p>and a function which uses jQuery's <em>grep</em> method to return an item from that array, by searching for the object <em>ref</em> property:</p> <pre><code>function returnObj(arr,r){ return $.grep(arr, function(elem,index){ return elem.ref == r; })[0]; } </code></pre> <p>If I use this function on an array that has undefined elements in it (they were previously deleted using the <em>delete</em> operator), I get the following error: <em>Uncaught TypeError: Cannot read property 'ref' of undefined</em>, which I assume is thrown when an undefined element is encountered.</p> <p>How can I modify the function so it doesn't break?</p>
javascript jquery
[3, 5]
608,694
608,695
How to install EtherPad
<p>This may be a silly question but how can I install the opensource version of etherpad on my site or a local server. I know the download page has instructions but im not sure how to utilize them. Is there a video that can help me do that or detailed steps? I have a little knowledge of PHP but im not sure how to get etherpad on a server or run locally.</p> <p>Thanks</p>
java php
[1, 2]
5,254,474
5,254,475
loop through input and select elements and hide the previous td
<p>The code below is looping through all the <code>input</code> and <code>select</code> elements inside a <code>div</code> and checking if the value is empty and then hiding it, it is working perfectly: </p> <pre><code>$("#customfields_1 :input").filter(function() { return $.trim(this.value).length === 0; }).hide(); </code></pre> <p>but now what I really want is to hide the previous <code>td</code>, something like this:</p> <pre><code>$("#customfields_1 :input").filter(function() { return $.trim(this.value).length === 0; }).prev('td').hide(); </code></pre>
javascript jquery
[3, 5]
3,876,191
3,876,192
Stackoverflow image uploader
<p>There is an awesome image uploader in stackoverflow. Im looking for a tutorial for creating application like this with php and jquery. Thanks</p>
php jquery
[2, 5]
1,295,607
1,295,608
How to Convert Long Data type to double data type in java?
<p>(isPlusClicked || op == '+'){</p> <pre><code> long result = 0; String finaldata = edt.getText().toString(); finaldata = finaldata.replace("(", ""); finaldata = finaldata.replace(")", ""); System.out.println(" the string is now ==== "+edt.getText().toString()); String[] total = finaldata.split("\\+"); System.out.println(" *************** "+total[0] + "************** "+total[1]); System.out.println(" the index in the string array are ..... "+sb.toString()); ArrayList&lt;String&gt; alvalue = new ArrayList&lt;String&gt;(); System.out.println(" the splited number is ==== "+total[0] +" the second number is "+total[1]); StringBuilder sb1 = new StringBuilder(edt.getText().toString()); int inc = 0; for(int i = 0;i&lt;sb1.length() ; i++){ char plus = sb1.charAt(i); if(plus == '+'){ String[] totaly = finaldata.split("\\+| \\++ | \\+++"); if(inc&gt;=1){ System.out.println(" *******inc value with result is ***************** "+result+"?&amp;&amp;&amp;&amp;&amp;&amp; "+inc); result = result + Long.parseLong(totaly[inc+1]); }else if(inc&lt;=0){ result = Long.parseLong(totaly[inc]) + Long.parseLong(totaly[inc+1]); //double myDouble = new Long(result).doubleValue(); System.out.println(" Second value is---- ---- "+totaly[inc+1]); } inc = inc +1; } edt.setText(""); edt.setText( String.valueOf(result)); } } </code></pre> <p>when i am put the value in double for example: 12345678+32164 than it's give me ans:5.12377842E8 and when i am try to convert in Long than 122.81+212.122 it give the Zero(0) Answer so please tell me What m i do? for correct answer </p>
java android
[1, 4]
3,742,520
3,742,521
jQuery audio buffered function throws DOM error
<p>I've got this little function to show the amount the audio has buffered. Its a pretty simple little thing and I am not sure why it is throwing the error <code>Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1</code>.</p> <pre><code>$(song).on('progress', function() { $("*[data-url='" + url +"'].body_container .player .load_progress").show(); var loaded = parseInt(((song.buffered.end(0) / song.duration) * 100), 10); $("*[data-url='" + url +"'].body_container .player .load_progress").css({width: loaded + '%'}); }); </code></pre> <p>I know this is a duplicate of things like <a href="http://stackoverflow.com/questions/2923564/uncaught-error-index-size-err">this</a> but i cannot get this to work properly. It seems to behave reasonably normally apart from the error of course. Only at times width is not drawn with the buffering as the seeker overtakes the buffering. Im on localhost so the audio does buffer instantly.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
2,219,150
2,219,151
What i am doing wrong with Class Overview?
<p>This code not work. Anyone can helpme?</p> <p>.java</p> <pre><code>package rfmsoftware.util.test1; import android.app.Activity; import android.os.Bundle; public class test1 extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button)findViewById(R.id.Button01); &lt;---- Error at this line !? } } </code></pre> <p>.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /&gt; &lt;EditText android:id="@+id/EditText01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10"&gt;&lt;/EditText&gt; &lt;Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/Scan"&gt;&lt;/Button&gt; &lt;View android:id="@+id/View01" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/View&gt; &lt;/LinearLayout&gt; </code></pre> <p>.error</p> <p>Button cannot be resolved to a type (type Java problem) ???</p>
java android
[1, 4]
2,367,054
2,367,055
wrap plain text inside a div before another html element
<p>Ok, that probably doesn't make a ton of sense... let me illustrate:</p> <p><code>&lt;div class="csl-entry"&gt; lorem ipsum yada yada yada... &lt;a title="some title" rel="external" href="http://google.com"&gt;Google&lt;/a&gt; &lt;/div&gt;</code></p> <p>I would like to wrap the "lorem ipsum yada yada yada..." in a <code>&lt;p&gt;</code> tag, but am unsure how to proceed without also wrapping the <code>&lt;a&gt;</code>. </p> <p>If it's easier to do in JavaScript or jQuery, I'm fine with that, too. Much of my site is semi-dependent on a bit of JS anyway.</p> <p>Thanks!</p>
php javascript
[2, 3]
208,380
208,381
Need help with build error
<p>Unable to copy file "..\Soln\Project1\Bin\Telerik.Web.UI.dll" to "bin\Debug\Telerik.Web.UI.dll". Access to the path 'bin\Debug\Telerik.Web.UI.dll' is denied. Project2</p> <p>I got two projects bound to one solution When I build Project2, it gives me the error above. How do I fix this ? I need to add reference of Project2 in Project1. But now that Project2 just won't build. I am unable to do that.</p>
c# asp.net
[0, 9]
3,865,483
3,865,484
How to apply jQuery methods to a javascript declared variable?
<p>I declare:</p> <p><code>var iframe = document.createElement("iframe");</code></p> <p>now I want to use this var <code>iframe</code> in order to apply jQuery methods:</p> <pre><code> $("iframe").on("load", function () { // DO SOMETHING }); </code></pre> <p>Like this does not work. How must I reference my <code>iframe</code>var</p> <p>UPDATE: I CAN NOT change the <code>iframe</code> declaration method.</p>
javascript jquery
[3, 5]
1,719,832
1,719,833
How to change the appearance of navigation menu when javascript disabled.
<p>I am re-building a website with a navigation menu that uses javascript, but when javascript is disabled the sub menu's list stack below. Is there anyway I make then disappear or change their colour to white so to blend in with the body background colour when the javascript is disabled? </p> <p>I have this problem with a carousel, a content slider also and jquery tabs. When I used to use Easy Slider I gave the list's individual id's and then in the css markup put the display to none and this worked, but it doesn't with any of these. </p> <p>Navigation menu I am using is <a href="http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/examples/" rel="nofollow">http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/examples/</a></p> <p>The content slider - <a href="http://webdeveloperplus.com/jquery/featured-content-slider-using-jquery-ui/" rel="nofollow">http://webdeveloperplus.com/jquery/featured-content-slider-using-jquery-ui/</a></p> <p>I've read an article about graceful degrading, but i don't really understand. Any help would be appreciated. thanks </p>
javascript jquery
[3, 5]
4,712,341
4,712,342
In ASP.Net C# would the Application end when and error occurs on the site or when Application_Error is triggered
<p>Hello brilliant guys on Stackoverflow, please I would like to know if in ASP.Net C# would the Application end when an error occurs or when Application_Error is triggered? From my understanding, it shouldn't, I just want to be double sure</p>
c# asp.net
[0, 9]
4,402,332
4,402,333
how to move the rows of grid view with out using Scrollbars in .Net
<p>when ever we add one row into the grid view control then already existing row will be move d down and new row will be added up .just like in twitter website.the rows will be automatically moved.</p>
c# javascript jquery
[0, 3, 5]
3,563,746
3,563,747
Why transfering global window parameter if it's a global one
<p>We have that basic <code>jQuery</code> script that use wrapper code, It initialized with the transfered global <code>window</code> parameter. Is it necessary transfering this parameter? <code>window</code> is a global parameter and you can use it from inside function if you transfer it or not.</p> <p>What is the reason for that?</p> <pre><code>(function (window, undefined) { var jQuery = (function () { //Define a local copy of jQuery var jQuery = function (selector, context) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init(selector, context, rootjQuery); }, //some code //... //... //... window.jQuery = window.$ = jQuery; })(window); </code></pre>
javascript jquery
[3, 5]
3,230,273
3,230,274
Dynamically including javascript files only once
<p>I have a javascript function I'm writing which is being used to include an external JS file, but only once. The reason I need such a function is because it is being called when some content is loaded via AJAX and I need to run page-specific code to that content (no, just using <code>.live</code> won't cover it).</p> <p>Here's my attempt, shortened for brevity:</p> <pre><code>$.include_once = function(filename) { if ($("script[src='" + filename + "']").length === 0) { var $node = $("&lt;script&gt;&lt;/script&gt;") .attr({ src : filename, type : "text/javascript" }) ; $(document.body).append($node); } }; </code></pre> <p>This works fine: the function is called, it loads the external file, and that file is being run when loaded. Perfect.</p> <p>The problem is that it will always re-load that external file: the query I'm using to check for the presence of the script always finds nothing!</p> <p>When debugging this, I added some lines:</p> <pre><code>alert($("script").length); // alerts: 4 $(document.body).append($node); alert($("script").length); // alerts: 4 </code></pre> <p>Looking in the dynamic source (the HTML tab of Firebug), I can't find the script tag at all.</p> <p>I know that I could maintain an array of files that I've previously included, but I was hoping to go with a method such as this, which (if it worked), seems a bit more robust, since not all the JS files are being included in this way.</p> <p><strong>Can anyone explain the behaviour seen in this second snippet?</strong></p>
javascript jquery
[3, 5]
2,950,671
2,950,672
PHP form wont submit
<p>I have a simple form:</p> <pre><code>&lt;form name ="Add" action="Add-Results.php" method="post"&gt; &lt;label for="name" class="smallfont"&gt;Name&lt;/label&gt; &lt;input type="text" name="name" size="30" /&gt; &lt;label for="name_error" class="error"&gt;Please enter a name&lt;/label&gt; &lt;input type="image" name="submit" src="../Content/Images/login-submit.gif"&gt; &lt;/form&gt; </code></pre> <p>Which works fine until I add in the following jquery</p> <pre><code>$(document).ready(function() { $(".error").hide(); $("input[name=submit]").click(function() { $(".error").hide(); var name = $("input[name=name]").val(); if (name == "") $("label[for=name_error]").show(); return false; }); }); &lt;/script&gt; </code></pre> <p>When I put in the jquery nothing happens when I click the submit. When I take out the jquery the form posts without a problem. Any ideas?</p>
php jquery
[2, 5]
953,438
953,439
How exactly can Python compliment your C# skills for windows based development?
<p>I'm looking for a fun challenge, and am thinking about learning Python. I've heard really good things about the language. My question is, how (if at all) can Python compliment the skills of a typical C# developer working mainly with MS technologies on a Windows Platform. </p> <p>Some examples of typical C# dev on windows would be (SOA applications, web applications, windows services, automation, xml handling)</p> <p>Surely there must be some scenarios where knowing Python would help you get certain tasks done quicker or more efficiently than using traditional C# / MS technologies. </p> <p>If you know of any specific scenarios, then please share. </p>
c# python
[0, 7]
3,207,094
3,207,095
asp.net ExpressionBuilder: Possible to wire up an event?
<p>I have used ExpressionBuilders here and there within my asp.net markup to return simple data types.</p> <p>Does anyone have any ideas how an ExpressionBuilder might be used to wire up an event inline? Or can ExpressionBuilders only return literals?</p> <p>I would like to wire up the OnLoad event (or any event) by creating an ExpressionBuilder (named AutoBind in my example). Any ideas if this can be done?</p> <pre><code>&lt;asp:DropDownList ID="DropDownList1" runat="server" DataSource='&lt;%# GetRecords() %&gt;' DataTextField="Name" DataValueField="ID" OnLoad="&lt;%$ AutoBind: this.DataBind() %&gt;" /&gt; </code></pre>
c# asp.net
[0, 9]
5,607,431
5,607,432
How can I update the background color of a dynamic input control?
<p>I'm successfully creating some dynamic input textboxes using the following javascript:</p> <pre><code>var type = "Textbox"; var foo = document.getElementById("fooBar"); for (i = 1; i &lt;= totalQty; i = i + 1) { var textbox = document.createElement("input"); //Assign different attributes to the element. textbox.setAttribute("type", type + i); //textbox.setAttribute("value", type + i); textbox.setAttribute("name", type + i); textbox.setAttribute("id", type + i); textbox.setAttribute("style", "width:300px"); textbox.setAttribute("width", "300px"); //Append the element in page (in span). var newline = document.createElement("br"); foo.appendChild(newline); foo.appendChild(textbox); } </code></pre> <p>Everything works fine with that. Once the user keys in data and clicks submit however, I need to go back and set the background-color of any textboxes with an error to red. I found some code to do the actual coloring:</p> <pre><code>textbox.style.backgroundColor = "#fa6767"; </code></pre> <p>...and I know the exact name of the textbox with the error (i.e. "Textbox1", "Textbox2", "Textbox3", etc) but I'm not sure how to programatically assign this background color code to the specific textbox. I can't use something like this, since all code is dynamically generated:</p> <pre><code>errorTextbox = $("#Textbox1"); </code></pre> <p>Any suggestions?</p>
javascript jquery
[3, 5]
264,885
264,886
Unable to call JavaScript on Action Menu Items
<p>I am new to JavaScript.</p> <p>In my code behind I have this code block:</p> <pre><code>if (!Page.IsCallback) { List&lt;String&gt; itemIds = new List&lt;string&gt;(); itemIds.Add(DELETE_ACTION); this.Page.ClientScript.RegisterStartupScript(GetType(), "SetItemClickConfirmJS", SetItemClickConfirmJS(itemIds, DELETE_CONFIRM_MSG), true); } </code></pre> <p>The function I am using is as follows :</p> <pre><code> private string SetItemClickConfirmJS(List&lt;String&gt; itemIds, string message) { StringBuilder sb = new StringBuilder(); sb.Append("function addItemClickConfirm(menuId, itemId)"); sb.Append("{"); //sb.Append(" debugger;"); sb.Append(" var item = igmenu_getItemById(itemId);"); sb.Append(" var menu = igmenu_getMenuById(menuId);"); sb.Append(" switch(item.getText())"); sb.Append(" {"); foreach (string itemId in itemIds) { sb.AppendFormat(" case '{0}':", itemId); sb.Append(" {"); sb.AppendFormat(" if(confirm('{0}'))", message); sb.Append(" {"); sb.Append(" Menu_ItemClick(menuId, itemId)"); sb.Append(" }"); sb.Append(" else"); sb.Append(" {"); sb.Append(" menu.NeedPostBack = false;"); sb.Append(" menu.CancelPostBack = true;"); sb.Append(" }"); sb.Append(" break;"); sb.Append(" }"); } sb.Append(" default: "); sb.Append(" Menu_ItemClick(menuId, itemId)"); sb.Append(" }"); sb.Append("}"); return sb.ToString(); } </code></pre> <p>When I click on the Menu Button a message pops up but when I click on the OK button on that Popup message block I get the following error</p> <p>[FormatException: String was not recognized as a valid Boolean.]</p> <p>. Please help.</p> <p>Thanks!</p>
c# javascript asp.net
[0, 3, 9]
3,592,111
3,592,112
To building a jQuery web widget for other domains
<p>I spent two days to develop a web widget for other domains but I didn't get any success. I found a <a href="http://alexmarandon.com/articles/web_widget_jquery/" rel="nofollow">tutorial</a> to develop a widget that is quite useful but my problem is:</p> <p>If user clicks on my widget button then the widget will check the login status. If the user is not loggedin then a popup window will open and ask for username and password. If the user successfully logged in to widget origin then the parent window will automaticaly refresh and show the data on the place of widget button.</p> <p>I have created the widget in jQuery to open the popup window but not able to refresh the parent window of popup.</p>
php jquery
[2, 5]