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,625,300
2,625,301
DataBinding DataSet to GridView yields infinite loop
<p>I am attempting to bind a GridView to a DataSet, but it throws a Stack overflow error. When I debug it, it runs to the DataBind line just fine (it seems like its getting the right records from the server and everything), but after executing the DataBind, it jumps to the top of the method and reruns the entire method, which results in an stack overflow.</p> <p>I can't understand why this isn't working. I've done something very similar with a DataTable before and it worked fine.</p> <p>Here is how I'm binding</p> <pre><code> public void CreateGrid(String str) { try { sqlConnection = new SqlConnection(); sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["MY_CONNECTION_STRING"].ConnectionString; sqlConnection.Open(); DataSet dt = new DataSet(); SqlDataAdapter adapter = new SqlDataAdapter(str, sqlConnection); adapter.Fill(dt); sqlConnection.Close(); } catch (Exception ex) { Console.WriteLine(ex.GetType().Name + ":" + ex.Message); } if (dt.Tables.Count &gt; 0) { Grid.DataSource = dt; Grid.DataBind(); } } </code></pre> <p>And here is my HTML part</p> <pre><code>&lt;asp:GridView runat="server" ID="Grid" AutoGenerateColumns="false" OnDataBinding="RebindGrid" AllowPaging="True" PageSize="10" AllowSorting="True" CellPadding="5" OnPageIndexChanging="Grid_PageIndexChanging" OnSorting="Grid_Sorting" Width="100%" CssClass="mGrid"&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="ID" ItemStyle-Width="0%" HeaderText="" Visible="false" SortExpression="ID"/&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre>
c# asp.net
[0, 9]
196,661
196,662
trying to add a hover and click event to list items that show / hide hidden uls?
<p>Basically I have 2 buttons that when hovered show/hide 2 hidden unordered lists so I use .toggle() for these</p> <p>What I would also like to do however is when i hover and then click the link the unordered list remains visible, then when i hover and click the other link the previous hidden list is hidden again and the new clicked list is shown? Just not managing to work out how this can be best achieved, at the moment when i hover and then click as soon as i hover off the list disappears. </p> <p>Hope this makes sense, fiddle is here <a href="http://jsfiddle.net/kyllle/D5Lmp/5/" rel="nofollow">http://jsfiddle.net/kyllle/D5Lmp/5/</a> </p> <p>Thanks</p>
javascript jquery
[3, 5]
5,307,846
5,307,847
jQuery: find and replace cleaner syntax with jQuery? and advanced find/replace capabilities?
<p>So i got this snippet of code:</p> <pre><code>$(document).ready(function () { var replacementDoneIn = $("body").html(); var regExMatch = /premier(( {1,5}?)?co(mpany)?([ |\.])?)?/ig; var replaceWith = "Nikon"; var resultSet = replacementDoneIn.replace(regExMatch, replaceWith); $("body").html(resultSet); }); </code></pre> <p>which is some what working for me, but it does not cover more robust and complicated scenario.</p> <p>I would like to expand find/replace capabilities with a help of jQuery. To properly utilize find/replace of the text inside of the body element excluding any html elements and any attributes and their values. </p> <p><strong>note</strong>: Not being completely certain on how jQuery text() function traverses children of the element it is applied on to.</p> <p><strong>note</strong>: as far as i understand i can loop through all elements in html via <code>$("*")</code>, but does that create any issues for such script</p> <p>so if you could direct me to the right path, it would be greatly appreciated. Links to resources that address this already, your advices, all will work. Because for some reason my head produces only complicated solutions, so I am wondering may be there are simpler approach.</p> <p>Thank you in advance.</p>
javascript jquery
[3, 5]
5,450,673
5,450,674
How do smooth slides work in javascript?
<p>For a while now i have been trying to figure out the algorithms behind smooth slides, fades etc..in javascript. Just to give you an example of what am talking about, I have seen a div with content in it that had a height of 0px and on toggled, it didn't just <em>snap</em> to height, it smoothly and gradually grew to height using some sort of function. What i do know is that the height of this div was being assigned its height value from either a date object that had an interval set or a loop of some sort. I've searched all over the web trying to find tutorials explaining how this works but failed. Can someone please either explain to me how to create my own smooth fades, slides or reference some links that i can read?</p> <p><em>PS: I know i can just use jquery, but i want to know how the fades and slides actually work.</em></p>
javascript jquery
[3, 5]
1,187,886
1,187,887
Opening an ASP.NET page from the parent page in a separate window
<p>I have two asp.net pages. One is <code>parent.aspx</code> and the other is <code>child.aspx</code>. </p> <p>The <code>parent.aspx</code> contains a button. </p> <p>Whenever I click that button on <code>parent.aspx</code>, I want the <code>child.aspx</code> to appear in another window of my desired size over the parent window just like popup but not popup. </p> <p>I have used <code>window.Open()</code> script function. But stuck about what c# code should I write on the back end.</p> <p>What can I do in such situation?</p>
c# asp.net
[0, 9]
3,022,300
3,022,301
How to call a JavaScript function from PHP?
<p>How to call a JavaScript function from PHP?</p> <pre><code>&lt;?php jsfunction(); // or echo(jsfunction()); // or // Anything else? </code></pre> <p>The following code is from <em>xyz.html</em> (on a button click) it calls a <code>wait()</code> in an external <em>xyz.js</em>. This <code>wait()</code> calls wait.php.</p> <pre><code>function wait() { xmlhttp=GetXmlHttpObject(); var url="wait.php"; \ xmlhttp.onreadystatechange=statechanged; xmlhttp.open("GET", url, true); xmlhttp.send(null); } function statechanged() { if(xmlhttp.readyState==4) { document.getElementById("txt").innerHTML=xmlhttp.responseText; } } </code></pre> <p>and <em>wait.php</em></p> <pre><code>&lt;?php echo "&lt;script&gt; loadxml(); &lt;/script&gt;"; </code></pre> <p>where <code>loadxml()</code> calls code from another PHP file the same way. </p> <p>The <code>loadxml()</code> is working fine otherwise, but it is not being called the way I want it.</p>
php javascript
[2, 3]
5,884,797
5,884,798
How exactly jQuery Mobile or Sencha Touch hide address bar in iPhone even when page changes?
<p>I know how to hide address bar in general</p> <pre><code>addEventListener("load", function() { window.scrollTo(1, 0); }, false); </code></pre> <p>But I'm trying to hide not show address bar when page changes </p> <p>jQuery Mobile and Sencha Touch manage to do this. I know I should be reading the source but I have no idea where to look.</p>
javascript iphone
[3, 8]
4,562,806
4,562,807
$().change or $().bind(change,function()) doesn't work on IE8, JQuery,Javascript
<p>Code Example:</p> <pre><code> $(document).ready(function() { txtchangefunction(); }); function txtchangefunction( $(".textCssClass").change(function () { ....}); or $(".textCssClass").bind('change', function()) </code></pre> <p>both work for Chrome etc. but not IE8.</p> <p>Can everyone help on that?? no console error comes out. Thanks a lot.</p>
javascript asp.net jquery
[3, 9, 5]
2,437,425
2,437,426
jQuery/javascript communicate between windows?
<p>I have a window with a link.</p> <p>When the link is clicked, a modal box opens (it's loading another page in an iframe).</p> <p>The iframe contains a login. When the user logs in, I would like the modal box to close and send a message back to the original page.</p> <p>How do I go about this?</p> <p>Is there a javascript event or a way to dispatch a message between a window and a related iframe?</p>
javascript jquery
[3, 5]
246,203
246,204
How to enable cookies for all browser using c#
<p>In my project am using cookies and working fine.Here comes the problem, when cookies are disabled for browser then what to do?</p>
c# asp.net
[0, 9]
4,055,512
4,055,513
Use loading image before the content success loading in jquery
<p>I used JSON to retrieve data from my controller and print it on my view using jquery. The content is display when users click on the menu link. Before the content load, user have to wait a few second.</p> <p>So in this period, I want to display the loading image in my view, and when the content is display success, the loading image hide.</p> <p>This is the html that I put the loading image :</p> <pre><code>&lt;div id="loading" style="position:relative; text-align:center;"&gt; &lt;img src="/Content/Images/loading.gif" alt="Processing" /&gt; &lt;/div&gt; </code></pre> <p>This is the sample function of jquery :</p> <pre><code>function ViewProduct() { $('#loading').hide(); $("#content ul#navmenu-v").empty(); $.getJSON(url, function (data) { $.each(data, function (index, dataOption) { var new_li = $("&lt;li class='level1' id='select_list'&gt;&lt;a href='javascript:void(0);' id='" + dataOption.ID + "' class ='selectedcategory'&gt;" + dataOption.Name + "&lt;/a&gt;"); mainMenu.append(new_li); $('a#' + dataOption.ID).click(function () { //display the loading image $.getJSON("ProductListing/Index", data, function (product) { //append the content in the body of web page }); }); }); }); </code></pre> <p>}</p> <p>This is where I called the function :</p> <pre><code>$(document).ready(function () { ViewProduct(); }); </code></pre> <p>Question : I want to hide the loading image after click. Anyone can tell me about this? Thanks so much. </p>
javascript jquery
[3, 5]
3,330,867
3,330,868
PHP/JS: Profilephoto resize and cutting
<p>Hi i just went on a site, when you press "upload image" a lightbox comes up, and then it says upload image, you browse find a image and then you press submit. After that, it shows your image with a square that you can move around and make bigger smaller /width/height.. so you like cutting. After that you can save, and you now have a new avatar.</p> <p>What have they done for doing that? Is there any library or so to do this? Would like to have that on my webpage.</p>
php javascript
[2, 3]
5,762,045
5,762,046
How to check if a button has been clicked using javascript?
<p>Here i need to check a button click using javascript i.e)if button A is clicked i will call a javascript function and if button B is clicked i will call another javascript function.</p> <pre><code>if(document.getElementById('imgBTNExportPPT').clicked == true) { ShowDialogExportPPTPOPUP(); } else if(document.getElementById('btnShowModal').clicked == true) { ShowDialogPrintPOPUP(); } </code></pre> <p>and</p> <pre><code> &lt;asp:ImageButton ID="imgBTNExportPPT" runat="server" Width="15" Height="15" border="0" OnClick="imgBTNExportPPT_Click" ImageUrl="~/Images/PPT_icon.png" /&gt; &lt;asp:ImageButton ID="btnShowModal" runat="server" Width="15" Height="15" border="0" ImageUrl="~/Images/Print_icon.png" onclick="btnShowModal_Click" /&gt; </code></pre> <p>is it possible??any suggestion??</p>
c# javascript asp.net
[0, 3, 9]
5,888,125
5,888,126
How to handle undo/redo event in javascript?
<p>I'm trying to detect whenever a form input's value changes using Javascript &amp; JQuery. Unfortunately, I find JQuery's <code>$(elem).change()</code> insufficient because it only fires the change event when <code>elem</code> loses focus. I have to <em>immediately</em> know when there are changes in the form input's value. To this end, I've narrowed down events associated with a possible change in an input's value to <em>keyup</em>, <em>paste</em>, <em>cut</em>, <em>undo</em>, and <em>redo</em>. However, neither javascript nor JQuery seem to have a way of dealing with undo or redo.</p> <pre><code>var onChange = function () { alert('Checking for changes...'); }; $(this).off('keyup').on('keyup', onChange); $(this).off('paste').on('paste', onChange); $(this).off('cut').on('cut', onChange); $(this).off('undo').on('undo', onChange); // undo ? $(this).off('redo').on('redo', onChange); // redo ? </code></pre> <p>I've googled for undo/redo event in Javascript/JQuery but didn't find anything helpful. Can someone help on how to deal with undo/redo events?</p>
javascript jquery
[3, 5]
903,961
903,962
Looking for a free interactive USA map with states that highlight
<p>I am looking for a free interactive map like this "http://davidlynch.org/projects/maphilight/docs/demo_usa.html" or even like this "http://www.fusioncharts.com/demos/gallery/#usa-states" The first one i had trouble implementing the javascript to where it would highlight. I'm also not very fond of this map "http://www.fedstats.gov/qf/". Could anyone help me? Even if i did the first one i would have to resize it to fit and all the coords would be off.</p>
javascript asp.net
[3, 9]
1,549,723
1,549,724
Delete specific class in page (jQuery)
<p>How can i delete all classes "green" in the page using jQuery? I don't know what selector it has. <code>find('.green').removeClass('green')</code> does not work.</p>
javascript jquery
[3, 5]
5,638,942
5,638,943
If my div is `display: none` print not working. How to change it?
<p>My div is <code>display: none</code> and printing does not work. How can I change this?</p> <p>Plugin: <a href="https://github.com/erikzaadi/jQueryPlugins/tree/master/jQuery.printElement" rel="nofollow">https://github.com/erikzaadi/jQueryPlugins/tree/master/jQuery.printElement</a></p> <p><strong>html:</strong></p> <pre><code>&lt;a href="#" value="$('#toPrint').printElement()" id="simplePrint"&gt;Print&lt;/a&gt; &lt;div id="toPrint"&gt;adgsdhashdshas&lt;/div&gt; </code></pre> <p><strong>css:</strong></p> <pre><code>#toPrint { display: none; } </code></pre> <p><strong>jQuery:</strong></p> <pre><code>$(document).ready(function() { $("#simplePrint").click(function(){ $('#toPrint').printElement(); }); }); </code></pre>
javascript jquery
[3, 5]
2,397,302
2,397,303
How to convert selectors and event capturing from jQuery to plain JS?
<p>Can someone please help with converting this code to plain JS:</p> <pre><code>$(document).ready(function() { $("textarea").bind("keydown", function(event) { var textarea = $(this).get(0); //further will need only textarea and event vars } }); </code></pre> <p>I don't care about cross browser compatibility as long as it works in current FF and Chrome.</p>
javascript jquery
[3, 5]
4,054,330
4,054,331
Multiple instances of Tabify, jQuery
<p>Im trying to have multiple instances of a tabbed content box, only for some reason I cant get it working...</p> <p>is it possible to add a loop to the function with .each() ?</p> <p><a href="http://jsfiddle.net/zAJVK/" rel="nofollow">http://jsfiddle.net/zAJVK/</a></p>
javascript jquery
[3, 5]
1,519,701
1,519,702
iphone web page transitions
<p>I am developing a web page for iPhones and iPod Touch's. I am using the Universal iPhone UI framework. I need to have silding page transitions, but can't seem to get it working. Is there a good javascript framework I could use that would make this easier? I've done a lot of normal web dev with jquery, but it doesn't seem to like the iPhone.</p>
javascript iphone
[3, 8]
713,781
713,782
Break after so many divs
<p>I have 4 hard coded divs. After the third div I would like to break or put the 4th div on a new line. How do I do this and can I do this php or do I have to use javascript/jQuery? The divs are wrapped in a label tag btw. <strong><em>I forgot to mention that the labels are dynamically turned on. So not all labels are viewed at once.</em></strong></p> <pre><code>&lt;label class="1"&gt; &lt;div id="div1"&gt;Stuff 1&lt;/div&gt; &lt;/label&gt; &lt;label class="2"&gt; &lt;div id="div2"&gt;Stuff 2&lt;/div&gt; &lt;/label&gt; &lt;label class="3"&gt; &lt;div id="div3"&gt;Stuff 3&lt;/div&gt; &lt;/label&gt; &lt;label class="4"&gt; &lt;div id="div4"&gt;Stuff 4&lt;/div&gt; &lt;/label&gt; </code></pre>
php jquery
[2, 5]
4,823,233
4,823,234
Plotting Realtime Graph in visual studio c++
<p>I am a new to windows programming. I am developing a application to process the measurement data from a laser sensor. I have got the data from the sensor and did some calulations and I need to plot the data which are in the double arrays say afx[81] and afy[81].. I have been browsing since yesterday to plot the 2-D graph.I found out the options I have are,</p> <ol> <li>using a third party library like gnuplot.</li> <li>using standard graphic library like PGL. <a href="http://www.codeproject.com/Articles/1546/Plot-Graphic-Library" rel="nofollow">http://www.codeproject.com/Articles/1546/Plot-Graphic-Library</a></li> <li>using C# or visual basic to do the plot and using it from c++.</li> </ol> <p>My requirements are</p> <ol> <li>I need to do real time plotting.the max scanning frequency of the sensor is 50hz.</li> <li>I want the application to run in all windows computers as a single application.</li> </ol> <p>Can someone provide me the best possible solution that I can approach.</p>
c# c++
[0, 6]
4,323,570
4,323,571
How to set the width of a layout in Android?
<p>Is there Any way to set the width of the Layout.</p> <p>Because most of the time it doesn't work?</p>
java android
[1, 4]
2,370,361
2,370,362
Android-Simulate mouseover/hover
<p>How can you simulate a mouseover event in an android app? I have to detect if the user is touching/hovering over a particular part of the screen for more than 2 seconds.</p>
java android
[1, 4]
1,280,314
1,280,315
Creating buttons and separating there functionality android
<p>my app have action bar on top of windows. Where are some buttons. Buttons count and there functions is changing depending on activity user are.</p> <p>I want to write a class with methods <strong>addFirstButton</strong>, <strong>removeFirstButton</strong> and so on. So i other classes i want to do this:</p> <pre><code>MyButtons myButtons = new MyButtons(); myButtons.addFirstButton(); </code></pre> <p>So there is everything alright, but how to create a listener button if i want to do this ?</p> <p>Normally i would do this:</p> <pre><code> Button backButton = (Button) customNav.findViewById(R.id.back); backButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Toast.makeText(Action_Bar_TestingActivity.this, "BACK", Toast.LENGTH_SHORT).show(); } }); </code></pre> <p>But i want that this would be in <strong>MyButtons</strong> class and method somehow would return a listener to that action.</p> <p>So any ideas if this possible ?</p> <p>Thanks.</p>
java android
[1, 4]
865,408
865,409
storing list item code in database
<p>i have the following structure:<br/></p> <pre><code>&lt;ul&gt; &lt;li code=12&gt;C++&lt;/li&gt; &lt;li code=5&gt;Java&lt;/li&gt; &lt;li code=17&gt;PHP&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>when the user click on save button the form will be submit to PHP function.<br/> i want to pass 12,5,17(list item codes) as array to PHP function(with $_POST array) to store it in the database.<br> what is the best way to do this?</p>
php javascript jquery
[2, 3, 5]
3,859,636
3,859,637
ImageView, why different size?
<p>First thing, I know many people have asked same thing, but this one is nearly same but I have few more questions.</p> <p>I have an image of 48px x 48px, so if I set this image in ImageView with </p> <pre><code>layout_width="wrap_content" layout_height="wrap_content" </code></pre> <p>then image looks bigger but if I use following fixed size, it gets smaller</p> <pre><code>layout_width="48dp" layout_height="48dp" </code></pre> <p>I think it's now showing properly(not pixelated ?) with 48dp, but why it got bigger if I use wrap_content ? And if the image size through wrap_content is correct then whats the point of using dp(if it make image smaller) ?</p>
java android
[1, 4]
4,152,136
4,152,137
How to trigger click on page load?
<p>I'm looking for a way to automatically "click" an item when the page loads. </p> <p>I've tried using</p> <pre><code>$("document").ready(function() { $("ul.galleria li:first-child img").trigger('click'); }); </code></pre> <p>but it doesn't seem to work? However, when I enter <code>$("ul.galleria li:first-child img").trigger('click');</code> into Firebug's console and run the script, it works.</p> <p>Can the trigger event be used on load?</p>
javascript jquery
[3, 5]
5,805,326
5,805,327
get a forms values via jquery, post to a php script, and have php script process for errors and return value
<p>I have this form:</p> <pre><code>&lt;form action= 'addperm.php' class = 'addperm' method='post'&gt; &lt;input type='text' name='user' /&gt;&lt;br /&gt; &lt;input type='radio' name='perm' value='1' CHECKED /&gt; Can view only&lt;br /&gt; &lt;input type='radio' name='perm' value='2' /&gt; Can make changes &lt;br /&gt; &lt;input type='submit' value='Add'&gt; &lt;/form&gt; </code></pre> <p>I want to know how, without redirecting to another page, I can get these two input values (user and perm), post them to a php script via ajax, and then have the php return the results</p>
php jquery
[2, 5]
673,143
673,144
Launching survey window when user exits site
<p>I have a survey request that will be presented to a small percentage of website visitors. I'm trying to figure out the best way to launch the survey when the user leaves the site. Initially, I was thinking of a pop-under that the user would happen upon when the closed their browser window - but I'm afraid this is probably deprecated and likely to be suppressed by the browser. I'm wondering if someone more clever than I has an idea that might work.</p> <p>I am using a lightbox style window to ask users if they'd be willing to a survey:</p> <p>JQuery</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("a#showSurvey").click(function(){ $("#lightbox, #lightboxPanel").fadeIn(300); }) $("a#closeSurvey").click(function(){ $("#lightbox, #lightboxPanel").fadeOut(300); }) }) &lt;/script&gt; </code></pre> <p>HTML</p> <pre><code> &lt;div id="lightboxPanel"&gt; &lt;h1&gt;We want your opinion.&lt;/h1&gt; &lt;p&gt;Would you be willing to take a short survey when you've finished viewing our site? &lt;p align="center"&gt; &lt;a href="#"&gt;Sure&lt;/a&gt; // launch the new window after a user is done with site?? &lt;a id="closeSurvey" href="#"&gt;No thanks.&lt;/a&gt; //This closes the lightbox &lt;/p&gt; &lt;/div&gt; &lt;div id="lightbox"&gt;&lt;/div&gt; </code></pre> <p>I'm not sure if there is anyway good way to do this with JS. Perhaps this is something that should be handled with the session on the server side.</p> <p>Any advice would be appreciated.</p>
javascript jquery
[3, 5]
5,585,366
5,585,367
PHP equivalent to C# string formatting
<p>I am trying to duplicate my C# string formatting where i can do something like this:</p> <pre><code>Console.Writeline("My name is [0]. I have been a [1] for [2] days.", "bob", "member", "12") </code></pre> <p>I want to be able to do this in PHP, but as far as I know the only function that resembles this is sprintf(). Is there a function that is identical to the one above</p> <pre><code>echo function("My name is [0]. I have been a [1] for [2] days.", "bob", "member", "12") </code></pre>
c# php
[0, 2]
2,164,195
2,164,196
Toggle and animate height of a ul within a li
<p>I have a list inside a li which needs to slide into view when the parent li is clicked.</p> <p>My code works nicely but if i click any li all of the sub lists show where as i want it only to apply to the one that was clicked...</p> <pre><code>$("#offering li").click(function() { $("#offering li ul").animate({height: "toggle"}, 1000); }); &lt;ul id="offering"&gt; &lt;li class="t current"&gt;&lt;a href="#solutions"&gt;&lt;span&gt;sage solutions&lt;/span&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;50&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;200&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;CRM&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="m"&gt;&lt;a href="#management"&gt;&lt;span&gt;solutions&lt;/span&gt;&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;50&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;200&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;CRM&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="b"&gt;&lt;a href="#thirdparty"&gt;&lt;span&gt;third party additions&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre>
javascript jquery
[3, 5]
647,317
647,318
javascript replace newlines in textareas
<p>I have a <code>textarea</code> in a contact form, when it is submitted to the page that sends the mail, it passes through another page.</p> <p>in the second page, when I <code>echo $_POST['textarea']</code> I get all the text in one line.</p> <p>Is there a javascript or PHP code that fix this?</p>
php javascript
[2, 3]
2,501,293
2,501,294
My site works fine in FF, but IE7 gives me error
<p>Here is my site: <a href="http://www.sumsy.com/temp/templatesys/config.php?template=1" rel="nofollow">http://www.sumsy.com/temp/templatesys/config.php?template=1</a></p> <p>IE6, 7 give me errors.</p> <p>Line 9 Char 3 Expected identifier, string or number Code 0 URL: config.php?template=1</p> <p>so for situation like this, how do you guys debug it? I dont even know the error is coming from JS code or Php code. IE doesnt say which file.</p> <p>Thanks</p>
php jquery
[2, 5]
2,154,984
2,154,985
How to change $.ajax() default settings?
<p>How can I modify the default values of options for the <a href="http://api.jquery.com/jQuery.ajax/"><code>$.ajax()</code></a> function?</p> <p>Ideally to do something similar to: </p> <pre><code>//set ajax async to false $(someSelector).load(url, data, function(){}); //set ajax async to true </code></pre> <p>to allow me to carry out <code>.post()</code> synchronously.</p>
javascript jquery
[3, 5]
408,655
408,656
C# date AddDays output
<p>I have following code:</p> <pre><code>string date = "13.04.2012"; string date2 = (DateTime.Parse(date).AddDays(1)).ToString(); </code></pre> <p>This is working correctly without a problem but after the <code>DateTime.Parse</code> function the variable date2 is '14.04.2012 00:00:00' but i would like to have only the date '14.04.2012' without the timestamp.</p> <p>I thought about using the substring function like this:</p> <pre><code>string sub = date2.Substring(0, 10); </code></pre> <p>That would work like this but isn't there a better way to get that result?</p>
c# asp.net
[0, 9]
932,586
932,587
how to use PyV8 and httplib to interpret javascipt
<p>I would like to write my own web test engine that will request (get/post) my wsgi application and i would like my client to interpret the return page that contains some javascript code. </p> <p>Basically it is how to use a PyV8 to make a headless browser.</p> <p>Thx</p>
javascript python
[3, 7]
2,932,364
2,932,365
vtip jQuery to display titles
<p>I am using vTip plugin to display titles on hover , here is my example code:</p> <p><a href="http://jsfiddle.net/bnjSs/" rel="nofollow">http://jsfiddle.net/bnjSs/</a></p> <p>I have a Div#showTitles , When i click on it I wants to toggle display of all div.vtips titles on page just like mouseover. </p> <pre><code>$("#showTitles").click(function(){ // this I am not sure how to acheive. return false; }); </code></pre> <p><strong>UPDATE:</strong> <a href="http://jsfiddle.net/bnjSs/2/" rel="nofollow">http://jsfiddle.net/bnjSs/2/</a> I have tried this but its not showing on correct positions as mouseover but once i mouseover on .vtip and then i click on #showTitles its working fine, I also need to toggle this behavior :</p> <pre><code>$("#showTitles").click(function(e,ui){ this.xOffset = 5; this.yOffset = 10; this.top = (e.pageY + yOffset); this.left = (e.pageX + xOffset); $('.vtip').each(function(index) { title = $(this).text(); $('body').append( '&lt;p id="vtip"&gt;&lt;img id="vtipArrow" /&gt;' + title + '&lt;/p&gt;' ); $('p#vtip #vtipArrow').attr("src", 'images/vtip_arrow.png'); $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn("slow"); }); return false; }); </code></pre> <p>Thanks for any help. </p>
javascript jquery
[3, 5]
3,152,290
3,152,291
Receiving incoming call from Twilio
<p>I am able to call the other twilio number when that user is login ,ring is going on ,but there is device is also listening ,but could not able to receive the call from other twilio number .is there any method by which i could able to receive the call from the twilio in twilio integration </p>
java android
[1, 4]
2,433,432
2,433,433
Scan a file folder in android for file paths
<p>So i have a folder at "mnt/sdcard/folder" and its filled with image files. I want to be able to scan the folder and for each of the files that is in the folder put each file path in an arraylist. Is there an easy way to do this?</p>
java android
[1, 4]
4,400,111
4,400,112
need help understanding this code
<p>this code in book <a href="http://rads.stackoverflow.com/amzn/click/1935182323" rel="nofollow">jQuery in action</a> page 131</p> <p>i don't understand </p> <p><em><strong>.trigger('adjustName');</em></strong></p> <p>what is adjustName</p> <p>and Simple explanation for trigger()</p> <p>thanks :)</p> <pre><code>$('#addFilterButton').click( function() { var filterItem = $('&lt;div&gt;') .addClass('filterItem') .appendTo('#filterPane') .data('suffix','.' + (filterCount++)); $('div.template.filterChooser') .children().clone().appendTo(filterItem) .trigger('adjustName'); }); </code></pre>
javascript jquery
[3, 5]
5,222,720
5,222,721
Increment number in a cell - JavaScript - jQuery
<p>I am using JavaScript with jQuery. I have the following </p> <pre><code>var $ticket = $nxt.parent().prev().children('.ticket'); </code></pre> <p>and <code>$ticket.text()</code> is integer 1.</p> <p>I want to increment it by 1 when when I click as;</p> <pre><code>$('.next').click(function() </code></pre> <p>How can I do this??</p>
javascript jquery
[3, 5]
3,183,384
3,183,385
jquery - arrange multiple arrays by column
<p>I have these arrays.</p> <pre><code>array1 = ["ant1", "bee1", "bird1"] array2 = ["horse2", "pig2", "dog2"] array3 = ["elephant3", "whale3", "giraffe3"] </code></pre> <p>And I want to convert each "column" into an array</p> <p>Is there some way to arrange the arrays to be like this?</p> <pre><code>array1 = ["ant1", "horse2", "elephant3"] array2 = ["bee1", "pig2", "whale3"] array3 = ["bird1", "dog2", "giraffe3"] </code></pre> <p>(No matter if it's with jquery or php)</p>
php jquery
[2, 5]
6,027,865
6,027,866
How to make sure the values are increments of 12 in jQuery?
<p>Ok so I have an ajax call that I need to preform if and only if the user has a quantity of 12 because the items are sold as dozens</p> <p>Here is my html</p> <pre><code>&lt;input class="items" type="text" name="quantity_26" size="3"&gt;&lt;/span&gt;&lt;br&gt; &lt;input class="items" type="text" name="quantity_27" size="3"&gt;&lt;/span&gt;&lt;br&gt; &lt;input class="items" type="text" name="quantity_28" size="3"&gt;&lt;/span&gt;&lt;br&gt; &lt;input class="items" type="text" name="quantity_29" size="3"&gt;&lt;/span&gt;&lt;br&gt; </code></pre> <p>here is my jQuery for the ajax call</p> <pre><code>if(is_mulitple_of_12){ $.ajax({ url: 'processing.php', type: 'post', ... ... } </code></pre> <p>obviously the is_mulitple_of_12 variable is what I need a way to find. I was thinking of maybe the <a href="http://www.java2s.com/Tutorial/JavaScript/0040__Operators/Modulus.htm" rel="nofollow">Modulus</a> javascript operator but i was wondering if there is a better way</p>
javascript jquery
[3, 5]
1,614,139
1,614,140
facebook session expires in android
<p>i am using facebook api in my android project </p> <pre><code>{"error":{"type":"OAuthException","message":"Error validating access token: Session has expired at unix time 1307350800. The current unix time is 1307352870."}} </code></pre> <p>My session expires....after a while....i want it as session never...expires</p> <p>expecting piece a piece code..so that session never endsup</p> <p>am using this for authorizing</p> <pre><code> facebook.authorize(SignIn.this, new DialogListener() { </code></pre>
java android
[1, 4]
153,148
153,149
Taking a screenshot of image in DIV with PHP
<p>I have a website where users have designed their own product. I need a PHP function to generate an image/screenshot in JPG or PNG automatically from the designed product. The screenshot should be for the designed product by user. If it is a JavaScript utility (rather than PHP), that will be fine too. </p> <p>I can't find anything. Where should I look?</p>
php javascript
[2, 3]
4,348,201
4,348,202
How do I detect when my user is watching a video (from an external source as well)
<p>I'm looking to implement a point system like the one on <a href="http://www.khanacademy.org/" rel="nofollow">Khan Academy</a>, and I don't know how to detect when my user is watching a video. </p> <p>I'm using jQuery &amp; ASP.NET. The videos are not hosted on my server and come from various sources.</p>
jquery asp.net
[5, 9]
2,304,299
2,304,300
Canvas Element in Visual Studio
<p>I'm using a canvas HTML5 in Visual Studio. I was wondering does a canvas element have to be placed on a Web Form or can it be placed on a Web User Control? My code works when the canvas is placed on a Web Form (.aspx), but when I place it on a Web User Control (.ascx) it does not seem to work. Does anyone know if this is possible and if there are there any sources you reccommend?</p> <p>Thanks</p>
c# javascript
[0, 3]
5,355,137
5,355,138
Can I insert PHP and javascript code in the same HTML file?
<pre><code>&lt;HTML&gt; &lt;script language="JavaScript"&gt; &lt;script language="php"&gt; &lt;/script&gt; &lt;/script&gt; &lt;/HTML&gt; &lt;HTML&gt; &lt;script language="php"&gt; &lt;/script&gt; &lt;script language="JavaScript"&gt; &lt;/script&gt; &lt;/HTML&gt; </code></pre> <p>I want to insert PHP and javascript code in HTML code like above. Can I do this work??</p>
php javascript
[2, 3]
1,368,635
1,368,636
C#/ASP.NET helper library
<p>I'm gonna start building a small helper library for my web projects, but not sure what typical features that they should contain (only building web application with C# and ASP.NET). I was thinking of logging features, caching, mail etc. Any other typical features that I should put in it?</p>
c# asp.net
[0, 9]
5,150,582
5,150,583
jquery v javascript
<p>I have a function which I need to appear within a jQuery <code>$(document).ready(function() {}</code> - I am <a href="http://www.thefreedictionary.com/au+fait" rel="nofollow">au fait</a> with javascript but not really worked with jQuery. How can I jQuerify this function?</p> <pre><code>function populateContext() { contextTxtBox = document.getElementById('searchContext'); pathArr = window.location.pathname.split( '/' ); contextTxtBox.value = pathArr[1].toUpperCase(); }; </code></pre>
javascript jquery
[3, 5]
2,112,861
2,112,862
Variable is accessed within inner class. Needs to be declared final
<p>So the title says it all. I'm getting a compilation error inside of my onClick</p> <p>I'm sure this is a really simple fix, but I'm not exactly sure how to write it. I'm still in the early stages of android development, so pardon my noob-ness. :)</p> <p>Here's the code.</p> <pre><code>public class fieldsActivity extends Activity { Button addSiteButton; Button cancelButton; Button signInButton; /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // to create a custom title bar for activity window requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.fields); // use custom layout title bar getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.topbar); Pager adapter = new Pager(); ViewPager mPager = (ViewPager) findViewById(R.id.fieldspager); mPager.setAdapter(adapter); mPager.setCurrentItem(1); addSiteButton = (Button) findViewById(R.id.addSiteButton); addSiteButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPager.setCurrentItem(2, true); //Compilation error happens here. } }); cancelButton = (Button) findViewById(R.id.cancel_button); signInButton = (Button) findViewById(R.id.sign_in_button); } </code></pre>
java android
[1, 4]
4,853,513
4,853,514
Refreshing webpage after browser back button?
<p>Let me begin by saying I do not want to "disable" or otherwise prevent the proper usage of the browser history buttons.</p> <p>What I need is a javascript-based procedure (cross-browser compatible, hopefully) to refresh a webpage (staying on the same URL) after navigating to it using the back/forward buttons. This is necessary because during this process the server keeps track of the user's position/page, and if the user wants to jump back 3 pages I need to "inform" the server of the new location by reloading the page (or is there a better way to do it?) I already disabled caching through HTTP headers but this doesn't work for back/forward history, at least in Firefox 7.</p> <p>Using jQuery is of course acceptable and desirable. I looked around a bit and found out about $(document).ready(). Now, please keep in mind I'm a complete javascript noob. I have zero experience, and the same goes for jQuery (I know what it does, I've looked at the docs, but that's about it). So I'm trying to understand how this works, but pages that mention this method seem to assume that the webdeveloper wants to modify the DOM from it, and there are a few quirks when you want to do that (load order and stuff). Since in my case I only need to refresh, it should hopefully be easier. So:</p> <ul> <li><p>I understand this doesn't only run when you browse back, it also runs every time you load the page. How can I make sure I don't end up with an infinite loop? I want it to run once when I browse back, but <em>not</em> on load, after the automated refresh or otherwise. On a normal load I'd rather not have it running because the user would have to download each page twice, which is stupid!</p></li> <li><p>Or is there a better way to do this? Any other ideas? Care to explain or point me in the right direction?</p></li> </ul> <p>EDIT: I only need compatibility with:<br> Internet Explorer 8 or higher<br> Firefox 4 or higher<br> Recent-ish Chrome/Safari (I don't keep track of version numbers but why would someone not use up to date Chrome anyway?)</p>
javascript jquery
[3, 5]
1,296,220
1,296,221
Re-sizing the webpage content
<p>In my project I have a webpage which has 2 div areas right and left. The left div takes almost 60% of the whole page width and the right one takes around 36% of the page. I wanted to resize the both div areas in a proper ratio when I shrink the browser from the right side or left side. The UI is getting generated from Javascript. This is the code. </p> <pre><code>boardHolderPadding = $board.outerHeight() - $board.height(); $board.height(viewportHeight - siblingsHeight - boardHolderPadding); this.$('#board .droptarget').setWidthAsRatioOfHeight(this.options.ratio); $('#sidebar').width($(window).width() - $board.find('#board').width() - 50); </code></pre> <p>I tried with JQuery resize plugin but couldnt get the proper result I'm looking for. Anyone have suggestion?</p> <p>Thanks</p>
javascript jquery
[3, 5]
1,336,584
1,336,585
need to enable a button if the checkbox is enabled using javascript in aspx page
<p>need to enable a button if the checkbox is enabled using javascript in aspx page. Here is my code in aspx page. Please Help !</p> <pre><code>&lt;script type="text/javascript"&gt; function checkButt(obj) { alert("Inside the function"); document.getElementById('&lt;%=btnLoadForm.ClientID%&gt;').disabled = !obj.checked; } </code></pre> <p></p> <p> </p>
javascript asp.net
[3, 9]
1,822,956
1,822,957
focus div element
<p>Concept: Focus the div when user click the Comment link. There was two link in my php page. one is <code>comment link</code> and another one is <code>readmore link</code>. The two link goes to the same page but i want to <code>focus the div element</code> when click comment link .</p>
javascript jquery
[3, 5]
1,018,178
1,018,179
jQuery grab a file uploaded with input type='file'
<p>I want to grab the file uploaded in a <code>&lt;input type='file'&gt;</code> tag.</p> <p>When I do $('#inputId').val(), it only grabs the <em>name</em> of the file, not the actual file itself.</p> <p>I'm trying to follow this: </p> <p><a href="http://hacks.mozilla.org/2011/03/the-shortest-image-uploader-ever/">http://hacks.mozilla.org/2011/03/the-shortest-image-uploader-ever/</a></p> <pre><code>function upload(file) { // file is from a &lt;input&gt; tag or from Drag'n Drop // Is the file an image? if (!file || !file.type.match(/image.*/)) return; // It is! // Let's build a FormData object var fd = new FormData(); fd.append("image", file); // Append the file fd.append("key", "6528448c258cff474ca9701c5bab6927"); // Get your own key: http://api.imgur.com/ // Create the XHR (Cross-Domain XHR FTW!!!) var xhr = new XMLHttpRequest(); xhr.open("POST", "http://api.imgur.com/2/upload.json"); // Boooom! xhr.onload = function() { // Big win! // The URL of the image is: JSON.parse(xhr.responseText).upload.links.imgur_page; } // Ok, I don't handle the errors. An exercice for the reader. // And now, we send the formdata xhr.send(fd); } </code></pre>
javascript jquery
[3, 5]
1,653,372
1,653,373
How to code an image slider?
<p>How can I code an image slider similar to the <a href="http://nivo.dev7studios.com/" rel="nofollow">Nivo slider</a>? Must be in Javascript/Jquery.</p> <p>I want to learn and create my own solution, so I dont want any plugins suggested for this reason. </p> <p>Is there any advice any one can give me, i.e. what should I do not do? starting points etc? If anyone knows of any good tutorials that would be good. Helpful tutorials though only, not the ones that just tell you to download the source code at the end of a load of jumble. </p> <p>One way I thought of doing it was to insert all the images into divs, and hiding all those divs, and one by one unhiding those divs and sliding them in. </p>
javascript jquery
[3, 5]
5,786,545
5,786,546
style switcher in jQuery without page refreshing
<p>I have now one page which has a default.css style<br> I have one style1.css file and another one is style2.css file.<br> I have one UI dropdownlist which has two options. </p> <p>When I select one then apply style1.css and same thing for other.</p> <p>The page should not be refresh.</p> <p>How can I do this?</p>
javascript jquery
[3, 5]
5,453,582
5,453,583
jquery alternative for ajax modal popup extender
<p>I know there have been many posts on jquery vs ajax toolkit and I have read many of them. But I'm still not getting it completely. I'm hoping this question would clarify it for me unless it gets closed or voted down.</p> <p>i have been reading a lot that jquery can replace MS Ajax tool kit completely. In my project (web forms), I am currently displaying a gridview that shows an ajax modal popup extender when row is clicked. That MPE has to talk to the database, get an object back and bind to the controls on the MPE popup. I'm assuming this is not easy to do with Jquery. There is no direct server interaction unless I do some web service or something like that. Even in that case, do I have to bring back the entire html preformatted?</p> <p>If this is not achievable, how can Jquery replace the whole ajax tool kit. Have I misunderstood this?</p>
jquery asp.net
[5, 9]
4,483,196
4,483,197
make a div editable
<p>I need to make a whole div(with class container) editable when the user clicks on the Edit link. Using contenteditable attribute can make a div editable. But it happens only when we double click on that div. I also do not prefer to use any plugins for that. So basically the div should be editable if the user clicks on the Edit button. I am new to jquery and learning th basic stuffs. Please help.</p> <p>Please find the structure of my Dom elements </p> <p><a href="http://jsfiddle.net/GeJkU/248/" rel="nofollow">http://jsfiddle.net/GeJkU/248/</a></p> <p>Sorry for changing the classname.</p>
javascript jquery
[3, 5]
3,659,398
3,659,399
How do I get a variable out of a try/catch block?
<p>I've been trying to get this right for 2 days and am about ready to throw something .....</p> <p>I have a JSONArray which I'm processing in a try/catch block but it doesn't seem to pass the variable out at the end.</p> <p>My code:</p> <pre><code>try{ //Get the element that holds the results ( JSONArray ) JSONArray getresults = json.getJSONArray("results"); //Loop the Array for(int i=0;i &lt; getresults.length();i++){ HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;(); JSONObject e = getresults.getJSONObject(i); totalpass = e.getJSONObject(i).getString("ftotalpass"); } } catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } </code></pre> <p>I've tried all manor of declaring the variable before, in, after the try/catch block but I just cannot get it to pass to the rest of my code.</p> <p>What am I doing wrong?</p>
java android
[1, 4]
942,949
942,950
Vertically center layer within the user's viewable area on a long page
<p>I'm trying to vertically center a div in the viewable area on a very long page. The true vertical center of the page is well above the user's viewable area in this case.</p> <p>I've added the scrollTop() length of the link the users clicks on to the formula which helps, but still places the div above the center of the viewable area.</p> <p>Code excerpt:</p> <pre><code>$('.' + layer).css({ display:'block', left:( $(window).width() - $('.' + layer).width() )/2, top:( $(this).scrollTop() + $(window).height() - $('.' + layer).height() )/2 -20, position:'absolute' }); </code></pre>
javascript jquery
[3, 5]
5,545,603
5,545,604
trying to add rows and cells to a table dynamically
<p>I have been successful in adding rows and cells to a table when the content of each cell is a text input. But when I try to add custom text (or a hyperlink) I do not get any result. Here is my code:</p> <pre><code>if (bb == "link") { var newRow = $("&lt;tr&gt;&lt;/tr&gt;").appendTo(thisTable); var newLinkCell = $("&lt;td&gt;&lt;/td&gt;").appendTo(newRow); var hInput = $("&lt;span&gt;" + l + "&lt;/span&gt;").appendTo(newLinkCell); } </code></pre> <p><strong>UPDATED FIDDLE:</strong></p> <p>This is the relevant code. A fiddle of the entire problem is here: <a href="http://jsfiddle.net/N8sW2/1/" rel="nofollow">http://jsfiddle.net/N8sW2/1/</a></p> <p>My problem deals with the "Link to Page" button. Please help.</p>
javascript jquery
[3, 5]
2,034,584
2,034,585
Upload queue for data
<p>For an android app i'm developing i need to check for an internet connection, before sending data to a web service. It's possible that a device won't be connected to the web for hours, while tasks have to be completed and put into a queue for uploading. Once the device establishes a connection, all of the data has to be transmitted. </p> <p>I thought about using getSystemService(Context.CONNECTIVITY_SERVICE) however that's only possible in an Activity, and for a correct use of OOP, i want to get all of the upload code into a separate class which checks for internet connection, makes a JSON, etc. It also routinely needs to check for a connection to see if the data can be transmitted.</p> <p>What would be the best way of accomplishing this? </p>
java android
[1, 4]
2,166,819
2,166,820
JQuery each append and fadeIn one by one
<p>I have an each function on an array and I want to create a div for each array row and fade them in sequentially. Preferably how they are ordered in the array. Currently I manage to fade all in at once, but I want it sequentially. This is my code:</p> <pre><code>$.each(data, function(key, val) { var generatedDiv = $(document.createElement('div')); generatedDiv.attr('id',"div-"+val.id); generatedDiv.css({//somecssproperties}); $('#results').append(generatedDiv); generatedDiv.fadeIn("fast"); }); </code></pre> <p>Any ideas?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
1,422,912
1,422,913
C++ System Command window shows up when launching a WinForm Application
<p>I have a C++ - based application. This application triggers in turn a C# based WinForm executable. I use system() to launch this. When I do this, I get system (command prompt) window alongwith my form. My question is how to suppress this window. I want only to launch the application without prompt window...</p> <pre><code>// Trigger the form application system("C:\\tmp\\MyApp\\SBCForm.exe"); </code></pre>
c# c++
[0, 6]
4,700,132
4,700,133
run function if EITHER statement is true
<p>This below is a snippet from the code that I am working on. The short version of this is when a radio button with a label of <strong>NO</strong> is NOT checked, then the details textbox will show. I simply want to add another condition which allows the box to be shown IF another label is checked. </p> <p>Example: IF 'NO' OR 'HOW MANY PEOPLE' are checked, then show the textbox.</p> <p>I have been trying using the pipes but to no success.</p> <pre><code>if ($this.siblings('label').text() != 'No') { if ($this.is(':checked')) { $details.show(); $prompt.hide(); } } </code></pre> <p>Thanks to anyone in advance, I know this is a simple question Im just a bit stuck!</p>
javascript jquery
[3, 5]
4,569,322
4,569,323
Expandable listview Refreshing
<p>I am using expandable listview i need to refresh as i am searching the list only for parent.I have searched for tutorial in which i can set visibility only for some parent but not all the expandable listview object .</p> <p>Thanks in advance.</p>
java android
[1, 4]
2,759,149
2,759,150
Navigation close onClick of another list item
<p>Does anyone know how I can expand on the function at the moment, so that when one navigation is open, when the user clicks to open the other navigation, the navigation which is open presently collapses?</p> <p>Please find the code below;</p> <p><a href="http://jsfiddle.net/N7xgC/" rel="nofollow">http://jsfiddle.net/N7xgC/</a></p>
javascript jquery
[3, 5]
1,342,113
1,342,114
How to slide a div from left to right on the image slide show?
<p>i am new to javascript and jquery. I have downloaded fadeslide show. i am fine with the slide show.But the description for each image is sliding on image from the bottom. But i need it from left. So kindly help me.</p> <p>code is as below.</p> <p>showhidedescpanel:function(state, animateduration){ var setting=this.setting var endpoint=(state=="show")? setting.dimensions[1]-setting.panelheight : this.setting.dimensions[1] setting.$descpanel.stop().animate({top:endpoint}, (typeof animateduration!="undefined"? animateduration : fadeSlideShow_descpanel.slidespeed), function(){ if (setting.descreveal=="always" &amp;&amp; state=="hide") setting.$restorebutton.css({visibility:'visible'}) //show restore button })</p>
javascript jquery
[3, 5]
4,123,481
4,123,482
How do i select an element with certain ID and a certain rel
<p>I looked at selectors and has attribute seems to be the closes choice however i cant seem to make it work.</p> <p>what i am trying to do i select an element with certain id that also has a certain rel value..</p> <p>for example:</p> <pre><code>&lt;input value="Needthisvalue" rel="15" value=wahtever" id="pickthisID" type="hidden"&gt; </code></pre> <p>to find out that input with that id and that rel. what I've tried so far is :</p> <p>TabID contain the 15.</p> <pre><code>$('#pickthisID[rel="'+TabID+'"]').val(); </code></pre> <p>Thanks in advanced.</p>
javascript jquery
[3, 5]
2,282,630
2,282,631
New to Jquery and trying to translate some code from Prototype
<p>I am trying to translate this code from Prototype into the same thing in Jquery:</p> <pre><code>$("follow_form").update("&lt;%= escape_javascript(render('users/unfollow')) %&gt;") $("followers").update('&lt;%= "#{@user.followers.count} followers" %&gt;') </code></pre>
javascript jquery
[3, 5]
2,645,261
2,645,262
JavaScript class function this operator
<p>I have a JS class that contains a AJAX post. I'm trying to refer to the class members from within the post function using <code>this</code> but it doesn't seem to be working. </p> <p>For example, from this: </p> <pre><code>function Classy() { this.goal = 0; $.post( "class/initial.php", function(back) { this.goal = back.goal; }, "json"); this.SampleFunction = function() { alert(this.goal); } } tester = new Classy(); tester.SampleFunction(); </code></pre> <p>The alert box outputs a value of <code>0</code>, even though this is definitely not what is coming back from the php file. I think the issue is I need something other than <code>this</code> to refer to the parent class. Anyone have any ideas?</p>
javascript jquery
[3, 5]
4,025,214
4,025,215
What does the jQuery selector $("element", $(document.body)) do?
<p>I am trying to figure out what in the world this jquery selector is doing. When it runs, it is executing on a massive scale and removing it increases execution speed by roughly 95%. The optimized code works fine without it, but I am still trying to figure out what it was doing in the first place.</p> <p>Here is the original code format:</p> <pre><code>$("[name='" + this.Name + "']", $(document.body))... </code></pre> <p>The item I'm trying to figure out is what is after the comma. It's not a normal part of the selector, as it is outside the main batch of quotes, and I have had no luck at all finding documentation on anything like this. When the code is reduced to </p> <pre><code>$("[name=\"" + this.Name + "\"]") </code></pre> <p>then it operates at a massively increased speed (95% faster). Does anyone know what that extra <code>$(document.body)</code> is doing?</p>
javascript jquery
[3, 5]
2,849,108
2,849,109
Android: Changing Wallpaper to Drawable
<p>I'm using this code to change the wallpaper of the android home</p> <pre><code>WallpaperManager wm = WallpaperManager.getInstance(this); wm.setBitmap(myBitmap); </code></pre> <p>I would like to set the background to a drawable. Is this possible?</p>
java android
[1, 4]
566,168
566,169
Adding jQuery to a 3rd party page fails
<p>I am trying out a few things, and among those I tried to insert jquery on a site, namely, <a href="http://www.tesco.com/wine" rel="nofollow">http://www.tesco.com/wine</a>. </p> <p>For some reason, I was not able to able access jQuery even though I was able to successfully append a new script tag to the body element. Also, the page seems to have a <code>window.$</code> function that I tried to delete with <code>delete window.$</code>. This, seems to return false for me. How do you make something undeleteable?</p> <p>Here is the code I used to append the jQuery script to the document:</p> <pre><code>var s = document.createElement('script'); s.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"; document.body.appendChild(s) </code></pre> <p>It is working on other pages.</p>
javascript jquery
[3, 5]
5,736,219
5,736,220
Change Attribute Every Second
<p>I want an image to change every second. I'm having trouble with setInterval. Could someone post a quick snippet on how to do this</p> <p>This is what I came up with.</p> <pre><code>var images = 'images/image_*.png'; for(var i = 1; i &lt;= 5; i++){ function changeImg(){ var path = images.replace('*', i); $('img').attr('src', path); } setInterval('changeImg()', 1000); } </code></pre>
javascript jquery
[3, 5]
4,522,172
4,522,173
Can't get location on android device
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10443577/get-current-location-in-android">get current location in android</a> </p> </blockquote> <p>I'm trying to make an application for android that gives me the position of the device. I'm using the LocationManager.requestlocationupdates method to start a listener. Unfortunately this doesn't work. When I'm looking for the stacktrace in Logcat I don't find any error but one sentence.</p> <blockquote> <p>11-28 12:01:17.377: E/AndroidRuntime(1138): at Tom.Tracer.App.GetCoords.run(GetCoords.java:28)</p> </blockquote> <p>This line doesn't really help me further..</p> <p>I'm using this code :</p> <pre><code>@Override public void run() { lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE) ; lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 2000, 10, locationListener) ; } </code></pre> <p>The Listener </p> <pre><code>private final LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { double longitude = location.getLongitude(); double latitude = location.getLatitude(); Date date = new Date(); toSave = "NEW" + date.toString()+ "-" + location.getLatitude() + "-" + location.getLongitude() + "/"; p("To save: " + toSave); } }; </code></pre> <p>Thanks for your help!</p>
java android
[1, 4]
3,370,633
3,370,634
Javascript loading issue or order of operations issue
<p>I have a link that Generates content. This is all working. I'm trying to associate a JS with this content, which is not working:</p> <pre><code>function add_fields(link, association, content) { var new_id = new Date().getTime(); var regexp = new RegExp("new_" + association, "g") console.log(content); $(link).parent().after(content.replace(regexp, new_id)); console.log(new_id); console.log("promotion_profile_extrafields_attributes_" + new_id + "_image") RD.FileUpload.create({ fileFieldName: "file", inputNodeID: "promotion_profile_extrafields_attributes_" + new_id + "_image", progressBarID: "bgUploaderProgressbar", swfuploadOptions: $.extend({ post_params: { dir: "chag/assets" }, button_placeholder_id: "bgUploaderButton3" }, Settings.swfOptionsforImages) }); } </code></pre> <p>This is generating the correct selector: promotion_profile_extrafields_attributes_1316033511105_image, which is a time stamped to make the id unique. I'm not sure why my JS isn't working.</p>
javascript jquery
[3, 5]
1,605,394
1,605,395
QR camera to capture 1D barcode
<p>i plan to development the QR camera for android app to capture 1D barcode , what should i start for it ? can someone guide me .</p>
java android
[1, 4]
1,468,927
1,468,928
where does window.somedata gets stored
<p>In JavaScript when i say <code>window.SomeData = 'whatever'</code>, where does it get saved in the browser? I thought it gets saved in the <code>viewstate</code> but it doesnt. Also how much security concern is it to save some data in <code>window.someKey</code>. I am not talking about username or password storage but some general data like PK values of some records.</p> <p>--Edit--</p> <p>The reason i am asking this is because i have a page with 5 tabs and each tabs gets loaded by an AJAX call. I need to save the data that comes back from AJAX request and currently i am using window.somekey to save it.</p>
javascript jquery
[3, 5]
2,586,818
2,586,819
Show week numbers in asp:Calendar
<p>Is there an easier way to show the week numbers in an asp:Calendar control? I found <a href="http://www.codeproject.com/Articles/24183/Adding-week-numbers-to-ASP-NET-Calendar-Control" rel="nofollow">this</a> post but it is a 2008 post. Thought there might be a simpler way now?</p> <p>I am developing in asp.net c# 4.0.</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,632,584
4,632,585
HTC Desire stops recording
<p>I'm writing an application that records background noise for a long time (up to 12 hours, mostly at night). I'm using MediaRecorder for the recording. The problem is that on HTC Desire device the recording stops after about 1 hour, or even shorter time (there is no crash). On another device, LG-P970h, this doesn't happen at all (i.e., no recording problem). What is the reason for this and what can I do? Thanks</p>
java android
[1, 4]
4,233,040
4,233,041
Toggling divs in javascript
<p>I want to toggle divs by clicking on links. but things are not going well for me when I click on a link it shows a new div but don hide the previous one</p> <p>JavaScript Code</p> <pre><code>&lt;script type="text/javascript"&gt; function toggle(id){ var el = document.getElementById(id); if(el != null &amp;&amp; el.style["display"]== 'none'){ el.style["display"] = "block"; } } &lt;/script&gt; </code></pre> <p>My divs code</p> <pre><code>&lt;?php foreach($titles_data as $title){ ?&gt; &lt;div style="display:none" id="content_&lt;?php echo $title['idtitles'] ?&gt;"&gt; &lt;div id="left-ad"&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php } ?&gt; </code></pre> <p>My links code</p> <pre><code>&lt;?php foreach($titles_data as $title){ ?&gt; &lt;li class="flag_&lt;?php echo strtoupper($title['language']) ?&gt;"&gt; &lt;a id="title_&lt;?php echo $title['idtitles'] ?&gt;" href="" title="&lt;?php echo $title['title'] ?&gt;" onclick="toggle('content_&lt;?php echo $title['idtitles'] ?&gt;')"&gt; &lt;/a&gt; &lt;/li&gt; &lt;?php } ?&gt; </code></pre> <p>How can it be done so that when i click on link its respective iv becomes visible and the previous one hides?</p> <p>Thanks</p>
php javascript jquery
[2, 3, 5]
4,039,191
4,039,192
How do I get a id of a <span> if i have id of div using jQuery?
<p>i am having <strong>"div"</strong> which contains <strong>span</strong> so i want id of that particular span</p> <pre><code>&lt;div id="status-0" class="abc"&gt; &lt;span id="span_id" class="xyz" title="Enabled"&gt;&amp;nbsp;&lt;/span&gt; &lt;/div&gt; So how to get id of span with jquery? and after some action i want to change class of that span using id, how to do that? </code></pre>
javascript jquery
[3, 5]
1,650,041
1,650,042
showing dialog from run method
<p>I am trying to pop up dialog from run method it gives me exception that Looper.prepare not called ,when i call the same method i dont get any exception but there is no pop up dialog shown on the console .As i have used handler in this way ,</p> <p>handler = new Handler() { public void handleMessage(Message msg) { showDialog(DIALOG1_KEY); // process incoming messages here } };</p> <p>i am not getting any exception again but still no luck can any body tell me where i am doing things wrong. Thnx in advance.</p>
java android
[1, 4]
4,543
4,544
When sortable is dropped fire an alert
<p>Is there a callback function which fires when a user moves a draggable into a new position ?</p> <p>So for fiddle : <a href="http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/" rel="nofollow">http://jsfiddle.net/adrianjsfiddlenetuser/zyUkd/</a> When "Hello 01" is dragged and dropped into a new area the alert is fired ?</p> <p>Do I need to use .droppable ?</p>
javascript jquery
[3, 5]
4,062,605
4,062,606
From mouse event to touch event
<p>I have this javascript code, which I'd like to use also on a touch or tap the screen. Now it works only on mouse click. I would like to have it on android. Can you please help?</p> <pre><code>//Draw circle function drawCircle(e) { canvas.click(function(e) { var canvasOffset = canvas.offset(); var canvasX = Math.floor(e.pageX-canvasOffset.left); var canvasY = Math.floor(e.pageY-canvasOffset.top); cb_ctx.beginPath(); cb_ctx.arc(canvasX,canvasY,cb_ctx.lineWidth/2,0,Math.PI*2,true); cb_ctx.fillStyle = cb_ctx.strokeStyle; cb_ctx.fill(); }); } </code></pre>
javascript android
[3, 4]
353,735
353,736
android : WALLPAPER_CHANGED is not working on samsung galaxy
<p>i have an application in which i am receiving WALLPAPER_CHANGED broadcast. the problem is that it is working in HTC Desire HD but not working on Motorola Milestone or Droid X. why is that ?? also it is not working on Samsung Galaxy S. </p> <p>what can be the issue ? </p>
java android
[1, 4]
1,076,594
1,076,595
Using Custom IHttpModule to save information on changing pages
<p>I have a site where users can use a particular page to enter in lots of information. If the user navigates away from that page, I'd like to store a Session variable so that the user may return to that page and retain all the information added previously.</p> <p>I've created a custom IHttpModule. My intent was to utilize that to take notice when users click away from the page. Then access the page, grab the variables from it, and store them for re-population later.</p> <p>Here's what I've got:</p> <pre><code>public void Init(HttpApplication application) { application.BeginRequest += (new EventHandler(this.Application_MovePages)); } private void Application_MovePages(Object source, EventArgs e) { HttpApplication application = (HttpApplication)source; HttpContext context = application.Context; System.Web.Ui page; if (HttpContext.Current.Handler != null) { page = (System.Web.Ui.Page)HttpContext.Current.Handler; } } </code></pre> <p>The problem is HttpContext.Current.Handler is always null. I'm missing something here.</p>
c# asp.net
[0, 9]
1,638,025
1,638,026
how to control sound in android?
<p>i m making an app for music player and i want to increase and decrease volume by using hardware buttons on mobile. so pls tell me any code to do this.</p>
java android
[1, 4]
4,216,822
4,216,823
Is it worth learning Java when you already know C# fairly well?
<p>Since C# is in many ways a direct derivative of Java I wondered whether there was any advantage to learning Java after the fact of having learnt quite a reasonable about about C#?</p> <p><strong>Note:</strong> Please provide clear, direct advice rather than discussion in order to keep in line with SO guidelines.</p>
c# java
[0, 1]
4,378,583
4,378,584
Load local xml data in listview in android
<p>can you suggest a simple example to load local XML data in List view. </p>
java android
[1, 4]
4,452,352
4,452,353
selecting items by class inside element on jQuery
<p>I try to pick all the child <code>.preview</code> elements inside <code>.dropzone</code> parent.</p> <pre><code>$('.dropzone').add($('.preview')).length </code></pre> <p>This returns 3 but there are 2 objects. I guess it is counthing also the <code>.dropzone</code> container. </p> <p>How can I choose only the two <code>.preview</code> items?</p>
javascript jquery
[3, 5]
5,457,347
5,457,348
How to keep div focus when the mouse enters a child node
<p>So I have this page here: <a href="http://www.eminentmedia.com/development/powercity/" rel="nofollow">http://www.eminentmedia.com/development/powercity/</a></p> <p>As you can see when you mouse over the images the div slides up and down to show more information. Unfortunately I have 2 problems that i can't figure out and I've searched but haven't found quite the right answer through google and was hoping someone could point me in the direction of a tutorial.</p> <p>The first problem is that when you mouse over an image it changes to color (loads a new image), but there's a short delay when the image is loading for the first time so the user sees white. Do I have to preload the images or something in order to fix that?</p> <p>My second problem is that when you move your mouse over the 'additional content area' it goes crazy and starts going up and down a bunch of times. I just don't have any idea what would cause this but i hope one of you will!</p> <p>All my code is directly in the source of that page if you would like to view the source.</p> <p>Thanks in advance for your help!</p>
javascript jquery
[3, 5]
5,875,311
5,875,312
Best way to have a user upload an image and save it for future retrieval with ASP .NET
<p>I'm looking for the best way to upload an image from a clients computer and save it for future retrieval with ASP .NET. </p> <p>What would be the best way to do this?</p>
c# asp.net
[0, 9]
1,268,483
1,268,484
Development feature: disable jQuery ajax
<p>is it possible to disable jQuery <code>ajax()</code> calls? As a developer, I ofttimes need to test site without ajax (without actually turning js off).</p> <p>I would create a script that utilizes local database: when certain link is clicked, it would toggle a property. Ie. how can I effect global bindings such as</p> <pre><code>$("a.ajax").live("click", function (event) { event.preventDefault(); $.get(this.href); }); </code></pre> <p>without actually changing the code itself? Could I replace the <code>ajax()</code> function? How would you deal with this?</p>
javascript jquery
[3, 5]
784,918
784,919
Disable click event on ajax loaded content of a DIV
<p>I need to disable click event on ajax loaded content of a DIV. </p> <pre><code>&lt;div id="left_column"&gt; &lt;div class="menu"&gt;------&lt;/div&gt; &lt;div class="menu"&gt;------&lt;/div&gt; &lt;div class="small_panel1"&gt;------&lt;/div&gt; &lt;div class="small_panel1"&gt;------&lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want disable click event from all div inside leftcolumn.</p> <p>I am trying below code but it is not working :- </p> <pre><code>$("#left_column").children().bind('click', function(){ return false; }); </code></pre> <p>Please suggest me what should I use here. Thank in advance</p>
javascript jquery
[3, 5]
944,146
944,147
c# const in jQuery?
<p>I have this piece of code in javascript:</p> <pre><code> var catId = $.getURLParam("category"); </code></pre> <p>In my asp.net and c# code for "category" query string i use a public const: </p> <pre><code>public const string CATEGORY = "category"; </code></pre> <p>so if i want to change the query string parameter to be "categoryTest" i only change this const and all the code is updated.</p> <p>Now the question is: how can i do something similar for the javascript i have in the same application (so i want to use the same constant)?</p> <p>I mean i want something like this:</p> <pre><code>var catId = $.getURLParam(CQueryStringParameters.CATEGORY); </code></pre> <p>but because there are none asp.net tags, my const is not interpreted...</p> <p>Any workaround?</p>
c# asp.net javascript jquery
[0, 9, 3, 5]