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
2,785,503
2,785,504
Jquery - why is click() and .on("click") triggering twice
<p>Why is this getting triggered twice on click? It isn't calling any external functions. The result is that the offState gets triggered twice, negating its purpose. Does click() fire twice by default? I also tried <code>.on('click', function()...</code> with the same results.</p> <pre><code>function makeBackNav(){ $('.backTitle').text(""); //make back button's text the previously selected category $('.backTitle').append(prevLocation).click(function(){ //need to swap images around so that they are activated on click var onState = $('#' + selectedCategory).find('img').first().attr('src'); var offState = $('#' + selectedCategory).find('img').last().attr('src'); $('#' + selectedCategory).find('img').last().attr('src', onState); console.log(offState); }); } </code></pre>
javascript jquery
[3, 5]
5,575,565
5,575,566
Overlay Image over Image
<p>I am searching for a way to overlay an image on an existing image.</p> <p>e.g:</p> <p><img src="http://i.stack.imgur.com/N0REB.gif" alt="img1"> + <img src="http://i.stack.imgur.com/OM7bj.jpg" alt="img2"></p> <p>I have found a great example over here: <a href="http://www.tjkdesign.com/articles/png_overlay_with_no_extra_markup.asp" rel="nofollow">PNG overlay using one single Image element.</a> but I have <strong>two</strong> problems with these. </p> <p><strong>First</strong> of all, I don't want the dimensions to be equal to each other. e.g (215*215 on 215*215). This is because my users would have the ability to choose where they want to put their image. (Top, left, bottom, top-right) so 8 directions.</p> <p>The <strong>second</strong> problem is that in that example, only 2 images are allowed to overlay. My users (again) will have the ability to put multiple images on top of it.</p> <p>I have a little knowledge of Javascript and PHP, so it would be great if you guys (and girls) could help me out.</p> <p>Sincerely,</p>
php javascript
[2, 3]
2,403,095
2,403,096
Calculating the amount of time passed between 2 dates
<p>I've written some JavaScript to calculate the difference between two dates, from a twitter stream, and then equate that to a specific value - such as 'Seconds ago', 'x days ago'.....</p> <p>I've created a Fiddle here that demonstrates what I've done: <a href="http://jsfiddle.net/meAEe/3/" rel="nofollow">http://jsfiddle.net/meAEe/3/</a></p> <p>However the result is always equal to '0 days ago'. </p> <p>Can anyone help me figure out why?</p>
javascript jquery
[3, 5]
2,000,085
2,000,086
How to get values from templatefields in Grdiview SelectedIndexChanged
<p>I have a gridview and sqldatasource.</p> <pre><code>protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = GridView1.SelectedRow; TextBox rrdp = (TextBox)row.FindControl("name"); txt1.Text = rrdp.text.ToString() } </code></pre> <p>But I'm getting : Object reference not set to an instance of an object. at the txt1.text = //etc..</p> <p>The columns are itemtemplates , the values are not nulls.</p> <p>Thanks</p>
c# asp.net
[0, 9]
792,636
792,637
How to use custom font asp.net application
<p>How to use custom font asp.net application.<br/> I have a font file with me. I want to add that file as a resource and use it inside the project. how to do it?</p> <pre><code> PrivateFontCollection pfc = new PrivateFontCollection(); Stream fontStream = this.GetType().Assembly.GetManifestResourceStream(Server.MapPath("~/Resources/EAN-13.ttf")); byte[] fontdata = new byte[fontStream.Length]; fontStream.Read(fontdata, 0, (int)fontStream.Length); fontStream.Close(); unsafe { fixed (byte* pFontData = fontdata) { pfc.AddMemoryFont((System.IntPtr)pFontData, fontdata.Length); } } </code></pre> <p>I tried this. But its not working.</p>
c# asp.net
[0, 9]
5,630,055
5,630,056
Accessing elements in the iframe
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/729577/can-javascript-access-iframe-elements-from-the-parent-page">Can javascript access iframe elements from the parent page?</a> </p> </blockquote> <p>I have an iframe in my document, and I want to get (and change) some attributes in it with JQuery. This is the code:</p> <pre><code>var iframe = $('iframe'); $("#id").click(function() { var btn = iframe.contents().find('a[href*="script.php"]'); alert(btn); for (var i=0, attrs=btn.attributes, l=attrs.length; i&lt;l; i++){ alert(attrs.item(i).nodeName); } }); </code></pre> <p>The first alert says "[object Object]", then I'm getting errors:</p> <blockquote> <p>Unsafe JavaScript attempt to access frame with URL <a href="http://somedomain.ru/somescript.php" rel="nofollow">http://somedomain.ru/somescript.php</a> from frame with URL <a href="http://domain.wia-games.net/" rel="nofollow">http://domain.wia-games.net/</a>. Domains, protocols and ports must match.</p> </blockquote> <p>and</p> <blockquote> <p>Uncaught TypeError: Cannot read property 'length' of undefined</p> </blockquote> <p>How should I solve the problem?</p> <p>UPD. console.log(btn):</p> <blockquote> <p>[prevObject: st.fn.st.init[0], context: document, selector: "a[href*="script.php"]", jquery: "1.9.0", constructor: function…] context: #document length: 0 prevObject: st.fn.st.init[0] selector: "a[href*="script.php"]" <strong>proto</strong>: Object[0]</p> </blockquote>
javascript jquery
[3, 5]
51,885
51,886
Change link href via jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery">How to change the href for a hyperlink using jQuery</a> </p> </blockquote> <p>I'm using Drupal and system generate my title. </p> <p>E.G.</p> <pre><code> &lt;a class="jquery-once-3-processed" id="quicktabs-tab-galeri-1" href="/?q=node&amp;amp;qt-galeri=1#qt-galeri"&gt;NEWS&lt;/a&gt; </code></pre> <p>I want change this <code>href</code> link via jQuery. How can i do this? Thank you.</p>
javascript jquery
[3, 5]
1,571,142
1,571,143
Is there a way to cover the whole window area within a web site, using Javascript/jQuery?
<p>Yes, otherwise I just starting make my wrapper in CSS so it covers 770px or 990 px etc..</p> <p>It should be like scaling after window size/resolution. Are their any way to make it adjustable for every single computer using Javascript/jQuery?</p>
javascript jquery
[3, 5]
3,887,274
3,887,275
Difference between C++ reference type argument passing and C#'s ref?
<p>I always thought they were about the same thing but someone pointed me out in one of my answers that such ain't quite true.</p> <p>Edit: <a href="http://stackoverflow.com/questions/838117/ref-keyword-and-appdomains/838152#838152">Here</a> is what I said and the comment I got. Edit2: What's the difference between C++'s:</p> <pre><code>public: void foo(int&amp; bar); </code></pre> <p>and C#'s</p> <pre><code>public void foo(ref int bar){ } </code></pre>
c# c++
[0, 6]
608,717
608,718
Threads and performance with Android games
<p>I've been following this tutorial: <a href="http://www.droidnova.com/playing-with-graphics-in-android-part-iii,176.html" rel="nofollow">http://www.droidnova.com/playing-with-graphics-in-android-part-iii,176.html</a></p> <p>To get comfortable with Android. It's been very, very helpful. In it though, he uses one thread to handle input, and another for drawing to the canvas. This is my first time using threads, and I am wondering if it is wise to put the entire onDraw() method into a synchronized block. Will this cause performance problems, especially in a game handling a lot of bitmaps?</p>
java android
[1, 4]
4,418,891
4,418,892
using jquery post to send values to php file
<p>I'm trying to write a script in javascript/jquery that will send values to a php file that will then update the database. The problem is that the values aren't being read in by the PHP file, and I have no idea why. I hard-coded in values and that worked fine. Any ideas?</p> <p>Here's the javascript:</p> <pre><code>var hours = document.getElementById("hours"); var i = 1; while(i &lt; numberofMembers) { var memberID = document.getElementById("member"+i); if(memberID &amp;&amp; memberID.checked) { var memberID = document.getElementById("member"+i).value; $.ajax({ type : 'post', datatype: 'json', url : 'subtract.php', data : {hours : hours.value, memberID : memberID.value}, success: function(response) { if(response == 'success') { alert('Hours subtracted!'); } else { alert('Error!'); } } }); } i++; } } </code></pre> <p>subtract.php:</p> <pre><code>if(!empty($_POST['hours']) AND !empty($_POST['memberID'])) { $hoursToSubtract = (int)$_POST['hours']; $studentIDString = (int)$_POST['memberID']; } $query = mysql_query("SELECT * FROM `user_trials` WHERE `studentid` = '$studentIDString' LIMIT 1"); </code></pre> <p>Edit: Updated code following @Daedal's code. I'm still not able to get the data in the PHP, tried running FirePHP but all I got was "profile still running" and then nothing. </p>
php javascript jquery
[2, 3, 5]
3,878,300
3,878,301
How to stop the finish() method after press back button in android?
<p>Can I check some condition in finish()</p> <p>if the condition is success, continue to back to previous</p> <p>else, stop the finish, and stay in current activity? </p>
java android
[1, 4]
1,640,399
1,640,400
Jquery table manipulation
<p>How to exclude the first td on the click event of jquery that I created below? I want to exclude the all first td of the rows on the click event that produces dialog box.</p> <pre><code>jQuery("#list tbody tr").click(function(){ //some code here }); &lt;table&gt; &lt;tr&gt; &lt;td&gt;first&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;first&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
1,966,726
1,966,727
Update select multiple
<p>I'm trying to write a function to update the "multiple" select (the second one below) such that when I select Method1 (from the first select), only the options 1A, 1B and 1C appears in the second select, and likewise for 2A, 2B... only when I select Method2. Is there a way to do this. Please help. Many thanks in advance.</p> <pre><code>&lt;select name="choices" onchange="updatesub()"&gt; &lt;option&gt;Method1&lt;/option&gt; &lt;option&gt;Method2&lt;/option&gt; &lt;/select&gt; &lt;select multiple="multiple" name="sub"&gt; &lt;option&gt;1A&lt;/option&gt; &lt;option&gt;1B&lt;/option&gt; &lt;option&gt;1C&lt;/option&gt; &lt;option&gt;2A&lt;/option&gt; &lt;option&gt;2B&lt;/option&gt; &lt;option&gt;2C&lt;/option&gt; &lt;/select&gt; </code></pre>
javascript jquery
[3, 5]
1,082,121
1,082,122
Wait until loading content
<p>I'm trying to load a table by jQuery load then zebra the table but the content of table is loaded but the zebra fails. If the page is loaded and the table exists the zebra function works.</p> <pre><code>$("#processTab").load("URL"); $(".Innertable tr:nth-child(even)").css("background-color", "#eee"); </code></pre>
javascript jquery
[3, 5]
4,084,842
4,084,843
ID1071: This application is not configured to trust an STS
<p>I'm having this error while trying to update the federal meta data of one of my project. Any idea how can I approach this error?</p>
c# asp.net
[0, 9]
4,053,122
4,053,123
Javascript named, self-calling function
<p>Hey guys, I have a couple bits of code that seem like they could be condensed but I'm not sure how.</p> <p>The code I have is this</p> <pre><code>var checkForUnitReferred = function () { $("#LeadForm").toggle($("#Claim_UnitReferredNoNull").is(":checked")); }; checkForUnitReferred(); $("#Claim_UnitReferredNoNull").change(function() { checkForUnitReferred(); }); </code></pre> <p>It basically checks if a checkbox is checked and displays a form, otherwise it hides it. What I would rather have is something like this</p> <pre><code>var checkForUnitReferred = (function() { $("#LeadForm").toggle($("#Claim_UnitReferredNoNull").is(":checked")); })(); $("#Claim_UnitReferredNoNull").change(function() { checkForUnitReferred(); }); </code></pre> <p>I know this doesn't work but I think something like that would be cleaner. Anyone know of a way to accomplish this?</p>
javascript jquery
[3, 5]
2,017,318
2,017,319
How to use win32::WriteFile when there is possible fail option?
<p>I using the win32 method 'WriteFile' to do some work in C# ( version .net 4.0 ) I need to wait till the method will finish the task and to do it i using 'WaitForSingleObject' .</p> <p>But there is some cases that the method 'WriteFile' is fail ==> so for this case i gave the 'WaitForSingleObject' 30 seconds time-out. </p> <p>But after this 30 seconds i get off the scope of the method 'WriteFile' => there if the GC will run the objects that i gave as arguments in the method 'WriteFile' will be collected and when this happened i get a crash !!! - </p> <p>I checked the dump and its saying the i have memory corruption. When i remove the line of 'WriteFile' the crash is not appears. </p> <p>How to solve it ?! I can't make the variables of the 'WriteFile' method to be global and i must leave them as local variables. </p> <p>The code </p> <pre><code> public void foo(byte[] bufferToWrite) { unsafe { NativeOverlapped overlapped = new NativeOverlapped() { EventHandle = eventHandle, OffsetLow = ( int )( s &amp; 0xffffffff ), OffsetHigh = ( int )( s &gt;&gt; 32 &amp; 0xffffffff ) }; GCHandle gch = GCHandle.Alloc( bufferToWrite, GCHandleType.Pinned ); IntPtr ptr = new IntPtr( ( void* )gch.AddrOfPinnedObject() ); bResult = WriteFile( handle, ptr, length, ref bytesWritten, &amp;overlapped ); if( bResult == ERROR_SUCCESS == || bResult == ERROR_IO_PENDING ) { dwResult = WaitForSingleObject( EventHandle, 30000 ); } } } </code></pre>
c# c++
[0, 6]
212,774
212,775
call javascript function by c#
<p>I have a javascript function which I want to send to c#.</p> <p>The c# function will then send that information to the fiscal printer.</p> <p>The function will get elements id from html document.</p> <p>The function looks like this </p> <pre><code>function senddata(price) { priceElem=document.getElemById("price"); } </code></pre> <p>I want to send data to c# function which will be printing. I have a file that is created by .net which I want to include in my c# function.</p> <p>This .dll file will connect to the fiscal printer and c# function. The .dll will help in communicating between the program and the fiscal printer. The html and javascript is retrieving this information in another program. I am using incotex fiscal printer. This c# program will be printing the receipt. Someone out there please help.</p> <p>Regards, masiela </p>
c# javascript
[0, 3]
5,029,866
5,029,867
jQuery alternate table row colors for a specific table
<p>i have two tables. <code>&lt;table id='1'&gt;&lt;/table&gt;</code> and <code>&lt;table id='2'&gt;&lt;/table&gt;</code>. When i put this code:</p> <pre><code>$(document).ready(function() { //for table row $("tr:even").css("background-color", "#F4F4F8"); $("tr:odd").css("background-color", "#EFF1F1"); }); </code></pre> <p>Both the tables got it alternate row colors, which i dont want, i want only to color the table with id=2. how it can be accomplished?</p>
javascript jquery
[3, 5]
4,815,282
4,815,283
javascript validation of control array
<p>I am doing an application in which end user can create 'n' number of textbox on runtime. If any user will demand 'n' number of textboxex then i have used control array e.g.</p> <pre><code>Enter the data: &lt;input type="text" name="txtData[]" id="txtData1" /&gt;&lt;br/&gt; Enter the data: &lt;input type="text" name="txtData[]" id="txtData2" /&gt;&lt;br/&gt; </code></pre> <p>In whole application name based validation is used (<a href="http://www.javascript-coder.com/html-form/javascript-form-validation.phtml" rel="nofollow">http://www.javascript-coder.com/html-form/javascript-form-validation.phtml</a>). I am unable to validate above functionality using this validation. Is any way to validate control array?</p>
javascript jquery
[3, 5]
532,533
532,534
How can i implement textbox auto suggest using jquery in my c# asp.net application?
<p>I want to implement jquery textbox auto suggest in my c# asp.net application for the purpose of searching employees.Now i am using ajax auto suggest in my application but it's seems to be slow when data more than 50000 thousand.Somebody please help me.If any great idea about faster serching with huge data without using indexing please share with me.</p>
c# jquery asp.net
[0, 5, 9]
5,416,103
5,416,104
How to remove text (without removing inner elements) from a parent element using jquery
<p>Imagine that I have something like the following (modified from <a href="http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/" rel="nofollow">http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/</a>)</p> <pre><code>&lt;div id="foo"&gt; first &lt;div id="bar1"&gt; jumps over a lazy dog! &lt;/div&gt; second &lt;div id="bar2"&gt; another jumps over a lazy dog! &lt;/div&gt; third &lt;/div&gt; </code></pre> <p>How can I remove just (only text) "first", "second" and "third" from DOM without affecting any of the child elements. </p>
javascript jquery
[3, 5]
4,241,271
4,241,272
multiple entries from csv files in java script
<pre><code> var marker = new google.maps.Marker({ position: myLatlng, map: map, title:"Hello World!" }); &lt;?php $fd = fopen ("landmarks.csv", "r"); echo "var latlngarr=new Array();"; $i=0; echo "var markerarr=new Array();"; while (!feof ($fd)) { $buffer = fgetcsv($fd, 4096); echo "var latlngarr[$i] = new google.maps.LatLng($buffer[2],$buffer[3]);"; echo "var markerarr[$i] = new google.maps.Marker({ position: latlngarr[$i], map: map, title:$buffer[1]"; }); $i++; } fclose ($fd); ?&gt; </code></pre> <p>I want to create multiple markers in google maps..the first entry works...but the other ones, from the csv file dont work? Is there something wron with the mixed php and Javscript code?</p>
php javascript
[2, 3]
203,928
203,929
HttpContext.Current.Session is null
<p>I have a WebSite with a custom Cache object inside a class library. All of the projects are running .NET 3.5. I would like to convert this class to use Session state instead of cache, in order to preserve state in a stateserver when my application recycles. However this code throws an exception with "HttpContext.Current.Session is null" when I visit the methods from my Global.asax file. I call the class like this:</p> <pre><code>Customer customer = CustomerCache.Instance.GetCustomer(authTicket.UserData); </code></pre> <p>Why is the object allways null?</p> <pre><code>public class CustomerCache: System.Web.SessionState.IRequiresSessionState { private static CustomerCache m_instance; private static Cache m_cache = HttpContext.Current.Cache; private CustomerCache() { } public static CustomerCache Instance { get { if ( m_instance == null ) m_instance = new CustomerCache(); return m_instance; } } public void AddCustomer( string key, Customer customer ) { HttpContext.Current.Session[key] = customer; m_cache.Insert( key, customer, null, Cache.NoAbsoluteExpiration, new TimeSpan( 0, 20, 0 ), CacheItemPriority.NotRemovable, null ); } public Customer GetCustomer( string key ) { object test = HttpContext.Current.Session[ key ]; return m_cache[ key ] as Customer; } } </code></pre> <p>As you can see I've tried to add IRequiresSessionState to the class but that doesn't make a difference.</p> <p>Cheers Jens</p>
c# asp.net
[0, 9]
1,515,504
1,515,505
Easiest way to create a confirmation message with jQuery/JavaScript?
<p>How can I achieve this?</p> <ol> <li>A user clicks the delete link (with a class of "confirm").</li> <li>Confirmation message appears asking "Are you sure?" with "Yes" and "Cancel" options.</li> </ol> <p>If yes is selected, the link continues as clicked, but if cancel is selected, the action is canceled.</p> <p><strong>Update:</strong> Final working code with <code>confirm()</code> thanks to <a href="http://stackoverflow.com/questions/1844351/how-to-disable-click-with-jquery-javascript/1844412#1844412">this guy</a>:</p> <pre><code>$('.confirm').click(function() { return confirm("Are you sure you want to delete this?"); }); </code></pre>
javascript jquery
[3, 5]
2,619,425
2,619,426
Best programming practice to get a value from a list
<p>I am developing and android application using Java. I need my application to get the phone prefix from Country code.</p> <p>Say for example, if the country code is US, it should return back prefix as "+1" in case of code IN, it should return back "+91", so on and so forth.</p> <p>This can be achieved by having a function with if-else block as follows:</p> <pre><code>String getPrefix(String iso){ String prefix = ""; if(iso.equalsIgnoreCase("AD")) prefix = "376"; else if(iso.equalsIgnoreCase("AE")) prefix = "971"; else if(iso.equalsIgnoreCase("AF")) prefix = "93"; else if(iso.equalsIgnoreCase("AG")) prefix = "268"; else if(iso.equalsIgnoreCase("AI")) prefix = "264"; .... .... return prefix; } </code></pre> <p>Or we can have a big vector object with all the key value pair, and the prefix can be retrieved by calling the get method on that object.</p> <p>I need this function to be called once for the program life cycle. Please suggest me the best logic to implement this.</p> <p>Regards.</p>
java android
[1, 4]
4,250,952
4,250,953
javascript execution order
<p>I am starting to learn Javascript and jQuery. I wanted to make a simple slide show with jQuery which displays list unordered list items one by one.</p> <p>My code is here: <a href="http://jsfiddle.net/aganhuyag/wZQGq/" rel="nofollow">on jsfiddle</a></p> <p>I thought that I'd make the slideshow by iterating over list items in a for loop and display them with fadeIn and fadeOut effects like below:</p> <pre><code>for(var i = 0; i &lt; 3; i++) { $('#slider li:nth-child('+ i +')') .fadeIn() .delay(1000) .fadeOut(); } </code></pre> <p>But it only shows the last item in the list.</p> <p>I read that I need to close the value of <code>i</code> variable in a separate function because of the Javascript scope that it sees the value of <code>i</code> is being increased to 2 in the loop. So, I made a separate function which closes the value of <code>i</code> and called the function. But it was still same, displaying the last item of the list.</p> <p>So, I just wanted to try without the loop by making two separate effects on list items like below:</p> <pre><code>$('#slider li:first-child') .fadeIn() .delay(1000) .fadeOut(); $('#slider li:nth-child(2)') .fadeIn() .delay(1000) .fadeOut(); </code></pre> <p>But it doesn't display the list items sequentially like written above. When you run the code, it seems like the first item is shown really fast and the last item is displayed as intended.</p> <p>I have written it like a C or Java code, thinking that it would execute from top to bottom. But it seems like Javascript is different and I didn't understand a key concept of Javascript.</p> <p>So, my question is why it is not displaying the list items in order and only displaying the last item, and what should I need to know to make it work as intented.</p> <p>Thank you.</p>
javascript jquery
[3, 5]
4,809,277
4,809,278
how to reset a form after submit?
<p>I have a simple form, lets say it takes an email address. Once the form is submitted a message stack notifies the user that their address has been submitted successfully. The issue is that after submitting the address the form field with the email still contains the email address that the user typed in, how would I reset this field? Would I have to use JavaScript for this? </p> <p>Thank you</p>
php javascript
[2, 3]
5,691,400
5,691,401
Loading Image to Custom List Array - Malformed Exception Protocol Not Found Error
<p>It works fine when I set myFileURL as "http://www.google.com/someimage.jpg", but when I try to use a variable I receive the error mesage.</p> <p>My code is here: <a href="http://pastebin.com/QTHwu5tv" rel="nofollow">http://pastebin.com/QTHwu5tv</a></p> <p><strong>Solution</strong> I was loading the data from an array result in a JSON query which added the brackets to the results.</p>
java android
[1, 4]
615,342
615,343
jquery .find issue
<p>I'm moving down a table using the up/down arrow keys. I am manipulating the class of the <code>&lt;tr&gt;</code> tags to change the CSS class (highlighted/non-highlighted). I noticed when the screen loads and I click the arrow keys the first time <code>tr_lst.attr('id')</code> has a value but after the 2nd click it says it is undefined.</p> <p>I think it has something to do with the manipulation of the CSS in the javascript code. Any ideas on how I can get this to print out a value after every keypress?</p> <pre><code> var tr_lst = $('#' + ListBoxVal).find('tr[class="LUGridRowHighlight"]'); console.log('tr_lst id: ' + tr_lst.attr('id')); </code></pre>
javascript jquery
[3, 5]
2,121,044
2,121,045
Sending pictures from android device to server
<p>im trying to send a picture from a android device to a server and was wondering if it was possible to send the picture information in a xml file and rebuild it on the server? </p>
java android
[1, 4]
4,288,950
4,288,951
why do i lose my hidden field value?
<p>I have some hidden fields on my page, all of which work fine apart from one. I am setting the value in document.ready, before calling buildGrid() :</p> <pre><code> $(document).ready(function() { $.ajax( { type: "POST", url: "/CDServices.asmx/GetWeekEndingDates", data: "{}", dataType: "json", contentType: "application/json; charset=utf-8", success: function(msg) { //store default dates in hidden fields $("#&lt;%=hdnCurrentDate.ClientID%&gt;").val(msg.d.CurrentDate); $("#&lt;%=hdnLastWeekEndingDate.ClientID%&gt;").val(msg.d.LastWeekEndingDate); } }); buildGrid(); }); </code></pre> <p>Yet in buildGrid, the value in the hidden field is empty :</p> <pre><code> function buildGrid() { alert($("#&lt;%=hdnLastWeekEndingDate.ClientID%&gt;").val()); </code></pre> <p>I call other functions on button clicks where the hidden field value is picked up fine, why does the value disappear here?</p>
javascript jquery
[3, 5]
2,827,444
2,827,445
Show alert on browser close but don't show alert while closing from logoff
<p>In my application when user logs out the browser is closed. And on browser close I am throwing an alert. Now what I want is if I directly close the browser window alert should come but if window is closed through logout alert should not come as I have shown another confirm message of logout.</p> <pre><code>function closeEditorWarning(){ for (var i=0;i&lt;childWindow.length;i++) { if (childWindow[i] &amp;&amp; !childWindow[i].closed) childWindow[i].close(); if(i==0) { alert("This will close all open e-App applications"); } } window.close(); } window.onbeforeunload = closeEditorWarning; </code></pre> <p>And this is my logout code </p> <pre><code> $('#'+id).click(function(event){ event.preventDefault(); $('#centerContent').load('&lt;%=request.getContextPath()%&gt;/'+target); }); } else { $('#'+id).click(function(event){ event.preventDefault(); var r=confirm("logout"); if (r==true) { flag=true; for (var i=0;i&lt;childWindow.length;i++) { if (childWindow[i] &amp;&amp; !childWindow[i].closed) childWindow[i].close(); } window.close(); } else { } }); } </code></pre>
javascript jquery
[3, 5]
4,521,533
4,521,534
How put a scrollbar into jquery picklist (dropdownlist)?
<p><img src="http://i.stack.imgur.com/pZeop.jpg" alt="enter image description here"></p> <p>I want put a scrollbar into the dropdownlist opened (picklist) because this is overflowing the height of this page.</p> <p>This is my code:</p> <pre><code> var picklist = function (msg) { var $selectall = $(this).find('[data-dropdown-selectall]'); var $filter = $(this).find('[data-dropdown-filter]'); var $inner = $(this).find('.picklist-inner'); var propertyName = $(this).attr('data-dropdown-property'); var friendlyName = $(this).attr('data-dropdown-friendlyname'); var $name = $(this).find('.picklist-header span'); $inner.maxHeight = 12; $selectall.bind('click', function(e) { var checked = $selectall.is(':checked'); $inner.children().each(function (i, v) { var chk = $(this).find('input'); if (i &gt; 0) { if (checked) { chk.attr('checked', checked); } else { chk.removeAttr('checked'); } } }); }); </code></pre> <p>Someone has some tip?</p> <p>Thank in advance</p>
javascript jquery
[3, 5]
3,405,069
3,405,070
How to find out when a download has completed in mobile when using PHP
<p>I am using a PHP header for downloading a JAR file and <a href="http://en.wikipedia.org/wiki/APK_%28file_format%29" rel="nofollow">APK</a> files in mobile. I can download the files successfully, but I want to show a popup when the download reaches 100%. How do I achieve this? </p> <p>Is there any callback method for the download complete event?</p> <pre><code>header('Content-Type: '.$mime); header('Content-Length: '.$stat['size']); header('Connection: close'); header('Content-disposition: attachment; filename='.$file_name); readfile($path_to_file); </code></pre>
php jquery
[2, 5]
5,424,003
5,424,004
Exception class java.util.concurrent.RejectedExecutionException only on galaxy s3
<p>I am having problems with my live wallpapers but only on galaxy s3. I get the following error</p> <pre><code>java.util.concurrent.RejectedExecutionException: Task com.ls.fs.Wallpaper$MyEngine$1@418f2030 rejected from java.util.concurrent.ThreadPoolExecutor@418f1978[Shutting down, pool size = 1, active threads = 1, queued tasks = 0, completed tasks = 87] at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1967) at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:782) at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1303) at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:600) at com.ls.fs.Wallpaper$MyEngine$1.run(Wallpaper.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) </code></pre> <p>This is the code around line 266</p> <pre><code>@Override public void onCreate(final SurfaceHolder holder){ super.onCreate(holder); Executor = Executors.newSingleThreadExecutor(); drawCommand = new Runnable(){ public void run(){ glRenderer.onDrawFrame(gl); egl.eglSwapBuffers(glDisplay, glSurface); if(isVisible() &amp;&amp; egl.eglGetError() != EGL11.EGL_CONTEXT_LOST){ executor.execute(drawCommand); } } }; setTouchEventsEnabled(true); } </code></pre>
java android
[1, 4]
2,426,100
2,426,101
how to get expiration date of local windows account?
<p>I need to create C# method like this :</p> <pre><code> void deleteExpiredAccounts(String Account,dateTime expirationDate) { if(expirationDate == DateTime.Now) { DirectoryEntry localDirectory = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer"); DirectoryEntries users = localDirectory.Children; DirectoryEntry user = users.Find(Account); users.Remove(user); } } </code></pre> <p>any idea will be appreciated..thanks in advance!</p>
c# asp.net
[0, 9]
4,419,390
4,419,391
base64 encode audio file and send as a String then decode the String
<p>I have been stuck on this issue for a few hours now trying to get it working. Basically what I am trying to do is the following. Base64 encode an audio file picked up from an sdcard on an Android device, Base64 encode it, convert it into a String and then decode the String using Base64 again and save the file back to sdcard. It all sounds fairly simple and works great when doing it using a text file. For example if I create a simple text file, call it dave.text and inject some text it in say "Hello Dave" or something similar it works great, but fails when I try doing the same with a binary file, audio in this example. Here's the code that I am using.</p> <pre><code>File file = new File(Environment.getExternalStorageDirectory() + "/hello-4.wav"); byte[] FileBytes = FileUtils.readFileToByteArray(file); byte[] encodedBytes = Base64.encode(FileBytes, 0); String encodedString = new String(encodedBytes); Utilities.log("~~~~~~~~ Encoded: ", new String(encodedString)); byte[] decodedBytes = Base64.decode(encodedString, 0); String decodedString = new String(decodedBytes); Utilities.log("~~~~~~~~ Decoded: ", new String(decodedString)); try { File file2 = new File(Environment.getExternalStorageDirectory() + "/hello-5.wav"); FileOutputStream os = new FileOutputStream(file2, true); os.write(decodedString.getBytes()); os.flush(); os.close(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>At this point if I try to save the file, it becomes corrupted. The audio file hello-5.wav is larger in size then the original and it doesn't play.</p> <p>Any ideas what I am doing wrong here? If I try to save decodedBytes using os.write(decodedBytes) it works but not when converted to a String and getBytes() is used.</p> <p>Any ideas? Thank You!</p>
java android
[1, 4]
4,735,009
4,735,010
jquery selector not working in IE6 due to uppercase id
<p>I have a hidden input field on a page</p> <pre><code>&lt;div id="SomeDiv"&gt; &lt;input type="text" name="ID" id="ID" value="Something"/&gt; &lt;/div&gt; </code></pre> <p>If i use $("#SomeDiv #ID").val() in IE9 i get the value "Something" but in IE6 i'm getting undefined. If i change the id and name to lower case IE6 returns correctly. I.e.</p> <pre><code>&lt;div id="SomeDiv"&gt; &lt;input type="text" name="id" id="id" value="Something"/&gt; &lt;/div&gt; </code></pre> <p>Then <code>$("#SomeDiv #id").val()</code>. Notice I've not changed the case on the div id, only the input.</p> <p>Anybody else come across this and a possible work around? Client is using IE6 so switching browser is not an option and I keep coming across this.</p> <p>Update :</p> <p>I've changed the id value from just "ID" to "WizardID" and it works in IE6</p> <pre><code>&lt;div id="SomeDiv"&gt; &lt;input type="text" name="WizardID" id="WizardID" value="Something"/&gt; &lt;/div&gt; $("#SomeDiv #WizardID").val() </code></pre> <p>I've also come across this issue with a field called "IsValid" IE6 cannot find the field at all but if i rename it "isValid" bam its found. I suspect its a bug with jquery but doubt it will be fixed as IE6 is long past it. Thanks for the help. </p>
javascript jquery
[3, 5]
2,350,088
2,350,089
jquery load function ignoring dynamic changes
<p>I am using jQuery's <code>load</code> function on a page to get the contents of a webpage and then print it. Here is my code:</p> <pre><code>$('#container').load('&lt;?php print $_GET['load']; ?&gt;', function(data) { window.print(); }); </code></pre> <p>where the variable 'load' is the url.</p> <p>The problem is that the page being loaded has a javascript designed filter attached it, meaning, on that page the user can click buttons to remove or display certain information e.g. <code>{ display: none }</code>.</p> <p>However the items which are hidden by the user DO show up in this new page. I understand why this is so, the JavaScript isn't changing the base HTML of the page and it's still there, but I would like to find a way around this issue.</p>
php jquery
[2, 5]
5,566,548
5,566,549
Refer to immediate selector object with jQuery?
<p>I'm trying to learn some jQuery, and I setup a test page with the following code:</p> <pre><code>&lt;a id='encode' href='javascript: void(0)'&gt;encode&lt;/a&gt; | &lt;a id='decode' href='javascript: void(0)'&gt;decode&lt;/a&gt; | &lt;br/&gt; &lt;textarea id='randomString' cols='100' rows='5'&gt;&lt;/textarea&gt; &lt;script type='text/javascript'&gt; $(document.ready(function () { $('#encode').click(function() { $('#randomString').val(escape($('#randomString').val())); }); $('#decode').click(function() { $('#randomString').val(unescape($('#randomString').val())); }); }); &lt;/script&gt; </code></pre> <p>The idea is I can put something in the textarea and click either "encode" or "decode", and it will either escape or unescape what I put into the textarea. </p> <p>This code works just fine, but my question has to do with how I am changing the value of the textarea. In my code, I am selecting the textarea value twice: once to (un)escape it, and once again to change the value. IMO this seems clunky and maybe unnecessary. I thought maybe I could do something like this instead:</p> <pre><code>$('#randomString').val(escape(this)); </code></pre> <p>But <code>this</code> seems to refer to the object of the link I clicked, not the <code>#randomString</code> selector, so is there some other magic word I can use to reference that <code>$('#randomString')</code>?</p>
javascript jquery
[3, 5]
1,537,175
1,537,176
Does youwave supports jquery mobile?
<p>I've developed an app via Dreamweaver CS5.5 using jquery mobile. While running this app in youwave, the app exits abnormally. But the app with jquery mobile works fine. Does youwave supports jquery mobile? I'm using youwave 2.2.2 and jquery mobile 1.0a3.min.js.</p>
jquery android
[5, 4]
575,535
575,536
How to unescape Javascript in PHP
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char">How to decode Unicode escape sequences like &ldquo;\u00ed&rdquo; to proper UTF-8 encoded characters?</a> </p> </blockquote> <p>I have some javascript text that contains values like '\u003c' (less than sign &lt;).</p> <p>Is there a php functions that allows me to unescape javascript ?</p> <p>(I did not expect urldecode to work, though i tried it. It does not indeed.)</p>
php javascript
[2, 3]
1,945,277
1,945,278
Get object from Formview with javascript
<p>I need to get textbox that exits in Formview inserttemplate via javascript. </p> <p>Both return null:</p> <pre><code>$get('txtTitle'); document.getElementById("txtTitle"); </code></pre> <p>The problem is that formview is not rendered on form load...</p>
asp.net javascript
[9, 3]
316,813
316,814
Not responding to events?
<p>I currently have three Divs and only one of them is in focus at a given time. All of them line up in a film strip fashion. When I click a DIV not in focus, the current one moves to the left or right (depending on the direction) and the new one comes into focus. </p> <p>The divs can have content that has links. So my problem is that upon clicking on the divs not in focus, if I happen to click on a link, the event is captured. Is there anyway I can disable event detection for divs not in focus?</p> <p>What I am looking for is something like:</p> <pre><code>if(div not in focus) disable all links if (div comes into focus) enable all links </code></pre>
javascript jquery
[3, 5]
3,805,591
3,805,592
How to use win32::WriteFile when there is possible fail option?
<p>I using the win32 method 'WriteFile' to do some work in C# ( version .net 4.0 ) I need to wait till the method will finish the task and to do it i using 'WaitForSingleObject' .</p> <p>But there is some cases that the method 'WriteFile' is fail ==> so for this case i gave the 'WaitForSingleObject' 30 seconds time-out. </p> <p>But after this 30 seconds i get off the scope of the method 'WriteFile' => there if the GC will run the objects that i gave as arguments in the method 'WriteFile' will be collected and when this happened i get a crash !!! - </p> <p>I checked the dump and its saying the i have memory corruption. When i remove the line of 'WriteFile' the crash is not appears. </p> <p>How to solve it ?! I can't make the variables of the 'WriteFile' method to be global and i must leave them as local variables. </p> <p>The code </p> <pre><code> public void foo(byte[] bufferToWrite) { unsafe { NativeOverlapped overlapped = new NativeOverlapped() { EventHandle = eventHandle, OffsetLow = ( int )( s &amp; 0xffffffff ), OffsetHigh = ( int )( s &gt;&gt; 32 &amp; 0xffffffff ) }; GCHandle gch = GCHandle.Alloc( bufferToWrite, GCHandleType.Pinned ); IntPtr ptr = new IntPtr( ( void* )gch.AddrOfPinnedObject() ); bResult = WriteFile( handle, ptr, length, ref bytesWritten, &amp;overlapped ); if( bResult == ERROR_SUCCESS == || bResult == ERROR_IO_PENDING ) { dwResult = WaitForSingleObject( EventHandle, 30000 ); } } } </code></pre>
c# c++
[0, 6]
1,595,327
1,595,328
Error while passing series of numbers as a parameter to a JavaScript function in PHP
<p>Here's my PHP code - </p> <pre><code>for ($i=1;$i&lt;=10;$i++) { $numbers .= $i."\n"; } echo "&lt;input type='button' onclick=ShowNumbers('$numbers') value='Show Numbers'&gt;"; </code></pre> <p>And my Javascript code - </p> <pre><code>function ShowNumbers(numbers) { alert("Numbers:: "+numbers); } </code></pre> <p>But when I click on the button <strong>Show Numbers</strong>, nothing happens. Whats going wrong ?</p> <p>When in FireBug I check the button element it shows - </p> <pre><code>&lt;input type="button" value="Show Numbers" ');="" 10="" 9="" 8="" 7="" 6="" 5="" 4="" 3="" 2="" onclick="ShowNumbers('1"&gt; </code></pre> <p>may be thats where the problem lies. How do I get it in right format?</p>
php javascript
[2, 3]
2,362,105
2,362,106
Assign new value to variable using itself
<p>This doesn't work but I can't see why it wouldn't? any help people? :)</p> <pre><code>params = qs.split("=", 2), id = params[1]; if(id.indexOf("?") != -1){ id = id.split("?", 1); } </code></pre> <p>basically I want to change the value of 'ID' if the IF statement is true, if not.. it skips it and the value Id remains the default.</p> <p>Thanks</p>
javascript jquery
[3, 5]
408,636
408,637
Android - delete from array adapter <string>
<p>I am creating an <code>ArrayAdapter&lt;String&gt;</code> from a resource array. Then I would like to delete an item from the list using <code>arrayAdapter.remove(String)</code> method. I find the correct string using <code>arrayAdapter.getItem(int position)</code>. But when I call the remove method I end up having <code>UnsupportedOperationException</code> and I have no clue of whats going on.</p> <p>on 20th June edited<br> I did the operation that delete from the resource not directly the adapter and notify the adapter about deletion. I was doing the operation on public boolean onContextItemSelected(MenuItem item); after the deletion on this method, I get an </p> <pre><code>ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 398 NullPointerException </code></pre> <p>I think after i delete the item from resources, something is not properly configured.. </p>
java android
[1, 4]
1,098,779
1,098,780
JavaScript error (Uncaught SyntaxError: Unexpected end of input)
<p>I have some JavaScript code that works in FireFox but not in Chrome or IE. In the Chrome JS Console I get the follow error: "Uncaught SyntaxError: Unexpected end of input".</p> <p>The JavaScript code I am using is:</p> <pre><code>&lt;script&gt; $(function() { $("#mewlyDiagnosed").hover(function() { $("#mewlyDiagnosed").animate({'height': '237px', 'top': "-75px"}); }, function() { $("#mewlyDiagnosed").animate({'height': '162px', 'top': "0px"}); }); &lt;/script&gt; </code></pre> <p>It says the error is on the last line which is });</p>
javascript jquery
[3, 5]
4,121,012
4,121,013
How can i have Response.Redirect() work from MasterPage?
<p>I have a problem: when i call a Response.Redirect() from the MasterPage it doesn't work. Well, debugging i can see that until the Pre_Render() method the target page is loaded, but then is rendered the previous page.</p> <p>Here's some code to better explain:</p> <p>(from MasterPageMain.master.cs)</p> <pre><code>protected void Page_Init(object sender, EventArgs e) { string m_QueryStringValue = Request.QueryString.Get("action"); if ((!string.IsNullOrEmpty(m_QueryStringValue)) &amp;&amp; (m_QueryStringValue.ToLower() == "send")) { if (Session["to"] != null &amp;&amp; Session["to"] is List&lt;string&gt;) this.SendPageByMail(); else { Session.Add("AddressToSend", Request.RawUrl); Response.Redirect("~/chooseRecipients.aspx"); } } } </code></pre> <p>I have a javascript that adds the querystring adding "action=send" when i click on the Send button.</p> <p>If i am on page "~/somethingInterestingToSend()" -for example- i want to get on the recipient selection page, but when i click the Send button i see always the same page.</p> <p>What coul be the mistake?</p>
c# javascript asp.net
[0, 3, 9]
1,849,500
1,849,501
Extract an image from a video hosted on a web site
<p>I need to extract an image/thumbnail from a video hosted on some website. For exemple, the host could be youtube.com or whatever.com and i want to extract an image for a precise frame, i.e 2:12. </p> <p>I have the direct URL for the video. I searched and found how to do it for youtube or vimeo, they provide xml or json with a path to the thumbnail. However i can't find how to do it for a web site that doesn't provide those informations.</p> <p>Ive downloaded FFmpeg, but it doesn't seem to offer to extract an image from a video hosted on some web site.</p> <p>Any other tool or any idea to make a tool myself ?</p> <p>Thanks</p>
c# asp.net
[0, 9]
3,588,511
3,588,512
How can I hide elements which only contain hidden DIVs in jQuery?
<p>I want to hide all blocks which only contain hidden DIVs (aside from a caption). All elements have to be selected via class names.</p> <p>In detail, I want each "eventBlock" not to show up when all "groupBlocks" underneath are already hidden. The same with "Menu" which should not show up when all child eventBlocks are hidden.</p> <p>Each "Menu" contains multiple eventBlocks, </p> <p>each "eventBlock" contains 1 or more groupBlocks.</p> <p>I am using classes and cannot use IDs because there are lots of groupBlocks, eventBlocks etc.</p> <p>DIVs are hidden using JQuery's "hide()" function, if it's relevant.</p> <p>My HTML basically looks like this:</p> <pre><code>&lt;div class="Menu"&gt; &lt;strong&gt;&lt;a name="one"&gt;Menu CAPTION&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt; &lt;div class="eventBlock event1"&gt; &lt;p class="underlined"&gt;eventBlock CAPTION&lt;/p&gt; &lt;div class="groupBlock group2"&gt; &lt;strong&gt;name&lt;/strong&gt;&lt;br /&gt; 4pm - 6pm&lt;br /&gt; &lt;/div&gt; &lt;div class="groupBlock group1"&gt; &lt;strong&gt;name&lt;/strong&gt;&lt;br /&gt; 5pm - 7pm&lt;br /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
320,153
320,154
Show button only if there is more data to load
<p>I need to create a script in jQuery and PHP that will show a <code>load more news</code> button only when there is more data to load that's not already on the page. The easiest solution would be to test if a table has been updated but i'm not sure that can be done. Another way would be to test if there is content in the table that is not currently on the page, again not sure how to do this.</p> <p>This is what I have so far;</p> <pre><code>//check for more data every 5 seconds window.setInterval(function() { $.get("phpscripts/getFeed.php", function(result) { //fade in #refreshFeed $("#refreshFeed").fadeIn(300); }); }, 5000); //Get feed on click $("#refreshFeed").live('click', function() { $.get("phpscripts/getFeed.php", function(result) { $("#newsFeed").html(result); }); }); </code></pre> <p>This just makes the button show up after 5 seconds and does not test if there is more data to load. The php script in the second function just loads data from a table.</p> <p>I would hope there is a way to use the same script in the function at the moment and do it all in jQuery. </p> <p>Just as an example, if anyone has ever been on twitter or the new facebook app for iphone the concept is exactly the same. When there is new information in the database a button is shown that will load that data to the top of the feed when clicked. I am sure facebook and twitter will use SSE though but I don't need to do that. All i need to do is check for new data every 5 seconds.</p>
php jquery
[2, 5]
2,051,196
2,051,197
what's the best way to apply a mask to an EditText on Android?
<p><br/> what's the best way to mask a EditText on Android? <br/> I Would like my EditText to behave like this decimal number input <a href="http://www.meiocodigo.com/projects/meiomask/#mm_demos" rel="nofollow">here</a>. Is there a easy way to do this? </p>
java android
[1, 4]
2,522,231
2,522,232
Passing the hyper-linked element to the hyper-linked page and receiving the element at the hyper-linked page
<p><a href="http://localhost/mypage.php" rel="nofollow">24</a></p> <p>what should i do when i just click on hyper-linked element it just pass the elemet to the hyper-linked page as in above example 24 should pass to <a href="http://localhost/mypage.php" rel="nofollow">http://localhost/mypage.php</a> and how can i receive this 24 in mypage.php </p>
php javascript
[2, 3]
5,206,046
5,206,047
Why am I getting a UnknownHostException?
<p>I'm trying to instantiate an URL object (in Java) with the address: <a href="http://www.cornellrams.com/rss.php" rel="nofollow">http://www.cornellrams.com/rss.php</a>. It gives me an UnknownHostException. The site is live and well, but I can't access the feed. Any ideas why it doesn't like me? This is on Android. I do have the internet permission in the manifest.</p>
java android
[1, 4]
657,369
657,370
When window has been scrolled X pixels left, scroll up JQuery
<p>Im trying to make a sort of parrallax site where, when my window has scrolle say, 1000 pixels right, stop scrolling right, scroll up 300 pixels, then continue to scroll right. </p> <p>Is this possible with jQuery? </p> <p>Im using the below to set my widths and scroll right...</p> <pre><code> $(document).ready(function(){ var height = $(window).height(); var width = $(window).width(); // Make each section 100% height and width $('section').each(function(){ $(this).css({'width' : width, 'height' : height}); }); // Calculate and set body width var sectionWidth = $('section').width(); var entireWidth = sectionWidth * 6; $('body').css({'width' : entireWidth}); // Scroll Horizontally $(function() { $("html, body").mousewheel(function(event, delta) { this.scrollLeft -= (delta * 30); event.preventDefault(); }); }); // After 3rd section, move up * height $(function() { }); }); </code></pre> <p>Ive written this to say when I get too X I need to move up only Im unsure where to go now...</p> <pre><code>var isVisible = false; $(window).scroll(function(){ var shouldBeVisible = $(window).scrollLeft()&gt;sectionWidth * 2; if (shouldBeVisible &amp;&amp; !isVisible) { isVisible = true; alert('foo'); } else if (isVisible &amp;&amp; !shouldBeVisible) { isVisible = false; alert('bar'); } }); </code></pre>
javascript jquery
[3, 5]
2,456,743
2,456,744
document.form[0] is Null or Not an Object error when hiding a text field in ASP.Net
<p>I am hiding a TextBoxin my aspx page like this:</p> <p><em>myField.visible=false;</em></p> <p>Now I have a DropDown as well which tries to access the TextBox on IndexChange. The problem is, it cant access the hiffen TextBox and I am getting <strong>document.form[0] is Null or Not an Object</strong>. How can I solve that? Is the some check for that in JavaScript?</p> <p>Thanks :-)</p>
c# javascript asp.net
[0, 3, 9]
949,761
949,762
How would I Select a simple table from sql and display it on a page?
<p>I want to SELECT a user from a table using the WHERE clause. I know how to write the query, but how do I execute it and how do I match the UserId with the current one (how do I know what the current userid is using the login controls)? I basically want to display profile information by selecting the table and matching it to the userid. Thanks.</p>
c# asp.net
[0, 9]
1,305,497
1,305,498
Is java.util.Scanner that slow?
<p>In a Android application I want to use Scanner class to read a list of floats from a text file (it's a list of vertex coordinates for OpenGL). Exact code is:</p> <pre><code>Scanner in = new Scanner(new BufferedInputStream(getAssets().open("vertexes.off"))); final float[] vertexes = new float[nrVertexes]; for(int i=0;i&lt;nrVertexFloats;i++){ vertexes[i] = in.nextFloat(); } </code></pre> <p>It seems however that this is incredibly slow (it took 30 minutes to read 10,000 floats!) - as tested on the 2.1 emulator. What's going on? I don't remember Scanner to be that slow when I used it on the PC (truth be told I never read more than 100 values before). Or is it something else, like reading from an asset input stream?</p> <p>Thanks for the help!</p>
java android
[1, 4]
3,832,534
3,832,535
How do you select the last visible element with jQuery?
<p>I am using jQuery and I want to select the last visible element with some class e.g. 'target'</p> <p>how can I do that ?</p>
javascript jquery
[3, 5]
79,378
79,379
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]
3,871,948
3,871,949
Embedded JavaScript doesn't work
<p>I have embedded JavaScript in ASP.NET application:</p> <pre><code>function HelloFromEmbedded() { window.alert('Hello from embedded resource.'); } </code></pre> <p>In AssemblyInfo.cs file:</p> <pre><code>[assembly: WebResource("JavaScript1.Scripts.EmbeddedJavaScript.js", "text/javascript", PerformSubstitution = true)] </code></pre> <p>This is my ASP.NET web page:</p> <pre><code>protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); ClientScript.RegisterClientScriptInclude("EmbeddedJS", ClientScript.GetWebResourceUrl(this.GetType(), "JavaScript1.Scripts.EmbeddedJavaScript.js")); } </code></pre> <p>I'd like to use embedded JavaScript in onmouseover event of text box in ASP.NET web page:</p> <pre><code>&lt;asp:TextBox ID="TextBox1" runat="server" onmouseover="HelloFromEmbedded();"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>But, it doesn't work. I can't see why.</p>
javascript asp.net
[3, 9]
1,085,750
1,085,751
move list items between unordered list sets while maintaining position order
<p>I'm using this code sample (<a href="http://jsbin.com/izuwe/2/edit" rel="nofollow">source</a>) to add list items (item 1, item 2 etc) to a master list from a set of unordered lists (list1, list2). On removing list items from the master list, they have to go back to the original position in the unordered list where it came from. </p> <p>The code in the sample works randomly; sometimes the list items are arranged in sequential order but at other times they may not be in order. I need help in fixing the code so that when items are moved from the master list, they are arranged in sequential order in the originating unordered list.</p>
javascript jquery
[3, 5]
5,964,377
5,964,378
Check whether any element in a list has an event
<p>Is it possible to loop through a list of table cells and check if any has a particular event (for example <code>click</code>), and then execute the callback function?</p>
javascript jquery
[3, 5]
2,872,297
2,872,298
How to Decrypt using Javascript
<p>I have a captcha text,which I am storing in hidden variable and retreiving the value in code behind(c#.net).</p> <p>Now I need to Encrypt that captcha text and store in hidden variable and decrypt the same in c#.net</p> <p>I need an algorithm that works both in javascript and c# .i.e encrypt in javascript and decrypt in c#.net.</p> <p>eg : text : "dfg563hj"</p> <p>Thanks for your help in advance. Ramesh.</p>
c# javascript
[0, 3]
4,404,301
4,404,302
Performing a Process on an Uploaded File .NET
<p>I'm programming in ASP.NET 3.5.</p> <p>I need to process a file that has to be uploaded by a user. The file is in a specific format. Basically, I need to take the information in the file, parse it, and insert it into a SQL db. I have no problem doing that, but I was wondering how to do this from a web site. </p> <p>I think I want to create a share that the user will have access to, have the user upload the file onto the share, and upon upload, save a record into the DB with the full UNC path. In the site, process the file with that UNC path, then move the file to some "processed" folder.</p> <p>Has anyone done something like this? Is there any "standard" way of doing things similar to this?</p> <p>Thanks.</p>
c# asp.net
[0, 9]
4,814,466
4,814,467
simpleCart - Modal window form and sending the shopping cart in a multidimensional array to php
<p>I'm using the js cart simpleCart but am having a simple issue..</p> <p>I have a modal pop up when the customer presses "checkout" and they have to fill in their contact details and what I have working is that the modal form on submit emails me with the filled information using the code (at the link below), however I can't figure out how to include in the same data array the shopping cart information (which I can expand on via PHP and make it look nice in their the email I receive).</p> <p>Any ideas, I'm trying to get this dang thing finished asap? All and any help is appreciated!</p> <p><a href="http://jsfiddle.net/uDS7A/" rel="nofollow">http://jsfiddle.net/uDS7A/</a></p> <p>Cart I'm using is <a href="https://github.com/wojodesign/simplecart-js" rel="nofollow">https://github.com/wojodesign/simplecart-js</a> or simplecartjs.com</p>
php javascript jquery
[2, 3, 5]
3,418,861
3,418,862
call javascript function by c#
<p>I have a javascript function which I want to send to c#.</p> <p>The c# function will then send that information to the fiscal printer.</p> <p>The function will get elements id from html document.</p> <p>The function looks like this </p> <pre><code>function senddata(price) { priceElem=document.getElemById("price"); } </code></pre> <p>I want to send data to c# function which will be printing. I have a file that is created by .net which I want to include in my c# function.</p> <p>This .dll file will connect to the fiscal printer and c# function. The .dll will help in communicating between the program and the fiscal printer. The html and javascript is retrieving this information in another program. I am using incotex fiscal printer. This c# program will be printing the receipt. Someone out there please help.</p> <p>Regards, masiela </p>
c# javascript
[0, 3]
5,659,726
5,659,727
Android.jar on a server
<p>I'm currently working on a client-server app for android and I'm wondering if it is ok to use the Android.jar library for the server component of my application. Does anyone understand the legalities and technicalities surrounding this?</p>
java android
[1, 4]
5,781,680
5,781,681
How can I get the JQuery to return a valid img src?
<p>So, I have images in a div that share the same class and one of them is selected at a time for a single view of that image. In this single view, I have arrows that I want to use to cycle between the images. The images sharing the same class have sequential alt values.</p> <p>Right now, I can get the preceding alt value and set the src of the image in the single view to the source of that image. But, I can't seem to get the same effect with the following image.</p> <pre><code> $("#leftButton").click(function(){ var current= $('img[id="selected"]'); var altVal=current.attr("alt").valueOf()-1; if(altVal&gt;=0) { var next= $('img[alt='+altVal+']'); current.attr("id", ""); next.attr("id", "selected"); $("#embiggenImage").attr("src", next.attr("src")); } } ); $("#rightButton").click(function(){ var gal=$('img[class="galleryImage"]'); alert(gal.length); var current= $('img[id="selected"]'); var altVal=current.attr("alt").valueOf()+1; if(altVal&lt;gal.length) { alert("inside"); var next= $('img[alt='+altVal+']'); current.attr("id", ""); next.attr("id", "selected"); $("#embiggenImage").attr("src", next.attr("src")); } } ); </code></pre> <p>As you can see, the code for changing the sources is exactly the same, and it reaches those two alerts fine, but returns a null source.</p> <p>Edit: It seems that in the leftButton click function, alt is being properly decremented, but in the rightButton click function, when I am trying to increment alt, it instead, is appending the '1', such that the final value of altVal is '01'. This does not make any sense to me..</p>
javascript jquery
[3, 5]
4,161,099
4,161,100
jQuery AJAX "undo helper"
<p>The common pattern in AJAX-based UIs is that when user performs an action, it is reflected in the UI instantly, but is marked as unfinished until the arrival AJAX response confirming that everything is OK. This is how e.g. adding an event in Google Calendar works. And when there is an error, that temporary UI change is reverted.</p> <p>Now, doing such reversion manually is not too creative, so I suspect that there is some "undo helper" in jQuery, which allows to preserve the state of UI elements, and then restore it - kind of attribute stack or something like that. This don't even has to have anything to do with AJAX.</p> <p>Is there anything like that?</p>
javascript jquery
[3, 5]
3,274,203
3,274,204
Dragable DIV using javascript
<p>I want to make Dragable div i know this can be done using Jquery plug in but i don't want to use because i just need only dragable function. so tell me how can i make dragable function i have did this</p> <pre><code>$(document).ready(function(e){ $("#eve").mousemove(function(e){ var p=$(this); var offset = p.offset(); var ol=offset.left; var ot=offset.top; var l=e.pageX-ol; var t=e.pageY-ot; var eX=e.pageX; var eY=e.pageY; var htm="left:"+ol+" top:"+ot+"&lt;br/&gt;"; htm+="eX:"+eX+" eY:"+eY+"&lt;br/&gt;"; htm+="curX:"+l+" curY:"+t+"&lt;br/&gt;"; htm+="l:"+(ol-l)+" t:"+(ot-t); p.html(htm); p.css({left:((eX-3))+"px",top:((eY-3))+"px"}); }); </code></pre>
javascript jquery
[3, 5]
5,802,755
5,802,756
Insert Page title into hidden form value with javascript/jquery?
<p>I've got a form on every page of my site via a template but I'd like to have the page title included into the emails sent via the forms so we know exactly which page the form was submitted from. Is there a simple way to do this with jquery? </p> <p>Thanks for any tips/ideas. </p>
javascript jquery
[3, 5]
5,666,539
5,666,540
asp.net session timeout
<p>how do i set the session timeout in asp.net ?</p> <p>thru the code and thru the web.config (i heard that you can do it here).</p> <p>thanks</p>
c# asp.net
[0, 9]
231,157
231,158
jQuery post data return comparison not working
<p>I have this bit of code:</p> <pre><code>function addEmail() { email = $("#email").val(); atime = $("select#time").val(); tid = &lt;?= $tid; ?&gt;; $.post("remindme.php", { email: email, time: atime, tid: tid }, function(data) { if (data == "x") { alert(data); $('#remindme').modal('hide'); $('#quota').show(); } else { alert(data); $('#remindme').modal('hide'); $('#remindersuccess').show(); } }); } </code></pre> <p><code>remindme.php</code> echo's "x" if something is wrong.</p> <p>I'm trying to compare the output from remindme.php but even though it echo's the x, the condition <code>data == "x"</code> does not work.</p> <p>I added <code>alert(data)</code> and I can see it properly displaying the <code>x</code> when needed..</p>
javascript jquery
[3, 5]
4,325,539
4,325,540
Is there a way to send a message from the server to client when an event happens?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1425048/implementing-server-push">Implementing Server Push</a> </p> </blockquote> <p>I want to send a message to the client from php to javascript when some event happens at the server side like for instance the user table is modified or something like this. When the event occurs, the server sends it to the client..How can I implement this ?</p> <p>If possible without using html5</p>
php javascript
[2, 3]
1,371,434
1,371,435
My function returns empty. why?
<p>I know that this is a basic question but I am stuck with it somewhere in my code. I got that code from somewhere but now I am modifying it according to my need.</p> <p>What does jQuery('#selector') do? In my code it always return empty.</p> <p>Here is my code</p> <pre><code>query: function (selector, context) { var ret = {}, that = this, jqEls = "", i = 0; if(context &amp;&amp; context.find) { jqEls = context.find(selector); } else { jqEls = jQuery(selector); } ret = jqEls.get(); ret.length = jqEls.length; ret.query = function (sel) { return that.query(sel, jqEls); } return ret; } </code></pre> <p>when I call this query function then I pass selector as parameter. When I do <code>console.log(selector)</code> it does have all the selectors which I need in this function. But the problem is on this line <code>jqEls = jQuery(selector);</code>. when I do <code>console.log(jqEls)</code> after this it returns empty thus the whole function returns empty.</p> <p>Can I use something different then this to make it work?</p>
javascript jquery
[3, 5]
85,642
85,643
Print page from hidden iframe
<p>I have problem hiding the page I want to print.</p> <p>When I click on the input button :</p> <pre><code>&lt;input type="submit" id="print" name="print"&gt; </code></pre> <p>This executes the following :</p> <pre><code>$(function(){ $('#print').click(function(){ if($('#bills_ID').val()==''){popUpMessage(Error);} else { window.open('Bills/BillsPrint.php?bills_ID='+$('#bills_ID').val(), '_blank') } }); }); </code></pre> <p>and prints the page. At this point I do not want to open this page Bills/BillsPrint.php when printing. I simply want it print without displaying the page.</p> <p>how can i try this by using hidden ifram</p>
javascript jquery
[3, 5]
2,931,215
2,931,216
how can I pass control value from parent window to popup window's code behind
<p>I want to receive value from parent's control to popup window's <strong>code behind.</strong></p> <p>for example</p> <pre><code>&lt;asp:RadioButton ID="rdoRate" GroupName="CouponType" value="0" runat="server" checked/&gt;Rate &lt;asp:RadioButton ID="rdoAmount" GroupName="CouponType" value="1" runat="server"/&gt;dollar </code></pre> <p>and recive selected radiobutton's value from popup window's code behind.</p> <p>My Solution is make querystring and pass the value.</p> <p>for example > </p> <pre><code>window.open(url + ?selectedRadioVal=" + $("#~~checkedradiovalue~~) .. blah balh) </code></pre> <p>and receive the value by <code>Reqeust.Querystring.Get()</code>.</p> <p>But I can't send very long string. (maybe the url length is limited, right?)</p> <p>Is there any good way to solve ?</p>
asp.net javascript
[9, 3]
1,579,594
1,579,595
What are the tools/frameworks used to build C# ASP.net applications?
<p>I am basically a java programmer who wants to move to .net. I haven't worked in .NET companies so I don't have any idea about the tools they use. In a Java company people use Maven, Hibernate and frameworks such as JSF or Tapestry.</p> <p>My questions are: </p> <p>What are the tools/frameworks that .NET/C# companies use? Do they use ASP.NET MVC? Do they use any ORM tool? Do they use any framework?</p> <p>I will be happy if someone could tell me about this.</p>
c# asp.net
[0, 9]
5,345,443
5,345,444
Server.UrlEncode vs. HttpUtility.UrlEncode
<p>Is there a difference between Server.UrlEncode and HttpUtility.UrlEncode?</p>
c# asp.net
[0, 9]
5,890,301
5,890,302
DateTime.Now.Year to fill maximum value in RangeValidator
<p>I am using a RangeValidator to validate that a year is between a static start year and a dynamic end year (the current year). I am drawing a huge blank for setting the maximum value in this fashion:</p> <pre><code>MaximumValue='&lt;% DateTime.Now.Year %&gt;' </code></pre> <p>Any help is appreciated as I usually don't set max values in this fashion.</p> <p>Edit: So I have been given the following ways to incorporate the code into the codebehind:</p> <ol> <li>validator init event</li> <li>page prerender</li> <li>and i'm a newb and would just have done on page load</li> </ol> <p>which is best?</p>
c# asp.net
[0, 9]
3,285,182
3,285,183
Jquery fadeIn fadeOut not working in IE8 but working in chrome, firefox
<p>I m trying to show and hide some elements(span) using jquery fadeIn and fadeOut method so I used following code:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $("a.moretag").click(function(){ $("span.hideelement").fadeIn("slow"); $("a.moretag").fadeOut("slow"); $("a.lesstag").fadeIn("slow"); }); $("a.lesstag").click(function(){ $("span.hideelement").fadeOut("slow"); $("a.lesstag").fadeOut("slow"); $("a.moretag").fadeIn("slow"); }); }); &lt;/script&gt; ..... &lt;span class="hideelement" style="display:none;"&gt;First&lt;/span&gt; &lt;span class="hideelement" style="display:none;"&gt;Second&lt;/span&gt; . . &lt;span class="hideelement" style="display:none;"&gt;Tenth&lt;/span&gt; &lt;a class="moretag"&gt;&lt;strong&gt;More&lt;/strong&gt;&lt;/a&gt; &lt;a class="lesstag" style="display:none;"&gt;&lt;strong&gt;Less&lt;/strong&gt;&lt;/a&gt; ..... </code></pre> <p>In above code when user clicks "more" link it will display previously hidden elements(display:none), more link is disappear and "less" link is displayed vice-vers.</p> <p>Here when I clicked "More" link it works fine means it disappears and displays "Less" link vice-ver. but it doesn't show/hide hidden span elements.</p> <p>This code works great in chrome, mozilla and IE7 but not working in IE8. What's wrong with code. Please help me.</p> <p>THANKS in ADVANCE.</p>
javascript jquery
[3, 5]
1,255,463
1,255,464
how to get control id in loop to upload 4 file in a single loop?
<pre><code> int count = 4; for (int i = 0; i &lt; count; i++) { if (FileUpload1.HasFile ) { } } </code></pre> <p>i am tring to upload 4 file by 4 diff FileUpload controls but how to get FileUpload1,2,3,4 in my if() the rest of the code will me same form all so how to?</p>
c# asp.net
[0, 9]
3,451,946
3,451,947
getting a value along with html markup returned by Ajax in Jquery
<p>I use the following to retrieve some html using Jquery:</p> <p>index.php</p> <pre><code>$.post( 'get-products.php', $("#offerForm").serialize() + '&amp;lastid=' + highest, function(data) { $('#demo').html(data); } </code></pre> <p>Is it possible to also retrieve a value of a variable from get-products.php, example:</p> <p>get-products.php</p> <pre><code>&lt;? echo $htmlOutput; echo $variable; ?&gt; </code></pre> <p>index.php</p> <pre><code>$.post( 'get-products.php', $("#offerForm").serialize() + '&amp;lastid=' + highest, function(data) { $('#demo').html(data); //variable processing statement goes here } </code></pre>
javascript jquery
[3, 5]
266,460
266,461
File locked by which process (android)?
<p>Currently I am developing one android application in which I have a file on sdcard and I have to find out process id of all process which are accessing this file.</p> <p>Using the android.os.FileObserver we can know only whether the file is accessed by any process. But how to get process id of that process?</p>
java android
[1, 4]
3,710,509
3,710,510
JavaScript to PHP arrays
<p>Let's say I have this:</p> <pre><code>var achievementData = { "achievements": { 0: { "id": 0, "title": "All Around Submitter", "description": "Submit and approved one piece of content in all six areas.", "xp": 500, "level_req": 3 }, 1: { "id": 1, "title": "Worldwide Photographer", "description": "Submit and approved one piece of image content in all six areas.", "xp": 1200, "level_req": 1 }, 2: { "id": 2, "title": "Super Submitter", "description": "Get approved 10 players and 2 clubs in one week or less.", "xp": 2500, "level_req": 5 }, } }; </code></pre> <p>That's JavaScript, so how I would turn it into PHP? I tried changing brackets and finding information on PHP arrays but it seems it's just SIMPLE examples.</p>
php javascript
[2, 3]
5,714,192
5,714,193
Find a control's row number in an HTML table
<p>I have an HTML table called DataTable. In my C# code, I add several rows/cells to the table. The first cell of each row has a drop down list called "ddlLevels_[id]" where id is the corresponding id in the database.</p> <p>My ultimate goal is based on certain options selected in the drop down list, to add a row under the current row.</p> <p>How would I accomplish adding the row? I assume I need to find which row number this element is currently on and insert a row afterwards. How do I find that row number?</p>
c# javascript
[0, 3]
1,038,400
1,038,401
how to save webpage in android sdcard or in device memory
<p>How to save Web page in android? I have create one application in which I have load web page in android web view using URL.</p> <p>I want to save that page using menu bar option and stored in device memory in sd card. I dont have any id to do this i am new in android.</p> <p>So please tell me code for this or else if any body have related Example kindly post it.</p>
java android
[1, 4]
3,963,651
3,963,652
Get javascript to write text exactly where it is
<p>is it possible to get javascript to output html where the javascript code is?</p> <p>For example</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;header&lt;/div&gt; &lt;div&gt;main &lt;script type="text/javascript" language="javascript"&gt; // print some html here, maybe &lt;a href="http://www.google.com"&gt;google&lt;/a&gt; &lt;/script&gt; &lt;/div&gt; &lt;div&gt;footer&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Where the end results would look like:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;header&lt;/div&gt; &lt;div&gt;main&lt;a href="http://www.google.com"&gt;google&lt;/a&gt;&lt;/div&gt; &lt;/script&gt; &lt;/div&gt; &lt;div&gt;footer&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I understand that I can give the containing div and id and then get javascript to insert the anchor take like that, but I just wanted to know if it's possible to do this directly, as in write the html exactly where the javascript is?</p>
javascript jquery
[3, 5]
2,108,188
2,108,189
Parsing plain data with Javascript (JQuery)
<p>Well , I have this text in a Javascript Var:</p> <pre><code>GIMP Palette Name: Named Colors Columns: 16 # 255 250 250 snow (255 250 250) 248 248 255 ghost white (248 248 255) 245 245 245 white smoke (245 245 245) 220 220 220 gainsboro (220 220 220) 255 250 240 floral white (255 250 240) 253 245 230 old lace (253 245 230) 250 240 230 linen (250 240 230) 250 235 215 antique white (250 235 215) 255 239 213 papaya whip (255 239 213) </code></pre> <p>And What I need is to cut it in lines and put them in one Array , after that i must separate each number and the rest in an string. I'm getting crazy searching functions to do that but now i can't see anyone in Javascript.</p> <p><strong>modified</strong></p> <p>End expected format will be first the next:</p> <pre><code>array[0]='255 250 250 snow (255 250 250)' </code></pre> <p>Then i wanna take it and extract each line into some vars to use them:</p> <pre><code>colour[0]=255; colour[1]=250; colour[2]=250; string=snow (255 250 250); </code></pre> <p>(the vars will be reused with each line)</p>
javascript jquery
[3, 5]
1,107,148
1,107,149
access preloaded images
<p>I have found a script <a href="http://engineeredweb.com/blog/09/12/preloading-images-jquery-and-javascript" rel="nofollow">here</a> that preloads images, but I dont know how can to access them.</p> <pre><code>(function($) { var cache = []; // Arguments are image paths relative to the current page. $.preLoadImages = function() { var args_len = arguments.length; for (var i = args_len; i--;) { var cacheImage = document.createElement('img'); cacheImage.src = arguments[i]; cache.push(cacheImage); } } })(jQuery) </code></pre> <p>In other words I would take chace[i] - when the preload finished - and append to a div. Any ideas?</p>
javascript jquery
[3, 5]
2,796,069
2,796,070
How to make a PHP library work in java environment?
<p>i have a php library which is in php. can i have this lib to work in java environment like calling the functionalists of the lib to work exactly like a java lib?</p> <p>Regards Tony</p>
java php
[1, 2]
5,155,898
5,155,899
How to display image based on variable in url
<p>I am using gallerific <a href="http://www.twospy.com/galleriffic/" rel="nofollow">http://www.twospy.com/galleriffic/</a> to display thumbnails and large images when a user clicks a thumbnail. You can see it in action here <a href="http://kimmelkids.com/kimmelkids/gallery/view-gallery/" rel="nofollow">http://kimmelkids.com/kimmelkids/gallery/view-gallery/</a></p> <p>My question is I know jquery can grab variables from the url and that is how gallerific changes images. But when I put in the url <a href="http://kimmelkids.com/kimmelkids/gallery/view-gallery/#leaf" rel="nofollow">http://kimmelkids.com/kimmelkids/gallery/view-gallery/#leaf</a> into the address bar it should go to the image in the gallery but it doesn't. </p> <p>Is there any way to have gallerific pull up the image based on the url enter into the address bar?</p>
javascript jquery
[3, 5]
1,356,528
1,356,529
Freeze an android application
<p>I want to create a timer for the screen in an application to be frozen. Let's say like two seconds. I don't want the screen to react to any on screen button clicks. Is this "frowned" upon? Or is there another way of going about this.</p> <p>My application:</p> <p><img src="http://i.stack.imgur.com/QjCgi.png" alt="enter image description here"></p> <p>User click:</p> <p><img src="http://i.stack.imgur.com/7ZWaa.png" alt="enter image description here"></p> <p>I want to then pause everything for two seconds (so my other buttons listeners don't go off) and then I want the listeners to go back, because I'll turn the button back from green to grey.</p>
java android
[1, 4]
3,628,783
3,628,784
Change theme dynamically without page refresh in ASP.NET
<p>You must have noticed one link in yahoo.com, msn.com or other popular websites named "Page Options". When you click this link you get a popup displaying different small several color icons. After clicking one of these icons your page theme changes without entire page refresh. Now you are able to see the same page with different look and feel. </p> <p>How does it happen and what it takes to do it? Is this possible in ASP.NET? If yes, how to do it? <strong>Show me some syntax.</strong></p>
asp.net jquery
[9, 5]
4,408,696
4,408,697
Asp.Net script in external js file
<p>How can I use server-side script in an external js file to grab a reference to a dom element?</p> <p>The following works as intended when used as inline-script, but is returning null when I move this to an external js file. </p> <pre><code>$("#&lt;%= gridResults.ClientID %&gt;"); </code></pre>
asp.net javascript jquery
[9, 3, 5]