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
611,238
611,239
Panel visible when link is press
<p>I try to do this. On a page a have a grid view and elements are links inside the grid. When I press one link I want a panel to became visible on the same page.</p> <p>How do I do this? It is possible with hyperlink elements or what should I use?</p> <p>Thank you</p>
c# asp.net
[0, 9]
5,989,018
5,989,019
jquery: Cant unbind hover event?
<p>My continue button has a hover event that tells you why it's disabled. The only problem is I can't remove the hover event when I enable the button....</p> <p><strong>this works</strong></p> <pre><code>function disable_continue_button(){ $('#frame_2 &gt; .next') .addClass('faded tt') .hover(function(){ $hovered = $(this); //tooltip? tip = $('.tip.notification.information'); tip.find('div').html($hovered.attr('tt')); tip.fadeIn(150); }, function() { tip.hide(); }) .mousemove(function(e) { var mousex = e.pageX +40; //Get X coodrinates var mousey = e.pageY -20; //Get Y coordinates tip.css({top: mousey, left: mousex }); }); } </code></pre> <p><strong>this doesn't work</strong></p> <pre><code>function enable_continue_button(){ $('#frame_2 &gt; .next') .unbind('mouseenter mouseleave mousemove') .removeClass('faded tt'); } </code></pre> <p>the classes are removed ok, but the hover tooltip is not removed...</p>
javascript jquery
[3, 5]
498,482
498,483
Get ASP.NET session id with jQuery
<p>I was wondering if it's possible to get the session id of a session with jQuery ? And if so, how do I do that, can't seem to find it on jquery.com</p>
jquery asp.net
[5, 9]
3,246,888
3,246,889
Text box value are not accessing in asp.net c#
<p>i have a textbox on .aspx page..On this page there is a user control .Inside this user contrl there is a button .I want o get the value of text box on button click which is not inside the user control .How can i do this</p> <p>Please Help me .</p>
c# asp.net
[0, 9]
4,653,262
4,653,263
Add items to a list, then make them into ListItems
<p>I want to make some kind of "list" of errors in C#, but I'm not sure how what type to use and how to go about populating it ("Errors" below).</p> <p>here is some pseudo code for what I'm trying to accomplish. </p> <pre><code>//... protected "some list type here" Errors {get;set;} // some other method would populate this.. protected override void OnLoad(EventArgs e) { var errorList = new Something(); // we'll just do this for now // Validate stuff // validation fails, so add a new error message to errorList // repeat until you have a list of errors to loop through var ul = new ListBox(); foreach (string errors in Errors) { var li = new ListItem { text = errors }; ul.Items.Add(li); } } </code></pre> <p>can anyone help me fill in the blanks for creating some kind of unordered list of errors in this fashion?</p> <p>My ultimate goal is to grab the error messages from all of the asp:validation controls within an asp:Login control then display each error in a list format</p>
c# asp.net
[0, 9]
2,756,360
2,756,361
DOs and DON'Ts of a programming class?
<p>Disclaimer: I apologize if this is too subjective and perhaps it may be better suited for <code>programmers.stackexchange</code> but I'll try my luck here first. </p> <hr> <p>I'm in need of some advice that has made you successful in a college-level programming course (in my case, C++ and Java). <strong>I would especially appreciate it if professors posted what they liked to see from their own students.</strong></p> <p>I've been writing code for a pretty long time now but due to other interests and some time off school, I've never actually took a programming class. I absolutely have to get an A for GPA reasons and I'm looking for any advice that may help me achieve that goal.</p> <p>First of all, I'm interested in code styles. What code style is best suited for homework?</p> <p>Secondly, I'm interested in how much commenting should be done and where it should be done. I've worked as a programmer before and we've had set style/comment guides, but as far as I can tell the professor hasn't put anything particularly set in stone on her syllabus.</p> <p>Also, how important is the standard. I'm not a huge C++ standard purist -- there are more than enough on SO and on programming newsgroups -- but her first example is something like:</p> <pre><code>#include &lt;iostream&gt; using namespace std; void main(void) { // stuff } </code></pre> <p>And needless to say, it kind of made me cringe. <code>void main</code>, no return, yuck. I'm just not particularly sure what to take from it.</p>
java c++
[1, 6]
17,259
17,260
filtering names in jquery input
<p>I have this code that selects all the text fields with "record_" in them.</p> <pre><code>$('input[name^="record_"]').map(function() { total += $(this).val() * 1; }); </code></pre> <p>But the fields with the name "record_1, record_2 and record_3" need to be * 8 not * 1.</p> <p>How can i filter the search so that it only finds records that have numbers after 3? I tried an IF function but the way ive done the above code means that "record_15" will be * 8 and not * 1 as it should be . I know this should be simple but i cant get my head around it.</p>
javascript jquery
[3, 5]
4,589,985
4,589,986
Camel case Validation for String in android
<p>I have a <code>String test="The Mountain view"</code>, i need all character after a space in a String need to be in Upper case , for example in the above text <code>'M'</code> is uppercase after space, the condition need to be reflect for every character after space in String.</p> <p>I need a regular expression or condition to check all character after space is in Upper case or else i need change the String after space into upper case character if it is in lower case.</p> <p>If anyone knows means help me out.</p> <p>Thanks.</p>
java android
[1, 4]
2,665,551
2,665,552
moving back and forth div
<p>Im trying to create some moving div, actually remake one, so that div would move endlessly back and forth, here is the script:</p> <pre><code>function animate(px) { $('.download').animate({ 'marginLeft' : "-10px" }); } </code></pre> <p>Thanks for help! ;)</p>
javascript jquery
[3, 5]
1,867,019
1,867,020
How to split on first delimiter
<p>Say I have an array of items I want to split on (this is for a page ).</p> <p>I'm trying to 'intelligently' extract out a title, but only the relevant part.</p> <p>I also dont want leading/trailing spaces.</p> <p>I'm not quite sure how to go about doing this though.. without putting a bunch of loops inside of other loops.</p> <pre><code>function cleanTitle(title) { // Extract up to first delimiter var delims = ['|','·','-',':']; } </code></pre> <p>I am using jquery.</p> <p>I also put the delims array in order of what I feel is most important. Instead of searching the entire title for the first array item before moving on to the next, I think it should do the entire string one letter at a time... each letter of the string it will check if its contained within that array. If not, it moves on. I know a lot of urls might contain even 3 out of all 4 of these, and then it wouldnt really work well otherwise.</p>
javascript jquery
[3, 5]
55,579
55,580
Transversing a JQuery object?
<p>I'm doing sorting of a list of elements, using:</p> <pre><code>jQuery.fn.sort = function() { return this.pushStack( [].sort.apply( this, arguments ), []); }; $("ol li").sort("sortFunction").appendTo("ol"); </code></pre> <p>The problem is in the sortFunction.</p> <pre><code>function sortFunction($a, $b) { ... } </code></pre> <p>Basically, what I want is to treat both $a and $b as jQuery objects, so I can manipulate them.</p> <p>e.g, inside the sortFunction do </p> <pre><code>$a.find("div#3 li").html(); </code></pre> <p>This doesn't work since $a and $b are native javascript objects.</p> <p>Any help?</p>
javascript jquery
[3, 5]
3,979,410
3,979,411
How to differentiate between sliding and clicking in android?
<p>In pure Java there is <code>MouseInputListener</code> which I can use to work with those 2 events.</p> <p>How do I do it with Android?</p> <p>If I implement both events then only one is fired (<code>onClickListener</code>) and not the other.</p> <p><strong>Updated:</strong></p> <p>The question is not about detecting the finger movement. </p> <p>I have a View (<code>ImageView</code> for example). I need to detect the click on this view which is <code>onClickListener()</code> and finger movement on this view (i.e. press, move then release the finger). </p> <p>The problem here is that only <code>onClickListener()</code> is called and <code>MotionEvent</code> handler is not caught. </p> <p>I need to be able to differentiate those 2 events as the main event should be finger movement and <code>onClickListener()</code> should just say "Don't click this view. Spin this view." </p> <p>Hopefully this is more clear. </p>
java android
[1, 4]
5,387,710
5,387,711
checking whether data is null
<p>Is it best practice to check whether a value is null coming from a database even though there are constraints on the column which disallow nulls.</p> <p>Thanks in advance</p>
c# asp.net
[0, 9]
32,926
32,927
Jquery add property to appended div
<p>I'm using a slideshow plugin that lets me set the div in which I want image captions to appear. I'm creating the caption div dynamically in js using <code>append()</code> but the caption doesn't appear because I assume the div has to be in HTML prior to loading the js script.</p> <p>Append function in js </p> <pre><code>.append('&lt;span class="image-wrapper current"&gt;&lt;a class="advance-link"&gt;&lt;div id="caption"&gt;&lt;/div&gt;&lt;/a&gt;&lt;/span&gt;') </code></pre> <p>I want to display captions in the div named caption. </p> <p>When initializing the plugin I have the following options. </p> <pre><code>var gallery = $('#thumbs').galleriffic({ delay: 2200, numThumbs: 20, captionContainerSel: '#caption' etc... </code></pre> <p>How can I make the caption appear in the <code>#caption</code> div that I appended?</p>
javascript jquery
[3, 5]
5,711,311
5,711,312
Can this style of carousel be done with jQuery?
<p>This is a Flash-based gallery: <a href="http://spin.co.uk" rel="nofollow">http://spin.co.uk</a> I love the way it works, but Flash isn't an option for me.</p> <p>I've had a look at various plugins but couldn't find any demo or indication that this kind of setup is even possible. I don't need to jump between slides, just backwards/forwards.</p> <p>Could anybody help me out? Thanks!</p>
javascript jquery
[3, 5]
1,733,143
1,733,144
Value of html from jquery get
<p>I want to retrieve the value of a text field on a another page on my website (prices.html) </p> <p>Using <a href="http://api.jquery.com/jQuery.get/" rel="nofollow">http://api.jquery.com/jQuery.get/</a>, how can I accomplish this? </p> <p>How can I do this? </p> <p><code>var price = $('input:price').val();</code> &lt;- the value of price from <code>prices.html</code> (i'm not on this page so i need to request it)</p> <p>How can I do this?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
4,240,805
4,240,806
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]
3,220,984
3,220,985
why setinterval slows down the website
<p>I am using this simple function but it much skows down the web site depending on the time the webpage has been opened.when user refresh or goes to another page,it takes much time to refresh.</p> <p>I am basically fecthing the user new posts.so time must keep running.</p> <p>If i dont use this function then webpage loads quickly.Although this is a simple function Plz help or suggest any alternarive approach.</p> <pre><code>$(document).ready(function() { setInterval( "timer();", 1000 ); }); function timer(){ $.post('sendchat2.php', {option:'timer',id= $('#timer').val()}, function(data) { $('#timer').html(data); }) } </code></pre>
php jquery
[2, 5]
197,325
197,326
parts of page loaded with ajax dont work with functions
<p>I have a table like this</p> <pre><code> &lt;tr&gt; &lt;td&gt;No.&lt;/td&gt; &lt;td&gt;Username&lt;/td&gt; &lt;td&gt;Password&lt;/td&gt; &lt;td&gt;Usage Left&lt;/td&gt; &lt;td&gt;%&lt;/td&gt; &lt;td&gt;Valid Until&lt;/td&gt; &lt;td&gt;Days Left&lt;/td&gt; &lt;td&gt;Delete&lt;/td&gt; &lt;/tr&gt;&lt;!-- This is table head and is contained in multiple rows --&gt; </code></pre> <p>I add/delete users with jquery but when i add a user instead of reloading the page i just append the row of newly added user to the table, so this newly added row delete doesnt work, however i can delete records after reloading the whole page again.</p> <p>I checked the class name of added rows and they are correct and i am using</p> <pre><code> $('.deleteThis').bind('click', function() { }); </code></pre> <p>function to delete records.</p>
javascript jquery
[3, 5]
2,837,718
2,837,719
Transfer data from java application to c#
<p>I need to transfer byte array from my java app to a c# app. One option is just store it into a file but its not so secure. I was thinking maybe there is a way to use a memorystream or something so the data wont be stored anywhere else than memory.</p> <p>EDIT: Just to give more information. Applications run on the same machine and C# applications is executing the java application.</p>
c# java
[0, 1]
2,446,061
2,446,062
How to get the # of options with the attr "selected" in a drop down using jQuery?
<p>This isn't working for me: </p> <pre><code> $('select').each(function() { alert($(this).find('option').attr('selected').length); } </code></pre> <p>actually what I really need is to just detect if the present select has any preselected options.</p>
javascript jquery
[3, 5]
1,248,287
1,248,288
How to use the select menu value in the specific DIV jQuery
<p>I have the following code to get the selected item value and post it to a DIV. That is okay, it is working fine, my DIV shows the selected value. But my question is how can I use that value in the DIV ? so that I can create a php msyql query.</p> <pre><code>&lt;head&gt; &lt;style&gt; .response { padding:10px; background-color:#9F9; border:2px solid #396; margin-bottom:20px; } &lt;/style&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("#developer").change(onSelectChange); }); function onSelectChange(){ var selected = $("#developer option:selected"); var output = ""; if(selected.val() != 0){ output = selected.val(); } $("#output").html(output); $('#output').slideDown("slow"); } &lt;/script&gt; &lt;/head&gt; &lt;select id="developer"&gt; &lt;option value="0"&gt;Select&lt;/option&gt; &lt;option value="1"&gt;name&lt;/option&gt; &lt;option value="2"&gt;name2&lt;/option&gt; &lt;/select&gt; &lt;div align=center class=response id=output style="display:none;"&gt; &lt;?php $sql = "SELECT * FROM users WHERE name='$name'"; $result = mysql_query($sql) or die("err"); while($row=mysql_fetch_array($result)){ $age = $row[age]; } echo $age; ?&gt; &lt;/div&gt; </code></pre>
php jquery
[2, 5]
3,325,911
3,325,912
Open A Contact Activity of Android with some fields which are already inserted
<pre><code>ArrayList&lt;ContentValues&gt; data = new ArrayList&lt;ContentValues&gt;(); ContentValues row1 = new ContentValues(); row1.put(Data.MIMETYPE, Organization.CONTENT_ITEM_TYPE); row1.put(Organization.COMPANY, "Android"); data.add(row1); ContentValues row2 = new ContentValues(); row2.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE); row2.put(Email.TYPE, Email.TYPE_CUSTOM); row2.put(Email.LABEL, "Green Bot"); row2.put(Email.ADDRESS, "[email protected]"); data.add(row2); Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI); intent.putParcelableArrayListExtra(Insert.DATA, data); startActivity(intent); </code></pre> <p>I did not find it in android.provider.ContactsContract.Intents.Insert.Data (which is using in second last instruction) there is no Data Variable in Insert Class , I am using API-8 v2.2 Please help is their any other way to do this ? I want to fill the data in add contact like this.</p>
java android
[1, 4]
1,771,459
1,771,460
change background color document with javascript
<p>I am using the following code : </p> <pre><code> &lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WebApplication3.Site1" %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;link href="style.css" rel="stylesheet" /&gt; &lt;script type="text/javascript"&gt; function change(color) { document.bgColor = color; } &lt;/script&gt; &lt;asp:ContentPlaceHolder ID="head" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div class="green"&gt; &lt;div id="slatenav"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="WebForm3.aspx" id="green" onclick="change('green')"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="WebForm4.aspx" id="red" onclick="change('red')"&gt;About Us&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Why it isn't working properly?</p>
javascript asp.net
[3, 9]
1,090,069
1,090,070
Any specific order for Java script and jquery
<p>I am using one java script and one jquery in my html file in head tag, but my problem both the scripts are not working, i have used one slide show script and one nav menu script, in this both only one is working , is there any specific order to write these scripts , please find the below script order i have used , i am getting only slideshow. please help me out .</p> <pre><code>&lt;script type="text/javascript"&gt; google.load("mootools", "1.2.1");&lt;/script&gt; &lt;script type="text/javascript" src="Js/MenuMatic_0.68.3.js" type="text/javascript" charset="utf-8"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; window.addEvent('domready', function () { var myMenu = new MenuMatic(); });&lt;/script&gt; &lt;script type="text/javascript" src="Js/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="Js/jquery.easing.1.3.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="Js/slides.min.jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $('#slides').slides({ preload: true, preloadImage: 'img/loading.gif', play: 5000, pause: 2500, hoverPause: true }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
996,557
996,558
Convert the javascript function into jquery
<p>i have one javascript function which are set drop down and textboxe from this fuction , i wanted to convert this function into jquery kindly assist.</p> <pre><code>function setDDls(strCity, strState, strCountry) { $(txtCity).val(strCity); $(ddlState).val(strState); $(ddlCountry).val(strCountry); $("#overlay .close").click(); return false; txtCitySearch = document.getElementById("&lt;%= txtCity.ClientID %&gt;"); ddlStateSearch = document.getElementById("&lt;%= ddlState.ClientID %&gt;"); ddlCountrySearch = document.getElementById("&lt;%= ddlCountry.ClientID %&gt;"); txtCitySearch.value = strCity; ddlStateSearch.selectedIndex = 0 for (i = 0; i &lt; ddlStateSearch.options.length; i++) { if (ddlState.options(i).text.toUpperCase() == strState.toString().toUpperCase()) { ddlStateSearch.selectedIndex = i; break; } } ddlCountrySearch.selectedIndex = 0; for (i = 0; i &lt; ddlCountrySearch.options.length; i++) { if (ddlCountrySearch.options(i).text.toUpperCase() == strCountry.toString().toUpperCase()) { ddlCountrySearch.selectedIndex = i; break; } } $("#overlay .close").click(); return false; } </code></pre>
javascript jquery
[3, 5]
2,836,506
2,836,507
Jquery or pure javascript
<p>Would a javascript programmer, that knows javascript pretty well, write his/her code in Jquery or in pure javascript?</p> <p>With other words. Are jquery just for people who doesn't know javascript well enough?</p> <p>Lets say we are talking about creating "comapny presentation websites", where javascript mainly will be be used for animations.</p>
javascript jquery
[3, 5]
1,704,944
1,704,945
asp.net c# is checkbox checked?
<p>How do I determine if the checkbox is checked or not checked? Very perplexed why this is not working - it is so simple!</p> <p>On my web form:</p> <pre><code>&lt;asp:CheckBox ID="DraftCheckBox" runat="server" Text="Save as Draft?" /&gt; &lt;asp:Button ID="PublishButton" runat="server" Text="Save" CssClass="publish" /&gt; </code></pre> <p>Code behind which runs in the click event for my save button:</p> <pre><code> void PublishButton_Click(object sender, EventArgs e) { if (DraftCheckBox.Checked) { newsItem.IsDraft = 1; } } </code></pre> <p>When debugging it never steps into the If statement when I have the checkbox checked in the browser. Ideas?!</p> <p><strong>I think there maybe some other code affecting this as follows...</strong></p> <p>In Page_load I have the following:</p> <pre><code>PublishButton.Click += new EventHandler(PublishButton_Click); if (newsItem.IsDraft == 1) { DraftCheckBox.Checked = true; } else { DraftCheckBox.Checked = false; } </code></pre> <p>newsItem is my data object and I need to set the checkbox checked status accordingly. When the save button is hit I need to update the IsDraft property based on the checked status of the checkbox:</p> <pre><code>void PublishButton_Click(object sender, EventArgs e) { if (IsValid) { newsItem.Title = TitleTextBox.Text.Trim(); newsItem.Content = ContentTextBox.Text.Trim(); if (DraftCheckBox.Checked) { newsItem.IsDraft = 1; } else { newsItem.IsDraft = 0; } dataContext.SubmitChanges(); } } </code></pre> <p>So, isDraft = 1 should equal checkbox checked, otherwise checkbox should be un-checked. Currently, it is not showing this.</p>
c# asp.net
[0, 9]
2,306,361
2,306,362
ASP.NET TextBox updated by Javascript not seen
<p>This is going to be easy for someone who knows what they are doing.</p> <p>I have a launch calendar button, a continue button, and a date textbox. The button launches a JavaScript calendar in a popup window. That calendar returns a date into the ReservationDate textbox field using:</p> <pre><code>window.opener.document.getElementById('ctl00_wpm_ShowProduct_ctl10_ReservationDate').value = '&lt;%= CurrentDate %&gt;'; </code></pre> <p>I know, it's not elegant but works. The problem is that even though on the browser I see the date in the field, when I hit the continue button and try to access it from my .NET script, the server side script sees it as empty.</p> <p>How do I tell the server to use the text the browser has in that field that it is not seeing?</p> <p>I know enough to know that it's a server side versus client side issue but how do I bridge that gap?</p>
c# javascript asp.net
[0, 3, 9]
372,651
372,652
how to assign an value from javascript variable to hidden field
<pre><code> &lt;script type="text/javascript" language="javascript"&gt; function(sender, e) { var **Sessioninfo**= $get('&lt;%= ((Hiddenfield)this.Master.FindControl("ct100_hfSession")).ClientID %&gt;'); } &lt;/script&gt; </code></pre> <p>here from my master page hiiden field i am getting the value in <strong>Sessioninfo</strong></p> <p>now in child page i have another hidden field called <strong>hfchildpage</strong> now i need to assign the Sessioninfo. value to hfchildpage</p> <p>can u plz provide the syntax for it thank you</p>
asp.net javascript
[9, 3]
4,401,684
4,401,685
How to use a while loop to build a stringarray and use it as a list
<p>I am writing an app for fellow students, and I am parsing information from a website. I paid a guy to write the parser but did a poor job and he wants more money to help anymore. So im trying to fix it myself.</p> <p>There is the extractor that grabs the xml info, how the gentlemen had it, was he called it in the main.java like this.</p> <pre><code> Content1 = extractor.BusRoutes.get(1); Content2 = extractor.BusRoutes.get(2); Content3 = extractor.BusRoutes.get(3); </code></pre> <p>But there is 30+ buses, and to me, that is not a solid idea. So I tried to do a while loop and an array in order to build the list and make it a list in android. </p> <pre><code> public class BusRoutes extends ListActivity { TransitXMLExtractor extractor; public String[] busroutearray() { extractor = new TransitXMLExtractor(); String[] busroutearray = new String[40]; int n = 0; while(n != (busroutearray.length - 1)){ busroutearray[n] = extractor.BusRoutes.get(n); n++; } return busroutearray; } /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, busroutearray())); getListView().setTextFilterEnabled(true); } </code></pre> <p>bus when i launch it, i always get a forced quit.</p> <p>edit, the n++ was there before, but got deleted while changing up the code, but with the n++ it still has same effect. </p>
java android
[1, 4]
3,408,265
3,408,266
How to remove PROTOCOL from URI
<p>how can I remove the protocol from URI? i.e. remove HTTP</p>
c# asp.net
[0, 9]
758,197
758,198
Opening a webpart from a separate page in modal form
<p>I am an IT schoolboy who is on an 8 month apprenticeship. I have been charged with creating a little sharepoint site for our tiny group in the company I am working at. I have site collection (is that the correct term?) permissions, and no access to SP Designer. Everything I have done so far is via webparts (lots of CEWP).</p> <p>I built a wiki site, and a few other things. I was then asked to build an image carousel with jquery. Done.</p> <p>Now my current issue.</p> <p>I have a list of applications we support in our department. It has about 14 columns, 10 of which are custom. I figured out a way to dynamically build a list and link them to another publishing page, on which I build a little thing to give a custom table of the output.</p> <p>All of this works just fine.</p> <p>However, now I would like it so the user clicks on the link, and the table (from the CEWP on the publishing page) opens in a sort of lightbox style effect. Actually, at this point, any modal fashion.</p> <p>I have no experience with ajax, and am pretty new at a lot of this stuff. I am in no way asking for anyone to write my code and do my job, but would appreciate some pointers as in what direction I should point my research? I don't want to waste days 'barking up the wrong tree'.</p> <p>Any help would be very appreciated. Thanks.</p> <p>EDIT - I'm working in SP2007. From what I understand, modal dialog is not supported in 2007?</p> <p>EDIT2 - If anyone else happens upon this...... I ended up using jquery ui dialog widget. Worked like a charm. Took a bit of screwing around to finally get it up and running, but works great. I now have a page that uses soap to grab all of the column contents from my custom list, it populates a dropdown menu that I made with js, and the links populated withing the dropdown open a dialog window populated with the particular information from that list. Looks great, and the great news is that the guys I work with are happy!</p>
javascript jquery
[3, 5]
5,141,177
5,141,178
Passing object array - Unexpected token [
<pre><code>function showConfirm(reArray) { var theHTML = ''; var optionArray = ["Option 1", "Option 2", "Option 3", "Option 4", "Option 5", "Option 6", "Option 7"]; var myButtons = {}; var j = 1; for(var i = 0; i &lt; reArray.length; i++){ theHTML +='&lt;div style="text-align:center"&gt;' + '&lt;span&gt;'+j+'.&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' + '&lt;span&gt;'+reArray[i].RoadNo+'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' + '&lt;span&gt;'+compass_image(reArray[i].Bearing)+'&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;' + '&lt;/div&gt;&lt;br/&gt;' j++; } for(i = 0; i &lt; reArray.length; i++){ ERROR HERE -----&gt; var placeFunction = function(reArray[i]){ plotRoadInfo(reArray[i]); $(this).dialog("close"); }; myButtons[optionArray[i]] = placeFunction; } $( "#dialog-modal" ).dialog({ height: 300, modal: true, buttons: myButtons }); $('#multipleRE').append(theHTML); } </code></pre> <p>So the function gets passed an object array (reArray), it then creates an array of buttons (myButtons) for a jquery dialog box. I'm attempting to to pass reArray[i] to the function that will be used by each button, which is to execute plotRoadInfo(reArray[i]);</p> <p>I keep getting "Unexpected token [", and I can't figure out why for the life of me.</p>
javascript jquery
[3, 5]
5,725,600
5,725,601
Android Fill Data Array Dynamic
<p>I'm stucked with filling an Array dynamic.</p> <p>I can't find the solution. Normal I would fill the array just by any loop.</p> <p>It's not working in this case I really spent hours to find a solution.</p> <p>I found an example to use a custom list in android. works fine.</p> <p>I create a object Test.</p> <pre><code>public class Test { public int icon; public int PB; public String title; public Test(){ super(); } public Test(int icon, String title, int PB) { super(); this.icon = icon; this.title = title; this.PB = PB; } </code></pre> <p>}</p> <p>and fill it static here works fine. But I don't get how to fill it dynamic.</p> <pre><code>Test test_data[] = new Test[] { new Test(R.drawable.ic_launcher, "Test 1", 10), new Test(R.drawable.ic_launcher, "Test 2", 100) }; </code></pre>
java android
[1, 4]
3,493,978
3,493,979
Conversion from jQuery into JavaScript
<p>I've a script:</p> <pre><code>&lt;form id="myform"&gt; &lt;input type="text" value="" id="input1"&gt; &lt;input type="text" value="" id="input2"&gt; &lt;input type="submit" value="submit"&gt; &lt;/form&gt; &lt;img id="image" src="http://mydomain.com/empty.gif" /&gt; &lt;script&gt; $(document).ready(function () { $("#myform").submit(function (ev) { ev.preventDefault(); var val1 = $("#input1").val(); var val1 = $("#input2").val(); $("#image").attr("src", "http://mydomain.com/image?val1="+val1+"&amp;val2="+val2); }); }); &lt;/script&gt; </code></pre> <p>How would it look like if written in JavaScript?</p>
javascript jquery
[3, 5]
495,146
495,147
Using JQuery to get string value of an onclick() event
<p>Wondered if there was good way to do this, thought I would post to the SO community...</p> <p>There is a 3rd party web page that I have no control over how it renders, but they allow me to add JQuery.</p> <p>Using the JQuery, I am creating a nav menu on the side of the page, it will be a list of links. The onclick event of these links I get from existing onclick events already on the page, but when I do a:</p> <pre><code>var linkLoc = $('#theLink').attr("onclick"); </code></pre> <p>linkLoc returns:</p> <pre><code>function onclick(event) { handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", "smartform"); } </code></pre> <p>instead of what I would expect:</p> <pre><code>handleJumpTo("com.webridge.entity.Entity[OID[E471CB74A9857542804C7AC56B1F41FB]]", smartform"); </code></pre> <p>I think JQuery is trying to get the event for binding, but I need the <em>actual Javascript markup</em> since I'm creating the HTML dynamically. I guess I could substring the "function onclick(event) {" out, but seems kind of hacky.</p> <p>Any ideas of an elegant way I could get the onclick markup?</p>
javascript jquery
[3, 5]
1,095,530
1,095,531
opening file upload window using javascript
<p>I have a button or link button. I want to open a window for file uploading by clicking the button or link button. Actually at that time I won't have any file upload control there. can any one tell me how to do it by using JavaScript?</p>
asp.net javascript
[9, 3]
3,678,002
3,678,003
jquery Sortable/Selectable: filtering child controls
<p>I have a div containing nested divs, like so:</p> <pre><code>&lt;div id="tree" class="tree"&gt; &lt;div class="node"&gt;&lt;div class="handle"&gt;&lt;/div&gt;Node 1&lt;div class="ignore"&gt;&lt;/div&gt; &lt;div class="node"&gt;&lt;div class="handle"&gt;&lt;/div&gt;Node 2&lt;div class="ignore"&gt;&lt;/div&gt; &lt;div class="node"&gt;&lt;div class="handle"&gt;&lt;/div&gt;Node 3&lt;div class="ignore"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Then, to add sortable() and selectable()</p> <pre><code>$('.tree').sortable({ handle:'.handle' }); $('.tree').selectable(); </code></pre> <p>I'm using the jQuery UI "sortable" behavior so that the user can reorder the list. The problem is that when the user clicks a div with the class "ignore," the "selectable" highlight moves to that div. I'd like to filter the selectable and sortable behaviors so that they only catch the .node sets, ignoring the .ignore test as it contains a toolbox whose controls no longer accept clicks.</p> <p>Suggestions?</p>
javascript jquery
[3, 5]
4,930,803
4,930,804
Changes in jQuery version
<p>I have been working on jQuery version 1.3 (one of the most popular versions I guess) for long time and hence have not been able to keep track of the changes in the later versions.</p> <p>So I just wanted to understand the changes that jQuery library has implemented from version 1.3 to the latest version 1.9 Specifically are there any changes related to jQuery AJAX implementation ?</p>
javascript jquery
[3, 5]
4,524,940
4,524,941
slider javascript library that handles image and text layer at different speed
<p>I am looking for jquery image slider plugin, that slides images and text layer at different speed similar to <a href="http://www.apple.com/imac/" rel="nofollow">http://www.apple.com/imac/</a></p> <p>This question is similar to <a href="http://stackoverflow.com/questions/3893765">Using javascript modulus to iterate through text slider with for loop</a>, but I want to know if a javascript library exists before working on it.</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,098,298
5,098,299
wrapping plain javascript object in jquery $({})
<p>I have this fragment of code from a book I am reading. And want to understand what <code>$({})</code> means and what is its use exactly.</p> <p>I tried searching on several search engines and even on SO. <code>$({})</code> wasn't a search-friendly term. </p> <pre><code> var Events = { bind: function(){ if ( !this.o ) this.o = $({}); this.o.bind.apply(this.o, arguments); }, trigger: function(){ if ( !this.o ) this.o = $({}); this.o.trigger.apply(this.o, arguments); } }; </code></pre> <p>I did find a similar <a href="http://stackoverflow.com/questions/3587372/what-does-mean-in-jquery">question</a> about <code>$([])</code> but I don't think it is quite the same thing.</p>
javascript jquery
[3, 5]
718,461
718,462
Export a jquery div as a picture
<p>I found a very nice jquery polaroid running in a div.</p> <p><a href="http://www.marcofolio.net/webdesign/the_polaroid_photo_viewer_non-full_screen.html" rel="nofollow">http://www.marcofolio.net/webdesign/the_polaroid_photo_viewer_non-full_screen.html</a></p> <p>Is it possible to save the result in a single image? What library should I use. I am using Java, javascript and python. Is there any library for those languages?</p> <p>Thanks</p>
java javascript python
[1, 3, 7]
3,186,551
3,186,552
How to properly do JS condition?
<p>I run this jQuery (1.8.3) code and always get the "in" alerted even when the length is greater than 1.</p> <p>What I'm doing is dynamically adding elements to a menu and the if is to make sure this element doesn't exist yet.</p> <p>I tried also <code>== 0</code> and <code>=== 0</code> but the result is the same...</p> <p>Here is a JS fiddle: <a href="http://jsfiddle.net/mHhwq/4/" rel="nofollow">http://jsfiddle.net/mHhwq/4/</a></p> <pre><code>$(".sidebarit a.olink").click(function(event){ iframe_url = $(this).attr("href"); sidebar_id = '#' + iframe_url.replace(/[/.]/g, ''); alert('sidebar_id: ' + sidebar_id); // create the sidebar if it doesn't exist if ($(sidebar_id).length &lt; 1) { alert("in"); $("#sidebar_nav ul").append('&lt;li&gt;&lt;/li&gt;'); $("#sidebar_content").append('&lt;div id="' + sidebar_id + '" style="display:none;"&gt;&lt;/div&gt;&lt;/div&gt;'); } else { alert("out"); } // don't follow the link event.preventDefault(); }); </code></pre> <p>In FireBug I see the length equals 1 but still enters the block.</p> <p>What am I doing wrong?</p> <p><strong>Update:</strong></p> <p>My mistake was that I added the <code>#</code> at the wrong place...</p>
javascript jquery
[3, 5]
3,379,963
3,379,964
Call a Javascript function within an inline statement
<p>Quick question: It's kind of tough to describe so let me just show an example.</p> <p>Is there anyway to do this: (I'm using jQuery but this is a general javascript question)</p> <p>$('div.element').offset().x;</p> <p>$('div.element').offset() by itself will return {'x' : 30, 'y' : 180}, so I'm just wondering if there is any compact way of doing this without creating an extra variable.</p> <p>Thanks! Matt</p>
javascript jquery
[3, 5]
5,817,802
5,817,803
Android Toast Cancelled But Not Dequeued
<p>I am using a single Toast object that is being accessed from multiple methods. Each of the methods initializes the Toast to display a different message, and each of the methods cancels the existing Toast on the screen in order to display its own. However, after the on-screen Toast is cancelled and it disappears, there is a delay before the new Toast is displayed. </p> <p>I have found that this delay is exactly equivalent to how long it would have taken the original Toast to disappear off the screen by itself (instead of being cancelled). This has led me to believe that although the Toast cancel() method removes it from the screen, it does not dequeue it from the system, causing other Toasts to still have to wait before they are displayed. Is there any way around this?</p>
java android
[1, 4]
5,174,136
5,174,137
Script executes but code-behind not
<p>I have a button on my aspx page. With this button, I'll add a option element into a select element and add some data to a GridView displayed on the page. I want to put the option element first than executes my code-behind from this button.</p> <p>I have the button and the evaluated combobox:</p> <pre><code>&lt;asp:DropDownList runat="server" ID="comboboxPeople" ... /&gt; &lt;asp:DropDownList runat="server" ID="comboboxOutput" /&gt; &lt;asp:Button runat="server" ID="buttonAdd" text="Add passanger" OnClick="buttonAdd_Click" OnClientClick="addOptionToSelectElement();" /&gt; </code></pre> <p>I have the script:</p> <pre><code>function addOptionToSelectElement() { var cb = document.getElementById('&lt;%=comboboxPeople.ClientID %&gt;'); var cbout = document.getElementById('&lt;%=comboboxOutput.ClientID %&gt;'); var op = document.createElement("op"); op.value = cb.options[cb.selectedIndex].value; op.text = cb.options[cb.selectedIndex].text; cbout.appendChild(op); } </code></pre> <p>And my code-behind:</p> <pre><code>protected void buttonAdd_Click(object sender, EventArgs e) { DoSomething(...); } </code></pre> <p>Here's my problem: If I attach the script function to my button, the code-behind doesn't work. If I don't use the script, my code-behind runs.</p> <p>Any idea? Thanks!!</p>
javascript asp.net
[3, 9]
184,759
184,760
Can't adjust label widths. JQuery
<p>I have such a sketch: <a href="http://jsfiddle.net/challenger/upcZJ/" rel="nofollow">http://jsfiddle.net/challenger/upcZJ/</a>.</p> <p>I found an article <a href="http://www.jankoatwarpspeed.com/post/2008/07/09/Justify-elements-using-jQuery-and-CSS.aspx" rel="nofollow">http://www.jankoatwarpspeed.com/post/2008/07/09/Justify-elements-using-jQuery-and-CSS.aspx</a> which explains how to adjust label widths relative to the widest one.</p> <p>But I can't do the same. What have I missed? I've tried do the thing inside an <code>accordion tab</code> and inside <code>aside division</code>.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,685,260
3,685,261
java.lang.NoClassDefFoundError
<p>I am currently getting an ArrayDeque class def not found error when testing my app on my phone(version 2.2) however i dont get the error when run in an emulator (2.3.3) Heres the Error:</p> <pre><code>java.lang.NoClassDefFoundError: java.util.ArrayDeque </code></pre> <p>Any help would be hugely appreciated.</p>
java android
[1, 4]
2,404,999
2,405,000
Check for empty a field from all in jQuery
<p>I have four fields, and I the function to return true if atleast one field has a value, if all fields don't have a value return false, How do I do this?</p> <p>My try:(this doesn't work like I want)</p> <pre><code>function required_eachinput(){ result = true; $('.myclass').each(function(){ var $val = $(this).val(); var ok = $val.each(function(){}); alert(ok); if(!$val){ $(this).css("background", "#ffc4c4"); result = false; } $(this).keyup(function () { $(this).closest('form').find('input').css("background", "#FFFFEC"); }) }); return result; } </code></pre>
javascript jquery
[3, 5]
2,924,243
2,924,244
Stop window scroll with keycode (arrows), event.preventDefault() not working?
<p>I built an autosuggest, and keycode works to navigate up and down through the list, but it scrolls the window. I have tried event.preventDefault() but it is not stopping it. Any ideas? This is what I have tried:</p> <pre><code>$(document).keyup(function(e) { e.returnValue=false; e.preventDefault(); switch(e.keyCode) { case 40: suggestionLine++; $('#suggestionLine_'+suggestionLine).focus(); break; // etc... </code></pre> <p>Thank you!</p>
javascript jquery
[3, 5]
1,537,761
1,537,762
Button clears other input fields
<p>In my web page am having some dropdown lists. OnSelectedIndexChanged of ddl1 I am binding dropdown lists ddl2 and ddl3 . Once I click the button, ddl2 and ddl3 values clearing. This happens during postback of Button1. The postback of button1 fires ddl1 OnSelectedIndexChanged event. Am using Dotnet framework 2.0</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { widestData = 0; lblPCno.Visible = false; if (!IsPostBack) { FillCombos(); BindCoverGridview(); } } protected void OnBtnClick(object sender, EventArgs e) { FillCoverDtls(vShowroom, vCategory,vsubCategory.ToString(),vFamily.ToString()); lblCount.Text = "Total : " + grdCoverDetails.Rows.Count.ToString(); } </code></pre>
c# asp.net
[0, 9]
3,695,644
3,695,645
raising custom events to allow web user controls to intercommunicate
<p>Hey , I have 2 web user controls, both inherit the same base class which extends UserControl. I want to raise an event on one and the other should be aware of it. both are on the same page however the 2nd control never handles the custom event i raised on the 1st one ! any ideas ? please just point to an implementation of possible (BTW, i'm googling it since morning but no luck !)</p>
c# asp.net
[0, 9]
2,406,418
2,406,419
Change attribute value of a tag
<p>I have some tags like this:</p> <pre><code>&lt;path d="M 782.5 421 C 787.828 421 787.828 429 782.5 429 C 777.172 429 777.172 421 782.5 421 Z" fill="#4572A7" stroke="#FFFFFF" stroke-width="0.000001" width="8" height="8"&gt;&lt;/path&gt; </code></pre> <p>And I want for all the tags to have bigger width and height instead of 8. But I'm confused because they aren't in the style attribute. How to change them via javascript or jquery?</p>
javascript jquery
[3, 5]
2,968,645
2,968,646
jQuery: Is there a way to make this shorter and more elegant?
<p>I have a code that looks like this:</p> <pre><code>&lt;div id="wrapper"&gt; &lt;img id="first" class="images" src="img/nike.jpg" /&gt; &lt;img id ="second" class = "images" src="img/golden.jpg" /&gt; &lt;img id = "third" class ="images" src ="img/a.jpg" /&gt; &lt;img id = "fourth" class="images" src="img/God__s_Canvas_by_Delacorr.jpg" /&gt; &lt;/div&gt; </code></pre> <p>I want to wrap each img with <code>&lt;a name = n&gt;</code> dynamically. So my solution was to do this:</p> <pre><code>$(".images").wrap('&lt;a&gt;&lt;/a&gt;') $("#wrapper a").each(function(n) { $(this).attr('name', n); }) </code></pre> <p>Is it possible to chain the 2 statements into 1 statement? I know that jQuery is particularly do elegant chaining so I think it's definitely possible. I just don't know how to yet.</p>
javascript jquery
[3, 5]
2,105,831
2,105,832
How to convert a urlcode in array in php?
<p>I hope you can help me;</p> <p>How to convert a urlcode in array in php?</p> <p>example:</p> <pre><code>$Urlcode = 'name=luiz&amp;country=Brazil&amp;city=patrociniomg'; </code></pre> <p>I need to transform this $Urlcode in array, in PHP, anyone know?</p> <p>Thanks to everyone now</p>
php jquery
[2, 5]
4,064,544
4,064,545
How can I save data with the help of javascript?
<p>I'm working on a project and the requirement is that we have links in menu. When we modify the curent page and dont save it and want to move or redirect on next page, then a pop up window shows which ask whether you want to save the data or not.</p> <p>I have completed up to pop up comes when we modify or enter some data in textboxes or do any change on page. Now the problem comes how we save the data when we click on yes button.</p> <p>How can I do this with the help of javascript?</p>
c# javascript
[0, 3]
2,164,452
2,164,453
how to execute javascript of one page on click in another page
<p>The thing is I have a page A.aspx there is script in that which will create a tab. from A I'm opening another page B.aspx . </p> <p>What I want is when I click a button in B.aspx . The script in A.aspx should execute . or else the link in A.aspx which call that script should execute ..</p>
javascript asp.net
[3, 9]
1,389,652
1,389,653
android determine programmatically if voice dictation on soft keyboard is enabled
<p>I am writing an app that requires a high level of security. The app will be deployed on a Droid X device. I cannot allow the user to access the voice to text feature of the soft keyboard (by touching the microphone icon) because the audio and text cannot be sent over the internet. There is a way to disable this feature in Settings by going to Language &amp; keyboard --> Multi-touch keyboard --> and then uncheck the Voice dictation checkbox. When this checkbox is unchecked, the microphone icon on the soft keyboard is disabled. What I need is to be able to verify in my app that this feature is still turned off when the user is in any activity in my app where there is a TextView that activates the soft keyboard. I have tried the following code, but it apparently isn't checking the feature I turned off because it still indicates that voice recognition is turned on even when Voice dictation has been disabled. Is there any way programmatically to specifically check if the Voice dictation feature of the soft keyboard is enabled?</p> <pre><code>PackageManager pm = getPackageManager();&lt;br&gt; List activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0); if (activities.size() != 0) { voice recognition is turned on....NAUGHTY USER! displayAlertMessage("You are naughty! You turned on voice recognition...No data entry will be allowed until this feature is turned off!"); } </code></pre>
java android
[1, 4]
2,494,271
2,494,272
Object Serialization in Java and Android
<p>how to write more than one object to ObjectOutputStream in single response(Objects are not fixed,objects are creating dynamically as per user's request).can i use either Arraylist or Vector for this,please give some sample program.</p> <pre><code>TexxtViews text=new TexxtViews(2, -2, 2, "WELCOME TO CCS");//First Object ButtonView button=new ButtonView(-2, 2, "OK");//Second Object ArrayList array=new ArrayList(); array.add(text); array.add(button); OutputStream out = resp.getOutputStream(); ObjectOutputStream outSt = new ObjectOutputStream(out); outSt.writeObject(array); </code></pre> <p>tried this code</p>
java android
[1, 4]
3,584,461
3,584,462
ArrayList to Array of Strings in java
<pre><code>ArrayList&lt;String&gt; newArray = new ArrayList&lt;String&gt;(); newArray = urlList.getUrl(); for( int i = 0 ; i &lt; newArray.size();i++) { System.out.println(newArray.get(i)); } newArray.toArray(mStrings );// is this correct mStrings = newArray.toArray();// or this to convert ArrayList ot String array here for( int i = 0 ; i &lt; mStrings.length;i++) { System.out.println(mStrings[i]); } edit: when i try as below , i get null pointer exception try { newArray.toArray(mStrings ); for( int i = 0 ; i &lt; mStrings.length;i++) { System.out.println(mStrings[i]); } }catch( NullPointerException e ) { System.out.println(e); } </code></pre>
java android
[1, 4]
2,734,942
2,734,943
What is the equivalent of Java's .length for arrays in C#?
<p>I'm new to C#, and I'm trying to convert this code from java into C#.</p> <pre><code> static public double euclidean_2(double[] x, double[] y) { if (x.length != y.length) throw new RuntimeException("Arguments must have same number of dimensions."); double cumssq = 0.0; for (int i = 0; i &lt; x.length; i++) cumssq += (x[i] - y[i]) * (x[i] - y[i]); return cumssq; } </code></pre> <p>I know java uses .length but what is the equivalent in C# since I keep getting an error</p> <p>Thanks</p>
c# java
[0, 1]
716,431
716,432
starting with jQuery Plugin
<p>Anybody can suggest some best resources about jQuery plugins . I need to learn it from scratch as I learned a lot of JavaScript things(it is not enough though) , its the time to turn to jQuery</p> <p>What are all the best practices when writing a jQuery plugin ?</p>
javascript jquery
[3, 5]
5,900,750
5,900,751
Can you change the height/width of an ASP.NET control from a Javascript function?
<p>What is the best way to change the height and width of an ASP.NET control from a client-side Javascript function?</p> <p>Thanks, Jeff</p>
asp.net javascript
[9, 3]
5,151,016
5,151,017
Using clientscript.registerstartupscript with parameters to call javascript function
<p>1) I'm having an javascript control created with HTML5 and showing it with div.</p> <pre><code>&lt;div id="&lt;%=this.ClientID%&gt;" style="z-index:100;"&gt;&lt;/div&gt; </code></pre> <p>The control has a method <code>init()</code> to which I need to pass parameters from code behind; in order to initialize it. So this is how I'm doing it:</p> <pre><code>string script2 = String.Format("&lt;%=this.ClientID%&gt;.init({0},{1})", param1, param2); this.Page.ClientScript.RegisterStartupScript(this.GetType(), "initialize control", script2, true); </code></pre> <p>Is this the right way?</p> <p>2) What's the difference between setting parameter as <code>{1}</code> and <code>'{1}'</code>? </p>
c# javascript asp.net
[0, 3, 9]
2,425,197
2,425,198
How to find website refer using Javascript?
<p>How would I find which website referred to the my website using Javascript? For exmaple, if A.com had a link to B.com (my website), how could I tell who referred to my website?</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,461,949
3,461,950
Dynamically Setting the Src Attribute of an Iframe while maintaining Cross-Browser Compatibility
<p>I am going to create a Iframe which must update its contents dynamically (through the src attribute - The Iframe will change its location every time a different button is clicked) to play different youtube videos that my company has created. The problem is that I saw that you can use jquery to achieve this. I am oblivious to jquery at the moment, but will take time to learn it. For now, I need an answer. How do I use Jquery (or any alternative browser friendly method ) to Change the src Attribute of my Iframe?</p> <pre><code>&lt;script runat="server"&gt; &lt;/script&gt; &lt;div style="margin-left:auto;margin-right:auto"&gt; &lt;table style="width: 960px" cellpadding="0px" cellspacing="0px"&gt; &lt;tr&gt; &lt;td rowspan="6"&gt; &lt;iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/JZOxqVl5oP4" frameborder="0" allowfullscreen id="VideoPlayer"&gt;&lt;/iframe&gt; &lt;/td&gt; &lt;td style="Width: 130px"&gt; &lt;img width="130px" src="./Images/Video_Logos/l_absa.gif" /&gt; &lt;/td&gt; ... </code></pre> <p>Note that there are 10 buttons. The buttons are images, and I was planning to call different "Methods" for different videos to play.</p> <p>I know about javascript's Document.GetElementById("VideoPlayer").SetAttribute("src","NEW LOCATION") within a function, but , lets face it. IE6 + 7 sucks.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
799,939
799,940
In jQuery how do I create alert every 5 seconds?
<p>Can I do this using jQuery or should I be looking at using something else?</p>
javascript jquery
[3, 5]
623,669
623,670
What is the difference between these functions?
<p>I have the book Jquery in Action, and it mentions these three functions when talking about removing conflict with other libraries. However, I don't know what the difference is between them and do not understand the book's explanation.</p> <pre><code>jQuery(function($) { alert('I"m ready!'); }); var $ = 'Hi!'; jQuery(function() { alert('$ = ' + $); }); var $ = 'Hi!'; jQuery(function($) { alert('$ = ' + $); }); </code></pre> <p>Does anyone know what the difference is? Thanks.</p>
javascript jquery
[3, 5]
5,108,937
5,108,938
jquery - make a div appear where I click?
<p>Hey, I'm trying to make a little feature where I can click on an icon, and a box will appear that is similar to lightbox, but anchored on the icon. Is there a way to </p> <ol> <li>Tell where the icon is on the screen, and then </li> <li>Have the top left corner of my box placed where the icon is, and then </li> <li>Have my box appear in that location?</li> </ol> <p>Thanks!</p>
javascript jquery
[3, 5]
2,002,179
2,002,180
post selextbox values to php page in jquery
<p>I am using jquery button click to post all the values in a selectbox to a PHP page, but this code does not seem to work. Can anyone please help?</p> <pre><code>&lt;script type="text/javascript"&gt; $(function() { $("#btn1").click(function () { var arr= new Array; $("#target_select option").each (function () { // You can push the array on an array arr.push( $(this).val() ); //alert( $(this).val() ); not getting the alert to display too }); $.post("test.php", { name: arr } ); }); }); &lt;/script&gt; </code></pre> <p>Generate</p>
php jquery
[2, 5]
1,171,001
1,171,002
search and suggest with keywords with drop down in java script
<p>I am using php and I have written the code for search and suggest. Like if i enter 're' in text box , it will give all the result start with re in drop down.</p> <p>Now what i want to display all the result with key words math and highlight them in search. Like if i enter 're' then it should display reliance, reliance capital, and so on with key highlight.</p> <p>And if I enter 'capital' word then it should return tata capital, reliace capital with capital highlight (this search is word match search). </p>
php javascript
[2, 3]
2,736,829
2,736,830
Remove JavaScript comments from string with C#
<p>I am trying to remove javascript comments (<code>//</code> and <code>/**/</code>) from sting with C#. Does anyone have RegEx for it. I am reading list of javascript files then append them to string and trying to clean javascript code and make light to load. Bellow you will find one of the RegEx that works fine with <code>/* */</code> comments but I need to remove <code>//</code> comments too:</p> <pre><code>content = System.Text.RegularExpressions.Regex.Replace(content, @"/\*[^/]*/", string.Empty); </code></pre>
c# javascript
[0, 3]
4,582,446
4,582,447
Is there any way to pass a symbol like # to android CallIntents?
<p>Actually I am trying to create an android app which handles out going phone calls to our call manager. The problem is the URI.parse method which deletes all symbols that are not allows in a phone number, but it had to pass an number which has a "#" in in it.</p> <p>Is there any way to pass the whole number like "012347#5687" to the android action_call intent??</p>
java android
[1, 4]
4,411,230
4,411,231
call javascript function from code behind
<p>I have this JavaScript code in ASPX page </p> <pre><code>&lt;script&gt; function show_modal(statut) { if (statut == true) { $(function () { $('#modal_success').modal('show') }) } else { $(function () { $('#modal_fail').modal('show') }) } } &lt;/script&gt; </code></pre> <p>That shows an modalpopup wich I like to launch from my code behind.</p> <p>I tried this, but it didn't work:</p> <pre><code>if (resultat) { ClientScript.RegisterStartupScript(this.GetType(), "", "show_modal(true);"); } else { ClientScript.RegisterStartupScript(this.GetType(), "", "show_modal(false);"); } </code></pre> <p>but I can't figure out why!</p>
c# javascript asp.net
[0, 3, 9]
2,083,135
2,083,136
High cpu consumption due to a jquery regex patch
<p>I am going to work on a project developped by someone else. I don't have any contact with this guy. I noticed a very high cpu consumption by the browser when the page is loaded.</p> <p>After some investigations, i think that the problem comes from a patch of jquery regex but I don't clearly understand the goal of this patch and the cause of this cpu consumption.</p> <pre><code>jQuery.expr[':'].regex = function(elem, index, match) { var matchParams = match[3].split(','); var validLabels = /^(data|css):/; var attr = { method: matchParams[0].match(validLabels) ? matchParams[0].split(':')[0] : 'attr', property: matchParams.shift().replace(validLabels,'') }; var regexFlags = 'ig'; var regex = new RegExp(matchParams.join('').replace(/^\s+|\s+$/g,''), regexFlags); return regex.test(jQuery(elem)[attr.method](attr.property)); }; </code></pre> <p>I have seen that this method was constanly called.</p> <p>I have several calls to regex like this one.</p> <pre><code>$(':regex(id,DelCompo.*$)').livequery('click',function(e) { //... } </code></pre> <p>If I comment them, the cpu consumption seems to be normal. Of course, some features are broken.</p> <p>I think the problem comes from this new regex function. Is it correct? What would be the best way to fix this problem?</p> <p>Thanks</p>
javascript jquery
[3, 5]
226,198
226,199
FileUpload with Custom Validator
<p>Having an issue with fileupload that is being validated by a custom validator. The textbox value is always empty or null onververvalidate.</p> <p>ASPX</p> <pre><code>&lt;asp:CustomValidator ID="cvFileUpload" runat="server" ErrorMessage="Please select file!" ControlToValidate="fuCheatingEvidence" onservervalidate="cvFileUpload_ServerValidate" ValidationGroup="vgSubmitForm" ValidateEmptyText="True"&gt;&lt;/asp:CustomValidator&gt; &lt;asp:FileUpload ID="fuCheatingEvidence" runat="server" Width="890px" Size="50" /&gt; </code></pre> <p>CODE BEHIND</p> <pre><code>protected void cvFileUpload_ServerValidate(object source, ServerValidateEventArgs args) { String fileName = fuCheatingEvidence.PostedFile.FileName; if (fileName != "") { args.IsValid = true; } else { args.IsValid = false; } } </code></pre> <p>It's just a simple check to see if the FileUpload control is empty or not and later on I will add some more custom validation.</p>
c# asp.net
[0, 9]
812,452
812,453
How to hide the value of textbox using jquery
<p>If the user did not give any value to text box the value 0 (zero) to be set on blur but the text box should not display the value How can i do it using jquery</p> <pre><code>&lt;g:textField name="distance" id = "distance" value="${tripInstance?distance}" min="0" class="number" /&gt; </code></pre>
javascript jquery
[3, 5]
4,990,464
4,990,465
Page Refresh in ASP.NET
<p>save dialog saves file to the local machine. But after that, my page stand there and do nothing for the rest of my process. I use below code to open a save dialog</p> <pre><code>protected void lnkbtnDownload_Click(object sender, EventArgs e) { string fileName = startupPath + "bin\\Inbox.mdb"; System.IO.FileInfo targetFile = new System.IO.FileInfo(fileName); if (targetFile.Exists) { Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + targetFile.Name); Response.AddHeader("Content-Length", targetFile.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(targetFile.FullName); Response.End(); } } </code></pre> <p>the html code is :</p> <pre><code>&lt;asp:Button id="lnkbtnDownload" runat="server" CausesValidation="false" Text="Download" CssClass="buttonstyle" OnClick="lnkbtnDownload_Click"&gt;&lt;/asp:Button&gt; </code></pre> <p>but after the file is save to local machine and the save dialog is close, my page no response at all. May I know how to do a postback to the page after the save dialog is close.?</p>
c# asp.net
[0, 9]
2,483,110
2,483,111
Is there a place where we can see PHP <=> C++ equilavent libraries/function for a php developer starting with C++?
<p>Is there a place where we can see PHP &lt;=> C++ equilavent libraries/function for a php developer starting with C++?</p> <p>As a PHP developer starting with C++, I often ask myself: what is the equivalent of such-and-such PHP function in C++?</p> <p>The advantage of php, is that we have a very nice site which documents about everything we might want to use. All the commonly used PHP modules are all listed in one place (<a href="http://php.net/manual/en/funcref.php" rel="nofollow">http://php.net/manual/en/funcref.php</a>).</p> <p>One of the difficulties of starting with C++ is that we always have to search all over the web for one (often one of many) equivalent of a php function.</p> <p>It'd be nice to have a place where there is a table with the equivalent C++ library (or header) for each PHP module or group of function.</p>
php c++
[2, 6]
1,400,351
1,400,352
setting correct row of dropdownlist not working
<p>I have a dropdownlist that is being populated from a database. That is working fine. The nonselectvalue of the control is -1 and the nonselectlabel is "..". When I try to open an existing record for editing, I can't seem to select the correct row. There are three parts to the ID: 111A-DD-12345. When the record is returned from the database, the ID is parsed into the three fields. The first and third parts are textboxes on the page, but the middle part is a dropdownlist. When we open an existing record, we parse out the ID with the following code:</p> <pre><code>string[] chunks = cID.Split('-'); ddOffice.SelectedItem.Text = chunks[1]; </code></pre> <p>But this just changes the first row of the ddl to DD (using the example ID above), so we end up with two rows in the ddl that have the same displayed text. How do I programmatically set the dropdownlist to the correct value?</p> <p>Edit: We also tried ddOffice.SelectedValue = chunks[1] , but that just displays the .. of the default, non-selected row.</p> <p>TIA, Theresa</p>
c# asp.net
[0, 9]
4,024,882
4,024,883
Loading youtube videos by its URL with the help of a JS/Jquery function
<p>I am trying to load youtube videos using JS function. The intention is to have the user simply copy and paste the youtube video URL into an input field and then have my JS code takes care of the loading part. Unfortunately I am not sure why js code is not loading anyvideo? <a href="http://jsfiddle.net/bullseye2346/fZsrs/" rel="nofollow">JS FIDDLE</a></p> <p>JS:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ var last_cnad_text_1 = ''; var options_cnad_text_1 = { embedMethod:'fill', maxWidth:320, maxHeight: 320 }; function loadVideo() { val = $('#cnad_text_1').val(); if ( val != '' &amp;&amp; val != last_cnad_text_1 ) { last_cnad_text_1 = val; $("#embed_cnad_text_1").oembed(val,options_cnad_text_1); } } $(function(){ $('#cnad_text_1').keydown(loadVideo()); $('#cnad_text_1').click(loadVideo()); $('#cnad_text_1').change(loadVideo()); }); }); ​&lt;/script&gt; </code></pre> <p>html:</p> <pre><code>&lt;html&gt; &lt;div class="col1"&gt;Insert a youtube video Link&lt;/div&gt; &lt;div class="col2"&gt; &lt;input id="cnad_text_1" type="text" name="cnad[text_1]"&gt; &lt;div id="embed_cnad_text_1"&gt; &lt;iframe&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;/div&gt;​ &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
3,499,599
3,499,600
Android - Thread.sleep and Handler.postDelayed() freezes animated UI elements
<p>In my activity, my app downloads a list of something from a website via an Http Connection. Before this list of things is displayed on the screen, I have a <strong>Loading...</strong> TextView with a little spinning ProgressBar to indicate that the data is currnetly being downloaded.</p> <p>I noticed, that if I do any type of <code>Thread.sleep()</code> during the process of fetching the data from the web, it freezes the spinning <code>ProgressBar</code>.</p> <p>Even if I put the method in it's own <code>Handler Runnable</code> so that it's on it's own thread, the animation freezing still occurs.</p> <p>Is there anything I can do about this?</p>
java android
[1, 4]
2,998,018
2,998,019
jquery select all textboxes in a listview
<p>I have a listview which is databound to X items. On a submit button click I would like to use jquery to go through the listview rows and do basic form validation. This validation isn't systems critical so I am not worried about someone manipulating or sending back malicious scripts. It is things like, you must have a firstname,lastname. So on and so forth. </p> <p><strong>Any ideas on how to do this in jquery without using the clientID (lvBob$ct10$txtName) would be great. Thank you very much</strong></p> <p>Sorry question seems to be a little ambigious</p> <p>To eleberate I would like to iterate over X amount of rows with X amount of columns that are rendered in a listview. Validate each column based on my buisness logic and spawn an error message for each failure to validate.</p> <p>Psuedocode</p> <pre><code>for each row in Listview { row.txt1 != null {return "error message"} } </code></pre> <p>But I would like to do this in jquery.</p>
jquery asp.net
[5, 9]
1,175,934
1,175,935
jQuery - How to get the value of the array stored in hidden field on button click ?
<p>How to retrieve the specific hidden field value on the click of the "showImages" </p> <pre><code>&lt;span class="isymbol" id="showImages" href="Javascript:Void(0);"&gt;&lt;/span&gt; &lt;input type="hidden" name="hdnplaceid[&lt;?php echo $k; ?&gt;]" id="hdnplaceid" value="&lt;?php echo $PackageDetailsSightSeeing[$k]['deal_place_id']; ?&gt;"&gt; &lt;input type="hidden" name="hdncityid[&lt;?php echo $k; ?&gt;]" id="hdncityid" value="&lt;?php echo $PackageDetailsSightSeeing[$k]['deal_city_id']; ?&gt;"&gt; </code></pre> <p>I tried this but everytime i get the same value irrespective of the button which i click</p> <pre><code>$('.isymbol').click( function() { var placeid= $("#hdnplaceid").val(); // $("#hdnplaceid").val(); var cityid=$("#hdncityid").val(); alert(placeid); alert(cityid); loadImagePopupBox(); }); </code></pre> <p>The span and the input field are in a for loop. So they are dynamically generated.</p> <p>Thanks,</p>
php jquery
[2, 5]
3,758,818
3,758,819
jquery multi file upload for asp.net
<p>i become stuck in a problem kindly help me in this matter.... problem is that i want a jquery multi file uploader to embed in asp.net page and requirement 1)no use of flash plugin 2)it support IE 3)no use of html 5 4) select multi files at a time like (gmail when we send email)</p>
javascript jquery asp.net
[3, 5, 9]
5,265,776
5,265,777
First Time Script
<p>when you first land on this site you show a first time div tag appear up top (like a toolbar) which sits offering a link to the FAQ page.</p> <p>Nice touch! Is this done with jQuery or do you have an example of the code?</p> <p>Any help appreciated.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
6,032,854
6,032,855
When to use Literal vs LiteralControl?
<p>What are the appropriate use of these two controls? From time to time I build up HTML in the code behind. Sometimes I want to output white space and I end up doing something like this.</p> <pre><code>const string twoSpaces = "&amp;nbsp;&amp;nbsp;"; p.Controls.Add(new Literal { Text = twoSpaces }); </code></pre> <p>or</p> <pre><code>const string twoSpaces = "&amp;nbsp;&amp;nbsp;"; p.Controls.Add(new LiteralControl { Text = twoSpaces }); </code></pre> <p>My question is, is this an appropriate use of these controls? Should I be adding whitespace this way? When do I use one over the other?</p> <p>I realize I could probably do something with CSS, but I really want to know what are the purposes of these two controls, and is there anything inherently wrong with using them in this fashion.</p>
c# asp.net
[0, 9]
2,282,820
2,282,821
Process Involved in PHP Screen Scraping
<p>Can anyone tell me the process involved n PHP Screen Scraping of aspx page using POST Request? I want to download the data from a website and save it to Database.</p>
php asp.net
[2, 9]
3,275,868
3,275,869
jQuery upload PDF with FormData?
<p>I am attempting to upload a file through jQuery to my remote server, but I can't seem to get it working.</p> <p>The user needs to be able to upload a pdf file, which will then be processed by the server and saved to the root folder.</p> <p><strong>jQuery</strong></p> <pre><code>$('form').submit(function (e) { var fd = new FormData(); fd.append('file', $('#file')[0].files[0]); $.ajax({ cache: false, beforeSend: function (xhr) { xhr.setRequestHeader("Cache-Control", "no-cache"); xhr.setRequestHeader("pragma", "no-cache"); }, url: 'http://www.codekraken.com/testing/pointify/test.php?callback=?', data: fd, dataType: "json", processData: false, contentType: false, type: 'POST', success: function (data) { console.log(data); }, error: function (data) { console.log(data); } }); e.preventDefault(); }); </code></pre> <p><strong>PHP</strong></p> <pre><code>&lt;?php header('content-type: application/json; charset=utf-8'); $name = $_FILES["fd"]["name"]; echo ($_GET['callback'] . '('.json_encode($name).')'); ?&gt; </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;form&gt; &lt;input type="file" id="file" name="file"&gt; &lt;input type="submit"&gt; &lt;/form&gt; </code></pre> <p>When I submit a file, such as <code>input.pdf</code> and then press submit, I get the response <code>(null)</code>. I would expect to get the name of the file, <code>input.pdf</code>, which means I am missing a crucial step in this process.</p>
php javascript jquery
[2, 3, 5]
3,648,790
3,648,791
Detecting Which Page is Referencing a PHP Generated JavaScript file
<p>I am generating a JS navigation using PHP. Script is included like so</p> <pre><code>&lt;script type='text/javascript' src='/topNav.js.php'&gt;&lt;/script&gt; </code></pre> <p>I would like to use PHP rather than JavaScript to assign the class for the current page's link but all of the $_SERVER vars see the topNav.js.php location.</p> <p>I know I could use JS something like</p> <pre><code>if(window.location.href == 'myurl') { document.getElementById('itemx').className += 'active'; } </code></pre> <p>but I wanted to know if there was a good way to do this via PHP.</p>
php javascript
[2, 3]
5,212,934
5,212,935
Use Javascript or jQuery to create an array from an array
<p>Assume you have an array:</p> <pre><code>var arrStateCityAll=['CA_Alameda','CA__Pasadena','CA_Sacramento','NY_Albany','NY_Buffalo','NY_Ithaca'] </code></pre> <p>Is there an <em>easy</em> way using javascript and/or jQuery to filter the arrStateCityAll to get a new array (a subset of arrStateCityAll); something like this:</p> <pre><code>// return's ['CA_Alameda','CA__Pasadena','CA_Sacramento'] var arrStateCityCA=FilterArray('CA',arrStateCityAll); </code></pre>
javascript jquery
[3, 5]
939,060
939,061
Store & Return Settings for a Webpage
<p>So I am using C# ASP.NET 3.5 and I would like to add a feature to my site to turn on and off a sort of debug mode for testing purposes. </p> <p>Is there a best way to have a file or class that stores or returns simply if myDebug is on or off. It has to be accessed fast since it will be used a lot on multiple pages and it should be easy to set using the website itself.</p> <p>My first thought is just a class with get/set which is stored on every page... perhaps the master page?</p> <p>Thanks for any input -Scott</p>
c# asp.net
[0, 9]
5,817,439
5,817,440
How to set position of element equals to position of another element?
<p>The simple question. How to set position of element equals to position of another element by jquery or javascript?</p> <p>The following code doesn't work:</p> <pre><code>$('#credit_tip').css('top', $('.credit').position().top); $('#credit_tip').css('left', $('.credit').position().left); </code></pre>
javascript jquery
[3, 5]
2,862,859
2,862,860
Uploading image from Mobile device to server via php page
<p>I have a simple PHP form that uploads an image and then resizes it. When I run it on my Android using an image taken by the phone's camera, the file uploads but does not resize. BUT, if I use an image taken from a digital camera and uploaded via bluetooth to my phone, then it works fine. </p> <p>I thought maybe the image is base64 encoded, so I tried:</p> <pre><code>$img = base64_decode($uploadfile); file_put_contents($name,$img); </code></pre> <p>and</p> <pre><code>$img = imagecreatefromstring(base64_decode($uploadfile)); file_put_contents($name,$img); </code></pre> <p>But, neither worked.</p> <p>I just downloaded one of the image files I uploaded from my camera to the server and tried uploading through the script. I get a "SyntaxError: Unexpected EOF" error. Thought it might help to mention this.</p> <p>Anyone know what I'm doing wrong?</p> <p>Thanks!</p>
php android
[2, 4]
1,762,878
1,762,879
How can I pass javascript object instead of manually typing image names
<p>I'm working with the <a href="http://tobia.github.com/CrossSlide/" rel="nofollow">CrossSlide jQuery plugin</a> and the documentation shows the following code:</p> <pre><code>&lt;script&gt; $(function() { $('#slideshow').crossSlide({ sleep: 2, fade: 1 }, [ { src: 'picture1.jpg' }, { src: 'picture2.jpg' }, { src: 'picture3.jpg' }, { src: 'picture4.jpg' } ]) }); &lt;/script&gt; </code></pre> <p>What I want to do is pass in an array of object with src property instead of manually passing in the pictures. I have been able to create an object but I'm not sure if there is a way do that.</p> <p>Does Javascript provide any method/ways of taking the object and having it, probably at runtime, expand or the like?</p> <p>If you think there is another plugin I should look into instead, I'm open to suggestions.</p>
javascript jquery
[3, 5]
5,273,745
5,273,746
jquery how to make sure that the user has selected a value for all select menus on a form
<p>i have a form with multiple select menus i want to make sure on submit that a user selected a value for each select menu how can i do that with jquery ? i tried something like </p> <pre><code>var form = $('myform'); if($(form ).find('select').length != $(form).find('select:option[selected="selected"]').length ) { alert('wrong please make sure to select all select menu'); } </code></pre> <p>but no luck </p> <p>please help </p> <p>Thank you</p>
javascript jquery
[3, 5]
84,310
84,311
What object does the $ sign in "function loadGal($) "?
<p>I have a gallery that I am trying to integrate in my site. I am replacing a and then I want to call the galleries function "function loadGal($)" so the gallery will be rebuilt. But I don't know what kind of parameter to send to it.</p> <p>Before I changed it, it was called inside "jQuery(document).ready(function($) {"</p> <p>I just tried to do something like this:</p> <pre><code>jQuery(document).ready(function($) { loadGal($); }); </code></pre> <p>it works fine but I don't know what is the dollar...</p>
javascript jquery
[3, 5]
943,646
943,647
how to read html content from assets folder in android
<pre><code>try { File f = new File( "file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)") ; FileInputStream fis= new FileInputStream(f); System.out.println("_______YOUR HTML CONTENT CODE IS BELLOW WILL BE PRINTED IN 2 SECOND _______"); Thread.sleep(2000); int ch; while((ch=fis.read())!=-1) { fileContent=fileContent+(char)ch; // here i stored the content of .Html file in fileContent variable } System.out.print(fileContent); //} } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>This is my code. I want to read html content from asstes folder my file is available in asstes folder But it gives exception <code>FileNotFoundException</code>. So plz any one tell me how to read html content from asstes folder in android?</p> <p>File f = new File( "file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)") ; when i debug f gives= file:/android_asset/[2011]011TAXMANN.COM00167(PATNA)</p> <p>plz tell me how to get corrct directory and where i m doing wrong it shud me coming file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)</p>
java android
[1, 4]
4,993,677
4,993,678
Calling my own function during with onClick
<p>How do I call a user-define function such as this one using the onClick attribute of a input button? More specifically what special steps must I take in JQuery and what would the HTML markup look like? Thanks</p> <pre><code>function simClick(keyCode) { var e = jQuery.Event("keypress"); e.keyCode = 8; $(document).trigger(e); } &lt;input type="button" ID="delBtn" class="calcBtn" value="Del" onclick="???????" /&gt; </code></pre>
asp.net jquery
[9, 5]