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
3,979,186
3,979,187
Show the server-side generated HTML in a new window
<p>What is the best way to show the server-side generated HTML (full page) into a new popup window? It should be triggered upon clicking a button (causing a postback to the server).</p> <p>Thanks</p> <p>Edited:</p> <p>The HTML content are dynamically generated in the code behind and the content is full page (<code>&lt;html&gt; ... &lt;/html&gt;</code>). Upon clicking a button on the web page, I would like to get the generated html content and pass it to the browser and show it in a new popup window. The content will be the final result (UI) not HTML tags.</p>
c# javascript asp.net
[0, 3, 9]
2,852,313
2,852,314
How to disable the back button in browser when user logout in asp.net c#
<p>Our problem is we are able to clear session on logout.</p> <p>But if a user clicks the back button then he/she can go through all previous screens.</p> <p>But the advantage is that on a single click on any of of such previously surf page bring user to login page back ,we had done that. But our requirement is we should no allow user to go through the previously surf page.</p>
c# asp.net
[0, 9]
1,960,113
1,960,114
up and down arrow is not working for list item. onkey input search
<p>/* up and down arrow is not working for list item. on key input search */ </p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="input1" value="" /&gt; </code></pre> <p>/* up and down arrow is not working for list item. on key input search */ </p> <pre><code> &lt;ul id="testing"&gt; </code></pre> <p>/* up and down arrow is not working for list item. on key input search */ </p> <pre><code> &lt;li tabindex="0"&gt; testing test&lt;/li&gt; &lt;li tabindex="1"&gt; testing&lt;/li&gt; &lt;li tabindex="2"&gt; testing&lt;/li&gt; &lt;li tabindex="3"&gt; testing&lt;/li&gt; &lt;/ul&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
2,941,440
2,941,441
jquery or js code to obtain exact node data for currently selected form item/text/image in a web page
<p>I want to obtain the exact details for the item on a web page that has been clicked on, using jquery.</p> <p>That item can be a form item (like a checkbox, text box, text area etc) or section of text (in a paragraph or div or other) or list or image ...</p> <p>What I figured out is the following--</p> <pre><code>$(function(){ $('*') .bind('click', function(event) { //now obtain details of item that has been clicked on... }); }); </code></pre> <p>Now, I want the exact details- viz the div id/form id/paragraph #, ie all details for that particular item. How do i get this data? I understand that this data is available in the DOM but I just dont know how to get it in this particular case...</p>
javascript jquery
[3, 5]
2,854,286
2,854,287
handling event bubling in jquery
<p>iam having links as shown below</p> <pre><code>&lt;a item='1' href='javascript:void(0)'&gt;&lt;img class='icon1' /&gt;&lt;span&gt;text1&lt;/span&gt;&lt;/a&gt; &lt;a item='1' href='javascript:void(0)'&gt;&lt;img class='icon2' /&gt;&lt;span&gt;text2&lt;/span&gt;&lt;/a&gt; &lt;a item='1' href='javascript:void(0)'&gt;&lt;img class='icon3' /&gt;&lt;span&gt;text3&lt;/span&gt;&lt;/a&gt; &lt;a item='1' href='javascript:void(0)'&gt;&lt;img class='icon4' /&gt;&lt;span&gt;text4&lt;/span&gt;&lt;/a&gt; $(function(){ $('a').click(_handleClick); }); function _handleClick(e) { var _item=$(e.target).attr('item'); // do something with _item variable } </code></pre> <p>// now my problem is when user clicks on image 'e' received in _handleClick is image so i can't read attr='item' so how can bubble the event to read that value.</p>
javascript jquery
[3, 5]
4,167,826
4,167,827
URL Rewriting in Response Filter
<p>We are attempting to rewrite some URLs in our response for an outside proxy server. We noticed that the response is being broken up as it goes through the response filter. We then use regular expressions to locate the URLs and rewrite them. The issue we ran into is that the way that it is broken up (not exactly sure how it gets segmented), we had one URL that was being cut in half between the chunks, and so our regular expression didn't pick it up in either chunk and it was not rewritten.</p> <p>Ex.</p> <p>End of Chunk1</p> <pre><code>"...&lt;body&gt;&lt;a href="http://myserver.local/"&gt; </code></pre> <p>Start of Chunk2</p> <pre><code>"path/file.aspx"&gt;Some link&lt;/a&gt;..." </code></pre> <p>So our regular expression doesn't pick up the link as a valid URL. We tried pooling our response into a StringBuilder to make sure we have the whole response before we attempt to rewrite the URLs, but that is resulting in the viewstate being corrupted. Any ideas?</p>
c# asp.net
[0, 9]
611,529
611,530
jQuery html() doesn't work well in IE9
<p>I use jquery to request data and then fill them to a table whose id is 'mresholder', it works in webkit and ff but it doesn't work well in IE. It will append those data behind <code>&lt;/table&gt;</code>.<br> How to solve this or what's the alternative way to do this?</p> <pre><code>for(i=0;i&lt;length;i++) { song=data.results[i]; o=$('#mresholder').html(); $('#mresholder').html(o+='&lt;tr sid='+song.song_id+' aid='+song.album_id+'&gt;&lt;td class="sname"&gt;'+song.song_name+'&lt;/td&gt;&lt;td class="sartist"&gt;'+song.artist_name+'&lt;/td&gt;&lt;td class="salbum"&gt;'+song.album_name+'&lt;/td&gt;&lt;/tr&gt;'); }; </code></pre>
javascript jquery
[3, 5]
4,726,241
4,726,242
Using Linq to aggregate from array to single var
<p>I have an accordion that binds data for each item from an array. I want that for every time that I bound the data I will loop through all of the array and aggregate all of the items with the same id and create a long string with a name from a cell. In the code the name <code>oneJob.order_id</code> does not exist and I don't know why.</p> <pre><code>protected string GetAllProffesions(int orderID) { IEnumerable&lt;string&gt; allProf; orderID = 544; Job[] curItems = null; curItems = JobManager.GetJobs(RangeID, GetParam()); allProf = from oneJob in curItems where oneJob.order_id == orderID select oneJob.profession_name; return Convert.ToString(allProf); } </code></pre>
c# asp.net
[0, 9]
669,530
669,531
how to add new datatable to dataset at first position
<p>i have one dataset with 3 data tables again i have to add one more data table in same dataset at first position(Ex:mydataset.tables[0]th position) .can any one help me regarding this.</p>
c# asp.net
[0, 9]
1,346,996
1,346,997
How can a block diagram be dynamically generated in ASP.NET?
<p>Based on the data, I need to dynamically generate a graphic in my ASP.NET page. What is the best way to do this. Is this easier to implement in Silverlight.</p>
c# asp.net
[0, 9]
5,146,589
5,146,590
Sequential AJAX request processing and storage
<p>I'm trying to write a script to sequentially pull data from printers that have a web interface. There are over 500 on a large local network, hence the reason I'd like to call out to the next one once the previous returns (successful or not). I'm having difficulties wrapping my head around callbacks ...if that's the best solution.</p> <p>Here's where I currently stand (be kind, this is my intro to jQuery/Javascript and this is a proof test). Also, is there a way to build an array from the resulting calls? The reason I've turned to Javascript is that I could not get PHP to behave with the execution times.</p> <p>Oh, you'll see ASYNC: true below only because I tried w/ false and it did not work (return anything).</p> <pre><code>function pingDevice(prnList) { prnList = ["www.google.com", "amazon.com", "facebook.com", "as923f.com"]; document.getElementById("myDiv").innerHTML="please wait..."; $(prnList).each( function(index,printer) { $.ajax({ type: "GET", dataType: "html", url: "pingTest.php?ping="+printer, async: true, success: function (data) { $('#myDiv').append( $('&lt;div class="prn"&gt;&lt;/div&gt;').html(data) ); $prnResults[printer] = data; }, error: function () { $prnResults[printer] = data; } }); }); $('#myDiv').append( $('&lt;div class="prn"&gt;&lt;/div&gt;').$prnResults ); } </code></pre>
javascript jquery
[3, 5]
592,049
592,050
dynamic data one by one
<p>I'm displaying dynamic data in slider can any one tell me how can i show them one by one. I want to show data of first cell first and then it's fade in and then I want to show data of second cell after fade out on left under testimonial. Here is link <a href="http://184.173.9.8/~intellis/sifrek/services.php" rel="nofollow">sifrek</a> </p>
php javascript jquery
[2, 3, 5]
2,515,538
2,515,539
How can i change the background color or apply an color to an Item in Drop down list
<p>Hi all i am having a drop down list with some items now while checking the items from the list and if that item exists in the drop down i would like to apply color for that particular item.</p> <p>Assume i have my drop down as follows</p> <pre><code> 123 1234 12345 </code></pre> <p>Now if i found <code>123</code> i would like to apply color for that particular element any help please</p>
c# asp.net
[0, 9]
5,177,426
5,177,427
Excuting Javascript Commands From Cs
<p>Is there a way that I can call a function like (fadeIn or fadeOut) from the .cs?</p> <p>So thats my situation - I have a datalist of stuff. When A user clicks something on the list, it gives him some details about the thing he clicked and if he wants it, he clicks it again.</p> <p>now, on the first click I changed the OnClientClick of the button to fadeOut the datalist. so on the second click (after he confirms the item) it fades out.</p> <p>Problem is - If he clicks one thing than click another thing, the fadeOut occurs.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,445,771
5,445,772
Jquery modification to add 1 and save the number in a txt file on every click
<p>I am using the following click function for a purpose. What can I add so it will add 1 in a txt file when it is clicked? Like a counter on how many times it was clicked.</p> <p>Thank you</p> <pre><code>$("#clearme").click(function(e) { e.preventDefault(); // i have some stuff here }); </code></pre>
javascript jquery
[3, 5]
2,673,485
2,673,486
Disabled JavaScript in IE6 still not able to see the script code?
<p>I m a beginner. This is more related to different options i was trying to learn.</p> <p>I just took example </p> <pre><code> &lt;!-- document.write("&lt;h1&gt;Hello World&lt;/h1&gt;"); //--&gt; </code></pre> <p>It was stated that we should use this tags to avoid the script display in browser if javascript is disabled. So Disabled Javascript By following steps as</p> <p>Click on the Tools menu Choose Internet Options... from the menu Click the Security tab on the Internet Options pop up Click the Custom Level... button to access your security settings Scroll almost all the way down to the Scripting section Select the Enable button for Active scripting Click OK to finish the process Click Yes when asked to confirm</p> <pre><code> document.write("&lt;h1&gt;Hello World&lt;/h1&gt;"); </code></pre> <p>Then i removed the tags and now i was expecting that i will be able to see the error that is script</p> <pre><code> "document.write("&lt;h1&gt;Hello World&lt;/h1&gt;");" </code></pre> <p>displayed as it is as Javascript is disabled and tags are removed. But what i see is nothing displayed empty page. Can some1 help me understand this?</p>
javascript asp.net
[3, 9]
2,579,735
2,579,736
Calling a javascript function on a php variable
<p>Javascript:</p> <pre><code>function capitalizeFL(string) { return string.charAt(0).toUpperCase() + string.slice(1); } </code></pre> <p>PHP:</p> <pre><code>echo "You have chosen a &lt;script&gt;document.write(capitalizeFL(".$race."));&lt;/script&gt;"; </code></pre> <p><code>$race</code> contains a string. What I would like is simply to capitalize the first letter of the php variable <code>$race</code>, using the Javascript function above, and print it on the page.</p> <p>I could find another way of doing this, but this JS-PHP mixing thing is confusing to me and I'd very much like to figure out WHY this doesn't work.</p>
php javascript
[2, 3]
4,415,525
4,415,526
Handling files uploaded with a size greater than maxRequestLength in web.config
<p>In my web.config, I have the file upload size limited to 10 MB:</p> <pre><code>&lt;httpRuntime maxRequestLength="10000" /&gt; &lt;!-- file size limit in KB --&gt; </code></pre> <p>On my page, I'm checking to see that the user doesn't upload a file larger than 5 MB:</p> <pre><code>protected void cvImageSize_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = (fupFile.PostedFile.InputStream.Length &lt;= 5000000); } </code></pre> <p>If a user tries to upload a 3 MB file, it uploads fine. If a user tries to upload a 7 MB file, they are shown the error message from cvImageSize.</p> <p>If a user tries to upload a 13 MB file...the site crashes. I'm not sure exactly what happens, Firefox gives me the page saying "<strong>The connection was reset. The connection to the server was reset while the page was loading.</strong>"</p> <p>Is there some exception I can catch when the user tries to upload a file with a size greater than the maxRequestLength? I'd like to show the user an error message on the page instead of the site basically crashing.</p>
c# asp.net
[0, 9]
137,885
137,886
printing a hidden tag on the page with jquery
<p>i have some tr tags with a checkbox in each and when the user clicks on any of the checkboxes i want the content from that tr to be written anywhere on the page</p> <p>Here is the HTML:</p> <pre><code>&lt;tr class="gradeA odd"&gt; &lt;td&gt;&lt;input id="instance_selected0" name="instance_selected0" value="2" type="checkbox"&gt;&lt;/td&gt; &lt;td&gt;September 15, 2010&lt;/td&gt; &lt;td&gt;Melbourne Vic&lt;/td&gt; &lt;/tr&gt; &lt;tr class="gradeU even"&gt; &lt;td&gt;&lt;input id="instance_selected1" name="instance_selected1" value="2" type="checkbox"&gt;&lt;/td&gt; &lt;td&gt;Thursday September 16, 2010 at 07:00 PM&lt;/td&gt; &lt;td&gt;Sydney Nsw&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>So if the user clicks on the first checkbox i need this to be inserted in the page in the div class .fields. this div is already on the page and its empty currently.</p> <p>This is what i need to be inside it</p> <pre><code>&lt;input id="request_venue" name="request[venue]" type="hidden" value="Melbourne Vic" /&gt;&lt;/div&gt; &lt;input id="request_showdate" name="request[showdate]" type="hidden" value="September 15, 2010" /&gt; </code></pre> <p>any ideas</p>
javascript jquery
[3, 5]
658,351
658,352
Why are backward slashes removed from querystring - ASP.NET & Javascript
<p>I am trying to generate a URL that contains a UNC path as one of the query string variables. The URL will open in a pop up window when an ASP.NET button control is clicked by the user. When the clicks the button, the backwards slashes are removed from the UNC path causing the page to break.</p> <p>The button renders correctly in the page source file with all the backward slashes.</p> <p>Is there any way to prevent this?</p> <p>Here is my source code:</p> <p>Code behind:</p> <pre><code>string unc = @"\\myserver\myfolder\myfile.txt"; string url = string.Format("http://www.mysite.com/page.aspx?a={0}", unc); MyButton.Attributes.Add("onclick", @"javascript:FullPop('" + url + @"')"); </code></pre> <p>ASPX page</p> <pre><code>&lt;script language="javascript" type="text\javascript"&gt; function FullPop(Newurl) { Win = window.open( Newurl,"Monitor", "fullscreen=0,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=800,height=600,top=50,left=50"); Win.focus(); } &lt;/script&gt; &lt;asp:button id="MyButton" runat="server" cssclass="mycss" text="View Actual Target" /&gt; </code></pre> <p><b>Update</b></p> <p>Server.UrlEncode does not work. Same behavior.</p> <p><b>Update 1</b></p> <p>Based on Daniel Lew's answer, I developed the following solution:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { string unc = @"\\myserver\myfolder\myfile.txt"; string url = string.Format("http://www.mysite.com/page.aspx?a={0}", unc); MyButton.Attributes.Add("onclick", @"javascript:FullPop('" + this.EscapeforJavaScript(url) + @"')"); } private string EscapeforJavaScript(string url) { return url.Replace(@"\", @"\\"); } </code></pre>
c# asp.net javascript
[0, 9, 3]
5,498,911
5,498,912
simple javascript "feature" panel
<p>I'm working on a free template which has a featured Div...</p> <p>www.subigya.com/test/durbarsquare</p> <p>"In the Spotlight" is the featured div.</p> <p>I have simple jQuery js in there to switch the images. How do I switch the heading &amp; <p> related to each div in the switch. Right now, only the images switch and not the text.</p> <p>The script used is feature.js and the stylesheet is style.css</p>
javascript jquery
[3, 5]
5,606,695
5,606,696
creating Web User Control and adding it to tool box
<p>I'm trying to learn how create a web user control so i can use in diffrent projects. I created a simple control just to see how it worked; after I created it, I could add it to any page on the current project and it worked fine. </p> <p>My problem is how can I add this control to the tool box so I can use it in diffrent projects? I tried to look for him by doing:</p> <pre><code>right click toolbox &gt; choose items &gt; looking for it. I can't see the control in the list. </code></pre> <p>What do i need to add so i can see it?</p> <p><a href="http://stackoverflow.com/questions/288047/user-controls-not-showing-up-in-the-toolbox">Here is the same question</a> but nothing help me :( I'm using visual studio 2010.</p>
c# asp.net
[0, 9]
4,459,627
4,459,628
How do I enable chrome debugging when inserting a script tag into the head using jquery
<p>I came across this case while trying to dynamicly load a bunch of script files, and where I was getting no errors returned when the JavaScript was failing. This will hopefully save someone a lot of time.</p> <p>How do I enable chrome debugging when inserting a script tag into the head using jquery. This does not allow for debugging (no errors are returned).</p> <pre><code>$(function(){ $('head').append('&lt;script type="text/javascript" src="example.js"&gt;&lt;/script&gt;'); }); </code></pre>
javascript jquery
[3, 5]
4,235,812
4,235,813
ASP.NET validate
<p>I want to validate an asp.net texbox with min char=3, max=10 and no special characters. I do not want to use a plugin of jQuery but plain jQuery</p> <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>How do I about it. </p> <p>P.S - I asked the question earlier then edited it, but can't find the question now. Seems like it did not get posted.</p>
asp.net jquery
[9, 5]
1,552,871
1,552,872
refer to an image with an array content
<p>how is it possible to refer to an image with an array index at the end of the image name? Here is the code i would like to work (doesnt though...:()</p> <pre><code>for (int i = 0; i &lt; melodiToner.length; i++) setImageResource(R.drawable.gronpil+melodiToner[i]); </code></pre> <p>i.e I would like to load image <code>gronpil1.png</code> in the first loop, <code>gronpil2.png</code> in the second. This isnt relative to the array content, I need some other file name endings so i cannot use the i variable, it has to be from the array.</p> <p>Thanks for all help!</p> <p>Andreas</p>
java android
[1, 4]
1,098,985
1,098,986
Why does a dialog seemingly have its one thread?
<p>I'm new to advanced programming - but from what I've read, all my android programs are on one thread. </p> <p>This means, only one line of code or method/function can be executed at a time before moving on to the next line (that's what I thought anyway). </p> <p>However, I'm using a custom dialog to develop this application and yet, the program continues even after the dialog has ran. I'd like my program to wait for the dialog to close so that I can receive the input and manipulate it.</p> <p>This seems fairly straightforward when programming in Java (e.g. the Scanner tool waits for the user input before proceeding as opposed to running the code following it while it waits for user input).</p> <p>How can I do this? </p>
java android
[1, 4]
6,000,920
6,000,921
I want to use 2 dropdown list in a way so that second dropdown list show remaining items of the first dropdown list except the selected one
<p>I want to use 2 dropdown list in a way so that second dropdown list show remaining items of the first dropdown list except the selected one. if u have the solution please send to me at [email protected] as soon as possible. </p>
c# asp.net
[0, 9]
4,260,679
4,260,680
jQuery simple modification to disable click on image when it was clicked once
<p>jQuery simple modification to disable clicking</p> <p>The following jQuery make use of an image submit button of a the JqPostForm form to post. </p> <p>How to change the image from image1.png to image3.png when clicked and disable further clicking ? and how to remove the Thank you message after 2 sec ?</p> <p>There is no need of keeping the form.</p> <pre><code>&lt;script&gt; $(function(){ $("#JqPostForm").submit(function(e){ e.preventDefault(); $.post("add.php", function(data){ $("#message_post").html("Thank you"); }); }); $('#submit').hover( function(){ // Change the input image's source when we "roll on" $(this).attr({ src : 'image2.png'}); }, function(){ // Change the input image's source back to the default on "roll off" $(this).attr({ src : 'image1.png'}); } ); }); &lt;/script&gt; &lt;form id="JqPostForm"&gt; &lt;input type="image" name="submit" id="submit" src="image1.png"&gt; &lt;/form&gt; &lt;div id="message_post"&gt;&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,369,614
3,369,615
Pros and cons of using a Thread or TimerTask for an Android game
<p>Many Android game examples utilize a Thread to run a game engine on a particular interval. However, I've seen some other examples that use a TimerTask to run the game engine interval as well. I'm curious as to what other developers think the pros and cons of each approach are.</p>
java android
[1, 4]
4,992,961
4,992,962
Jquery selector data retrival in variable, in another different page
<p>How can we use Jquery to read certain page content in a variable on a different page? If for example we want to read div.tag1 from a page into another page but in a variable( ie i dont want to load it into the page but manipulate it so store it in variable)</p> <p>Eg: file1.html have(say)</p> <pre><code>&lt;div class="tag1"&gt; Hello world &lt;/div&gt; &lt;div class="tag2"&gt; Hello Boys &lt;/div&gt; &lt;div class="tag3"&gt; Hello Girls &lt;/div&gt; </code></pre> <p>Now I want page2 to have Jquery script that will store the content of div.tag1 in a variable.</p> <p>This is what I need in file2.html : // without loading it to any page ie without using load.</p> <pre><code>&lt;script type="text/javascript"&gt; var filename = "file1.html"; var myData = // Code to retrieve div.tag1 from file1.html( ie filename) document.write(myData); // for the time being.. later it will go in Database. </code></pre> <p></p> <p>Any help will be appreciated.</p>
javascript jquery
[3, 5]
2,066,634
2,066,635
where can I find the slider in http://www.pipilika.com/home.php?
<p>what is the name of the slider used under the horizontal menu in <a href="http://www.pipilika.com/home.php" rel="nofollow">http://www.pipilika.com/home.php</a> ?</p> <p>where can I find it plz?</p> <p>thanks in advance</p>
php javascript jquery
[2, 3, 5]
5,373,188
5,373,189
How to get alert message when user click on outside panel in asp.net
<p>I have form in which I have several controls. My concern is that when I filling values in Panel1 , &amp; click on any other control or space outside panel1 .How can I get alert message. I am working in asp.net</p>
c# javascript asp.net
[0, 3, 9]
6,002,973
6,002,974
javascript date + 1
<p>How do I take today's date and add 1 day to it?</p> <p>If possible, inline please?</p>
javascript jquery
[3, 5]
1,761,198
1,761,199
How to block a php script from being executed directly from address bar?
<p>I have something like this:</p> <pre><code>$.getJSON('/scripts/commons/theScriptDoTravelBackInTime.php',{ }, function(){ // etc.. etc... } }); </code></pre> <p>Is there a way to stop the php script from being executed simply by a direct call in the address bar like <a href="http://www.myserver/scripts/commons/theScriptDoTravelBackInTime.php" rel="nofollow">http://www.myserver/scripts/commons/theScriptDoTravelBackInTime.php</a> ?</p> <p>Maybe outputting an echo "Hey no cheating !"</p>
php jquery
[2, 5]
5,690,233
5,690,234
How to call a function in jquery?
<p>I wanted to my code a bit cleaner so I wanted to put a very long function in it's own method.</p> <p>Right now I have</p> <pre><code>$('#Id').submit(function() { // lots of code here }); </code></pre> <p>now I wanted to break it up like</p> <pre><code> $('#Id').submit(MyFunction); function MyFunction() { // code now here. } </code></pre> <p>but I need to pass in some parms into MyFunction. So I tried</p> <pre><code>$('#Id').submit(MyFunction(param1, param2)); function MyFunction(param1, param2) { // code now here. } </code></pre> <p>But when I do this nothing works. Firebug shows me some huge ass error about F not being defined or something. So I am not sure what I need to do to make it work.</p>
javascript jquery
[3, 5]
476,400
476,401
Custom Membership Provider for asp.net using c#
<p>How i can realise my own Membership Provider for my social network example project where i want to use more extended registration with new fields? Thanks. </p>
c# asp.net
[0, 9]
5,806,339
5,806,340
ASP.NET 1.1 issue
<p>For some reason I cannot add a server control onto a specific asp.net form. If I make an attempt to do this, I get the following error when selecting from the datagrid: Index was out of range. Must be non-negative and less than the size of the collection </p> <p>I have checked the values and they are all non negative and this exact select works if I restore the page back to the original form from source control. </p> <p>How do server controls affect the index property of a datagrid? </p> <p>here is where the code fails:</p> <pre><code>int _indiv; int _index; index = e.Item.ItemIndex; indiv = Convert.ToInt32( (grd_associateSearch.DataKeys[e.Item.ItemIndex]).ToString()); </code></pre> <p>I cannot get past the last line with an additional server control on the page and the code works flwlessly without it.</p>
c# asp.net
[0, 9]
4,507,440
4,507,441
Replace last occurence of character in string
<p>Is there an easy way in jQuery to replace the last occurence of an '_' (underscore) in a given string?</p>
javascript jquery
[3, 5]
3,625,761
3,625,762
How to get the simple name of the ZipEntry?
<p>I would know if is it possible to get the simple name from a <code>ZipEntry</code>...</p> <p>When I invoke the <code>getName()</code> of the Entry, I get a full path name.</p> <p>I need get only the file's name.</p> <p>Here I need get the simple name instead the full name with its root.</p> <pre><code>public class ZipFileSample { public static void main(String[] args) { try { ZipFile zip = new ZipFile(new File("C:\\Users\\Levi\\Desktop\\jessica.zip")); for (Enumeration e = zip.entries(); e.hasMoreElements(); ) { ZipEntry entry = (ZipEntry) e.nextElement(); //Here I need to get the simple name instead the full name with its root System.out.println(entry.getName()); } } catch (ZipException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } </code></pre>
java android
[1, 4]
1,457,449
1,457,450
How to handle global state with clean up in android
<p>I am working on an android app which has some global state (including several <code>SoundPool</code>s, which take a while to load) and I'm looking to find the best way of managing this. So far I can see two options, neither of which are perfect:</p> <ol> <li><p>Store the state in my main <code>Activity</code> - this hooks into the <code>Activity</code> lifecycle nicely (with opportunity to cleanup), and over screen rotations I can use <code>onRetainNonConfigurationInstance</code> and <code>getLastNonConfigurationInstance</code> to retain the state, however when navigating between activities this state will be completely lost and have to be re-loaded, which will be unacceptably slow</p></li> <li><p>Store the state in a global singleton or an <code>Application</code> subclass - this allows the state to persist over navigation between activities, but because Application doesn't have an <code>onDestroy</code> event there is no opportunity to release the <code>SoundPool</code>s</p></li> </ol> <p>Any suggestions on a better way to do this? Or should I not worry about releasing the SoundPools when the app is stopped/killed?</p> <p>Thanks, Chris</p>
java android
[1, 4]
4,305,750
4,305,751
How to detect when certain div is out of view
<p>I just saw something very interesting in vk.com</p> <p>Basically in profile page the right column is changing its width when the left column is gone of the view.</p> <p>Example : <a href="http://vk.com/durov" rel="nofollow">http://vk.com/durov</a></p> <p>Just scroll down a little bit to see it.</p>
javascript jquery
[3, 5]
1,396,791
1,396,792
I want to display a circular progress indicator using jquery in asp.net when textbox textchange event occurs
<p>I want to display a circular progress indicator using jquery in asp.net when textbox textchange event occurs. When user enters some value in a textbox and textchange event occurs or when user loses the focus on that textbox, system checks values in databases. I want to give user a progress indicator type when query is in progress.</p> <p>How can I accomplish this with jquery?</p> <p>Code here:</p> <pre><code> $("#Txturl").blur(function() { $.ajax({ type: "POST", url: "Default.aspx/Getvalue", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", async: true, success: function(msg) { ///to to do here? i ve no idea; } }); return false; }); </code></pre>
asp.net jquery
[9, 5]
3,372,114
3,372,115
VideoView in ListView
<p>Is it possible to use the VideoVideo with the ListView as an item. Has anyone done this? Are there any issues I should be aware of?</p>
java android
[1, 4]
3,406,587
3,406,588
Dynamic calculate values from inputs
<p>I've a script calculates my dynimic buy form. Everything works fine but when I add quantity input script takes only first value. I want to it takes every next value from "value" (each). I will be glad for help.</p> <pre><code>$(function() { $("#sumuj").click(function() { var add = 0; var add2 = 0; $(".netto").each(function() {add += Number($(this).val()) * $(".value").val();}); $(".brutto").each(function() {add2 += Number($(this).val()) * $(".value").val();}); add = add.toFixed(2); add2 = add2.toFixed(2); $("#price").val(add); $("#pricevat").val(add2); }); }); </code></pre> <p>Done:</p> <pre><code>$(function() { $("#sumuj").click(function() { var add = 0; var add2 = 0; $(".netto").each(function() {add += Number($(this).val()) * Number($(this).parent().find('.value').val());}); $(".brutto").each(function() {add += Number($(this).val()) * Number($(this).parent().find('.value').val());}); add = add.toFixed(2); add2 = add2.toFixed(2); $("#price").val(add); $("#pricevat").val(add2); }); }); </code></pre> <p>Thx for help/</p>
javascript jquery
[3, 5]
4,344,082
4,344,083
Write a file "on-the-fly" to the client with C#
<p>I'm using C# and ASP.NET 2.5.</p> <p>I want a simple way to generate a "file" on-the-fly (let's say a csv file for this example) and transmit it to the client without actually writing it to the server file system. </p>
c# asp.net
[0, 9]
2,150,949
2,150,950
How do I execute functions one after the other?
<p>Maybe I'm using it wrong, but I want to chain 3 functions, with the second function starting when the first function completes and the third function starting when the second function completes. According to the <a href="http://api.jquery.com/jQuery.when/" rel="nofollow">docs</a> I should be able to do it like this:</p> <pre><code>$.when( first() ).then( second() ).then(third() ); </code></pre> <p>They all seem to be executing at the same time. What gives?</p> <p><a href="http://jsfiddle.net/9XECY/2/" rel="nofollow">My fiddle</a></p> <p>I've also tried:</p> <pre><code>first().then( second() ).then(third() ); </code></pre> <p>This will fade in the first div, but not the second and third;</p>
javascript jquery
[3, 5]
1,251,800
1,251,801
how show image when click value in combox using jquery and php?
<p>how show image when click value in combox using jquery and php ?</p>
php jquery
[2, 5]
5,497,323
5,497,324
how to detect change for a radio button list
<pre><code>&lt;ul id='theList'&gt; &lt;li&gt;&lt;input type='radio' name='foo' val='1' /&gt;&lt;/li&gt; &lt;li&gt;&lt;input type='radio' name='foo' val='2' /&gt;&lt;/li&gt; &lt;li&gt;&lt;input type='radio' name='foo' val='3' /&gt;&lt;/li&gt; &lt;li&gt;&lt;input type='radio' name='foo' val='4' /&gt;&lt;/li&gt; &lt;li&gt;&lt;input type='radio' name='foo' val='5' /&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I want to show an alert('hi') when some radio input is selected. I tried this:</p> <pre><code>$(function(){ $('#theList input[type="radio"]').live('change', function(){ alert('hi'); }); }); </code></pre> <p>and it doesn't work. (I use live because I change the content of the ul via ajax)</p>
javascript jquery
[3, 5]
4,812,149
4,812,150
How to reset a list
<p>It might be a silly question but still i am facing problem with this.</p> <pre><code> var eformDetailIds = []; eformDetailIds=$("[name=eform_id]").map(function(){ return $(this).val() }).get(); </code></pre> <p>this is the code that i have written in js function and calling this function on button click.</p> <p>But the problem is the list eformDetailIds containing the previous values also. could you please how to set this empty list for every function call? Thanks in advance.</p>
javascript jquery
[3, 5]
4,664,602
4,664,603
How can I redirect to a page when the user session expires?
<p>I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. There are lot of pages in the project, so adding code to every page of the site is not really a good solution. I have MasterPages though, which I think might help.</p> <p>Thanks!</p>
c# asp.net
[0, 9]
3,668,979
3,668,980
Create string from exsting string in which every character is represented by * and only space represented by space
<p>I want to generate a new string from an existing string.<code>javascript</code> In the new generated string all characters would be presented by '*' except ' ' (space). For example if existing string is </p> <p><BR>"hide me"<BR></p> <p>then new genrated string would be</p> <p><BR> <code>"**** **"</code><BR></p> <p>I tried like this, but it is not working. </p> <pre><code> function hiddenData() { var size = word.length; for (var i = 0; i &lt;= size; i++) { if (word[i] == ' ') { hiddenStr[i] = ' '; } else { hiddenStr[i] = '_'; } } hiddenStr[i] = '\0'; } </code></pre> <p>Sorry for my poor explanation, </p>
javascript jquery
[3, 5]
1,391,081
1,391,082
Using sessions in classes
<p>I have code that's using session variables; it's both in the master page code behind and in the code behind of some aspx files. I wanted to put this code in a function that's in a different file but when I did that, the statement Session["VariableName"] became underlined in red on the word session. What am I missing?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
2,518,634
2,518,635
What's the best way to send JavaScript array to PHP script using GET?
<p>I have an interactive web application powered by jQuery where users can manipulate visual objects on the screen. When done, the "state" of JavaScript objects should be sent to PHP to store into database. I'd prefer to use GET for this, but solution that uses POST to submit the data is also viable. </p> <p>I'm currently thinking to serialize all JS objects using something like base64 encoding and just use something like:</p> <pre><code>var str = encode_objects(); document.location = 'result.php?result='+str; </code></pre> <p>However, something tells me there has to be some, more elegant, way than writing my own base64 encoding function in JavaScript. Isn't there something already built into JavaScript that can do the job?</p> <p><strong>Update:</strong> decoding in PHP is not the problem. I know how to decode base64, JSON, whatever in PHP. The problem is how to encode data on JavaScript side.</p> <p>AJAX is out of the question. It has to be a clean GET or POST with page reload.</p>
php javascript jquery
[2, 3, 5]
922,462
922,463
Creating a temporary element X made up of other elements?
<p>I am using a jquery print plugin that has the capability to print out particular elements from the page. </p> <p>If I call <code>$('.main-container').print();</code> it will print out all elements within the main container.</p> <p>However, there are many elements within the 'main-container' that I would not like to include in the element that is passed on to the print() function.</p> <p>My question is, is there an a way to combine 3-4 elements into one and store that element in a variable so then I can pass this new element to the print() function leaving out all the elements I wish to not print?</p> <p>Something like:</p> <pre><code>var $printThis = $('header').html(); $printThis += $('.middle-column').html(); $printThis += $('.footer').html(); $printThis.print(); </code></pre>
javascript jquery
[3, 5]
5,068,802
5,068,803
Does jQuery have a built in function to return the rootURL?
<p>I typically use the below function to return the root URL if I ever need this, but thought to ask if jQuery had a "one liner" way to do this ...</p> <pre><code>function getRootURL() { var baseURL = location.href; var rootURL = baseURL.substring(0, baseURL.indexOf('/', 7)); // if the root url is localhost, don't add the directory as cassani doesn't use it if (baseURL.indexOf('localhost') == -1) { return rootURL + "/AppName/"; } else { return rootURL + "/"; } } </code></pre>
javascript jquery
[3, 5]
5,329,131
5,329,132
Asp.Net Javascript compilation Error: "Identifier Expected"
<p>I am having problem with following code. Its showing compliation error:- "Identifier Expected".</p> <pre><code>&lt;script type="text/javascript" runat = "server"&gt; function isOverElement(currentElement, targetId) { while (currentElement) { if (currentElement.id == targetId) return currentElement; currentElement = currentElement.parentNode; } return null; } &lt;/script&gt; </code></pre> <p>The problem is in line:- <strong>function isOverElement(currentElement, targetId)</strong> Rest all is OK, I suppose.</p> <p>please help. thnx</p>
javascript asp.net
[3, 9]
5,869,557
5,869,558
jQuery wrap() is wrapping every assigned object on click
<p>I have a form that creates a div when you enter a name and click "add". I want to wrap this div in an li but when I do this it wraps every created div with the same class name in an li therefore I end up with multiple levels of li's around the div. Is there a way to only target the div that is created on that click?</p> <p>The fiddle is here <a href="http://jsfiddle.net/clintongreen/BMX4J/1/" rel="nofollow">http://jsfiddle.net/clintongreen/BMX4J/1/</a></p>
javascript jquery
[3, 5]
1,322,911
1,322,912
strange issue with js in updatePanel
<p>I have a link <strong>in an update panel</strong> which calls a js method to do printing of the current window:</p> <pre><code>&lt;a href="javascript:print()" id="cpMain_popupCouponDescriptionControl_hrefPrint"&gt;Print Coupon&lt;/a&gt; </code></pre> <p>where the js method is called on Page_Load event:</p> <pre><code>private void loadJs() { String flashMap = "script"; if (!Page.ClientScript.IsClientScriptBlockRegistered(this.Page.GetType(), flashMap)) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), flashMap, "function print(){ alert('test'); window.print(); return false; }", true); } } </code></pre> <p>When pressing the link, the alert window is shown multiple times (after I click "Ok", which seems strange) but window.print() is never called (a new tab for printing is not opened).</p> <p>If I directly call <code>javascript:window.link</code> from <code>href</code> it works, but because the link is contained in an update panel, it no longer works second time (that's why I tried to register the script).</p> <p>Can anybody see the issue here?</p>
javascript asp.net
[3, 9]
516,782
516,783
Printing text inside scrollable element
<p>I have a multiline textbox inside a aspx page.When printing the page contents inside the scroll textbox(non-visible part) were missing in print.Is there is any way to handle this in javasript or asp.net serverside?</p>
javascript asp.net
[3, 9]
4,535,165
4,535,166
Call java method from javascript
<p>I have a web jsp web application. In one page I need two dropdownlist. When I will select a value from dd1 then second dropdown will be fill according this value. How I can call java function from dropdown 1 change event in javascript or jqury? I got example but that is calling jsp page but I need to java method and send parameter what i got from dropdown1 following is my dropdown dd1. So If i select tom i have to related information of tom in dd2. </p> <pre><code> &lt;td&gt; &lt;select id="dd1"&gt; &lt;option value="1"&gt;john&lt;/option&gt; &lt;option value="2"&gt;Tom&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th&gt; Projects &lt;/th&gt; &lt;td&gt; &lt;select id="dd2"&gt; &lt;option value="1"&gt;pp1&lt;/option&gt; &lt;option value="2"&gt;pp2&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; </code></pre> <p>I have following code </p> <pre><code>$(function () { var ddVal = ''; var dropdown = document.getElementById("dd1") $(dropdown).focus(function () { ddVal = $(this).val(); }).blur(function () { if (ddVal == $(this).val()) { $(this).change(); } }).change (function () { }); </code></pre> <p>for change event of dd1. but I don't know how to call java method from jquery. </p> <p>in my application i have a java class where there is amethod which return list that I need to load in dd2 dropdown.</p> <p>can anyone help me regarding this issue?</p>
java javascript
[1, 3]
4,551,003
4,551,004
Index of div element jquery
<p>I have following html:</p> <pre><code>&lt;div class="rows"&gt; &lt;div class="row"&gt;&lt;input type="text" onchange="javascript:getIndex(this);" value="" /&gt;&lt;/div&gt; &lt;div class="row"&gt;&lt;input type="text" onchange="javascript:getIndex(this);" value="" /&gt;&lt;/div&gt; &lt;div class="row"&gt;&lt;input type="text" onchange="javascript:getIndex(this);" value="" /&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>my function:</p> <pre><code>function getIndex(elem) { var $i = $(elem).parent().parent(); alert($i.index($(elem).parent())); } </code></pre> <p>I keep getting -1 telling me its not found... I looked into it and tried to spit out the value within the obj parent. alert($(elem).parent().html()); this returns me the tag with the default value that was changed...but if i alert $(obj).val() its totally different. So I am thinking that maybe the reason I keep getting a -1.</p> <p>Has anyone experience this before?</p> <p>Thanks</p>
javascript jquery
[3, 5]
830,509
830,510
put two shorts to a byte array
<p>I need a byte array with 4 bytes which contains 2 shorts. I have now this:</p> <pre><code>MemoryStream str = new MemoryStream(); using (BinaryWriter writer = new BinaryWriter(stream)) { writer.Write((short) printscreen.Width); writer.Write((short) printscreen.Height); } byte[] bytes = str.ToArray(); </code></pre> <p>In java I used bytebuffer. But what should I use for c#?</p> <p>I send this bytes through a socket to a java server. Java code:</p> <pre><code>byte[] data = new byte[in.available()]; in.read(data); ByteBuffer buffer = ByteBuffer.wrap(data); System.out.println(buffer.getShort()); </code></pre>
c# java
[0, 1]
40,707
40,708
has no method 'replace' jquery error
<p>I got the following js code which is erroing in the console and i'm not too sure of what i'm doing wrong. Basically i'm trying to get a list of fields so i can do some calcs on.</p> <pre><code>var LabourItems = { rate: null, hours: null, total: null, init: function(object) { var rate = $(object).children('.rate').first(); var hours =$(object).children('.hours').first(); total = rate * hours; updateTotal(object,total); }, updateTotal: function(object, total) { $(object).children('.total').first().attr('value', total) } } //reactTochange for those inputs that you want to observe $('.hours').live(function() { var labourItems; jQuery.each($('.labouritems'), function(key,value){ labourItems.push(LabourItems.init(value)); }); }); </code></pre> <p>Console Error:</p> <pre><code>Uncaught TypeError: Object function () { var labourItems; jQuery.each($('.labouritems'), function(key,value){ labourItems.push(LabourItems.init(value)); }); } has no method 'replace' </code></pre>
javascript jquery
[3, 5]
4,520,893
4,520,894
jquery documentready
<p>hi guys I wanted to know, is there a way to not display my webs content scattered before the jquery document ready is finished? I saw it on a site somewhere and I cannot find it now, forgot to bookmark the site. Does anyone have a clue?</p>
javascript jquery
[3, 5]
648,068
648,069
Stop window.event with Javascript window.confirm?
<p>I am trying to have a confirm box come up when the viewer tries to close the window, that allows the user to stay on the current page (by click Cancel), or continue closing the window (by click OK).</p> <p>My code is as follows...</p> <pre><code>&lt;script&gt; function confirm_exit(){ var message = window.confirm("My message."); if (message == true) { // Output when OK is clicked window.close(); } else { // Output when CANCEL is clicked ??????? } } &lt;/script&gt; </code></pre> <p>I am not sure because either one I click closes the window. I need Cancel to remain at the current page, and OK to close the window or proceed with the users window.event. </p> <p>Hope this makes sense.</p>
javascript jquery
[3, 5]
3,202,829
3,202,830
Why $.extend(window, window, someobject) triggers page refresh?
<p>I have object like this:</p> <pre><code>var example = { test1: 10, test2: 20, test3: 30 } </code></pre> <p>For some reason, I wanted to use <code>test#</code> variables without <code>example</code>, so I extended <code>window</code> object like this(using jQuery):</p> <pre><code>$.extend(window, window, example) </code></pre> <p>But, whenever this function has called, page was refreshed.</p> <p>And one more question, if I try to extend <code>document</code> in the same way, some error occurs like this:(in Chrome)</p> <blockquote> <p>Error: NAMESPACE_ERR: DOM Exception 14</p> </blockquote> <p>Why is that? And is there any way to use variables without object(namespace) name?</p>
javascript jquery
[3, 5]
1,445,914
1,445,915
Submit username and password javascript (not a form)
<p>I have a popup which asks the user for login information, which means two input text fields for password and username. </p> <p>Now as I will be verifying the information using ajax I didn't wrap the elements on a because form always needs a php action, correct? or am I missing something?</p> <p>So I'd like to know if there is a fancier way to check if the user pressed enter, in order to submit the login information, than checking each time a key is pressed, with keydown, if it's the enter key. </p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
555,314
555,315
Dynamically changing layout in application
<p>I want my users to have the ability to choose a few buttons which would be transferred to a different page, like a "favourite buttons" page. To do this, I need to change the layout from the app. I would like the modified layout to persist even after closing the app. Is it possible to do this?</p>
java android
[1, 4]
4,327,163
4,327,164
make append happen only the first time
<p>i have on a list a button that fire this event:</p> <p><strong>js:</strong></p> <pre><code>$(this).parents('tr') .find('.class') .append("&lt;input type='text' size='5'/&gt;"); </code></pre> <p>its possible to make this append happen just in the first time? </p> <p>like a <code>return false</code>, dont know.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
246,501
246,502
UserControl, Child Master Page and Parent Master Page (How to call function form User Control)
<p>Basically I have a userControl.ascx with a lot of code... this user control is used in the Child.MasterPage and the Child.MasterPage inherits from a Parent.MasterPage.</p> <p>In the Parent.MasterPage I have a method in the .cs file, this method accepts a string and passes it to a literal.</p> <p>The problem:</p> <p>I have spent hours trying to pass a string from my UserControl directly to the Parent.MasterPage.cs method with no luck. The child.MasterPage does not have a c# file, it just inherits from the parent.master</p> <p>a line of code that I am using so that I can pass values to the patent.MasterPage reads like this.. but I am not able to pass to the method please help!</p> <pre><code>MasterPage myMasterPage = this.Parent.Parent.Page.Master.Master;. </code></pre>
c# asp.net
[0, 9]
3,891,907
3,891,908
Read and then write .pcm files using Java
<p>How can I read and then write <code>.pcm</code> files using Java on Android, which I just recorded using the microphone at different frequencies?</p> <pre><code>// TODO Auto-generated method stub File fileForSaving = new File(Environment. getExternalStorageDirectory(),recordings/" + name + ".pcm"); File file = new File(Environment.getExternalStorageDirectory(),"test.pcm"); int sampleFreq = (Integer)freqset[SELECTED_INDEX]; </code></pre> <p>I want to save the file to fileForSaving with different frequency rates.</p>
java android
[1, 4]
4,811,775
4,811,776
ScriptManager.RegisterClientScriptBlock being returned in response but not being run by the browser
<p>I'm using the following to try and execute some JavaScript when an update panel has completed its request:</p> <pre><code>script = String.Format("SparkBase.Html.ScrollToElment('{0}');", clientID) System.Web.UI.ScriptManager.RegisterClientScriptBlock(Me, Me.GetType, "Focus_" &amp; clientID, script, True) </code></pre> <p>The JavaScript does actually show in the HTTP Response, however the browser doesn't execute it.</p> <pre><code>|76|scriptBlock|ScriptContentNoTags|SparkBase.Html.ScrollToElment('ctl00_CPMain_lblErrorOptionalExtraQuantity'); </code></pre> <p>I've run the JavaScript code manually in the console and it works. </p>
javascript asp.net
[3, 9]
1,593,187
1,593,188
events not firing for "input" in chrome jquery
<p>I can't get any key events to fire on an input element with jquery. Given the following code:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="./js/jquery-1.5.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./js/jquery-ui-1.8.14.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $("#cmd").keypress(function(event) { alert("keypress"); if(event.which == 13){ $.ajax({ type: "POST", url: "update", data: "key=" + key + "&amp;cmd=" + $("#cmd").val() }); $("#cmd").val(""); $("#cmd").focus(); } }); &lt;/script&gt; &lt;title&gt;BCMD&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="main" style="background-color: black; color: white; width:100%; height:500px;"&gt; &lt;input id="cmd" type="text" style="border:0;"&gt;&lt;/input&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Nothing is firing. Any ideas? Thanks.</p>
javascript jquery
[3, 5]
5,617,011
5,617,012
Can this be written much more simplistically using a foreach?
<pre><code>function GetDiagrams(componentID) { $.getJSON("../PlanView/GetDiagrams", { ComponentID: componentID }, function (diagrams) { for (var i = 0; i &lt; diagrams.length; i++) { PaintDiagram(diagrams[i]); } }); } </code></pre> <p>All I am doing is calling PaintDiagram on each element returned. I tried Googling for a bit because I am pretty confident this is easily reducible, but was not able to pull up a quick example.</p> <p>Is this function a candidate for any more refactoring?</p>
javascript jquery
[3, 5]
2,348,088
2,348,089
Function that dropdowns list of option in "select" element
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/249192/how-can-you-programmatically-tell-an-html-select-to-drop-down-for-example-due">How can you programmatically tell an HTML SELECT to drop down (for example, due to mouseover)?</a><br> <a href="http://stackoverflow.com/questions/4457076/show-select-dropdown-in-jquery">Show select dropdown in jQuery?</a> </p> </blockquote> <p>Suppose i have an select element like this:</p> <pre><code>&lt;div&gt; &lt;label&gt;Colors&lt;/label&gt; &lt;select class="clients"&gt; &lt;option selected="selected"&gt;All&lt;/option&gt; &lt;option&gt;Blue&lt;/option&gt; &lt;option&gt;Green&lt;/option&gt; &lt;option&gt;Yellow&lt;/option&gt; &lt;option&gt;Brown&lt;/option&gt; &lt;/select&gt; &lt;img class="select-arrow" src="images/select-arrow.png" /&gt; &lt;/div&gt; </code></pre> <p>i'm very interested in how to dropdown list of option by clicking on the image, for now i've tried </p> <pre><code>$('document').ready(function(){ $('.select-arrow').click(function(){ $('.clients').focus(); }) }) </code></pre> <p>but not sucessed.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
4,162,450
4,162,451
Jquery list within a list menu
<p>So I would like to build a unsorted list and and another unsorted list within it so there is a basic menu functionality.</p> <p>I basically need to know how to have Jquery access the elements so when a main level item is clicked, its children show.</p> <p>So for example:</p> <pre><code>&lt;ul class="category-links"&gt; &lt;li&gt; &lt;span&gt;Category 1&lt;/span&gt; &lt;ul class="sub-category-links"&gt; &lt;li&gt;Sub-category 1&lt;/li&gt; &lt;li&gt;Sub-category 2&lt;/li&gt; &lt;li&gt;Sub-category 3&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I might have several of these. Essentially I set the subcategories to display:none and I want Jquery to allow for when I click on the "category-links", only its children are displayed.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,844,602
2,844,603
how to send table value to printer?
<p>I want to send table values to printer.That table contails more than 50 records.so there is scrollbar or pagination on that table.Below the printer there print button, if click the button those all values should go to printer.</p> <pre><code>function print(){ window.print(); window.opener.document.location = window.opener.document.location.href; window.close(); } </code></pre> <p>I used to code for print value.but it shows only the page, not in all table values .I ma using jsp,javascript.</p> <p>I am looking for directdownload without css and open popup window, i need to do this work.</p> <p>Any idea????</p>
javascript jquery
[3, 5]
2,339,786
2,339,787
Failing to identify right click event in Mozilla Firefox
<p>I'm trying to add some behavior for the right click event. Weirdly I simply cannot make the event handling work.</p> <p>This is the jQuery code:</p> <pre><code>$('body').on('click', '#wrapper', null, function(ev){ if (ev.which === 2 || ev.which === 3){ alert("Here!"); } }); </code></pre> <p>I think that the event is fired but it cannot be identified as a "rightclick". The alert message is never shown. What am I doing wrong? Thanks you!</p> <p><em>LE: I am able to identify the left click event with <code>ev.which === 1</code>. So there is no problem there.</em></p>
javascript jquery
[3, 5]
4,742,647
4,742,648
More than one crop boxes on image using jquery
<p>I am looking for out of box solution to have more than one crop boxes on the image. jcrop and imageareaselect pulgins dont seem to be supporting it. </p> <p>any hack or other ideas i can support multiple image crop boxes on an image in browser.</p>
javascript jquery
[3, 5]
1,983,418
1,983,419
How to call JQuery CheckBox Changed Event inside a Jquery Accordion Header?
<p>Thanks for all your valuable responses to the questions that I have asked before, those suggestions helped me a lot. I have one more question here. I am using a JQuery accordion control in my page,and the accordion header contains a checkbox, Based on the checkbox selection, I need to retrieve some date from the DB. So, I need the checkbox changed event to get fired, but The event never gets fired for some reason. I am building the checkboxes dynamically through code.</p> <p><strong>Code:</strong></p> <pre><code>string sa= ''; sa+= '&lt;h3&gt;&lt;a href=#&gt;&lt;input type=checkbox runat=server OnCheckedChanged=chkScores_CheckedChanged id=chkScorecard' + i + '&gt;Auckland Aces&lt;/input&gt;&lt;/a&gt;&lt;/h3&gt;&lt;div&gt;&lt;p&gt;'; </code></pre> <p>after creating checkboxes like above, I am adding them to the accordion div.</p> <p>If you observe, I am giving <b>OnCheckedChanged</b> event, but that event is not firing.</p> <p>Any idea..Why it is happening like that. I have been trying for past 6 hours on this, but no luck.</p> <p>Can you guys please tell me if I am doing anything wrong, or is there any alternate approach to this.</p> <p>Thanks and appreciate your feedback.</p>
c# jquery asp.net
[0, 5, 9]
4,407,526
4,407,527
How to renable document.write after jQuery ajax has completed
<p>I have to grab a snippet of JS that has document.write in it - this causes the page to go blank once the document.write renders. I was able to work around this by redefining document.write and pass the response of the script to a function that I use to output the response from the getScript() jQuery function. I am having an issue however with other elements and scripts that load later in the page that my redefining is preventing to output on the page. How can I set document.write back to the default functionality after the jQuery getScript() has completed?</p> <pre><code>$.getScript('somescript.com/script/', function(){ //Prevent document.write normal behavior document.write = function(markup) { fullMarkup += markup; appendResponse(markup); } } }); </code></pre>
javascript jquery
[3, 5]
38,149
38,150
Delete image from Folder/Database using RowCommand/RowDeleting events
<p>I am uploading images and display them in a <code>Gridview</code>.I save the images in a folder and the name in the database.Now I want if I uploaded 3 pictures and have to delete one which I select.So I have picture 1 2 3. When I select picture 2 than this will be deleted..How can I do that? This is my code to upload my pictures:</p> <pre><code>string filename = Path.GetFileName(fileuploadimages.PostedFile.FileName); fileuploadimages.SaveAs(Server.MapPath("Images/" + filename)); SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["baza_chestionar"].ToString()); con.Open(); SqlCommand cmd = new SqlCommand("Insert into Images(ImageName,ImagePath) values(@ImageName,@ImagePath)", con); cmd.Parameters.AddWithValue("@ImageName", filename); cmd.Parameters.AddWithValue("@ImagePath", "Images/" + filename); cmd.ExecuteNonQuery(); con.Close(); Response.Redirect("~/upload.aspx"); </code></pre>
c# asp.net
[0, 9]
825,566
825,567
Creating events in JavaScript like C#
<p>I primarily write code in C#. However, I'm working with some JavaScript. I have defined a class in JavaScript as shown here:</p> <pre><code>function Item(id, name) { this.ID = id; this.Name = name; // define event submitCompleted this.submit = function() { // When the submission is completed, fire "submitCompleted" event. }; } </code></pre> <p>My challenge is, I don't know how to create and fire custom events in JavaScript. If this was C#, I'd do the following:</p> <pre><code>public class Item { public string ID { get; set; } public string Name { get; set; } public Item(string id, string name) { this.ID = id; this.Name = name; } public event EventHandler SubmitCompleted; public void Submit() { // Submission logic SubmitCompleted(this, EventArgs.Empty); } } </code></pre> <p>How do I do the equivalent in JavaScript? Thank you!</p>
c# javascript
[0, 3]
818,519
818,520
android ensuring safety
<p>I am making app, which would send value to php script. Then php script would conncect to Mysql database and return JSON array. And then the app would read it. How to ensure safety? For now I am not using any safety measures.</p>
java php android
[1, 2, 4]
3,348,868
3,348,869
scroll down to position
<p>I have this code to make page scroll up and down,Please tell me how to make it back to scroll postion instead of down page when i click down?</p> <pre><code>&lt;a href="javascript://" id="toDown"&gt;Down&lt;/a&gt; &lt;a href="javascript://" id="toTop"&gt;Top&lt;/a&gt; &lt;script type="text/javascript"&gt; jQuery.noConflict(); $(window).scroll(function(){ if($(window).scrollTop() &gt; "0"){ $('#toTop').fadeIn(); $('#toDown').hide(); }else if($(window).scrollTop() == "0"){ $('#toTop').fadeOut(); $('#toDown').fadeIn(); } }); $('#toTop').click(function(){ $('html, body').animate({scrollTop:0}, 0); $('#toDown').fadeIn(); }); $('#toDown').click(function(){ $('html, body').animate({$('body').height()}, 0); $('#toDown').fadeOut(); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,540,817
1,540,818
javascript jquery checkbox
<p>I'm working on a piece of JavaScript. I'm completely new to JS, But I have a group of checkboxes part of the domainchkb class and with the name, all with different values. I am trying to group those into an array to format into JSON. When executing the code the debugger stops at <code>return this.parent().text();</code>. What am I doing wrong here? Any help would be appreciated.</p> <pre><code>function format4Cart(){ var domains; var values = $('input[name=domainchkb]:checked').map(function(){ return this.parent().text(); }).get(); domains = "{\"type\" : \"single\", \"data\" : ["; $.each(values, function(domainIndex,selected_domain){ domains += "{\"id\" : \""+selected_domain+"\", \"domain\" : \""+whois_response.data.domain+"\"},"; }); $(domains).text().replace(/(\s+)?.$/,""); domains += "]}"; domains=encodeURIComponent(domains); ajaxAdd2Cart(domains); } </code></pre>
javascript jquery
[3, 5]
409,641
409,642
when i click on anchor i need to enable text field
<p>I have a anchor tag, with id="click_me". When i click on this i should enable input text (<code>&lt;input type="text" id="summary" class="summary"&gt;</code>), which is disabled first.</p> <p>even i can do it using javascript function, by calling these javascript function() using onclick in the tag; but in my application i shld not use these. </p> <p>I am newbie to php. please suggest me any alternative solution either using DOM or anything else. Thanks in advance</p>
php javascript jquery
[2, 3, 5]
389,196
389,197
Ldap SASL with unboundID
<p>I am developing an android app in which using unboundedID.jar I have implemented SSL TLS but no idea about SASL can you give me some idea. Some sample code.How to implement SASL with unbound id</p>
java android
[1, 4]
4,071,417
4,071,418
C++ PHP Programmer Struggling With C++
<p>I have been working with PHP almost daily for the past year and a half. From the first hello world example, it just clicked and I understood the concept of it straight away ie how it interacts with databases,forms, and other servers via HTTP and how it returns HTML, or whatever markup you specify. I am by no means an expert and in my quest to become a better programmer I have recently began to learn C++.</p> <p>The problem is that I am struggling to understand the concept of programming in C++. Reading through the textbooks feels like I am going over old ground, in the sense of understanding assignment and arithmetic operators, which are very similar/identical to PHP. </p> <p>Also there is a massive black hole going from a tic tac toe program to creating an everyday peice of software like an mp3 player.</p> <p>I don't even understand C++ architechture, ie it cant be all in one int main() function. For example in the mp3 player example that I spoke would clicking on a new track be a seperate main function or an include header file?</p> <p>I am thinking it might be better to learn how to use QT4 and build programs that way and pick up C++ as I go.</p> <p>I know this is more of a blog rant but I suppose the question I am trying to ask is where can I find good sources of c++ learning that are just theory but practical and diverse enough to get a understanding of the C++ programming concepts?</p>
php c++
[2, 6]
3,513,617
3,513,618
Converting code from JS to Jquery
<p>I found a bit of code to run a tool bar and need a bit of help converting it to jquery so I can use my existing code with it.</p> <pre><code>scroll_final=document.body.scrollTop; scroll_final=document.documentElement.scrollTop; var toolbarid=document.getElementById('toolbar'); toolbarid.style.visibility='hidden'; toolbarid.style.opacity='1.00'; toolbarid.style.filter='alpha(opacity=100)'; toolbarid.style.visibility='visible'; </code></pre> <p>As always...thank you for your help, Todd</p>
javascript jquery
[3, 5]
2,574,987
2,574,988
why does this on() trigger right away instead of just binding?
<p>Im having some problems with <code>.on()</code> and how to use it instead of <code>.bind()</code> in this situation. What im trying to do here is i click a link and that is supose to bind another click event, but instead it triggers that event right away. I looked in the documentation/jquery.js file and this is how im suppose to do it.</p> <p><strong>Demo:</strong> <a href="http://jsfiddle.net/bNaFV/" rel="nofollow">http://jsfiddle.net/bNaFV/</a></p> <pre><code>$('#click_me').on('click', function(){ $('#show_me').addClass('remain'); //this is only suppose to bind that next time i click anywhere on the document it should hide // not right away $(document).on('click', 'html', function(){ $('#show_me').hide(); }); }); $("#click_me").hover( function () { $('#show_me').show(); }, function () { if ($('#show_me').hasClass('remain')){ return; } else { $('#show_me').hide(); } } ); &lt;a href="#" id="click_me"&gt;click me&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; &lt;div id="show_me"&gt;&lt;/div&gt;​ </code></pre>
javascript jquery
[3, 5]
3,565,468
3,565,469
object instance not set on page load?
<p>I am trying to load my website and it says object instance not found. What do i do??</p>
c# asp.net
[0, 9]
5,133,687
5,133,688
How to close an iframe from inside that iframe
<p>I have a an iframe with content from another PHP page on my server inside a modal window. I would like to figure out a way how to close the modal box with the iframe from inside the iframe.</p> <p>I am using this modal window plugin: <a href="http://opensource.steffenhollstein.de/templates/modalbox/" rel="nofollow">http://opensource.steffenhollstein.de/templates/modalbox/</a></p> <p>According to the documentation this method closes the modal window:</p> <pre><code>jQuery.fn.modalBox.close(); </code></pre> <p>If I put it inside the iframe like this:</p> <pre><code>&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery.modalbox-1.0.9/js/jquery.modalbox-1.0.9-min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;!-- $(document).ready(function() { $('.closeModalBox').click(function() { jQuery.fn.modalBox.close(); }); }); //--&gt; &lt;/script&gt; </code></pre> <p>I have an input with the class .closeModalBox in the iframe:</p> <pre><code>&lt;input type="submit" name="zrusPridatElearningKurz" id="zrusPridatElearningKurz" value="Storno" class="input-submit closeModalBox" /&gt; </code></pre>
javascript jquery
[3, 5]
3,350,874
3,350,875
Get contents of a div from a URL
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/26947/how-to-implement-a-web-scraper-in-php">How to implement a web scraper in PHP?</a><br> <a href="http://stackoverflow.com/questions/3577641/how-to-parse-and-process-html-with-php">How to parse and process HTML with PHP?</a> </p> </blockquote> <p>I need to crawl through a page and get the contents of a particular div. I have php and javascript as my two main options. How can it be done?</p>
php javascript jquery
[2, 3, 5]
2,497,542
2,497,543
putting source of all images into an array
<p>What is the cleanest way to put the source attribute string of all images within a div into an array?</p> <p>I was hoping this would work - </p> <pre><code>var imageSourceArray = $("#leDiv img").attr('src'); alert(imageSourceArray[3]); //not alerting the source, boo hoo. </code></pre> <p>Do I need to loop through $("#leDiv img") and add each src string to an array individually? Or is there a more elegant way to do this?</p>
javascript jquery
[3, 5]
5,275,890
5,275,891
PHP passing a class as a reference?
<p>in Python, you could do something like this:</p> <pre><code>class SomeClass(object): pass s = SomeClass someClassInstance = s() </code></pre> <p>How could you accomplish the same effect in PHP? From what I understand, you cannot do this? Is this true?</p>
php python
[2, 7]
2,407,120
2,407,121
Test if a DOM element or JSON
<p>Suppose a function accepts one argument that is whether a DOM element or JSON that are wrapped in jQuery object or not, so how to tell one from the other?</p>
javascript jquery
[3, 5]
3,429,461
3,429,462
is there any way to get the index of an Item from a DataTable inside of a Repeater?
<p>I am trying to get the index of the DataItem from the DataTable and insert that into the repeater. I tried this solution: <a href="http://stackoverflow.com/questions/1722486/inject-index-of-current-item-when-binding-to-a-repeater">http://stackoverflow.com/questions/1722486/inject-index-of-current-item-when-binding-to-a-repeater</a></p> <p>but that does not give me what I want. that solution only gives me the location of the item within the Repeater, but I want the location of the item within its source DataTable. </p> <p>The reason for this is because I want to number my search results, and if I use the above solution then the numbers reset on pagination.</p> <p>Thanks!</p>
c# asp.net
[0, 9]
4,215,742
4,215,743
Tab 'a' click issue
<p>I've a simple tab script with scroll plugin, When I click on each tab, the scroll of that tab will be activated, but there is a problem because if you click two times on each tab you will have two instance of scroll on your page! here is my code, Any ideas?</p> <p><strong>P.S I using mCustomScrollbar plugin.</strong></p> <pre><code>(function($){ $(window).load(function(){ $('ul.tabs').each(function(){ var $active, $content, $links = $(this).find('a'); $active = $($links.filter('[href="' + location.hash + '"]')[0] || $links[0]); $active.addClass('active'); $content = $($active.attr('href')); $links.not($active).each(function() { $($(this).attr('href')).hide(); }); // Set scrollbar to main item $('#mContent').mCustomScrollbar(); // Bind the click event handler $(this).on('click', 'a', function(e) { var $currentScroll = null, $currentTab = $(this).attr('href'); switch ($currentTab) { case '#tabs-contentDescription': $currentScroll = '#mContent'; break; case '#tabs-contentChangelog': $currentScroll = '#mChangelog'; break; case '#tabs-contentPermission': $currentScroll = '#mPermission'; break; } console.log('Current tab is: ' + $currentTab + ' And current scroll div is :' + $currentScroll); // Make the old tab inactive. $active.removeClass('active'); $content.hide(); // Update the variables with the new link and content $active = $(this); $content = $($(this).attr('href')); // Make the tab active. $active.addClass('active'); $content.show(); $($currentScroll).mCustomScrollbar(); e.preventDefault(); }); }); }); }) (jQuery); </code></pre>
javascript jquery
[3, 5]
107,130
107,131
multiple selectors not seems to work
<p>I have following HTML </p> <pre><code>&lt;div id="finalTree"&gt; &lt;ul&gt; &lt;li class="last" style="display: list-item;"&gt; &lt;a id="DataSheets" href="#"&gt;Data Sheets&lt;/a&gt; &lt;/li&gt;&lt;/u&gt;...........&lt;/div&gt; </code></pre> <p>and I am first hiding all these li and then trying to show those li which match to selector. Here is my JavaScript. Here filterData is id of links. </p> <pre><code>function filterLeftNavTree(filterData){ jQuery("ul.treeview").find("li").hide(); var selectors =[]; if(filterData.indexOf("|")!=-1){ var filterData = filterData.split("|"); for(i=0;i&lt;filterData.length;i++){ selectors.push('#'+filterData[i]); } var filtered = selectors.join(','); $(filtered ).show(); }else{ $('#'+filterData+).show(); } } </code></pre> <p>the last two line doesn't works... any one can tell me what can be possible reason. Actually I tried to show li with <code>:has, :contains, find().filter()</code> but all these are taking too much time if I have large tree. </p> <p>Do I am trying to show it by using multiple selector, but it's not showing any thing. Any alternative having faster way to show it will be highly appreciated. </p>
javascript jquery
[3, 5]