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,903,021
2,903,022
How do I get the onclick variable into a dialog function
<p>I have a onclick event that has a value in it that I want to post to a backend php script. Just not sure how to get it in the dialog function. </p> <pre><code>function reorder(job_index)//&lt;--------this fella { $('#dialog').dialog('open'); } $(document).ready(function(){ $(function() { $("#dialog").dialog({ bgiframe: true, autoOpen: false, height: 250, width: 600, modal: true, buttons: { 'Yes, use the number above': function() { var jobID=$("#jobnumber").val(); $.post("rpc.php", { job_index:job_index,// &lt;-------to here jobID:jobID, method: "reorder" }, function(data,textstatus) { alert(data.message); }, "json"); }, 'No, create a new number for me': function() { $(this).dialog('close'); }, Cancel: function() { $(this).dialog('close'); } } }); }); }); </code></pre> <p>The value is job_index. Any tips?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,741,311
5,741,312
compress video files
<p>i want compress video files and send it from Transmitter and receive it and decompress it and show</p> <p>is sdk for it? (for c++ or c#)</p> <p>and if is possible Introduction to me some video library.</p> <p>thanks.</p>
c# c++
[0, 6]
4,265,405
4,265,406
JavaScript For Checking Date
<pre><code>function checkDate(sender, args) { var toDate = new Date(); toDate.setMinutes(0); toDate.setSeconds(0); toDate.setHours(0); toDate.setMilliseconds(0); if (sender._selectedDate &gt; toDate) { alert("You can not select forthcoming days!"); sender._selectedDate = toDate; sender._textbox.set_Value(sender._selectedDate.format(sender._format)) } </code></pre> <p>I used this javascript to validate the date of the textbox. Its should only accept the all the past date and todays date. Future dates are not accepted. It works perfectly for past and future date. But when i select the todays date it do not accept. The logic is correct because selected date should be greater than todays date as i have given. Can any one give a suggestion on this.</p>
javascript asp.net
[3, 9]
584,518
584,519
Difference of Enum between java and C++?
<p>Hi I am learning Enums in java I like to know what are the major differences of Enum in java and C++. Thanks</p>
java c++
[1, 6]
1,031,495
1,031,496
only one radio buttons
<p>I have read in an example that if you use more than one radio button you should use <code>RadioGroup</code> like this:</p> <pre><code>&lt;RadioGroup android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"&gt; &lt;RadioButton android:id="@+id/radio_pirates" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="14dp" android:layout_marginLeft="100dp" android:onClick="onRadioButtonClicked" android:text="@string/attendance" android:textSize="8dp" /&gt; &lt;RadioButton android:id="@+id/radio_pirates2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="14dp" android:layout_marginLeft="100dp" android:onClick="onRadioButtonClicked" android:text="@string/attendance" android:textSize="8dp" /&gt; &lt;/RadioGroup&gt; </code></pre> <p>If I have only one radio button, can I remove <code>&lt;RadioGroup&gt;</code> or that is wrong ?</p>
java android
[1, 4]
5,769,625
5,769,626
Can you check if a web application is already running on another browser tab?
<p>I have a web application written in ASP.NEt/C# and javascript. It uses session variables.</p> <p>When I open the application, is there a way to check if the application is running in another tab?</p> <p>Or do you have any ideas on making session variables unique for each tab?</p> <p>Any help would be great!</p> <p>Thanks</p> <p>Kev.</p>
c# javascript asp.net
[0, 3, 9]
1,663,356
1,663,357
how do i avoid including jquery twice?
<p>i have a service i'm building, which will be included as JS on client web pages. optimally, i want to build the service using jquery.</p> <p>the case may arise, where the page already has JQ included.</p> <p>how do i avoid including JQ twice in the page? how do i make sure i still have the desired JQ functionality, even if the page has already included an older version of JQ?</p> <p>is the only solution simply abandoning JQ and going with hand-coded script?</p>
javascript jquery
[3, 5]
5,242,787
5,242,788
My javascript to jQuery translation has a bug
<p>My guess is that this javascript just finds the div called <code>divid</code> and then uses it with the <code>sendit</code> function.</p> <pre><code>var somevalue = 19; if (navigator.appName.indexOf("Microsoft") != -1) { thediv = window["divid"]; } else { thediv = document["divid"]; } thediv.sendit(somevalue); </code></pre> <p>I would imagine in jQuery it would look something as simple as this:</p> <pre><code>var somevalue = 19; $('divid').sendit(somevalue); </code></pre> <p>But it's not working!! What could I be missing?</p> <p>I should say that it's in the middle of other javascript code, could that be a problem? </p>
javascript jquery
[3, 5]
2,210,507
2,210,508
sorting a json list?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1129216/sorting-objects-in-an-array-by-a-field-value-in-javascript">Sorting objects in an array by a field value in JavaScript</a> </p> </blockquote> <pre><code> var myData = [ {"Identifier":1,"Naam":"Van Der Valk","Adres":"Europaweg 218","Postcode":"1238AC","Plaats":"Zoetermeer","Longitude":"4.48822","Latitude":"52.06258", "Status":"Laadpunten Beschikbaar", "lunch":"true", "diner":"true", "meet":"true", "wifi":"true", "Distance": "10.1"}, {"Identifier":2,"Naam":"Meram place","Adres":"NOT Given 1","Postcode":"0000LL","Plaats":"Rotterdam","Longitude":"4.48178","Latitude":"51.92422", "lunch":"false", "Distance": "181"}, {"Identifier":3,"Naam":"Station Zwolle","Adres":"NOT Given 6","Postcode":"0000LL","Plaats":"Zwolle","Longitude":"6.08302","Latitude":"52.51677", "lunch":"false", "Distance": "5.1"}, {"Identifier":4,"Naam":"Pompstation Shell","Adres":"NOT Given 1","Postcode":"0000LL","Plaats":"Den Haag","Longitude":"4.30070","Latitude":"52.07050", "lunch":"false"}, {"Identifier":5,"Naam":"Amsterdam Arena","Adres":"NOT Given 218","Postcode":"0000LL","Plaats":"Amsterdam","Longitude":"4.89517","Latitude":"52.37022", "lunch":"true", "diner":"true", "wifi":"true", "meet":"true", "Distance": "34.2"} ]; </code></pre> <p>I have a question, given I have the above json.. and i want to append this to a list i.e ul li.. how is it possible to get the list ordered with the one with the lowest distance etc.</p>
javascript jquery
[3, 5]
3,870,929
3,870,930
Onload click the link
<p>At the moment the following code will load only when the users clicks the link.</p> <p>I want on load of the page this to happen without the user having to click.</p> <pre><code>&lt;script&gt; $(document).ready(function() { // Support for AJAX loaded modal window $(document).on('click', '.btn-modal', function() { $.get($(this).attr('data-target'), function(data) { $('#modal').html(data); $('#modal').modal('show'); }, 'html'); }); });​ &lt;/script&gt; &lt;!-- Modal window to load dynamic content --&gt; &lt;div class="modal hide fade customDialog" id="modal"&gt;&lt;/div&gt; &lt;a class="btn btn-modal" data-target="page.html" &gt;Launch Modal&lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
4,800,105
4,800,106
How to play external video with java android jdk?
<p><a href="http://www.androidpeople.com/android-mediaplayer-example/" rel="nofollow">Here</a>'s an example on how to play video,</p> <p>but it embeds the video as resource of the apk,</p> <p>how to play an external video ,e.g. the <code>test.mp4</code> under the <code>/download</code> directory of sdcard?</p>
java android
[1, 4]
3,186,560
3,186,561
jQuery - "Trigger a click" vs "Function call"?
<p>Say I have some actions binded to a link ( with .click or .live), and I want to do the same thing later, but I don't want duplicated code. Which is the correct way and why?</p> <p>This:</p> <pre><code>$('#link').click(function(){ //do stuff }); //called later $('#link').trigger('click'); </code></pre> <p>OR:</p> <pre><code>$('#link').click(function(){ do_stuff(); }); //called later do_stuff(); //defined here function do_stuff(){ //do stuff } </code></pre>
javascript jquery
[3, 5]
1,030,487
1,030,488
Best Javascript tutorial so i can get started on JQuery?
<p>Sorry if this is in the wrong stack exchange, wasn't sure if I should post it here, or overflow.</p> <p>Just wanted to know of a few good online tutorials or a book I can do to get me started with Javascript (I know the small basics, alerts, css styles) and then maybe it branches to JQuery, or at least will give me enough of a base to start JQuery, and still understand the underlining language.</p> <p>Thanks (eventually will be using JQuery for UI and interactions)</p>
javascript jquery
[3, 5]
5,912,658
5,912,659
The status code returned from the server was: 500
<p>I have a feature in my site that is sending emails. I want to save the email details including the message that users typed in the database for historical purposes. Page uses validation for the fields and as such it throws an error: </p> <p><code>"Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500".</code></p> <p>Goggling this I've learned that this is to prevent potential hack of my site as well a database, which I can appreciate.</p> <p>What do I need to do safely save the text in the database? Currently the datafiels is a <code>varchar(max)</code> and I use this to insert data: </p> <pre><code>emailHistoryUpdated = _emailHistUpdate.InsertEmailHistory(_today, _name, txtSubject.Text, txtMessage.Text, txtFileUp.FileName, Session["iAm"].ToString()); which is my middle tear. I use the dataset created with VS2010 and stored procedure to communicate with the SQL server. </code></pre>
c# asp.net
[0, 9]
3,689,862
3,689,863
regex search using string
<p>I have a string of text that has the value of the selected text. Id like to do a replace() of this text in a given div of text.</p> <p>so I know I can do that with the following:</p> <p><code>myelement.replace(/foo/g, 'bar');</code></p> <p>However I need to do it with my string ie:</p> <p><code>myelement.replace(/*mystring*/g, 'bar');</code></p> <p>So I tried:</p> <pre><code>mystring = '/'+mystring+'/g'; myelement.replace(mystring, 'bar'); </code></pre> <p>Which didnt work, so i tried (which i knew wouldn't work):</p> <p><code>myelement.replace(/+mystring+/g, 'bar');</code></p> <p>So how can i do this?</p> <p>I've coded something up for you guys in jsfiddle --> <a href="http://jsfiddle.net/5DYZN/" rel="nofollow">HELP ME PLEASE!</a></p>
javascript jquery
[3, 5]
2,452,378
2,452,379
how to make a "Tr" visiable and invisable based on radio buttonlist click
<p>i have an <strong>2 "tr"</strong> under </p> <ol> <li>tr one have an file upload control</li> <li><p>tr two have an textbox control.</p> <p>so i have an radio button list woth three values 1:image 2:video 3:Audio by default i need to show file upload control visiable that is the <strong>1"tr".</strong> but once user clicks on video/audio option in radio button list then i need to make <strong>2 "tr"</strong> visiable[ textbox] and <strong>1"tr"</strong> invisiable[fileupload control] so how can i achive this functionality in javascript</p> <p>thank you </p></li> </ol>
asp.net javascript jquery
[9, 3, 5]
2,823,344
2,823,345
Having a TableRow with TextView's underneath each other
<p>I'm currently having the following problem:</p> <p>I've got a TableView that is given TableRow's to be added to it with data. I want each TableRow to contain 2 TextView's having a width of the parent and are underneath each other, for example:</p> <pre><code>| TextView1.............. | | TextView2.............. | | .........EndOfTextView2 | </code></pre> <p>In my example above, it's just showing that I also want the second TextView to be able to run over multiple lines.</p> <p>Here is the XML for my TableLayout:</p> <pre><code>&lt;TableLayout android:id="@+id/feed" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="5px" android:stretchColumns="1" &gt; &lt;/TableLayout&gt; </code></pre> <p>Used to iOS so I'm kind of new in this XML/Java style mobile programming department.</p> <p><strong>EDIT:</strong></p> <p>I ended up adding a LinearLayout to the TableRow, is this the best way to do it?</p>
java android
[1, 4]
2,677,601
2,677,602
Want to rotate element in jquery
<p>I am trying to <em>rotate an element</em> (any element div,p..) with the <em>handle</em> (handle=>div) which I placed on the element's <em>top-left</em> corner, now my problem is that the element does not fully rotate to 360 degree, can anyone please help out :</p> <pre><code>$("#elementid").live('mouseover', function () { $(this).draggable({ handle: "#handleid", drag: function (event, ui) { var rotateCSS = 'rotate(' + ui.position.left + 'deg)'; alert(ui.position.left); $(this).parent().parent().css({ '-moz-transform': rotateCSS, '-webkit-transform': rotateCSS }); } }); }); </code></pre>
javascript jquery
[3, 5]
5,147,505
5,147,506
php + javascript open a link in new weindow (tab) automatically
<p>I have 100 links for example, in a file. The idea is to loading to a php page, it loads the links file, it reads the first line and gets the first link. Then it opens it in a new window of browser, after 5 seconds the page refreshes itself and it gets the second link from the file and opens it in a new window again.</p> <p>Now, I can do the whole thing by php, But I don't know how to open the link in a new window automatically without any click. and I guess it might be possible through JS.</p> <p>Thanks for help :)</p>
php javascript
[2, 3]
3,508,892
3,508,893
Disabling LinkButton doesn't disable the click event in javascript
<p>I want to disable a <code>LinkButton</code> clink on the client site.</p> <pre><code>objLinkButton.disabled = true; // or objLinkButton.disabled = -1; </code></pre> <p>This disables the link but I am still able to click on the link and do PostBack.</p> <p>Is there any way I can disable the link.</p> <p>Code:</p> <pre><code>&lt;asp:linkbutton id="xyz" runat="server" onClick="javascript:LinkDisable(this)" &gt;&lt;/asp:linkbutton&gt; </code></pre> <p>which renders as a link which does a postback... I am opening the page on postback in a new window. What I want to do is.. when I click on the link for the firsttime.. it will open a new page and then it will disable the link.</p> <p>what I am doing is .. onClick of that link I have a javascript function.. which is something like this..</p> <p>In LinkDisable ...</p> <pre><code>function LinkDisable(obj) { obj.disabled = -1; obj.href = '#'; //Cant return false from here.. otherwise it wont postback... } </code></pre> <p>When I do this.. the link gets grey's out ... but I am still able to click it. I want to stop the user from clicking it the second time.</p> <p>Any help is appreciated.</p>
c# asp.net javascript
[0, 9, 3]
4,473,161
4,473,162
How to get inner tr tag using JQuery?
<p>I am trying to grab documentnumber attribute from the tr tags inside tbody, and save it in an array.</p> <p>Below is the html , I am working on</p> <pre><code>&lt;tbody class="line-item-grid-body"&gt; &lt;tr data-group-sequence-number-field-index="" data-sequence-number-field-index="1" documentnumber="80" documentid="4133604" parent="80" class="line-item parent-line-item line-item-show reorderable-row droppable-element"&gt; &lt;td&gt; &lt;table&gt; &lt;tbody&gt; &lt;tr&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr data-group-sequence-number-field-index="" data-sequence-number-field-index="1" documentnumber="80" documentid="4133604" parent="80" class="line-item parent-line-item line-item-show reorderable-row droppable-element"&gt; &lt;/tr&gt; &lt;/tbody&gt; </code></pre> <p>and this is what I did, which is not working. If I don't specify particular class then system also grabs inner tr tags, which I don't want</p> <pre><code>var docs = jQuery("#line-item-grid").find('tbody').find("tr[class='line-item parent-line-item line-item-show reorderable-row droppable-element']"); for (i=1;i&lt;=docs.length;i++) { var tempValue = jQuery(docs[i]).attr('documentnumber'); alert(tempValue); } </code></pre> <p>Any ideas?</p>
javascript jquery
[3, 5]
4,646,511
4,646,512
Object doesn't support this property or method IE8 Jquery
<p>I am getting the error "Object doesn't support this property or method" in Explorer 8, this is the piece of code, I can't see the problem.</p> <pre><code>jQuery('.block_right h3').click(function(){ jQuery(this).parent().find(".respuesta").slideToggle('slow').find(".block_right h3 span").toogle(); }); </code></pre> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
1,674,841
1,674,842
How to display cash value in words using jQuery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7257575/number-to-word-jquery">Number to Word - jquery</a> </p> </blockquote> <p>I want to show the total billed amount in receipt in words also. How to achieve it using jQuery?</p> <p>Ex.</p> <pre><code>Item Qty Unit Price Line Price ------------------------------------------------------ Pen 2 100 200 Note Book 3 30 90 ------------------------------------------------------ Total 290 In Words: Rupees Two Hundred and Ninety Only </code></pre>
javascript jquery
[3, 5]
5,310,129
5,310,130
Android set ringtone failure
<p>I try the following code and it doesn't set the ringtone. The logcat entry for "ff" says null so I guess the URI isnt being concatenated properly?, I cant seem to figure out where in my code I am going wrong.</p> <pre><code>String filepath =Environment.getExternalStorageDirectory().toString()+"//media//audio//ringtones//bluemoon.mp3"; File ringtoneFile = new File(filepath); ContentValues content = new ContentValues(); content.put(MediaStore.MediaColumns.DATA,ringtoneFile.getAbsolutePath()); content.put(MediaStore.MediaColumns.TITLE, "test"); content.put(MediaStore.MediaColumns.SIZE, 215454); content.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mpeg"); content.put(MediaStore.Audio.Media.ARTIST, "artist"); content.put(MediaStore.Audio.Media.DURATION, 230); content.put(MediaStore.Audio.Media.IS_RINGTONE, true); content.put(MediaStore.Audio.Media.IS_NOTIFICATION, false); content.put(MediaStore.Audio.Media.IS_ALARM, false); content.put(MediaStore.Audio.Media.IS_MUSIC, false); Log.i("BOOM", "the absolute path of the file is :"+ringtoneFile.getAbsolutePath()); Uri uri = MediaStore.Audio.Media.getContentUriForPath( ringtoneFile.getAbsolutePath()); Uri newUri = getApplicationContext().getContentResolver().insert(uri, content); Uri ringtoneUri = newUri; Log.i("ff","the ringtone uri is :"+ringtoneUri); RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE,newUri); </code></pre>
java android
[1, 4]
2,610,796
2,610,797
jQuery change text in link
<p>I have a simple question for jQuery...</p> <p>I have a table with a link like this</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td class="views-field"&gt; &lt;a href="ciao"&gt;201105&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>Now I would change the link's text from 201105 to 2011-05</p> <p>(simple add a "-" after the first 4 characters)</p> <p>I tried substring but don't work... Help me!!</p>
javascript jquery
[3, 5]
2,361,074
2,361,075
if focus function
<p>im trying to hide a bee while its movement is not done yet if it is focused</p> <p>here is the bee, that is originally hidden beyond the cloud and not seen, and in first 4 seconds it goes up out of the cloud, then goes to the right also in 4 seconds, then it goes down in 0.3sec, like its hiding, then goes to its origin point beyond the cloud and function repeats in 20 secs. but i want, while these movements, if it is focused, i want the bee to hide, i mean go down in 0.3sec, and then it will appear again after 20 secs.</p> <pre><code> var bee5 = function() { $("#bee5").animate({"top": "-50px"}, 3000, function() { $(this).animate({"left": "130px"}, 700,function() { $(this).animate({"left": "110px"}, 800, function() { $(this).animate({"left": "125px"}, 700, function() { $(this).animate({"left": "115px"}, 800, function() { $(this).animate({"left": "130px"}, 1000, function() { $(this).animate({"left": "110px"}, 900, function() { $(this).animate({"left": "120px"}, 800, function() { $(this).animate({"top": "-10px"}, 250) }) }) }) }) }) }) }) }) $('#bee5').mouseover(function() { $(this).animate({"top": "-10px"}, 250) }); setTimeout(bee5, 15000); } </code></pre> <p>here is css: the bee5 original point</p> <pre><code>#bee5 { position:absolute; top:-10px; left:120px; z-index:0; } </code></pre>
javascript jquery
[3, 5]
3,287,102
3,287,103
Issue with jQuery when fetching data using .load()
<p>I have a table that when a row is clicked it sends the first 6 characters of that row (an ID) to a PHP page and loads the subsequent data into a div further down the page. The issue it seems is that once I click a row to load the div, The majority of the jQuery events stop working (.hover, .sortElements) these are attached to the original table. Is there anyone that would know a 'fix' or work around for this issue or is there something I am just missing.</p> <pre><code>&lt;SCRIPT type='text/javascript'&gt; $(document).ready(function(){ $(".panel").hide(); $(".itemjobbutton").click(function(){ $(".panel").slideToggle("200"); return false; }); var inverse = false; $("#jobTable th").click(function(){ var header = $(this), index = header.index(); header .closest('table') .find('td') .filter(function(){ return $(this).index() === index; }) .sortElements(function(a, b){ a = $(a).text(); b = $(b).text(); return ( isNaN(a) || isNaN(b) ? a &gt; b : +a &gt; +b ) ? inverse ? -1 : 1 : inverse ? 1 : -1; }, function(){ return this.parentNode; }); inverse = !inverse; }); $('#jobTable tr').click(function(){ if($(this).index() != 0) { var thistext = $(this).text().substring(0,6); $("#joblistingDetail").load('jobview.php' , {jobID: thistext}).hide().slideDown('100'); $("#jobTable tr").css("background", "#fff"); $(this).closest('tr').css('background-color', '#C3D9FF'); } }); }); $('#jobTable tr').hover( function() { $(this).addClass('hover'); }, function() { $(this).removeClass('hover') } ); </code></pre> <p></p>
php javascript jquery
[2, 3, 5]
345,662
345,663
mouseenter mouseleave not working the way I think it should
<p>I am relatively new to jQuery, and I seem to be stuck with this mouseenter/mouseleave problem. I would like to setup a menu that "hides" when the page isn't at the top, which seems to be working fine, when it's hidden I would like to make it so when a user hovers over it the class switches and the menu comes back out. However, I don't want this when it gets scrolled back to the top. It works fine when the page first loads (in firefox and chrome) and I haven't scrolled yet, but after scrolling down and back to the top the menu will hide on mouseleave. </p> <p>Here is a <a href="http://jsfiddle.net/bJquD/" rel="nofollow">jsFiddle</a> of my current code setup.</p> <p>I've been trying to solve this for awhile now, and have tried a few other methods.</p> <p>I tried just using hover like this</p> <pre><code>$("#access").hover(function() { $(this).removeClass("scroll").addClass("normal"); }, function() { $(this).removeClass("normal").addClass("scroll"); }); </code></pre> <p>but that did the same thing as the code I have right now.</p> <p>Some of the other methods I tried was to pass the b variable to another function, create a seperate div and track it's position to determine whether or not to use the mouseenter/mouseleave, and finally to bind them, but none of this seemed to work as I thought it should.</p> <p>I can't think of anything else to try, so I am not sure if it's something I'm doing wrong or if this isn't even possible to accomplish like this.</p> <p>This is my first question I tried to include as much information as I could think of hopefully it's enough information.</p>
javascript jquery
[3, 5]
2,449,613
2,449,614
Change div to form on click
<p>I have a div with text inside:</p> <pre><code>&lt;div id="test"&gt;Some text here to edit&lt;/div&gt; </code></pre> <p>When the users clicks on this it needs to change to:</p> <pre><code>&lt;form name="input" action="html_form_action.asp" method="get"&gt; Edit: &lt;input type="text" name="tex" value="Some text here to edit"/&gt; &lt;input type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre> <p>How can I make it so when the user clicks on the text in the div, it will transform into an form/input box like above?</p>
javascript jquery
[3, 5]
3,681,645
3,681,646
Special characters in Android
<p>In EditText field I set values in Cyrillic alphabet, such as АБГ .. all shows fine. When I try to set some Greek or any other letter similar to that, such as <strong>'ʎ'</strong> (lambda), <strong>'ƃ'</strong> (not sure where this comes) or <strong>'ɟ'</strong> .. it shows squares like "□ □ □" this.</p> <p>The charset is UTF-8, otherwise it would not show the Cyrillic alphabet letters... any ideas on this behavior? </p>
java android
[1, 4]
4,222,910
4,222,911
I need help with these two functions
<p>The first one displays the div, the second one hides the dive up on clicking anywhere else in the document. the problem i have is, when i click the button to show the div, it also counts as a document click so it hides the div. how can i it make not hide the div when i click to show the div</p> <pre><code>&lt;script type="text/javascript"&gt; function test22(){ var links = document.getElementById('links_safari'); if(links.style.display == "none"){ document.getElementById('links_safari').style.display=""; var content = $('#links_safari').html(); var words = content.split(','); for (var i = 2; i &lt; words.length; i += 3) { words[i] += '&lt;br&gt;'; } content = words.join(' '); $('#links_safari').html(content); $('#links_safari').css("margin-top", -322); $('#links_safari').css("margin-left", 180); safariPopupStatus++; } else{ links.style.display="none"; } } &lt;/script&gt; &lt;script type="text/javascript"&gt; $(function (){ $(document).click( function (e){ var links = document.getElementById('links_safari'); links.style.display="none"; } ) }) &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,487,519
3,487,520
Java & Android: Accessing a function using Classname vs this
<p>I'm not sure if this is a Java related question or an Android related question, please let me know which one it is. Obviously I am trying to develop for the Android, and I am using Eclipse.</p> <p>Within a java class MainThread I have declared a constant. </p> <p>This declaration works: private static final String TAG = MainThread.class.getSimpleName();</p> <p>But this does not: private static final String TAG = this.class.getSimpleName();</p> <p>Why is it that using the 2nd method returns the error: <em>Syntax error on token "class", Identifier expected</em></p>
java android
[1, 4]
4,532,140
4,532,141
How to display an image that we received through Ajax call?
<p>Web server generates images and sends them to client directly. There are no URLs to the images, for security reasons. For example, if I enter <code>/images/25</code> URL in the browser server will send it and browser will download it. </p> <p>Now I want to get this image from Ajax call and then display it on existing page. I can get the image data. My question is: how can I display an image?</p> <pre><code>$.get("/images/25", function (rawImageData) { // ??? Need to add an image to DOM }); </code></pre> <p><strong>Update</strong></p> <p>I apologize for being so stupid. Thank you, JW. Of course I can just put img tag with src to my URL. It does not matter if this is a direct URL to an image file or the server sends it dynamically.</p>
javascript jquery
[3, 5]
591,382
591,383
Scrolling in a view containing a ListView (Android)
<p>In one of my activities I am showing certain information and at the end I have a <code>ListView</code>. So my layout looks a bit like:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="30dip" &gt; ... &lt;ListView android:id="@android:id/android:list" android:layout_width="wrap_content" android:layout_height="fill_parent" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>When I run the application in the emulator I see that the information before the list view is always shown in the screen and there is a vertical scroll for the <code>ListView</code> only.</p> <p>Is there a way to change this scrolling behaviour ?. What I would like to have is a vertical scroll for all the information in the screen, not only at the level of the <code>ListView</code>.</p> <p>I tried wrapping the <code>LinearLayout</code> with a <code>ScrollView</code>, with different combinations of the <code>android:layout_height</code> attribute for all the views involved but I did not get the effect that I was looking for. Besides, some people say that it is a pretty bad idea to wrap a <code>ListView</code> with a <code>ScrollView</code> :</p> <p><a href="http://stackoverflow.com/questions/1526831/android-scrollview-layout-problem">Android ScrollView layout problem</a></p> <p><a href="http://stackoverflow.com/questions/306626/scrolling-with-multiple-listviews-for-android">Scrolling with Multiple ListViews for Android</a></p> <p>Thanks for any other ideas.</p>
java android
[1, 4]
1,448,876
1,448,877
Delayed document.write
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1536970/javascript-controlling-the-insertion-point-for-document-write">JavaScript - controlling the insertion point for document.write</a> </p> </blockquote> <p>I want to delay <code>document.write</code> if block with <code>document.write</code> not in the viewport of browser. I tried to make it after window loaded, but <code>document.write</code> replaces the whole content :(</p> <pre><code>$(function(){ document.write('bla') )} </code></pre> <p>Also, in this <code>document.write</code> I have script with ads and it must work when added in block. </p> <p>Is it possible?</p> <p>UPD: i have code whith <code>document.write</code>, which pushes in document <code>&lt;script&gt;</code>. so, because of this code my page loads very slowly and i want to load this script only when dom is ready or when user srolls to the block where my ads placed</p>
javascript jquery
[3, 5]
3,429,922
3,429,923
Updating on-screen element several times in one function
<p>This has got to be easy, but has got me stumped.</p> <p>How do I change an element on screen several times in one function?</p> <p>I want to change a label to read something like "starting..." at the beginning of my function, then go away and do some stuff and then change the label to "finished" at the end.</p> <p>As an illustration why does the following code:</p> <pre><code> errorMessage.Text = "Three..."; System.Threading.Thread.Sleep(1000); errorMessage.Text = "Two..."; System.Threading.Thread.Sleep(1000); errorMessage.Text = "One..."; System.Threading.Thread.Sleep(1000); errorMessage.Text = "Go!"; System.Threading.Thread.Sleep(1000); </code></pre> <p>Just pause for 4 seconds and then change the label text to "Go!" rather than counting down?</p> <p>TIA</p> <p>Ben</p>
c# asp.net
[0, 9]
3,088,632
3,088,633
What problems would you expect when switching from JS to C++?
<p>What problems would you expect when switching from JS to C++ ?</p>
javascript c++
[3, 6]
1,984,243
1,984,244
Efficient and Accurate way to add items into a TList
<p>I have 2 lists and the entities of the those lists have some IDs for instance</p> <p><code>Client.ID,</code> where ID is a property of Client anf then I have <code>PopulationClient.ID</code>, where ID is a property of the class PopulationClient. So I have two Lists</p> <pre><code>TList&lt;Client&gt; clients = clientsHelper.GetAllClients(); TList&lt;PopulationClient&gt; populationClients = populationHelper.GetAllPopulationClients(); </code></pre> <p>So then I have a temp List</p> <pre><code>TList&lt;Client&gt; temp_list = new TList&lt;Client&gt;(); </code></pre> <p>So the problem i am having is doing this efficiently and correctly. This is what I have tried.. but I am not getting the correct results</p> <pre><code>foreach(PopulationClient pClients in populationClients) { foreach(Client client in clients) { if(pClients.ID != client.ID &amp;&amp; !InTempList(temp_list, pClients.ID)) { temp_list.Add(client); } } } public bool InTempList(TList&lt;Client&gt; c, int id) { bool IsInList = false; foreach(Client client in c) { if(client.ID == id) { IsInList = true; } } return IsInList; } </code></pre> <p>So while I am trying to do it right I can not come up with a good way of doing it, this is not returning the correct data because in my statement in the first loop at the top,at some point one or more is different to the otherone so it adds it anyways. What constraints do you think I should check here so that I only end up with a list of Clients that are in population clients but not in Clients?.</p> <p>For instance population clients would have 4 clients and Clients 2, those 2 are also in population clients but I need to get a list of population clients not in Clients.</p> <p>ANy help or pointers would be appreciated.</p>
c# asp.net
[0, 9]
5,186,947
5,186,948
Objects in arrays, can it be done?
<p>I am new to OOP, and I'm trying to make a simple game to help me learn Java. My idea was to make an enemy class, but I want the amount of enemies to be dynamic. I tried making a new object as an array rather than manually typing attker1 attker2 and so on ...</p> <pre><code>Mole attacker[3]; attacker[0] = new Mole(); attacker[1] = new Mole(); attacker[2] = new Mole(); </code></pre> <p>I hope you get the idea of what I'm trying to do. I've tried searching Google, but I keep getting tutorials on how to make arrays out of regular data types (i.e. int, char, etc.). I'd like to know what it's called, whatever I'm trying to do. If there is a better way of doing this I'll listen to that too.</p> <p>Thank you.</p>
java android
[1, 4]
2,330,942
2,330,943
FormsView data bind goes wrong
<p>I got a fromview defined as following:</p> <pre><code> &lt;asp:TableCell&gt; &lt;asp:UpdatePanel runat="server" id="UpdatePanel2" updatemode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:FormView ID="LavenderRegion" AutoGenerateColumns="true" AutoGenerateEditButton="true" AutoGenerateSelectButton ="true" runat ="server"&gt; &lt;ItemTemplate&gt; &lt;/ItemTemplate&gt; &lt;/asp:FormView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/asp:TableCell&gt; </code></pre> <p>and code behind like this:</p> <pre><code>LavenderRegion = Model.GuiCreators.CreateFormsView(data); LavenderRegion.DataSource = data; LavenderRegion.DataBind(); public partial class ItemTemplate : IBindableTemplate { public static FormView CreateFormsView(DataTable datatable) { FormView form = new FormView(); form.ItemTemplate = new ItemTemplate(); return form; } </code></pre> <p>when I run it the <code>LavenderRegion.DataBind();</code> line fails me beause <code>InstantiateIn(Control container)</code> gets as a parameter a <code>tablecell</code> when i excpect it to get the <code>FormView LavenderRegion</code></p> <p>whats going on? </p> <p>I cannot seem to find the tablecell my <code>InstantiateIn(Control container)</code> function gets at all</p>
c# asp.net
[0, 9]
571,522
571,523
What is the PHP equivalent of this C# encoding code?
<p>I want to turn the following C# code into PHP.</p> <p>The C# is:</p> <pre><code>byte[] operation = UTF8Encoding.UTF8.GetBytes("getfaqs"); byte[] secret = UTF8Encoding.UTF8.GetBytes("Password"); var hmac = newHMACSHA256(secret); byte[] hash = hmac.ComputeHash(operation); </code></pre> <p>Which I've turned into this:</p> <pre><code>$hash = hash_hmac( "sha256", utf8_encode("getfaqs"), utf8_encode("Password")); </code></pre> <p>Then I have:</p> <pre><code>var apiKey = "ABC-DEF1234"; var authInfo = apiKey + ":" + hash //base64 encode the authorisation info var authorisationHeader = Convert.ToBase64String(Encoding.UTF8.GetBytes(authInfo)); </code></pre> <p>Which I think should be:</p> <pre><code>$authInfo = base64_encode($apiKey . ":" . $hash); </code></pre> <p>Or</p> <pre><code>$authInfo = base64_encode(utf8_encode($apiKey . ":" . $hash)); </code></pre> <p>But not certain, notice this second encoding uses Encoding.UTF8, not UTF8Encoding.UTF8.</p> <p>What should the PHP code look like?</p>
c# php
[0, 2]
160,627
160,628
Break on space (Textbox)
<p>In C# I know this</p> <pre><code> if (textBox1.Text.Length &gt; x) { textBox1.AppendText(Environment.NewLine); } </code></pre> <p>(x is some random number) But what if I want to break on first space before x?</p>
c# asp.net
[0, 9]
281,027
281,028
execute javascript dynamically
<pre><code>&lt;html&gt; &lt;body&gt; &lt;div id="div1"&gt; &lt;/div&gt; &lt;div id="div2"&gt; &lt;input type="button" value="Go!" onclick="go()" /&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; window.onload=function(){ var newsc = "&lt;script id='sc1' type='text/javascript'&gt;function go() { alert('GO!') }&lt;\/script&gt;"; var e = document.getElementById('div1'); e.innerHTML = newsc; eval(document.getElementById('div1').innerHTML); } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>This is my html page.when page loads <code>alert('Go')</code> is fired but this not what i am want to do. I would like to do is that when we click on <strong>Go</strong> button then <code>go</code> function should be called</p> <p><strong>UPDATE:</strong></p> <pre><code>$.ajax({ url: 'ajax/js.php?id=123', success: function(data) { eval(data); } }); </code></pre> <p>this ajax request return different code on different id</p>
javascript jquery
[3, 5]
4,400,449
4,400,450
problem in Labels with asterisk!
<p>I have the following ASP.NET markup:</p> <pre><code>&lt;td align="right" valign="top" style="width: 130px"&gt; Answer: &lt;asp:Label ID="lblanswer" runat="server" CssClass="errorMessage" ForeColor="Red" Text="*"&gt; &lt;/asp:Label&gt; &lt;/td&gt; </code></pre> <p>I want it to say "Answer:*" with only the asterisk in red. </p> <p>How to do that if I want Answer to be inside the <code>&lt;asp:label/&gt;</code>. </p>
c# asp.net
[0, 9]
1,925,168
1,925,169
PHP Jquery - kill php script that was launch using an ajax call in jquery
<p>I have a button on my page. When clicked it triggers an ajax call using the ajax method of jquery. The php script runs loops that insert data into my db. My problem that I want to kill that script from running but I don't know how to do. Hope someone can help. Thank you in advance. Cheers. Marc</p>
php jquery
[2, 5]
5,633,594
5,633,595
Javascript and PHP export data to file
<p>I have a button. By clicking the button, I want to export some data shown on the webpage to a file for downloading. </p> <p>I am doing this in this way: I have a <code>export.php</code>. I send the data as the parameter to PHP file (another parameter is filename), and PHP server create a file and write the data, and then send file. Code is like:</p> <pre><code>$filename = $_GET['filename'] . '.csv'; $export = $_GET['export']; $writer = fopen($filename, 'w') or die('cannot create'); fwrite($writer, $export . "\n"); fclose($writer); header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename='.basename($filename)); readfile($filename); unlink($filename); exit(); </code></pre> <p>For cases that the data are short, it works fine. But if the data are long, since the data are passed as part of the URL, I will get "Request-URI Too Large" error.</p> <p>Is there any alternative way to do that? Is it possible to directly write data using JavaScript?</p>
php javascript
[2, 3]
3,682,403
3,682,404
Viewing additional GridView columns on click with javascript?
<p>I'm trying to figure out how to select and view row details in my gridview. Basically I have a gridview with 9 columns, but 6 are hidden. When I click on a row, I want it to load those additional column values into my javascript so I can put them in a seperate table below. I feel like it's relatively simple but I'm just not understanding something and I was hoping I could be pointed in the right direction.</p> <p>Here's some code I have if you need it.</p> <pre><code>&lt;asp:GridView ID="BillabilityView" BackColor="White" runat="server" AutoGenerateColumns="false" CssClass="tbl"&gt; &lt;columns&gt; &lt;asp:boundfield datafield="UserName" headertext="User Name" /&gt; &lt;asp:boundfield datafield="UserID" headertext="User ID" /&gt; &lt;asp:boundfield datafield="HrsTLB" headertext="Billable Hours" /&gt; &lt;asp:boundfield datafield="HrsTLNB" headertext="Nonbillable Hours" /&gt; &lt;asp:boundfield datafield="HrsTL" headertext="Total Hours" /&gt; &lt;asp:boundfield datafield="HrsExp" headertext="Expected Hours" /&gt; &lt;asp:boundfield datafield="Billability" headertext="Billability" /&gt; &lt;/columns&gt; &lt;/asp:GridView&gt; </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
2,563,247
2,563,248
Click event when not clicking on an element
<p>Maybe I'm, just tired but I have a right click menu that I want to close when the user clicks anywhere else than the menu. But I cant figure out how to make it disappear when the user clicks on something else.</p> <p>Here is the code for showing the menu:</p> <pre><code>// If mouse click on was pressed $('#content_list table tr').bind('mouseup', function(event) { // if right click if(event.which == 3) { showRightClickMenu(event); } event.preventDefault(); event.stopPropagation(); }); </code></pre> <p>And this is what I got for hiding the menu</p> <pre><code>// If mouse click outside document $(document).bind('blur', function(event) { hideRightClickMenu(); event.stopPropagation(); }); // If mouse click not on the menu $('*:not(#rightClickMenu *)').bind('mousedown keydown', function(event) { hideRightClickMenu(); event.stopPropagation(); }); </code></pre> <p>The first bind checks if the user clicks outside the document and the second bind checks if the user clicks on everything except the menu. But the second one doesn't really work. If I click on the menu the menu is hidden.</p> <p>Shouldn't be so hard imo... Anyone got any ideas?</p>
javascript jquery
[3, 5]
5,097,185
5,097,186
include flash file in asp.net
<p>i have to include flash file in asp.net page with c#. coding please</p>
c# asp.net
[0, 9]
3,570,584
3,570,585
jquery content editable indent
<p>I've been looking for a few hours now, and still can't work it out.</p> <p>So I am working on a text editor and I want it so when they press the '<strong>tab</strong>' key it indents the text, that either I have selected or the text in front of my cursor text selector. I have been looking in to design mode and I've tried to make one element designMode but you can't unless I was doing it wrong. This is my code, that starts up my simple editor</p> <pre><code> $(".code").click(function () { $(".code").attr('contenteditable', 'true'); document.getElementById("code").designMode = "on"; }); </code></pre> <p>and then the '<strong>tab key code</strong>'</p> <pre><code>$(".code") .keydown(function (e) { var keyCode = e.keyCode || e.which; if(keyCode == 9) { e.preventDefault(); } }); </code></pre> <p><strong>Question:</strong> How do you indent in contenteditable for example in a texteditor you can indent nothing or text. (I dont have any problems with my key events not firing)</p> <p>This is not a textarea or input box, its just a contenteditable div</p>
javascript jquery
[3, 5]
743,645
743,646
Why is Post back not triggered when user navigates away from page, but triggered on close?
<p>I have the following code to detect user navigation or close. The post back is triggered on close but not when navigated away. If i place a alert message it is triggered at all times.</p> <p>Oh and there is a timer on the page which is actually disabled after first tick. but there is always a post back triggers when navigating away with eventtarget timer. I think this may be because i have cleared cache for the previous page.</p> <pre><code>&lt;script src="Scripts/jquery-1.4.4.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(window).bind("beforeunload", function () { alert("u r navigating away"); // this message gets triggered at all times. __doPostBack('callPostBack'); }); &lt;/script&gt; protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { string eventTarget = this.Request["__EVENTTARGET"]; string eventArgument = this.Request["__EVENTARGUMENT"]; if (eventTarget != String.Empty &amp;&amp; eventTarget == "callPostBack") { //do task } } } </code></pre> <p>Thanks in advance.</p>
javascript asp.net
[3, 9]
3,773,000
3,773,001
How to remove selected special character from list
<p>I have C# list where lot of values like this </p> <p><code>&lt;b&gt;Moon&lt;/b&gt;</code></p> <p>and i want to remove <code>&lt;b&gt;</code> and <code>&lt;/b&gt;</code>.</p> <p>I want result like this <code>Moon</code>.</p> <p>How can i remove this type of characters from list.</p>
c# asp.net
[0, 9]
2,013,015
2,013,016
Compressing parameters in the URL
<p>The urls on my site can become very long, and its my understanding that urls are transmisted with the http requests. So the idea came to compress the string in the url.</p> <p>From my searching on the internet, i found suggestions on using short urls and then link that one to the long url. Id prefere to not use this soltuion because I would have to do a extra database check to convert between long and short url.</p> <p>That leaves in my head 3 options:</p> <ol> <li>Hashing, i dont think this is a option. If you want a safe hashing algorithm, its going to be long.</li> <li>Compressing the url string, basicly having the server depress the string when when it gets the url parameters.</li> <li>Changing the url so its not descriptive, this is bad because it would make development harder for me (This is a 1 man project).</li> </ol> <p>Considering the vast amount posible amount of OS/browsers out there, I figured id as if anyone else has tried this or have some clever suggestions.</p> <p>If it mathers the url parameters can reach 100+ chars.</p> <p>Example:</p> <pre><code>mysite.com/Reports/Ability.aspx?PlayerID=7737&amp;GuildID=132&amp;AbilityID=1140&amp;EventID=1609&amp;EncounterID=-1&amp;ServerID=17&amp;IsPlayer=True </code></pre> <p>EDIT:</p> <p>Let me clarify atm this is NOT breaking the site. Its more about me learning to find a good solution ( Im well aware this is micro optimisation, my site is very fast atm ) and making my site even faster ( To challage myself, and become a better coder ).</p> <p>There is also a cosmetic issue, i personaly think that a URL longer then the address bar looks bad.</p>
c# asp.net
[0, 9]
1,881,859
1,881,860
How to know whether checkbox is checked or not, jquery?
<p>Is there any better way to do this :</p> <pre><code>var IsC = $('input[type=checkbox]').attr("checked") == "checked" ? true : false; </code></pre> <p>?</p>
javascript jquery
[3, 5]
4,837,945
4,837,946
Firefox PostBacks
<p>Does anyone have an idea why these buttons work in IE and Chrome, but not in Firefox? Also, my dropdowns which I use to filter databound controls aren't working either...must be something to do with postbacks. How can I fix this? Many thanks for your help!</p> <pre><code>&lt;asp:Button CssClass="button_style" ID="LinkButtonDetails" runat="server" Text="DETAILS" PostBackUrl='&lt;%# GenerateLinkDetails(Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %&gt;' /&gt; &lt;asp:Button CssClass="button_style" ID="LinkButtonTagCloud" runat="server" Text="TAG CLOUD" PostBackUrl='&lt;%# GenerateLinkCloud(Eval("CompanyID"), Eval("ProjectName"), Eval("ProjectID")) %&gt;' /&gt; </code></pre> <p>Rendered HTML Markup:</p> <pre><code>&lt;input type="submit" name="Gridview1$ctl02$LinkButtonTagCloud" value="TAG CLOUD" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;Gridview1$ctl02$LinkButtonTagCloud&amp;quot;, &amp;quot;&amp;quot;, false, &amp;quot;&amp;quot;, &amp;quot;displaycloud.aspx?guid=b6b98ee2-fadc-4624-95e5-eacf5f84eb73&amp;amp;name=Dave&amp;amp;role=Admin&amp;amp;member=27&amp;amp;company=17&amp;amp;proje­ct=BIS Tests&amp;amp;proj_id=9&amp;quot;, false, false))" id="Gridview1_ctl02_LinkButtonTagCloud" class="button_style" /&gt; </code></pre>
c# asp.net
[0, 9]
3,976,108
3,976,109
What's the opposite of jQuery `.get()`?
<p><code>.get()</code> converts a jQuery object to a DOM element that Javascript can use without jQuery.</p> <p>If I have a DOM element, how can I convert it to a jQuery object?</p>
javascript jquery
[3, 5]
4,685,183
4,685,184
Sleep() in java (Android)
<p>I am following this tutorial to have a loading screen in my program. The tutorial says my activity should Sleep() using the Sleep() command, however it does not recognise Sleep() as a function and provides me with an error, asking if I would like to create a method called Sleep().</p> <p>Here is a link to the tutorial:</p> <p><a href="http://androidcookbook.com/Recipe.seam;jsessionid=4DBCC1688B51DB16A2A40A86E135D361?recipeId=1599" rel="nofollow">http://androidcookbook.com/Recipe.seam;jsessionid=4DBCC1688B51DB16A2A40A86E135D361?recipeId=1599</a></p> <p>Here is the code sample:</p> <pre><code>public class LoadingScreenActivity extends Activity { //Introduce an delay private final int WAIT_TIME = 2500; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); System.out.println("LoadingScreenActivity screen started"); setContentView(R.layout.loading_screen); findViewById(R.id.mainSpinner1).setVisibility(View.VISIBLE); new Handler().postDelayed(new Runnable(){ @Override public void run() { //Simulating a long running task this.Sleep(1000); System.out.println("Going to Profile Data"); /* Create an Intent that will start the ProfileData-Activity. */ Intent mainIntent = new Intent(LoadingScreenActivity.this,ProfileData.class); LoadingScreenActivity.this.startActivity(mainIntent); LoadingScreenActivity.this.finish(); } }, WAIT_TIME); } } </code></pre>
java android
[1, 4]
5,198,929
5,198,930
Jquery Javascript checkbox selection/deselection
<p>I have a HTML form and inside it I have a bunch of checkboxes.</p> <p>What I am trying to do is this. - If any one checkbox is selected, I want to set a variavle in javascript. - if nothing is selected, I want to set that variable to blank. - I am toggling the class of the checkbox as well.</p> <p>This is how I am currently doing it.</p> <pre><code>var checklist = ""; $('.form3 :checkbox').change(function() { $(this).closest('label').toggleClass("checkselected", this.checked); if(window.checklist != "OL" ) { window.checklist = "OL"; } }); </code></pre> <p>The problem with this code is, if once the variable is set, I am not sure how to clear it is the user deselects all checkboxes and none of the boxes are selected any longer.</p> <p>Any suggestion? (I am using jQuery)</p>
javascript jquery
[3, 5]
5,727,644
5,727,645
Extract word from string using jquery or javascript
<p>I would like to extract word from tag like</p> <pre><code>&lt;li&gt;{firstname} {last name}&lt;/li&gt; </code></pre> <p>So, can I get extract strings "firstname" and "last name" using javascipt or jquery?</p> <hr> <p>Actually I think I have made some mistake to explain.</p> <p>my String looks like</p> <pre><code>&lt;li&gt;&lt;a href="#contactDetail"&gt;{firstname} {lastname}&lt;/a&gt;&lt;/li&gt; </code></pre> <p>here i would like to know how many parameters available means {first..} {last...} that can be only {fi..} and I would like replace with some other parameters.</p> <p>So, I have a list of array which includes many parameters like firstname, lastname, address and so on... now I would like to replace that with according to what i will get from string.</p> <p>Hopefully, I have tried my best to explain my problem.</p>
javascript jquery
[3, 5]
612,579
612,580
what is wrong with this jquery?
<p>I cant seem to figure this out. Something within this jquery code is breaking my site:</p> <pre><code> $('.menu li').click(function() { nextslide = $(this).attr('id').replace('m_', ''); if ($('#m_till').hasClass('active')) currentslide = 'till'; else if ($('#m_receipts').hasClass('active')) currentslide = 'receipts'; else currentslide = 'support'; slide_right(currentslide, nextslide); } </code></pre> <p>When I remove this code, my site works fine. So it has to be something within this function that is causing the problem.</p>
javascript jquery
[3, 5]
5,547,834
5,547,835
Why does changing the minSdkVersion of my application change the color of the text in my tabs?
<p>Why does changing the minSdkVersion of my application change the color of the text in my tabs? Am I doing something wrong?</p> <p>I recreated the problem using the <a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html" rel="nofollow">Hello Tab Widget</a>. By adding <code>&lt;uses-sdk android:minSdkVersion="8" /&gt;</code> to the manifest, I get ugly tabs. If I don't want ugly tabs, do I have to change the minSdkVersion?</p>
java android
[1, 4]
2,213,308
2,213,309
Using jQuery in a JavaScript function
<pre><code>function divlightbox(val) { if(val) { val=val.replace( /^\s+/g, "" ); var count_js=0; var big_string=''; document.getElementById("video_lightbox").innerHTML=""; document.getElementById("divlightbox").style.display = "block"; $("#video_lightbox").css({"height":"430px","top":"10%","width":"480px"}); </code></pre> <p>I found out that the error is in the above. My question is <strong>can't I use jQuery and traditional JavaScript at same time?</strong> I have done coding like this numerous times and never ran into a problem like this. I used to use jQuery methods like <code>.hide()</code> and <code>.css()</code> inside JavaScript functions but this time it doesn't work. </p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
5,287,358
5,287,359
Problem with jquery :not selector
<p>I'm having an issue trying to NOT select a tablerow with the function:</p> <pre><code>$("tr").click(function(e) { var row = jQuery(this) //rest of code left off }); </code></pre> <p>Basically it finds all tablerows and adds click functionality that will open a edit modal that has a row with textboxes that are populated with info from the tablecells. The problem is that the tablerow in the modal is also getting the functionality so when a user goes to edit a value in a text box the all the values disappears...</p> <p>So what I have been trying and failing is to filter the tr by id several way by using: </p> <pre><code>$("tr").not('trEdit').click(function(e) { var row = jQuery(this) </code></pre> <p>and</p> <pre><code>$("tr not:'trEdit').click(function(e) { var row = jQuery(this) </code></pre> <p>I've also played around with trying the second table and then not selecting it's table rows, but the tables aren't besides each other &amp; the example I had was...no I haven't tried table[1] tr yet(now that I think about it)...</p> <p>Please help...I'm going nuts trying to figure this out..</p> <p>Thanks!!!!!</p>
javascript jquery
[3, 5]
2,420,028
2,420,029
Assigning DOM element to variable dosen't work with .click
<p>So, my problem is very simple. Using</p> <pre><code>$('.tree li.parent &gt; a').click(function(){ var target = $(this); target.parent().toggleClass('active'); target.parent().children('ul').slideToggle('fast'); }); </code></pre> <p>works, it finds the clicked element and does the magic things it is supposed to do.</p> <p>However, assigning the DOM element to a variable like this does not work:</p> <pre><code>var things = $('.tree li.parent &gt; a'); things.click(function(){ var target = $(this); target.parent().toggleClass('active'); target.parent().children('ul').slideToggle('fast'); }); </code></pre> <p>I've been trying to get my head around this for a good 45 minutes now, can anyone help me?</p> <p>Dosen't even work having:</p> <pre><code>var things = $('.tree li.parent &gt; a'); things.click(function(){ alert("hello"); }); </code></pre>
javascript jquery
[3, 5]
1,990,066
1,990,067
Useful undocumented methods and properties of jQuery
<p>I would like to gather all <em>useful</em> undocumented methods and properties of <a href="http://jquery.com/" rel="nofollow"><strong>jQuery</strong></a> (at least for the <a href="http://code.jquery.com/jquery.js" rel="nofollow">current version 1.9.0</a>).</p> <p>Some of them look quite promising either for solving particular problems, or for accelerating the JavaScript code evaluation.</p> <p><strong>Important:</strong> Since the listed features here are not documented, it should be used with caution, as new versions of jQuery might not support these features in future releases.</p>
javascript jquery
[3, 5]
5,509,189
5,509,190
Execute jquery animate only one time
<p>I've the following function:</p> <pre><code>$('.link1').click(function(){ $("#div2").slideUp(function(){$("#div1").slideToggle();}); $('html, body').animate({scrollTop: '600px'}, 800); }); </code></pre> <p>It toggles a div and scroll the page down. The problem is that everytime the user toggles the page scroll down again...how could I run this animate function only at first click?</p>
javascript jquery
[3, 5]
3,014,880
3,014,881
Setting IFrame size from within the IFrame
<p>I've been trying a few things like the following trying to get the iframe to be reset from within the iframe but I am not sure what I am doing wrong. Ideas?</p> <pre><code> window.top.$("#ID").width(324); window.top.$("#ID").height(369); </code></pre> <p>Has not worked.</p>
javascript jquery
[3, 5]
2,082,870
2,082,871
setting value of textbox using javascript in asp.net
<p>i am using .aspx page where i used html textarea to get the teat from user. i am also have a asp:textbox say "txtbox1" control where i want to have the value of that textarea in txtbox1. but it is not setting the value.. i am using javascript as:</p> <pre><code> document.getElementById('txtareahead').readOnly= true; document.getElementById('txtareahead').innerHTML=document.getElementById('txtareahead').value; document.getElementById(’&lt;%= txtbox1.ClientID %&gt;’).value = document.getElementById('txtareahead').value; </code></pre> <p>how can i set the value of asp:textbox using javascript..</p>
javascript asp.net
[3, 9]
3,380,973
3,380,974
jQuery $ is not a function in Firefox, works in Chrome and works with $(document).ready()
<p>I'm implementing jQuery in a site and am getting the "$ is not a function" in Firefox when I try to use a selector, but $(document).ready() works perfectly right before it. My code looks like this</p> <pre><code>&lt;script&gt; $(document).ready(function(){ alert("hi") }); // Works fine function showDiv(){ $("#traditionalCC").hide(); } //Throws error &lt;/script&gt; </code></pre> <p>Does anyone know why this happens, and why it works in Chrome and Firefox.</p>
javascript jquery
[3, 5]
4,741,641
4,741,642
issue with SharedPreferences
<p>i want to store string in memory through sharepreferance but there are some problem raise that could not store in memory can you please let me know how can i solve this? any permission needed? </p> <p><strong>Code::</strong></p> <pre><code>SavePreferences("MEM1", LanguageSelcted); LoadPreferences(); </code></pre> <p><strong>Method::</strong> </p> <pre><code>public void SavePreferences(String key, String value) { try { SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(key, value.trim()); editor.commit(); } catch (Exception e) { e.printStackTrace(); } private void LoadPreferences() { try { SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE); LanguageSelection = sharedPreferences.getString("MEM1", ""); Log.i(TAG, "LanguageSelection is :&gt;&gt;&gt;" + LanguageSelection); Toast.makeText(getBaseContext(), "LanguageSelection is :&gt;&gt;&gt;" + LanguageSelection, Toast.LENGTH_LONG).show(); /* * textSavedMem1.setText(strSavedMem1); * textSavedMem2.setText(strSavedMem2); */ } catch (Exception e) { e.printStackTrace(); } } </code></pre>
java android
[1, 4]
5,082,434
5,082,435
How can I write this jQuery statement shorter?
<p>I have this code. This works perfect but I just wanna know if it's possible to write it shorter or not? I looked at jQuery <a href="http://api.jquery.com/hasClass/" rel="nofollow">hasClass()</a> docs but didn't find anything useful.</p> <pre><code>$(this).hasClass('nw') ?'nw' :$(this).hasClass('ne') ? 'ne' : $(this).hasClass('sw') ? 'sw' : $(this).hasClass('se') ? 'se' : false ; </code></pre>
javascript jquery
[3, 5]
2,693,375
2,693,376
JQuery: get current selector
<p>I have a form with multiple <code>select</code> dropdown menus that start with the id: package which are added dynamically by the user. My goal is to put all the selected values from these <code>select</code> dropdowns into an array. Here is the code I have so far. </p> <pre><code>$(document).ready(function() { arr = new Array(); $(document).on('change', 'select[id ^="package"]', function() { arr.push($(this).val()); alert(arr.join('\n')); //for testing }); }); </code></pre> <p>Currently all I am doing is pushing the selected values onto the array rather than setting the values for a specific index. Therefore if I keep switching the value for a specific <code>select</code>, I will keep pushing values onto the array. How can I determine which selector I am currently in so I can get an index into the array to modify the array accordingly?</p>
javascript jquery
[3, 5]
3,635,220
3,635,221
PageRedirect to previous Page?
<p>I have a page(A) that has a popup. When the link in the popup is clicked, it takes you to page B. Page B has a Submit and cancel button. Cancel button should get me back to Page A. How is it possible with javascript or Asp.net?? </p> <p>Thank you in advance!!</p>
c# javascript asp.net
[0, 3, 9]
4,955,595
4,955,596
Problem with Scrolling a list
<p>I've one application which is containing some item in List. I've successfully installed this into my device (Samsung Galaxy SII). In my emulator i can view the items by scrolling that. But, in my device it seems black shaded on the item. How can i reduce that? Is it possible? Thanks in advance.</p>
java android
[1, 4]
1,810,488
1,810,489
jquery.validate is disallowing new lines in text areas
<p>I have an ASP.NET application, I inherited from an old development team. They are having an issue where if you type the enter key into an <code>asp:textbox</code>, it is ignored instead of the newline being shown. A standard <code>multiline textbox</code> is being used here. If I comment out the script declaration for <code>jquery.validate-1.11.0.js</code>, the enter key now works as expected.</p> <p>I am wondering what logic could this script possibly be doing that it would disallow new lines in all text areas on the site like this? I have looked for handling of <code>keydown</code> or <code>keyup</code> event and cannot find any reference to <code>textarea</code> handling of these events in the code. I'm wondering if anyone has maybe seen this before.</p>
jquery asp.net
[5, 9]
2,412,195
2,412,196
Using PlotKit (javascript) through C#
<p>I'm relatively new to Javascript, and although I know how to use it, I don't really understand the mechanics behind it. Bear with me here.</p> <p>I need to write a small app that creates a chart (in SVG) based on data I take in as an XML file. I found <a href="http://www.liquidx.net/plotkit/" rel="nofollow">PlotKit</a>, which does exactly what I need, except that it's written in Javascript, while my current program is written in c#. I did some googling and found a few articles which explain how to evaluate simple Javascript code using the .NET VsaEngine class. Unfortunately, I have absolutely no idea how to use the VsaEngine to execute more complicated Javascript that requires references to other files. Basically, all I want is for c# to be able to call something like this as Javascript:</p> <pre><code>var layout = new PlotKit.Layout("bar", {}); layout.addDataset("data", [[0, 0], [1, 1], [2, 2]]); layout.evaluate(); var canvas = MochiKit.DOM.getElement("graph"); var plotter = new PlotKit.SVGRenderer(canvas, layout, {}); var svg = SVGRenderer.SVG(); </code></pre> <p>And get back the SVG string for the chart. I have no idea how to make it so that the above script knows where to look for all of the necessary objects. If I were to make a web page to do this, I would just add a few script headers referencing /plotkit/Layout.js, /plotkit/Canvas.js, etc., the Javascript would work fine. </p> <p>If anyone could explain exactly how I would use PlotKit through C#, or could explain a more effective way to do this, I would really appreciate it.</p> <p>EDIT: I realize I wasn't too clear with this question - I need my c# program to emulate a Javascript engine and use the PlotKit library without actually running a web browser. Is there any way to do this?</p>
c# javascript
[0, 3]
5,451,719
5,451,720
How do I make a Generic Data Access Class?
<p>ASP.net C# 3.5 Framework, working in Visual Studio 2008 currently.</p> <p>What I want is a Generic Data Access Class. I have seen several of them but what I want is to see one that I pass the Connection String and the SQL statement and it will return a List of Objects or when only one item an Object or when no response needed a boolean to let me know if it succeeded?</p> <p>I hope this makes sense if not let me know and I will explain more.</p>
c# asp.net
[0, 9]
3,114,981
3,114,982
System.Web.UI.DataVisualization.Charting missing error in .net 4.0?
<p>I'm trying to use the Chart control in asp.net 4.0. While I know it required a separate install as part of 3.5, it's included by default with 4.0.</p> <p>I can see the Chart control in my toolbox, and I can drag it to my designer and see a preview of the chart. However, when I try to compile my website, I get an error stating:</p> <pre><code>The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?) </code></pre> <p>I receive the same error when I take a brand new page and add the following:</p> <pre><code>using System.Web.UI.DataVisualization; </code></pre> <p>Any ideas? I can understand why I would get this error in 3.5, but no clue why I would receive in 4.0, especially when I can see the control in the toolbox.</p>
c# asp.net
[0, 9]
3,011,309
3,011,310
Fixed character limit text box with running feedback - javascript
<p>Is there a simple javascript pattern for showing how many characters left you can use in a fixed character text box?</p> <p>Say you have a text box and you want them only to use 500 characters, twitter and stack-overflow show how many you have left as you type. I presume you can use jquery and a type event to produce a dynamic running count. </p> <p>Is there an elegant pattern for this in javascript.</p>
javascript jquery
[3, 5]
3,294,770
3,294,771
configuring IIS to cache based on content-type?
<p>We had a weird issue on our site last week that seemed to be a caching issue. A version of our page was cached with <code>Content-Type: text/vnd.wap.wml; charset=utf-8</code> set in the header.</p> <p>After some research, I found out that asp .net uses .browser files in the <code>%SystemRoot%\Microsoft.NET\Framework\versionNumber\CONFIG\Browsers</code> path to determine preferred mime types for certain user agents. based on the content-type above, it looks like a Nokia phone was the first application to hit our page after a cache clear based on the content-type above, and asp stored a cached version of the page with that content-type rather than <code>text/html</code>. the problem with that content-type is that browsers do not recognize it, and will just display the page as plain text.</p> <p>I could verify that the above scenario was the cause. I took one of our servers out of our pool, recycled the app pools for the site and reset iis, then hit the page with fiddler and passed the follow headers as a GET to our homepage.</p> <pre><code>Accept: text/html User-Agent: NokiaN90-1/3.0545.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1 </code></pre> <p>this returned the following content-type in the response as expected:</p> <pre><code>Content-Type: text/vnd.wap.wml; charset=utf-8 </code></pre> <p>Now to fix this going forward, it would make sense for asp to cache various flavors of the page based on the content-type it will be serving, right? is there a way to configure asp to do this, or is there a better way to handle this scenario?</p>
c# asp.net
[0, 9]
464,259
464,260
'Permission Denied' when trying to make Jquery $.ajax request
<pre><code>function populateGroups(){ var p =1; var groupNames = new Array(); $.ajax({ type: "GET", url: "http://okcmonprd103/iMon/findgroups.pl", dataType: "text/xml", success: function parseGroupNames(xml){ $(xml).find('group').each(function(){ groupNames[p] = $(this).find('name').text(); p++; }); groupNames.sort(arraySort); for(p=0;p&lt;groupNames.length-1;p++){ $('#Groups').append('&lt;option value="'+p+1+'"&gt;'+groupNames[p]+'&lt;/option&gt;'); $('#dutyGroups').append('&lt;option value="'+p+'"&gt;'+groupNames[p]+'&lt;/option&gt;'); } } }); </code></pre> <p>}</p> <p>I send this ajax call to a server on our network that runs a Perl script that returns XML data. This works fine on my machine in IE8, and in my Windows 7 Gadget (which is what this is mainly for) but whenever other people in the company try to use it, they get the "Permission Denied" error. Do I need to set up a proxy page in order to make this work?</p> <p>It does work on my machine, I just don't see how other people on the same network wouldn't be able to use this... </p>
javascript jquery
[3, 5]
634,498
634,499
Construction of a while, import high volume of data
<p>I am creating a test application whose purpose is to import a large amount of text messages into the sms inbox. I have a few thousand messages in two columns "address" and "body". I can have them in a csv, sqlite, or string array format. I'm unsure how to approach this problem so as to make this while loop efficient and what way I might want to parse the data. </p> <p>Please instruct as to the best approach to accomplish this. </p> <p>For simplicity sake I've tried it as an array here but there are some syntax errors.What is the correct way to use an array to add values into the database?</p> <p>Here is what I have so far:</p> <pre><code> private void importSms(final String[] addressvariable, final String[] bodyvariable) { Thread queue = new Thread(new Runnable() { public void run() { while(true) { //will have to define this boolean ContentValues values = new ContentValues{); values.put("address", [addressvariable]); values.put("body", [bodyvariable]); getContentResolver().insert(Uri.parse("content://sms/inbox"), values); } } }); queue.start(); </code></pre>
java android
[1, 4]
5,167,522
5,167,523
Accessing Jquery object [] and get error
<p>I'm new in Jquery, I can't access the elements within the Jquery object. </p> <pre><code>var iconNumber=$('#tblFeedControlBar').find('td').length; // 8 var iconNumber=$('#tblFeedControlBar').find('td')[0].width(); // error $('#tblFeedControlBar').find('td').get(0).after(iconArrow); // error </code></pre>
javascript jquery
[3, 5]
4,835,456
4,835,457
Jquery detect id/class by overlapping
<p>I've searched a lot for this on google, but without luck...</p> <p>Basically I need some js, that can find the id/class of the element, that I'm hovering (So I can use "this"-property).</p> <p>Because I have a lot of divs (Some have to be auto generated, with random names [Or maybe not, if I can use the "this"-property]) on my page, and I don't want to type in all there names (Such as I have to do in <a href="http://www.labs.skengdon.com/_hittest" rel="nofollow">_hittest</a>, with just gives me a true/false value)</p> <p>Hope you guys can help me :D I've really search for this, for a loooongtime</p> <p>*EDIT: Not a mouse hover, that I'm looking for, but when hover a div with another div</p>
javascript jquery
[3, 5]
1,859,254
1,859,255
Can an app send an email without opening the email interface in Android?
<p>Can an app send an email without opening the email interface? How?</p>
java android
[1, 4]
4,814,400
4,814,401
ASP.NET Server Tags
<p>When I use:</p> <pre><code>&lt;asp:Label id="lbCatId" runat="server" Text='&lt;%# Eval("VideoId") %&gt;' Visible="true" /&gt; </code></pre> <p>I get:</p> <pre><code>&lt;span id="ctl00_mainContent_ucCoverFlow_rptVideos_ctl00_lbCatId"&gt;5&lt;/span&gt; </code></pre> <p><br /></p> <p>However when I use:</p> <pre><code>&lt;asp:Image runat="server" href='Play.aspx?VideoId=&lt;%# Eval("VideoId") %&gt;' ID="iThumbnailFileName" CssClass="content" /&gt; </code></pre> <p>I get:</p> <pre><code>&lt;img id="ctl00_mainContent_ucCoverFlow_rptVideos_ctl01_iThumbnailFileName" class="content" href="Play.aspx?VideoId=&amp;lt;%# Eval(&amp;quot;VideoId&amp;quot;) %&gt;" </code></pre> <p><br /></p> <p>I would like to know why C# isn't generating the 'VideoId' like it is in the first example.</p>
c# asp.net
[0, 9]
4,891,863
4,891,864
Using oncontextmenu command is there any possibility to identify which menu has been selected on right click?
<p>Is there any possibility to identify which menu has been selected on right click in an IE7 using the command oncontextmenu.</p> <p>If yes can you please share the code? </p>
javascript jquery
[3, 5]
1,583,756
1,583,757
Use jQuery.post() result in javascript function
<p>I've got no clue how to do the following, so I wasn't sure what to search for either.</p> <p>For validating my registration form I've a javascript function that checkes the existence of the inserted username in the database onblur of the username textfield. </p> <pre><code>function checkUsername(username){ $.post("checkmail.php", {username: username} , function(data){ var $response=$(data); var response = $response.filter('#username-response').text(); if(response == "taken") { document.getElementById('username').style.borderColor = rood; valid = false; } }); </code></pre> <p>}</p> <p>This works fine, but now I want to validate it again onsubmit of the form in case users decide to submit an existing username.</p> <pre><code>function validateForm() { var valid = true; //checks different fields //now check voor username existence var username = document.getElementById('username').value; checkUsername.call(username); if (!valid) { return false; } else { return true; } } </code></pre> <p>I'm not familiar enough with Javascript to get this working. Probably thinking in the wrong direction...</p>
javascript jquery
[3, 5]
656,278
656,279
navigate away alert without saving modifications
<p>I'm developing a website in php.</p> <p>I want to show a message something like javascript alert, when a user tries to edit or add something in a form and tries to navigate to some other section without saving the modification, i want to show a message to them,</p> <p>that you are about to navigate about from this page, your modifications are not saved, do you want to continue?</p> <p>how can i do this??</p> <p>any one have an idea ???please share it with me..</p> <p>Thanks</p>
php javascript
[2, 3]
3,536,126
3,536,127
insert echo into the specific html element like div which has an id or class
<p>I have this code.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; body{background:#666666;} div{border:1px solid red;} &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("juliver", $con); $result = mysql_query("SELECT * FROM hi"); while($row = mysql_fetch_array($result)) { echo '&lt;img src="'.$row['name'].'" /&gt;'; echo "&lt;div&gt;".$row['name']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['title']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['description']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['link']."&lt;/div&gt;"; echo "&lt;br /&gt;"; } mysql_close($con); ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>the above code works.</p> <p>now, I want to insert this</p> <pre><code>echo '&lt;img src="'.$row['name'].'" /&gt;'; echo "&lt;div&gt;".$row['name']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['title']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['description']."&lt;/div&gt;"; echo "&lt;div&gt;".$row['link']."&lt;/div&gt;"; echo "&lt;br /&gt;"; </code></pre> <p>into the specified div or other element in the html, example, i will insert this</p> <pre><code>echo '&lt;img src="'.$row['name'].'" /&gt;'; </code></pre> <p>into the html element .</p> <p>I dont know how to do this, please help me. Thanks</p> <p>Juliver</p>
php javascript jquery
[2, 3, 5]
4,461,267
4,461,268
How to read the contents of an entire disk bit by bit
<p>I've got a flash card that I need to compute a checksum on the entire contents of the drive.</p> <p>If I could acquire a stream to the entire drive I could just read it in bit by bit.</p> <p>Does anyone know if there is an API for doing this?</p> <p>Everything I see so far requires me to open a file.</p> <p>Is there any way to just read an entire drive's contents bit by bit?</p>
c# c++
[0, 6]
670,117
670,118
Run JavaScript function on element defined with jQuery
<p>Not sure I titled this well.. show's that I'm in unfamiliar territory. How can I run a JavaScript function based off of the element called in a jQuery function?</p> <p>Theory:</p> <pre><code>&lt;script type="text/javascript"&gt; $.fillit('video'); &lt;/script&gt; </code></pre> <p>(run fillit on video tag present in page.. interchangable with other elements)</p> <pre><code>$.fillit = function(){ this is where it says "run on the tag defined in the jQuery function" }): </code></pre>
javascript jquery
[3, 5]
2,366,834
2,366,835
Access parent property in jQuery callback
<p>Unsure if I've phrased this correctly, but in the callback how do I reference the controls property of the base class?</p> <p>This has been bugging me for some time and I usually work around it, but I'd be grateful if anybody can enlighten me on how I should do this properly.</p> <pre><code>var base = function() { var controls = {}; return { init: function(c) { this.controls = c }, foo: function(args) { this.init(args.controls); $(this.controls.DropDown).change(function() { $(this.controls.PlaceHolder).toggle(); }); } } }; </code></pre> <p>Much Obliged,</p> <p>Paul</p>
javascript jquery
[3, 5]
1,061,017
1,061,018
Question about @Override annotation
<p>Im new to android development. I would like to know why do we have to precede every overriden method with @Override annotation in android ?. In regular java this is not a requirement.</p> <p>Please Help Thanks </p>
java android
[1, 4]
5,364,781
5,364,782
jquery.localize doesnt work
<p>i have followed instructions found on <a href="https://github.com/coderifous/jquery-localize" rel="nofollow">https://github.com/coderifous/jquery-localize</a>, and for testing purpose i have created this test file:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt; &lt;title&gt;Test&lt;/title&gt; &lt;script src="jquery-1.6.1.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;script src="jquery.localize.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p rel="localize[greeting]"&gt;some text&lt;/p&gt; &lt;script type="text/javascript" charset="utf-8"&gt; $(function(){ $("[rel*=localize]").localize("test", "en") }) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>and test-en.json</p> <pre><code>{ "greeting": "welcome stranger.." } </code></pre> <p>locally it is working with IE8 and Firefox, but with chrome it is not working. what i get is an error in console log: XMLHttpRequest cannot load file:///C:/../test/examples/test-en.json. Origin null is not allowed by Access-Control-Allow-Origin.</p> <p>how can i set it up correctly? are they any incompqtibilites with jquery 1.6.. or web browsers?</p> <p>thanks</p>
javascript jquery
[3, 5]
4,589,487
4,589,488
jquery javascript equivalent
<p>I use too much jquery</p> <p>I want to do this with out jquery:</p> <pre><code>&lt;a onclick="javascript:$(this).next().css('display', 'none')"&gt; </code></pre> <p>I thought it was this:</p> <pre><code>&lt;a onclick="javascript:this.nextSibling.style.display = 'none'"&gt; </code></pre> <p>But its not. Style returns undefined.</p> <p>Let me clarify:</p> <p>I want to do this:</p> <pre><code>&lt;a class="errorToggle"&gt;error&lt;/a&gt; &lt;div style="padding-left:20px;margin:0 0 10px 0;display:none;"&gt; &lt;h4&gt;A PHP Error was encountered&lt;/h4&gt; &lt;p&gt;Severity: &lt;?php echo $severity; ?&gt;&lt;/p&gt; &lt;p&gt;Message: &lt;?php echo $message; ?&gt;&lt;/p&gt; &lt;p&gt;Filename: &lt;?php echo $filepath; ?&gt;&lt;/p&gt; &lt;p&gt;Line Number: &lt;?php echo $line; ?&gt;&lt;/p&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(".errorToggle").click(function(){ $(this).next().css("display", "block"); }); &lt;/script&gt; </code></pre> <p>Without jQuery BECAUSE this is a code igniter error view file that quite often will load before my header does, so I will not have access to jquery. It doesn't need to be pretty, or well coded, just work. This will not be used in production.</p>
javascript jquery
[3, 5]
4,580,787
4,580,788
Javascript decodeURIComponent() with PHP
<p>I'm encoding URL's using javascript's <a href="http://www.w3schools.com/jsref/jsref_encodeuricomponent.asp" rel="nofollow">encodeURIComponent()</a> function when a form is submitted:</p> <pre><code> &lt;form name="form" action="actions.php" method="post"&gt; &lt;input type="text" name="url" id="url" value="http://"&gt; &lt;script type="text/javascript"&gt; function encodeLinks(){ var e = document.getElementById('url') e.value = encodeURIComponent(e.value); } &lt;/script&gt; &lt;button type="submit" class="btn btn-primary" onclick="encodeLinks()"&gt;Submit&lt;/button&gt; &lt;/form&gt; </code></pre> <p>What is the most efficient way to get that data back into javascript on the actions page in order to decode it and then use it in a mysql query?</p>
php javascript
[2, 3]
1,361,311
1,361,312
writing an "if" statement in Android
<p>I'm new to Android. I'm trying to write a method that has an if statement in it.What I'm trying to get happen is "if the text in the Textview is equal to a certain value, change the background image in the layout." I know the setting background bit works, I've narrowed the problem to the If statement. in the below code showBook is a TextView, tvString is the string that holds the value of showBook. bgview is the layout id.</p> <pre><code> String tvString = showBook.getText().toString(); bookDisp.setText(tvString); View mainbg = bgview.getRootView(); if(bookDisp.equals("John")){ mainbg.setBackgroundResource(R.drawable.dbvjohn); </code></pre> <p>the problem is the line</p> <pre><code>if(bookDisp.equals("John")){ </code></pre> <p>it doesn't want to compare bookDisp with a string "John". It will however will work if I compare two textviews for example</p> <pre><code>if(bookDisp.equals(newTextView)){ </code></pre> <p>so I think the problem is the .equals bit. what code would I use to compare bookDisp with "John"? it's not <code>if(bookDisp = ("John")){</code> because Eclipse wants me to change bookDisp to a string. So what would be the proper code to compare a textview bookDisp to a string "John"?</p> <p>Never mind folks! I figured it out, and the error wasn't in this method at all, but in another method. I had <code>+ cursor.getString(1) + " ";</code> in that method, so the strings in the textviews were displaying as "John " and the "if" statement above was looking for "John". </p>
java android
[1, 4]
3,027,874
3,027,875
What does "Uncaught TypeError: Object [object Object] has no method "
<p>So this is a more general question. There are hundred of questions on why this and that returns this error but I want to get a deeper understanding to quicker solve these kind of issues. Or just learn something new. If someone can find a reference to an explanation I will be happy to close the question but I just couldn't find one.</p> <ol> <li>What is it that is missing?</li> <li>Is it the browsers javascript compiler that throws the error or is it jQuery?</li> <li>What are the Object[object Object]?</li> </ol>
javascript jquery
[3, 5]
1,249,732
1,249,733
dynamic selector for onClick not working
<p>I want to make simple onClick event</p> <pre><code>$('._1').click(function(){ window.open('abc.html?parameter=1'); }); </code></pre> <p>in above case , i have _1 as a class, now there are multiple such elements, and 1 here also acts as parameter to window.open request</p> <p>but there are multiple click events i want to bind</p> <pre><code>var arrayOfValues = [1,2,4,6,7,8]; for(var z=0;z&lt;arrayOfValues.length;z++) $('._'+arrayOfValues[z]+'').click(function(){ window.open('abc.html?parameter='+arrayOfValues[z]); }); </code></pre> <p>but this is not working</p>
javascript jquery
[3, 5]