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
1,051,825
1,051,826
What does $ do when using JQuery?
<p>I am reading JavaScript and JQuery, The Missing Manual</p> <p>and they start of with this Snippet : </p> <pre><code>$(document).ready(function(){}); </code></pre> <p>I know that <code>function(){}</code> is an anonymous function, and that document is an object with properties I can set / read, and that ready() is a JQuery function defined in the library, but I don't know what the rest of the syntax is for and it is not explained in the book.</p> <p>Particularly,</p> <pre><code>$(document) </code></pre> <p>Can someone explain what this does or point me to a link? Also, someone said that you can identify JQuery by this alone, is this true? </p>
javascript jquery
[3, 5]
3,167,270
3,167,271
return values from Jquery function
<p><br>I am a complete novice in jQuery and javascript, so if this sounds very silly or very simple thing to do please help me out with your expertise<br></p> <pre><code>$(document).ready(function(){ $('#add_button').click(function(){ var vol = $('input#cv').val(); var col = $('input#cc').val(); var comment = $('input#co').val(); var sample = $('#cv').attr('class'); var url = $('input#cv').attr('title'); if( (vol &amp;&amp; col &amp;&amp; comment) == ''){ alert('No data to update'); }else{ url = url.concat('volupdate=',vol,'&amp;concupdate=',col,'&amp;commupdate=',comment,'&amp;sample=',sample); alert(sample + " " + vol + " " + col +" "+ comment +" " + url); } }); }); </code></pre> <p>html : </p> <pre><code>my $correct_vol = qq{&lt;input type="text" name="cv" id="cv" size="6" class="$sample_name" title="/here/is/where/you/are"&gt;}; my $correct_conc = qq{&lt;input type="text" name="cc" id="cc" size="6" class="$sample_name" title="/here/is/where/you/are"&gt;}; my $comments = qq{&lt;input type="text" name="co" id="co" size="10" class="$sample_name" title="/here/is/where/you/are"&gt;}; my $update = q{&lt;input type="submit" value="Update" id="add_button" class="add_now"&gt;}; </code></pre> <p>These forms the last four columns in a big table. <br>My question is: How should I return the url in jquery function to my perl? <br> if I use <code>return url</code> what should I expect ? And how should I handle the values passed from the <code>url</code> in my script? Thanks for your suggestions.</p>
javascript jquery
[3, 5]
82,209
82,210
using jquery when passing arguments to function
<p>I have a link which triggers js function. To the link I have attached data-attribute on html which I want to pass to the function.</p> <pre><code>$(".trigger").awesomeFunction({ oneArgument: "secretSauce", secondArgument: $(this).data("address") }); </code></pre> <p>Now that second argument ends up null instead of the data-address attribute. Is it because $(this) is not in right scope inside the function arguments list and if so how could I refer to the originating link?</p>
javascript jquery
[3, 5]
5,286,175
5,286,176
How to identify button click from array of buttons
<p>I have a table with 1 button in each row, on click of button tax shown in that row will be applied to the client and i need to show some indication to end user. I want to change the button css(color, txt ect.) on click for that purpose. Below is the code -</p> <pre><code>&lt;table class="data report_table"&gt; &lt;tbody&gt; &lt;c:forEach var="taxVO" items="${taxVo}" varStatus="item"&gt; &lt;tr class="${item.index % 2 == 0 ? 'odd gradeX' : 'even gradeC'}"&gt; &lt;td&gt;&lt;c:out value="${taxVO.taxName}" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="button" class="btn-icon" value="Apply" id="applyTaxButton" onClick="applyTax('${taxVO.taxId}');"&gt;&lt;/input&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/c:forEach&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>and jquery i am using is -</p> <pre><code>function applyTax(taxIdValue) { $('#taxId').val(taxIdValue); $(this).$('#applyTaxButton').css("background-color","yellow"); } </code></pre> <p>but i am getting error - Uncaught TypeError: Object [object Object] has no method '$'. Can someone please let me know how to fix it?</p>
javascript jquery
[3, 5]
5,907,501
5,907,502
jquery AJAX sent data in key value pair
<p>In my aspx page, i have the js like this :-</p> <pre><code> &lt;script language="javascript" type="text/javascript"&gt; $("#btnLoad").click(function () { var dataForAjax = "{'datakey':'hello'}" $.ajax({ type: "POST", url: "Ajax__Demo.aspx/SendFile", data: dataForAjax, success: function (msg) { alert(msg); // Problem with this line. It is not showing the value. } }); }); &lt;/script&gt; </code></pre> <p>In the same webpage code behind class file ,i have the webmethod defined like this:-</p> <pre><code>[WebMethod] public static string SendFile(string key, string data) { return data; } </code></pre> <p>For some reason, i am able to get the data in the alert used on the html side. alert(msg); is giving me nothing and i am expecting to get the passed value back. In this case it should be 'Hello'. </p> <p>I am missing something very small here, please help me out here.</p>
c# jquery
[0, 5]
5,805,722
5,805,723
chrome safari javascript jquery back
<p>Is there anything particular to chrome or safari that would make a javascript/jquery script work on the first page load, but then when the user hits the back button after navigating the site, it causes select boxes to be selected?</p> <p>Here is the code. Apologizes before hand for the lack of conventions. I had to get this up quick:</p> <p><a href="http://www.mailcanarias.com/index.php" rel="nofollow">http://www.mailcanarias.com/index.php</a></p>
javascript jquery
[3, 5]
2,725,367
2,725,368
SelectedIndexChanged
<p>Problem:</p> <p>SelectedIndexchanged does not fire. I tried investigating with a breakpoint but it does not even get to the event. I made the event by double clicking on the combobox. But it did not help. Please advice.</p> <p>Here is the code:</p> <pre><code> protected void nav_dd_parent_edit_SelectedIndexChanged(object sender, EventArgs e) { } &lt;td width="55%" class="style1" height="20px"&gt; &lt;asp:DropDownList ID="nav_dd_parent_edit" runat="server" DataSourceID="sp_GetNavParents_Edit" DataTextField="Name" DataValueField="NavItemId" Height="24px" ReadOnly="FALSE" Width="375px" onselectedindexchanged="nav_dd_parent_edit_SelectedIndexChanged"&gt; &lt;/asp:DropDownList&gt; &lt;/td&gt; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //Page.MaintainScrollPositionOnPostBack = true; //SiteMaster.g_solution = "Couche-Tard - QV"; //SiteMaster.g_solution_id = 27; nav_dd_parent.DataBind(); if (SiteMaster.g_solution != null &amp;&amp; SiteMaster.g_solution != "") { nav_literal.Text = "Solution: " + SiteMaster.g_solution; nav_hidden_SoltnId.Value = SiteMaster.g_solution_id.ToString(); } else { nav_literal.Text = "Please select a solution first from the 'Solution Template' Tab."; panel_top.Visible = false; } } </code></pre>
c# javascript asp.net
[0, 3, 9]
2,549,734
2,549,735
C# delete column from datatable where all values are zero
<p>I need to delete columns from datatable where all rows have 0 for value. Or in other words, where sum is 0. </p> <pre><code>1 2 5 99.9 442.25 221 0 1 2 77.7 889 898 55 0 9 0 66 42 55 0 0 </code></pre> <p>In this example, last column should be removed.</p> <p>How to do this?</p>
c# asp.net
[0, 9]
5,182,658
5,182,659
Android (Java) Simple Send and recieve with Server - Fast Setup Challenge
<p>I'm writing an Android App and I'm looking for the fastest (In terms of setup) way for me to send data to a server and receive information back on request.</p> <p>We're talking basic stuff. I have a log file which tells me how a user is using my application (In beta, I wouldn't runin a user experience by constantly logging usually) and I want to communicate that to my server (That I haven't setup).</p> <p>I don't need security, I don't need high throughput or concurrent connections (I have 3 phones to play with) but I do need to set it up fast!</p> <p>I remember back in the day that setting up XAMPP was particularly brainless, then maybe I could use PHP to send the file from the phone to the Server?</p> <p>The Server would ideally be able to respond to a GET which would allow me to send back some SQL statements which ultimately affect the UI. (It's meant to adapt the presented options depending on those most commonly used).</p> <p>So there you have it, I used PHP about 4 years ago and will go down that route if it's the best but if there's some kind of new fangled port open closing binary streaming singing and dancing method that has superseeded that option I would love to know.</p> <p><a href="http://developerlife.com/tutorials/?p=288">This tutorial</a> seems useful but I don't really need object serialization, just text files back and forth, compressed naturally.</p> <p>Android comes with the <strong>Apache HTTP Client 4.0</strong> built in as well as java.net.URL and java.net.HttpUrlConnection, I'd rather not add too much bult to my App with third party libraries.</p> <p>Please remember that I'm setting up the server side as well so I'm looking for an overall minimum lines of code!</p> <p>Thanks,</p> <p>Gav</p>
java android
[1, 4]
5,725,310
5,725,311
C# string.Split returns double quotes out of no where
<p>Why does this </p> <pre><code> string test = "Text1, Text2"; string [] tests = test.Split(", ".ToArray()); </code></pre> <p>returns this</p> <pre><code>[0] = "Text1" [1] = "" [2] = "Text2" </code></pre> <p>what's with the quotes in tests[1] ?</p> <p>I thought the output would be like this</p> <pre><code>[0] = "Text1" [1] = "Text2" </code></pre>
c# asp.net
[0, 9]
1,453,379
1,453,380
UseSubmitBehavior="false" and binding OnClientClick?
<pre><code>&lt;asp:Button ID="RecoverButton" runat="server" Text="Recover" OnClick="RecoverButton_OnClick" UseSubmitBehavior="false" /&gt; </code></pre> <p>I kind of figured out <code>UseSubmitBehavior="false"</code> overwrites the <code>OnClientClick</code> function I was providing.</p> <p>I went with this then:</p> <pre><code>$(document).ready(function() { $("[id$=RecoverButton]").live("click", RecoverButton_OnClick); }); function RecoverButton_OnClick(s, e) { var input = $("[id$=MasterUsername]").val(); var valid = $dn.s.MailValidation(input); if (!valid) { // prevent postback here } } </code></pre> <p>But I don't know how I can prevent the postback event from firing up. I tried doing something like <code>e.preventDefault()</code> but it didn't work, ideas?</p> <p><strong>Update</strong> thing is both the <code>__doPostback</code> and <code>jQuery</code>'s click handler seem to fire up at the same time (or maybe ASP.NET's fires first), but I placed an alert on my RecoverButton function and firebug already shows the postback happening while the alert is there, blocking execution.</p>
jquery asp.net
[5, 9]
4,193,591
4,193,592
can anybody give me realtime sqlite example
<p>Actually earlier i was working as a Web Developer so i am not able to imagine mobile database. It has become complicated for me</p> <p>I mean to say steps like given as below, CheckDBExist Create it if does not exist, Insert when told to, Update when required and, anything u would like to suggest me as a beginner</p> <p>Example with multiple fields addition in a table and multiple values entering into it.</p> <p>Thanks in advance.</p>
java android
[1, 4]
1,319,587
1,319,588
How can I hook up to a parent's event?
<p>I've got an aspx file, and rendered within it is an ascx control.</p> <p>The aspx file has a button, that, when clicked, fires an event.</p> <p>I've got a button in the ascx control that I'd like to hook up to that same event...but I'm not clear on how to do it. I'm obviously missing something fairly elementary.</p> <p>I was thinking it would be something like this:</p> <pre><code>myButton.Click += new EventHandler(btn_Click); ... void btn_Click(object sender, EventArgs e) { &lt;some way to get ahold of the parent aspx&gt;.btn_Click(sender, e) } </code></pre> <p>But, I've had no luck thus far, which makes me wonder if I'm barking up the wrong tree.</p> <p>Ideas?</p>
c# asp.net
[0, 9]
705,131
705,132
Android - delete from array adapter <string>
<p>I am creating an <code>ArrayAdapter&lt;String&gt;</code> from a resource array. Then I would like to delete an item from the list using <code>arrayAdapter.remove(String)</code> method. I find the correct string using <code>arrayAdapter.getItem(int position)</code>. But when I call the remove method I end up having <code>UnsupportedOperationException</code> and I have no clue of whats going on.</p> <p>on 20th June edited<br> I did the operation that delete from the resource not directly the adapter and notify the adapter about deletion. I was doing the operation on public boolean onContextItemSelected(MenuItem item); after the deletion on this method, I get an </p> <pre><code>ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 398 NullPointerException </code></pre> <p>I think after i delete the item from resources, something is not properly configured.. </p>
java android
[1, 4]
2,688,072
2,688,073
Processing a dynamically generated form in javascript with php post to database
<p>I have a form that contains dynamically generated fields. There can be an arbitrary number of fields in the submitted form, depending on how many fields are added by the user. Here is a JSFIDDLE that you can refer to know what kind of fields i am generating dynamically. <a href="http://jsfiddle.net/RASG/bYBPD/" rel="nofollow">LINK TO JSFIDDLE</a></p> <p>the only difference in this JSFIDDLE and my project is that instead of generating 2 dropdownsand 2 input fields in one set i am generating 3 dropdowns and 1 input fields in one set. number of sets that can be generated is maximum of 15 by now that the user can select from the dropdown in jsfiddle.</p> <p>What is need to know is if a user generated 7 sets, how would i know the name of each field as i have to use PHP to process the data of this form and submit to a database.</p>
php javascript
[2, 3]
2,915,505
2,915,506
Add no. of days in a date to get next date(excluding weekends)
<p>I have an date, i need to add no. of days to get future date but weekends should be excluded. i.e </p> <pre><code>input date = "9-DEC-2011"; No. of days to add = '13'; next date should be "27-Dec-2011" </code></pre> <p>Here weekends(sat/sun) are not counted. </p>
javascript jquery
[3, 5]
5,498,544
5,498,545
How to load and display the images in the folder with different name in the ImageView in android?
<p>These is the code snippet of an Android program... Where I am trying to display images in an ImageView. But while making it dynamic by removing the constant values the program is giving me an error which I am not able to resolve... </p> <pre><code>public void onCreate(Bundle savedInstanceState) { Class&lt;drawable&gt; resources = R.drawable.class; Field[] fields = resources.getFields(); for (Field field : fields) { imgName[n]=field.getName(); n++; } while(cnt!=n) { int resID = getResources().getIdentifier(imgName[cnt], "drawable","com.example.imageviewpckg"); imgList[cnt]=resID; cnt++; } } </code></pre> <p>Can we write the above code for initializing the <code>int</code> Array with ImageView <code>ids</code> instead of the fixed initialization as show below code of line...</p> <p>This below line gives me the correct output:</p> <pre><code>int imgList[] ={ R.drawable.img1, R.drawable.img2, R.drawable.img3, R.drawable.img4, R.drawable.img5, R.drawable.img7 }; </code></pre>
java android
[1, 4]
3,825,679
3,825,680
How do I tell IE to add the class 'Selected' to my LI on scroll?
<p>I was hoping to get a little help with my code. This works in moz/webkit but not in ie. I don't quite understand why :(</p> <pre><code>$(window).trigger('hashchange'); // Add .selected class to nav on page scroll var $sections = $('section'); var $navs = $('nav &gt; ul &gt; li'); var topsArray = $sections.map(function() { return $(this).position().top - 50; }).get(); var len = topsArray.length; var currentIndex = 0; var getCurrent = function( top ) { for( var i = 0; i &lt; len; i++ ) { if( top &gt; topsArray[i] &amp;&amp; topsArray[i+1] &amp;&amp; top &lt; topsArray[i+1] ) { return i; } } }; $(document).scroll(function(e) { var scrollTop = $(this).scrollTop(); var secondSection = topsArray[1]; if(scrollTop &lt;= 200) { // moved past the header $navs.eq(0).removeClass("selected") } else if(scrollTop &gt;= 205 &amp;&amp; scrollTop &lt;= secondSection ) { // between header and 2nd section $navs.eq(0).addClass("selected") } var checkIndex = getCurrent( scrollTop ); if( checkIndex !== currentIndex ) { currentIndex = checkIndex; $navs.eq( currentIndex ).addClass("selected").siblings(".selected").removeClass("selected"); } }); </code></pre>
javascript jquery
[3, 5]
261,184
261,185
How to keep the block text in div tag refresh function?
<p>I have a page that the function is to refresh div tag. Div tag function is refresh the data will receive.</p> <p>So far that's ok.</p> <p>When I block the text using mouse, that's will clear the block text based on timing "20000". This below the JS script function.</p> <pre><code>&lt;script src='js/jquery.min.js'&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("#content2").load("post_rf.php"); var refreshId = setInterval(function() { $("#content2").load('post_rf.php?randval='+ Math.random()); }, 20000); $.ajaxSetup({ cache: false }); }); &lt;/script&gt; </code></pre> <p>What I want to do is, how to keep the block text in div refresh function ? Because some user maybe want to copy the text. In this case, user must quickly copy the text before div refresh.</p> <p>Maybe the example like facebook post live update.</p>
php jquery
[2, 5]
4,188,001
4,188,002
How to convert string to "iso-8859-1"?
<p>How can i convert an UTF-8 string into an ISO-8859-1 string?</p>
c# asp.net
[0, 9]
3,317,851
3,317,852
Correctly remove anonymous function event handlers
<p>I'm trying to figure out how best to remove anonymous event handlers using jQuery.</p> <p>I define a variable to hold my jQuery object:</p> <pre><code> var dom = $('#private-module'); </code></pre> <p>Later on in my object:</p> <pre><code> run: function () { var button, that = this; button = dom.append('&lt;button class="btn"&gt;Click Me&lt;/button&gt;'); button.on('click', function(event) { console.log('Clicked!'); that.destroy(); }); }, destroy: function () { var button; button = dom.find('.btn'); button.off('click'); } </code></pre> <p>No matter what I do, I cannot kill the click handler on the button. Feels like my understanding here of scope is flawed. What is the preferred way, in this situation to remove the handler? I've tried namespacing the events and all sorts but no luck so I am guessing it's something simple that I've overlooked. Perhaps I shouldn't even be using anonymous functions for event handlers.</p> <p>Just to bolt something on to my reasoning for using .append: </p> <p><a href="http://jsperf.com/jquery-append-vs-appendto" rel="nofollow">http://jsperf.com/jquery-append-vs-appendto</a></p> <p>Here is the final solution:</p> <pre><code>dom.append('&lt;button class="btn"&gt;Send Message&lt;/button&gt;'); button = dom.find('.btn'); button.on('click', function (event) { sendTestMessage(); that.destroy(); }); </code></pre> <p>I also agree and understand about using the .one method. Thanks for that.</p>
javascript jquery
[3, 5]
5,060,780
5,060,781
Any way to turn this into a jQuery function?
<p>I have tried to wrap this in a function and cannot get it to work. I am wondering if it is because it is appending something to the body? But here is the script. Any help is greatly appreciated.</p> <pre><code>$('.showIt').click(function(){ $('body').append("&lt;div class='show'&gt;&lt;/div&gt;"); }); </code></pre> <p>I would like to put that into a function i can call, but i cant seem to get it to work, This is what i have tried and it fails to work for me.</p> <pre><code>function create(){ $('body').append("&lt;div class='show'&gt;&lt;/div&gt;"); }); $('.showIt').click(function(){ create(): }); </code></pre> <p>can someone please help?</p>
javascript jquery
[3, 5]
5,104,040
5,104,041
Odometer Speedometer jquery plugin
<p>Is there any plugin who give's the chart type = ODOMETER ?</p> <p>incrideble how is so hard to find this, even highchart's that i'm using ( very good chart library ) dont have a odometer, dont know why.</p> <p>i found some "speedometer", <a href="http://jacob-king.com/demo/speedometer" rel="nofollow">Demo</a> but wont help-me.</p> <p>anyone know any plugin or something like who work with odometer's ?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
5,517,307
5,517,308
On/off states with words in a form?
<p>Doing a rebuild of a website and I want to give several words an "on" and "off" state within a form</p> <p>The previous developer created this site but looking at his code it's slightly horrific - <a href="http://www.mediwales.com/news" rel="nofollow">http://www.mediwales.com/news</a> . I'm doing the bit in the grey box where the sectors can be selected.</p> <p>How can I recreate this? Is there a more modern way to do this in jquery? I need it to work across all the browsers (down to IE7).</p> <p>I want to be able to style the on/off states and tie it to the form.</p>
php jquery
[2, 5]
871,533
871,534
jquery .on() event argument does not work in Firefox
<p>Kindly see this fiddle :</p> <p><a href="http://jsfiddle.net/e9uwA/1/" rel="nofollow">http://jsfiddle.net/e9uwA/1/</a></p> <p>What's supposed to happen here is that the smaller box should fadeout via css transition, then ontransitionend, adjust the height of the bigger box. It works fine in Chrome, Opera but it doesn't work in Firefox.</p> <p>I think it has something to do with the second argument <code>event</code> on the .on() method of jQuery. If that isn't allowed, are there any other alternatives?</p> <p>Thank you!</p> <p>Oh and disregard the comments written in the fiddle :)</p>
javascript jquery
[3, 5]
3,469,986
3,469,987
radio button to enable form fields
<p>I have a form containing two radio buttons, I want to enable corresponding fields when a radio button is checked. My code just isn't working, here it is:</p> <pre><code>&lt;head&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var $type = $('select'), $field1 = $("#fieldID1"), $field2 = $("#fieldID2"); $type.change(function() { var isDisabled = ($type.filter(":checked").val() === "1"); $field1.prop("disabled", !isDisabled); $field2.prop("disabled", isDisabled); }).change(); }); &lt;/script&gt; &lt;/head&gt; </code></pre> <p>My html body is like:</p> <pre><code>&lt;body&gt; &lt;form action="" method="post"&gt; &lt;input type="radio" name="select" value="1" /&gt; &lt;input type="text" name="fieldID1" id="fieldID1"/&gt; &lt;input type="radio" name="select" value="2" /&gt; &lt;table id="fieldID2"&gt; &lt;tr&gt;...&lt;/tr&gt; &lt;tr&gt;...&lt;/tr&gt; ... &lt;/table&gt; &lt;input type="submit" value="Add"&gt; &lt;/form&gt; &lt;/body&gt; </code></pre> <p>I referenced the code from <a href="http://stackoverflow.com/questions/6036635/improving-use-of-radio-buttons-to-enable-disable-form-fields">this post</a>. Can anyone point me out what the problem is, I am not quite familiar with jQuery, thanks!</p> <p>Still cannot be fixed...</p>
javascript jquery
[3, 5]
2,864,581
2,864,582
Why all the images in a slider first linup for 1-2 secs before they adjust in a proper position?
<p>if you open this page <a href="http://www.expertforyou.com/" rel="nofollow">http://www.expertforyou.com/</a></p> <p>All the images are like vertical for a second or two, before they line up. Depending on internet speed, it could be a few seconds.</p> <p>How can we remove this?</p>
php jquery
[2, 5]
346,702
346,703
Comparing 2 dates (failing if one of the dates is in following year)
<p>The code below works fine if the 2 dates are within the same year, but seems to break if the end date is in the following year. Could anyone point me in the right direction as to why?</p> <p>Both vars are date pickers in the format DD/MM/YYYY.</p> <p>Thanks in advance. </p> <pre><code>$(document).ready(function() { $("#start").change( function() { var startDate = $('#start').val().replace('/',''); var endDate = $('#due').val().replace('/',''); if(startDate &gt; endDate){ $("#due").val($(this).val()); } }); }); </code></pre>
javascript jquery
[3, 5]
5,682,664
5,682,665
changeDate event in jQuery UI datepicker?
<p>In this datepicker is event <code>changeDate</code> -> <a href="http://www.eyecon.ro/bootstrap-datepicker/" rel="nofollow">http://www.eyecon.ro/bootstrap-datepicker/</a></p> <p>What is the equivalent in jQuery UI datepicker?</p>
javascript jquery
[3, 5]
4,832,604
4,832,605
Embedding Javascript in PHP With Brackets
<p>Alright so I've been trying to echo some JavaScript for the fancybox window to popup if a user logs in or out. This is what I have so far, but it keeps throwing a server error.</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="scripts/fancybox/jquery.fancybox.css" /&gt; &lt;script type="text/javascript" src="scripts/fancybox/jquery.fancybox.js"&gt;&lt;/script&gt; &lt;?php $msg = $_GET['msg']; if(isset($msg['0'])); { echo ' &lt;script type="text/javascript"&gt; $.fancybox.open([ { href : \'m.php?=0\', title : \'Successfully Logged In!\' } ], { padding : 0 }); &lt;/script&gt;'; } else if (isset($msg['1'])); { echo ' &lt;script type="text/javascript"&gt; $.fancybox.open([ { href : \'m.php?=1\', title : \'Successfully Logged Out!\' } ], { padding : 0 }); &lt;/script&gt;'; } ?&gt; </code></pre> <p>What am I doing wrong?</p>
php javascript
[2, 3]
5,948,410
5,948,411
Selected Text Instance
<p>I have a bunch of text on my document. You can select word/words from it and highlight the text. After you highlight it, an ajax request is sent and the selected word/words are sent to backend (PHP) and processed to be saved into the database. The page is refreshed and the selected text is permanently higlighted.</p> <p>Now the bad part, if you higlight "the", it will highlight all the "the"'s in the text document. How do I detect which "the" is higlighted through javascript so that only the proper instance is saved in database.</p>
php javascript jquery
[2, 3, 5]
1,507,457
1,507,458
strange behavior with javascript global variable and jQuery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5316697/jquery-return-data-after-ajax-call-success">jQuery: Return data after ajax call success</a> </p> </blockquote> <p>first of all I'm not very experienced with JS or jQuery, but as far as my programming skills go I can't seem to find anything that's wrong with my approach.</p> <pre><code>var subtree; $.post("addTreeServlet", { term:clickedNode, max:maxId, id:clickedId }, function(jsonResponse){ subtree = eval('(' + jsonResponse + ')'); } ); $jit.json.prune(subtree, level); return { 'id': nodeId, 'children': subtree.children }; </code></pre> <p>I went through the code with the debugger, and here is what happens: The program comes back from the addTreeServlet and transmits a String representing JSON data. the eval() function takes this String and transforms it into an JSON Object (again, it looks perfectly fine in the debugger). But as soon as I leave the function(jsonResponse) the var subtree is shown as undefined, and I can't figure out why.</p> <p>Is that because of the jQuery method? I have no idea...</p> <p>It is also the same behavior if I just put subtree = "whatever". It becomes undefined as soon as I exit the function..</p>
javascript jquery
[3, 5]
5,214,413
5,214,414
Validate if website exists with AJAX
<p>I'm trying to check if a website exists with an ajax call, but I'm not sure I am getting it right. On my page I grab a URL on click</p> <pre><code>$("#go").click(function() { var url = $("#url").val(); $.ajax({ type: "POST", url: "/ajax.php", data: "url="+url, success: function(){ $("#start").remove(); }, error: function(){ alert("Bad URL"); } }); }); </code></pre> <p>a=And then check on ajax.php</p> <pre><code>$url = $_POST['url']; ini_set("default_socket_timeout","05"); set_time_limit(5); $f=fopen($url,"r"); $r=fread($f,1000); fclose($f); if(strlen($r)&gt;1) { return true; } else { return false; } </code></pre> <p>It seems I am getting SUCCESS no matter what... What am I missing?</p>
php jquery
[2, 5]
5,256,435
5,256,436
Two Radio Buttons ASP.NET C#
<p>I have two radio buttons for metric and US measurements. I load the page so the metric radio button is clicked. How do I set the two buttons so when US is clicked metric unclicks and vise versa?</p>
c# asp.net
[0, 9]
3,308,944
3,308,945
Get the complete month name in English
<p>I use DateTime.Now.ToString("MMMM") in order to get the current month's full name. It works well, but I get it in Hebrew. Is there an option to control the output language? I need it to be English</p>
c# asp.net
[0, 9]
1,367,251
1,367,252
Call a javascript function with json_encode parameter
<p>I would like to call a function onclick, but with a json_encode parameter like this:</p> <pre><code>&lt;a href="#" onclick="javascript:table1Modif(&lt;?php echo substr(json_encode($res['base']),1,-1); ?&gt;);return false;"&gt; </code></pre> <p>And the Jquery function just alert the parameter:</p> <pre><code>&lt;script&gt; function table1Modif(key){ $('#table1').html(function() { alert(key); }); } &lt;/script&gt; </code></pre> <p>But I have an "undefined" error! I am sure that it's due to json_encode, but I don't know how to solve it. Thank you!</p>
php javascript jquery
[2, 3, 5]
4,486,144
4,486,145
Identifying explicit intent purpose in Android, or building seperate activities?
<p>This may be in the RTFM category but I can’t seem to figure out the proper way to do this. One of my activities shows some random data from a database, it uses some user-defined search-criteria from a previous activity to filter out which data blocks to search from. But it’s main purpose is to display the data, and present the user with a UI to manipulate the data to his will. </p> <p>The user can also bookmark this random data, and then access it later again (the bookmarks show up in a listview in another activity). Rather than creating a whole new activity with basically the same purpose, I want to reuse the one already created, and just tell it that I want to view some data, rather than search for some new. So what is the proper way of informing an activity of want you want to do? Should that be defined in the Intent extras bundle or is there another way?</p> <p>Or would the proper way be to create a new activity for this?</p>
java android
[1, 4]
914,950
914,951
does a jquery plugin exist that would show a div then hide it after a period of time
<p>I remember writing this code in the past, so I could do it again, but I'm hoping to find a plugin that would do the same thing. Basically I have a div for error messages. At the start it's hdiden. When there's an error message, I show it, then fade it out after 20 seconds. Does a plugin already exist that could take div.class and the error message and do this?</p>
javascript jquery
[3, 5]
4,946,298
4,946,299
simple jquery fetch from mysql
<p>I am trying to use jQuery with MYSQL and I wrote something like this :</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; function example_ajax_request() { $('#example-placeholder').html('&lt;p&gt;Loading results ... &lt;img src="ajax-loader.gif" /&gt;&lt;/p&gt;'); $('#example-placeholder').load("loadres.php"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="query"&gt; &lt;select name="show" id="box" &gt; &lt;option value="0"&gt;Select A Test&lt;/option&gt; &lt;option value="All"&gt;--All--&lt;/option&gt; &lt;option value="M1"&gt;Model1&lt;/option&gt; &lt;/select&gt; &lt;input type="button" onclick="example_ajax_request()" value="Click Me!" /&gt; &lt;/div&gt; &lt;div id="example-placeholder"&gt; &lt;p&gt;Placeholding text&lt;/p&gt; &lt;/div&gt;&lt;/body&gt; &lt;/html&gt; </code></pre> <p>Basically I want to pass parameters to the <code>loadres.php</code> file. But unable to figure out the exact way to do. Any help is appreciated.</p> <p>Thanks.</p>
php jquery
[2, 5]
6,019,845
6,019,846
Changing An iframe source from the listbox
<p>I want to change the source of the iframe from a listbox. And here is my code.</p> <pre><code>&lt;iframe id="iframeID" frameborder="0" width="100%" height="300px"&gt;&lt;/iframe&gt; &lt;asp:Button ID="btnView" runat="server" Text="Pop Up HTML Preview" OnClientClick="ShowPopUp();" /&gt; ShowPopUp = function() { var x = document.getElementById('&lt;%=ListBox1.ClientID %&gt;'); var val = x.options[x.selectedIndex].Value; document.getElementById("iframeID").src = val; </code></pre> <p>But error says I have an undefined iframe.<br/> What is wrong?<br/> Please help me. Thanks :)</p>
c# asp.net
[0, 9]
4,383,513
4,383,514
How to check the value given is a positive or negative integer?
<p>Lets say i have the value 10 assigned to a variable;</p> <pre><code>var values = 10; </code></pre> <p>and i want to run a specific function if the value is a positive</p> <pre><code>if(values = +integer){ //do something with positive } else { //do something with negative values } </code></pre> <p>How would this be achieved?</p>
javascript jquery
[3, 5]
2,899,766
2,899,767
javascript jquery .change function not executing
<p>hey guys im having a hard time trying to solve this problem </p> <p>Categories is a select box and it's being populated by database .. what I'm trying to do is, that when I change the category then this function runs and via ajax populates the subcategory </p> <pre><code>$("#categories").change(function(){ var selectedCategoryIndex = $('option:selected', '#categories').index(); $.post( 'ajax/allAjaxContent.php', { categoryId: selectedCategoryIndex }, function (response) { $('#subCategories').html(response); } ); }); </code></pre> <p>this function is not being executed at all ... i tried commenting all of the body and just put an alert in it but that doesn't work either, any suggestions on what i should do??</p> <p>thanks in advance</p>
javascript jquery
[3, 5]
4,017,368
4,017,369
How can I get the count of downloads in google play programatically
<p>I have uploaded my Android app in Google Play... The downloads whatever is displaying in Google Play of my app... I need that count in my website. So, please help me out with this.</p>
java javascript android jquery
[1, 3, 4, 5]
2,223,651
2,223,652
Android- How to display an external video feed
<p>I have made a robot that is controlled with my Asus tablet (TF300T). I have written the control app using MIT app inventor which communicates over bluetooth. What id like to do is mount some kind of video camera (either a stock wireless web cam, or a specialist camera from somewhere like sparkfun) onto the robot and then modify the control app to display the video feed. I understand that I will have to ditch app inventor to do this and write using the SDK directly and that is fine, but I would like to know if the concept is possible and if so could you kindly point me to some resources that document this ?</p> <p>all help appreciated.</p>
java android
[1, 4]
4,550,907
4,550,908
Check if there's images on a folder
<p>I'm using an slideshow and I would like check if there any image on a specific folder since I'll make it all dynamically. I saw some questions here about this but can't get it work.</p> <pre><code>&lt;div class="foo"&gt; &lt;img src="images/[dynamic_folder_name]/1.jpg" alt="" /&gt; &lt;img src="images/[dynamic_folder_name]/2.jpg" alt="" /&gt; &lt;/div&gt; </code></pre> <p>There'll be allot of folders and maybe some could be empty so I wanna check with jquery if there's any images with those names and if not set a default image.</p> <p>If you have any other ideas for doing this instead of using jquery, you're more than welcome.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
80,372
80,373
Getting a collection of input values
<p>I have a function that sets text input's to "" whenever they are clicked/focused on. It works fine when I hard code defaults values into an array, however I'd like to not do this and instead get a collection of the default values so I can use it across several pages without having to add values to manually add values to the array.</p> <p>I'm trying to loop through all of the input's, and create an array but my newb skills are preventing me from doing so, here is what I have so far:</p> <pre><code>$(function() { var defaultValues = $('input[type="text"]').each(function) { $(this).val(); )}; // instead of simply ["default value 1", "default value 2"] $('input[type="text"]').live("focus", function() { $(this).css("color", "#000000"); if (jQuery.inArray($(this).val(), defaultValues)) { $(this).val(""); } }); }); </code></pre>
javascript jquery
[3, 5]
2,814,521
2,814,522
Multiple parents with the same class with siblings with the same classes
<pre><code>&lt;div class="example"&gt; &lt;div class="test"&gt;Some text&lt;/div&gt; &lt;div class="whatever"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="example"&gt; &lt;div class="test"&gt;Some more text&lt;/div&gt; &lt;div class="whatever"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>How can I make each <code>.example</code>'s <code>.whatever</code> contain the contents of its <code>.test</code>?</p> <p>For example, if the code were just this:</p> <pre><code>&lt;div class="example"&gt; &lt;div class="test"&gt;Some text&lt;/div&gt; &lt;div class="whatever"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Then I could just do this:</p> <pre><code>$('.whatever').text($('.test').text()); </code></pre> <p>But I have multiple elements with the class <code>.whatever</code> and multiple elements with the class <code>.test</code>, and each <code>.test</code> contains different text.</p> <p>So in other words, how can I make every element with the class <code>.whatever</code> contain the text of the element <code>.test</code>, but only the element <code>.test</code> that is in the sample <code>.example</code> element?</p> <p>Sorry for the confusing wording.</p>
javascript jquery
[3, 5]
4,384,217
4,384,218
How can I set the value inside a field to a table td with Jquery?
<p>I have few fields and I want the values inside those fields to get copied to <code>tbody td</code>. I have made an jsfiddle could someone please take a look at it.</p> <p><a href="http://jsfiddle.net/tsdUU/" rel="nofollow">http://jsfiddle.net/tsdUU/</a></p> <p>I would like to have each tbody td looks like follow:</p> <blockquote> <p>Copied value: (value that was typed inside the fields)</p> </blockquote> <p>Any kind of help is appreciated</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
1,817,450
1,817,451
Javascript script tags inside JQuery .html function
<p>Quick question is it possible to get javascript script tags inside JQuery .html function?</p> <pre><code>function pleaseWork(){ $('#content').html('&lt;h3 style="color:#335c91"&gt;This is the header&lt;/h3&gt;&lt;div class="holder"&gt;&lt;script type="text/javascript" src="javascriptFile.js"&gt;&lt;/script&gt;&lt;/div&gt;'); } </code></pre> <p>What I am trying to accomplish is when the user clicks on a button, this header and javascript code show up in the div content, right now when I click on the button, there is no header showing and it goes to a blank page and shows the javascript code (it works, but not how I would like it to work.)</p> <p>Thanks.</p>
javascript jquery
[3, 5]
5,463,148
5,463,149
The right way to get http referrer from jquery
<p>Command $(document).referrer is the correct way to get referrer with Jquery?</p>
javascript jquery
[3, 5]
4,787,877
4,787,878
Hide asp.net panel with validation using Javascript
<p>I need a way to hide/show an asp.net Panel with Validators inside using Javascript.</p> <p>I have successfully hide a panel using this code below:</p> <pre><code>function ShowHidePanel(panelId, isShown) { var pnl = document.getElementById(panelId); if (pnl != null) { if (isShown) { pnl.style.display = 'block'; } else { pnl.style.display = 'none'; } } } </code></pre> <p>I am trying to disable all the validators inside using this code below:</p> <pre><code>function ToggleValidator(validatorId, enabled) { var validator = document.getElementById(validatorId); if (validator != null) { ValidatorEnable(validator, enabled); } } </code></pre> <p>However, even though my panel is hidden, the validation on those validators inside is still firing.</p> <p>Any thought will be appreciated.</p>
c# javascript asp.net
[0, 3, 9]
4,488,146
4,488,147
The simplest solution to hide calendar on blur or click
<p><a href="http://jsfiddle.net/SXrAb/" rel="nofollow">http://jsfiddle.net/SXrAb/</a></p> <p>Following the jsfiddle link there is a simplified sample of what I need. Currently it shows the calendar on button click, and hides it on input blur.</p> <p>What I cannot implement additionally is hiding calendar on button click.</p> <p>So - calendar should:</p> <ol> <li><strike>open on button click if hidden</strike> (done)</li> <li><strike>hide on blur</strike> (done)</li> <li>hide on button click if opened (this is what I'm in stuck with, because blur is triggered before button click event so I have no chance to handle it properly)</li> </ol> <p><strong>UPD</strong>:</p> <p>the solution is expected to work correctly in all cases, like "mousedown on button, drag below, mouseup" (otherwise I wouldn't ask it ;-)</p>
javascript jquery
[3, 5]
1,417,550
1,417,551
Simple problem on my jQuery function
<p>Hi I am trying to show 1.php on div firstresult and 1b.php to div secondresult. My code is not correct though. I want one option value to trigger two div and two php files. like to get the val and display 1.php to first and 1b.php to the second.</p> <pre><code>&lt;script language='JavaScript'&gt; $(document).ready(function() { $('#termid').change(function() { var val = $(this).val(); $('#firstresult').load(val + '.php', { value: val }).$('#secondresult').load(val + 'b.php', { value: val }); }); }); &lt;/script&gt; &lt;form&gt; &lt;select id="termid"&gt; &lt;option value=""&gt;- select -&lt;/option&gt; &lt;option value="1"&gt;Option 1&lt;/option&gt; &lt;option value="2"&gt;Option 2&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; &lt;div id="firstresult"&gt;&lt;/div&gt; &lt;div id="secondresult"&gt;&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,661,836
3,661,837
$.post, radio button value, jquery
<p>I have trouble to pass radio button value by using $.post can anyone help me find out the problems? </p> <p>i got Undefined index:gender</p> <pre><code>&lt;?php $gender = $_POST['gender']; if (!$gender) { echo $gender; } ?&gt; &lt;script type="text/javascript"&gt; function get(){ $('#error').hide(); $.post( 'signup.php', { gender:signup.gender.value }, function(output){ $('#error').html(output).fadeIn(100); } ) } &lt;/script&gt; &lt;form name="signup"&gt; &lt;input class="radio" type="radio" name="gender" value="male"/&gt; Male&lt;br/&gt; &lt;input class="radio" type="radio" name="gender" value="female"/&gt; Female &lt;input type="button" value="submit" onclick="get();" /&gt; &lt;/form&gt; &lt;div id="error"&gt;&lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
3,581,778
3,581,779
Conflict between two versions with reading contacts in android
<p>I created an application that reads contacts from the phone and it works fine on platform version of 3.1 but it throws NullPointerException when i run it on 2.3.3 platform.Can anyone show me the reason for this error.</p> <pre><code>ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,null,null, null, null); while (cur.moveToNext()) { String id = cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID)); Cursor phones = cr.query(Phone.CONTENT_URI, null, Phone.CONTACT_ID + " = " + id, null, null); while (phones.moveToNext()) { String number = phones.getString(phones.getColumnIndex(Phone.NUMBER)); int type = phones.getInt(phones.getColumnIndex(Phone.TYPE)); System.out.println("Numeber= "+number); switch (type) { case Phone.TYPE_HOME: home=number; break; case Phone.TYPE_MOBILE: mobile=number; break; case Phone.TYPE_WORK: work=number; break; case Phone.TYPE_OTHER: other=number; break; } } phones.close(); } </code></pre> <p>thanks.</p>
java android
[1, 4]
1,093,466
1,093,467
Using setTimeout() in jquery
<p>I'm not new to Javascript but then I realize I don't know how to use <a href="https://developer.mozilla.org/en/window.setTimeout" rel="nofollow">setTimeout()</a>.</p> <p>I have tried this:</p> <pre><code>$(document).ready(function(){ setTimeout('changeit()',1000); // I have also tried setTimeout('changeit',1000); // var t = setTimeout('changeit()',1000); &lt;--- tried also something like this. // changeit(); &lt;-- works when i do this. function changeit(){ $('#hello').html('Hello World - this was inserted using jQuery'); // #hello is &lt;p id="hello"&gt;Hello World&lt;/p&gt; } }) </code></pre> <p>Can anyone help me with this one?</p>
javascript jquery
[3, 5]
5,252,574
5,252,575
Listen for DOM appending
<p>How to listen for appending or prepending a child-node in a DOM element?</p> <p>Since I'm using jQuery it would be much better if a solution with their methods is provided.</p> <p>Is it possible to <code>.delegate()</code> such event?</p>
javascript jquery
[3, 5]
5,662,915
5,662,916
How to skip a character from a string when delete key is pressed using jQuery
<p>Hi how to disable delete key press or backspace key press when deleting a particular character from a string using <strong>jQuery</strong>. For example, from string 1234-555 when the cursor is at hypen, if delete key is pressed it should not delete hypen. Instead of that cursor should stay in the same position. Basically disabling the delete key at hyphen. In the same way when the cursor is after hypen, if backspace key is pressed it should not delete hypen. Instead of that cursor should stay in the same position. </p>
javascript jquery
[3, 5]
5,232,949
5,232,950
JavaScript into Asp Page
<p>i am learning javascript client side scripting language and i am using js in ASP.. i dont know when i compile the code, it shows </p> <blockquote> <p>COMPILATION ERROR:Compiler Error Message: CS1061: 'ASP.default_aspx' does not contain a definition for 'popup' and no extension method 'popup' accepting a first argument of type 'ASP.default_aspx' could be found (are you missing a using directive or an assembly reference?)</p> </blockquote> <p>here is my code : </p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WEB_test_app._Default" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt; &lt;head runat="server"&gt; &lt;title&gt;Shuraat Web ki&lt;/title&gt; &lt;script type ="text/javascript"&gt; function popup() { alert("popup!!"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick ="popup()"/&gt; &lt;script type ="text/javascript"&gt; document.write("Abid"); &lt;/script&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript asp.net
[3, 9]
3,120,381
3,120,382
PHP or Python?
<p>How to go about to get started learning php. Which one is best to learn php programming or python. I just want to know which one of these is leading.</p>
php python
[2, 7]
1,228,774
1,228,775
Assigning a variable via jQuery.fn.data() will keep a reference to the original tag value?
<p>Considering the following html:</p> <pre><code>&lt;div id="test" data-test='["foo", "bar"]'&gt;&lt;/div&gt; </code></pre> <p>and the following javascript:</p> <pre><code>var dataValue = jQuery('#test').data('test'); dataValue.splice(0,1); </code></pre> <p>I will then have the following results:</p> <pre><code>dataValue ['bar'] // as expected, i'm fine with that jQuery('#test').data('test') ['bar'] // why ? i would expect ['foo', 'bar'] </code></pre> <p>This might be something really basic I don't understand with javascript itself or jQuery but I'd be happy if someone could shed some light on this.</p>
javascript jquery
[3, 5]
2,093,909
2,093,910
Cloning and insert, inserting more times than expected
<p>I have a styled element with the class 'item' that is hidden. Initially the page will only have one element with this class. I am simply using this hidden element as a model, that I can grab with jquery and insert it into a list every time the 'add item' button is clicked, with the correct item name in the inner text. </p> <p>What I am trying to do is clone this hidden 'item' element and insert it right after where the <strong>last</strong> item element is located on the webpage. Show it, and change the inner text to whatever I need.</p> <p>My current implementation does not clone / insert items as expected, though I believe it should, I am probably missing something.</p> <p>My Markup</p> <pre><code>&lt;div class="item" style="border:1px solid blue; padding:7px; display:none;"&gt;hello&lt;/div&gt; </code></pre> <p>add item</p> <p>My JavaScript</p> <pre><code>$(".addItem").click(function(){ //clone hidden item element blueprint $('.item').eq(0).clone().insertAfter('.item:last-child'); //Change inner text of element $('.item:last-child').text("apples").show(); }); </code></pre> <p><strong>JSFiddle</strong></p> <p><a href="http://jsfiddle.net/XPVAs/" rel="nofollow">http://jsfiddle.net/XPVAs/</a></p>
javascript jquery
[3, 5]
498,324
498,325
What does this Code do?
<p>i'm reading through <a href="http://docs.jquery.com/Plugins/Authoring" rel="nofollow">jQuery's "Plugins/Authoring"</a> though i already wrote a few jQuery-Plugins. Now I see that jQuery has a special way of scoping the methods and calling:</p> <pre><code>(function( $ ){ var methods = { init : function( options ) { // THIS }, show : function( ) { // IS }, hide : function( ) { // GOOD }, update : function( content ) { // !!! } }; $.fn.tooltip = function( method ) { // Method calling logic if ( methods[method] ) { return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' ); } }; })( jQuery ); </code></pre> <p>I understand the concept of what will happen in the end… but how exactly? This part is what confuses me:</p> <pre><code> // Method calling logic if ( methods[method] ) { return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } </code></pre> <p>Why <code>Array.prototype.slide.call(argumetns, 1)</code>? And where does the variable "arguments" come from all of the sudden? Any brief or deeper explanation is much appreciated. It is said, that this is how plugins should be written… so i'd like to know why.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,610,751
3,610,752
parseInt and vars acting like strings
<p>So Im trying to learn javascript - still pretty basic.</p> <p>Im doing something like this</p> <pre><code>function add(amount) { // number is 9 var number = parseInt($("#id").attr("number")); number = number + amount; } </code></pre> <p>this makes the number a string - is there any way I can 'define' stuff so it knows its a integer so everything doesnt flood over in parseInts in all my functions?</p>
javascript jquery
[3, 5]
4,432,667
4,432,668
NameValueCollection returns Length Property instead of Name Value
<p>Could someone shed some light on this my NameValueCollection returns the Length property instead of Name and Value could some show me what im doing wrong here. I can't set the DataTextField or DataValueField for the dropdownlist it just gives me length.</p> <pre><code> public NameValueCollection GetDisplayForumGroups() { using (CMSEntities db = new CMSEntities()) { var forums = (from x in db.Forums where x.ParentID == null select new { Name = x.Title, Value = x.ForumID }); NameValueCollection collection = new NameValueCollection(); foreach (var forum in forums) { collection.Add(forum.Name, forum.Value.ToString()); } return collection; } } public Dictionary&lt;string, int&gt; GetDisplayForumGroups() { using (CMSEntities db = new CMSEntities()) { Dictionary&lt;string, int&gt; forums = (from x in db.Forums where x.ParentID == null select x).ToDictionary(x =&gt; x.Title, x =&gt; x.ForumID); return forums; } } </code></pre>
c# asp.net
[0, 9]
4,805,860
4,805,861
jQuery Tag Editor
<p>Is there any open source tag editor for jQuery that works like the tag editor in stack overflow?</p>
javascript jquery
[3, 5]
394,443
394,444
Is it possible to get the information dropped into a droppable div and storing it in a database
<p>I'm trying to drag and drop nametags see <a href="http://jsfiddle.net/Kxtvg/132/" rel="nofollow">HERE</a> and store the ones dragged into the droppable divs and later put them in my database. So I would basically want to check and see if there are values in the droppable box and have a submit button. And upon the submit action I would want to make sure values were in the droppable div and store the data in a database. I'm wondering if I could use <code>&lt;?php isset() ?&gt;</code> with a query either by including jquery with it (if possible) or just do it using jquery alone (if possible) maybe using the <code>val()</code> property.I would be greatly appreciative to know if what I'm asking is possible as well as any other tips that may help me moving forward. </p>
php javascript jquery
[2, 3, 5]
606,452
606,453
jquery and javascripts toghether
<p>I have this jquery..</p> <pre><code>&lt;script type='text/javascript'&gt; $(document).ready(function() { $('.colnews2').hide(); $("#colnews1 li").click(function() { //alert($(this).attr("id")); $('.colnews2').hide(); var value = $(this).attr("id"); var theDiv = $("#colnews2-" + value); theDiv.slideDown(); colnews1ID=value; }); }); &lt;/script&gt; </code></pre> <p>and this javascripts.. </p> <pre><code> var pager = new Imtech.Pager(); $(document).onload(function() { pager.paragraphsPerPage = 2; // set amount elements per page pager.pagingContainer = $('#mainlevel-nav'); // set of main container pager.paragraphs = $('div', pager.pagingContainer); // set of required containers pager.showPage(1); }); </code></pre> <p>and i need them in the same php.</p> <p>I tried the following, but does not work.</p> <pre><code>&lt;script type='text/javascript'&gt; $(document).ready(function() { var pager = new Imtech.Pager(); pager.paragraphsPerPage = 2; // set amount elements per page pager.pagingContainer = $('#mainlevel-nav'); // set of main container pager.paragraphs = $('div', pager.pagingContainer); // set of required containers pager.showPage(1); $('.colnews2').hide(); $("#colnews1 li").click(function() { //alert($(this).attr("id")); $('.colnews2').hide(); var value = $(this).attr("id"); var theDiv = $("#colnews2-" + value); theDiv.slideDown(); colnews1ID=value; }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,647,204
4,647,205
How to check is page is redirected from previous page or not in asp.net
<p>In Page 1 on button click I redirect the page to page 2 with msgid, and in page 2 in page load I check whether the previous page is valid. So i check <code>(this.Page.PreviousPage != null)</code> but this is always null and the page gets redirected to page 1. I am doing this so that no one can change the msgid in the url. How can I solve this issues. thanks</p> <p>Page1:</p> <pre><code> int msgid = Convert.ToInt32(Hidden_MsgID.Value); string url = "Page2.aspx?MsgID=" + msgid; Response.Redirect(url); </code></pre> <p>Page2:</p> <pre><code>if (this.Page.PreviousPage != null) { } else { Response.Redirect("Page1.aspx"); } </code></pre> <p>instead of response.redirect I used server . transfer and it works Server.Transfer(string.Format("ResponseMetric.aspx?MsgID={0}", msgid));</p>
c# asp.net
[0, 9]
3,852,026
3,852,027
how to view next element when check box is checked
<p>I have CheckBox and textbox I am trying to remove the CssClass hidden after user check the box I tried using next but it didn't work can someone help me </p> <p>HTML </p> <pre><code> &lt;ul id="sortable"&gt; &lt;asp:Repeater runat="server" ID="rep_sortable"&gt; &lt;ItemTemplate&gt; &lt;li class="ui-state-default"&gt; &lt;span class="ui-icon ui-icon-arrowthick-2-n-s"&gt;&lt;/span&gt;&lt;%# DataBinder.Eval(Container.DataItem, "Body") %&gt; &lt;asp:CheckBox ID="chb_com" runat="server" AutoPostBack="false" Checked='&lt;%# DataBinder.Eval(Container.DataItem, "Completed") %&gt;' oncheckedchanged="CheckBox1_CheckedChanged"/&gt; &lt;asp:HiddenField ID="hf_reminderID" runat="server" Value='&lt;%# DataBinder.Eval(Container.DataItem, "ReminderID") %&gt;'/&gt; &lt;asp:TextBox runat="server" ID="txtb_whyclosed" CssClass="hidden"&gt;&lt;/asp:TextBox&gt; &lt;/li&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/ul&gt; </code></pre> <p>Jquery </p> <pre><code>$("input[type=checkbox]").on("click", function () { console.log("vbvsdvs"); $("input[type=checkbox]").next("input:text").removeClass("hidden"); </code></pre>
jquery asp.net
[5, 9]
4,906,344
4,906,345
How to use Jquery to get select option value and pass to PHP?
<p>I have two database tables, grouptypes and groups. A grouptype can have multiple groups, but a group only belongs to one grouptype. I have two select tags, one is grouptypes and another one is groups.</p> <p>What I want to do is that whenever a user selects a grouptype in the grouptypes dropdown menu, it triggers a handler to retrieve the corresponding groups that belong to that grouptype, and pass it to the second select dropdown list.</p> <p>I have the code as follows. It has not been completed and there are some errors. Can anyone help?</p> <pre><code> &lt;?php $result = $_POST['grouptype']; echo $result; ?&gt; GroupType: &lt;select id="groupTypes"&gt; &lt;?php foreach($grouptypes as $type) : ?&gt; &lt;?php echo "&lt;option value='" . $type-&gt;name . "'&gt;" .$type-&gt;name. "&lt;/option&gt;"; ?&gt; &lt;?php endforeach ?&gt; &lt;/select&gt;&lt;br /&gt; &lt;br /&gt; Group: &lt;select id="groups"&gt; &lt;?php $count = 0; ?&gt; &lt;?php foreach($groups as $group) : ?&gt; &lt;?php $count++; ?&gt; &lt;?php echo "&lt;option value='" . $group-&gt;name . "'&gt;" .$group-&gt;name. "&lt;/option&gt;"; ?&gt; &lt;?php endforeach ?&gt; &lt;/select&gt;&lt;br /&gt; &lt;script type="text/javascript"&gt; $('#groupTypes').change(function(){ var grouptype = $('#groupTypes').val(); $.post("GroupModificationSuccess.php", {grouptype: grouptype}); }); &lt;/script&gt; </code></pre>
php jquery
[2, 5]
2,452,172
2,452,173
android Class not found
<p>I am currently facing this issue in my application. please help me out. activity is regiesterd in manifest file with preceding dot without full package. SetContentView is already set in my activity. any other suggestions ?</p>
java android
[1, 4]
4,854,129
4,854,130
Are Dynamically Loaded Files Cached by the Browser?
<p>I have a question that is related to this answer, <a href="http://stackoverflow.com/questions/912711/jquery-to-load-javascript-file-dynamically/912713#912713">$.getScript(filename)</a></p> <p>Are dynamically loaded files cached by the browser?</p> <p>If not, how can I force them to be?</p>
javascript jquery
[3, 5]
125,658
125,659
How to add a class onto the selected li element and make li full-sized-clickable
<p>I want to add a class to the selected 'li' and at the same time, remove the class:selected from previous selected li element.</p> <p>I have worked on it hours and still haven't got any luck. I also checked others questions, but their solutions don't work for me.</p> <p>Help please....</p> <pre><code>&lt;ul id='mainView' class='menu' style='float: left; clear: both;'&gt; &lt;a href="/Link1"&gt;&lt;li&gt;Patient&lt;/li&gt;&lt;/a&gt; &lt;a href="/Link2"&gt;&lt;li&gt;Recommendations&lt;/li&gt;&lt;/a&gt; &lt;/ul&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('.menu ul a').on('click', function (event) { $('.menu ul a.selected').className = ''; alert($(this).attr('id')); $(this).attr('class') = 'selected'; }); }); // $('.menu li').on('click', function () { // $('.menu li.selected').className = ''; // this.className = 'selected'; // }); &lt;/script&gt; </code></pre> <p><strong>Update:</strong></p> <p>I did put a inside li, but if I click on the li not the a inside of the li, the webpage does not redirect. That's the reason why I do it in a reversed way.</p> <p><strong>Update 2</strong> The reason why the selected li does not get the "selected" class is because the whole webpage is redirected to a new page which has the same navigation bar. So now the question is how to highlight the selected li(it was selected on the previous page) on the new webpage.</p>
javascript jquery
[3, 5]
1,937,444
1,937,445
How to name input fields dynamically?
<p>I have multiple of this div in my form generated dynamically by the user </p> <pre><code>&lt;div class="property-container"&gt; &lt;input type="hidden" name="proposal[process][systems][1][id]"&gt; &lt;input type="hidden" name="proposal[process][systems][1][name]"&gt; &lt;input type="hidden" name="proposal[process][systems][1][stations][2][id]"&gt; &lt;input type="hidden" name="proposal[process][systems][1][stations][2][name]"&gt; &lt;input type="hidden" name="proposal[process][systems][1][stations][2][price]"&gt; &lt;/div&gt; </code></pre> <p>And this is how I name them using jQuery</p> <pre><code> stationFieldsNames:function(station_container, system_id){ var hidden = station_container.find('.property-container input[type=hidden]:first'); station_container.find('.property-container').each(function(propCon){ hidden.attr('name','proposal[process][systems]['+ system_id +'][id]'); hidden.next().attr('name','proposal[process][systems]['+ system_id +'][name]'); hidden.next().next().attr('name','proposal[process][systems]['+ system_id +'][stations]['+propCon+'][id]'); hidden.next().next().next().attr('name','proposal[process][systems]['+ system_id +'][stations]['+propCon+'][name]'); hidden.next().next().next().next().attr('name','proposal[process][systems]['+ system_id +'][stations]['+propCon+'][price]'); }); } </code></pre> <p>The problem I have with this is that I get duplicated field names. When I submit the form I see in the array that the data is missing. Where do I do wrong?</p>
javascript jquery
[3, 5]
68,964
68,965
Generate page dynamically & insert body into another page - is this realistic?
<p>I have the requirement to create a page which contains a graph at the top, and for each item in the graph there's a fact sheet below. I already produce the fact sheets as stand-alone pages. Now, rather than recreating the fact sheet to include in the page I have to create, I'd like to use the work that already exists. </p> <p>Is it realistic that I dynamically generate each fact sheet as needed, strip out the body and insert that into the new page? If so, does anyone have any pointers or suggestions? Thanks</p>
c# asp.net
[0, 9]
4,136,997
4,136,998
mediaplayer fadein
<p>In my app I've an instance of sound and I like add the fadein. I try with this code but audio is always to max volume.</p> <pre><code>float volume = 1; float speed = 0.05f; } public void FadeIn(float deltaTime) { MediaPlayer.setVolume(volume, volume); volume += speed * deltaTime } </code></pre>
java android
[1, 4]
5,934,376
5,934,377
Java book for experienced programmers (PHP)
<p>I searched on few questions earlier asked here but my context is not matching exactly to them. I am working on LAMP from past few years. I recently learnt Java SL-314 Syllabus thinking my knowledge in PHP and other PLUS some knowledge in core Java from Oracle website can be helpful. I saw Java document is very poor compared to PHP. In PHP, one can get everything basic from the php.net site itself. For a simple thing like showing the resultset data to servlet or JSP from plain java code, I need to search a lot and still I cannot get past ArrayList etc. I was looking for a code in Java like this in PHP:</p> <pre><code>while ($row = mysql_fetch_assoc($result)) { echo $row["userid"]; echo $row["fullname"]; echo $row["userstatus"]; } </code></pre> <p>I mean I want to use all fields the way I want. </p> <p>I have a book, Java in Nutshell but that seems too theoretical. I need small book so that I can read it soon. I want to develop web app using Java. For getting help from core java, I want simple example codes to do all normal work I used to do in PHP. </p> <p><strong>Please help me find simple Java book with example code which can help me do all normal stuff one do in PHP.</strong></p>
java php
[1, 2]
3,844,420
3,844,421
Replace class depending on event
<p>If have a set of collapsible elements, in which I need to replace classes <em>left</em> and <em>right</em> depending on event <em>isCollapse</em>:</p> <pre><code>&lt;div class="collapsible-set"&gt; &lt;div class="collapsible"&gt; &lt;h3&gt; &lt;a class="left"&gt; &lt;span class="left"&gt;&lt;/span&gt; &lt;/a&gt; &lt;/h3&gt; &lt;/div&gt; &lt;div class="collapsible"&gt; &lt;h3&gt; &lt;a class="right"&gt; &lt;span class="right"&gt;&lt;/span&gt; &lt;/a&gt; &lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I need to toggle the classes. Is there an eaiser way to do this than what I came up with?</p> <pre><code>if (collapse) { $('.left').addClass('topLeft').removeClass('left'); $('.right').addClass('topRight').removeClass('right'); } else if (!collapse) { $('.topLeft').addClass('left').removeClass('topLeft'); $('.topRight').addClass('right').removeClass('topRight'); } </code></pre> <p>There must be an eaiser way to do this without writing so much code...</p>
javascript jquery
[3, 5]
1,191,770
1,191,771
remove intermediary object from map object
<p>I have a couple of these and think (know) that I'm doing something wrong (or could be simpler). </p> <pre><code> html: &lt;div class='item-to-select' data-global-id='55'&gt;some&lt;/div&gt; var l=$(this).map(function(){ t=new Object(); t.global_id=$(this).data('global-id'); return t; }).get(); var list=l[0]; // want to remove this </code></pre> <p>How would I remove this intermediary object? Or a better way</p> <p>thx</p>
javascript jquery
[3, 5]
1,750,879
1,750,880
Learning C++ or Java for future lower level programming?
<p>I know Ruby and PHP and want to start learning a lower level programming.</p> <p>I'm having a hard time choosing between C++ and Java, and coming from only dynamic languages I don't know exactly what I can do with C++ and not Java, and vice versa.</p> <p>Could someone explain what the benefits (focused on features) are for each of them?</p>
java c++
[1, 6]
3,745,617
3,745,618
How to stop upload in background?
<p>When I click on a button how do I stop an upload because it is still uploading in the background?:</p> <p>Below is code:</p> <pre><code> $(".imageCancel").click(function() { $(".upload_target").attr("src","#"); //iframe } </code></pre>
javascript jquery
[3, 5]
4,345,325
4,345,326
How to implement this type of behaviour in jquery or javascript
<p><a href="http://kavisha-pinto.sulekha.com/blog/post/2008/06/arranged-marriage-humour-poetry.htm" rel="nofollow">http://kavisha-pinto.sulekha.com/blog/post/2008/06/arranged-marriage-humour-poetry.htm</a></p> <p>if you all see this link. left hand side we wil have one slide bar which open and we have some tabs in that conent.</p> <p>is that any way that we can implement same behaviour in Jquery or javascript?</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,938,962
3,938,963
Set the value to ID of the element on click event by jquery
<p>I want to set the menu to active when click on it. This is what I've tried : </p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; var select; $(document).ready(function () { $.getJSON(url, function (data) { $.each(data, function (index, dataOption) { var new_li = $("&lt;li class='level1' id='select_list'&gt;&lt;a href='javascript:void(0);' id='" + dataOption.ID + "' class ='selectedcategory'&gt;" + dataOption.Name + "&lt;/a&gt;"); $('a#' + dataOption.ID).click(function () { select = "selected"; $('.level1').attr("id",select); }); }); }); }); &lt;/script&gt; </code></pre> <p>What I tried to do is to set the id of 'level1' to selected, when I click on that link. But my coding is set all the link to selected, even I click only 1 link.</p> <p>Could anyone give me the solution please.</p> <p>Thanks so much.</p>
javascript jquery
[3, 5]
5,818,389
5,818,390
find and remove character within label text string with jquery
<p>I have this code</p> <pre><code>&lt;div class="new"&gt; &lt;label&gt; text text text (=price) &lt;/label&gt; &lt;/div&gt; </code></pre> <p>I want to remove the "(=" and ")" around the price,</p> <p>I've tried the following but to no avail:</p> <pre><code> jQuery(document).ready(function() { jQuery(".new label").each(function() { jQuery(this).text(jQuery(this).text().replace(/[(=]/, "")); }); }); </code></pre>
javascript jquery
[3, 5]
2,025,320
2,025,321
How to check whether a function is already called in java?
<p>I have called a method twice in my Android Java project but i want to invoke it only once. When I am calling the method for a second time, I want to check whether the method has already been invoked or not. Code is something like this:</p> <pre><code>class SomeClass { //called with certain condition private void a(){ c(); //first call } private void b() { c(); //second call,check here whether function is invoked already or not,if invoked not invoke here or vice-versa } //called with certain condition private void c() { } } </code></pre>
java android
[1, 4]
4,650,276
4,650,277
How to Remove a iframe by jQuery
<p>I create a <code>iframe</code> in a <code>div</code> by jQuery.Then I load another page(lets say page A.jsp) into that iframe. The page 'A.jsp' has some functionality and end of it, the parent iframe should be removed from the first page when a button in 'A.jsp' is pressed . Loading the page 'A.jsp' into the iframe is OK. but I can't remove the parent iframe. How I tried was, select the parent tag <code>iframe</code> then, remove it. but it didn't work. Here is how I tried.Here $(this) referes to a button in page A.jsp and &amp;('div iframe')referes to the parent iframe </p> <pre><code>$(this).closest($('div iframe')) .animate({ opacity:0 },500,function(){$(this).remove()}) </code></pre> <p>How can I remove the parent iframe ?</p>
javascript jquery
[3, 5]
586,286
586,287
Push to Webpage
<p>How does Facebook and other pages seem to automatically push to webpages? They arent continually refreshing.</p> <p>I know it would be through javascript but am a bit unsure on the theory. Is there a javascript script that is continuelly checking back with the facebook server to see if any updates are created?</p> <p>Can someone point me into the right direction to where i can research how to add this functionality to my webpage? (Its probably more a javascript thing, however I am using C# ASP.NET)</p>
c# javascript asp.net
[0, 3, 9]
2,825,256
2,825,257
jQuery switching text
<p>Actually i have:</p> <pre><code>function switch() { if(document.getElementById('mydivid').innerHTML == "Show +") document.getElementById('mydivid').innerHTML = "Show -"; else if(document.getElementById('mydivid').innerHTML == "Show -") document.getElementById('mydivid').innerHTML = "Show +"; } </code></pre> <p>but i looking to do this with jQuery. I have:</p> <pre><code> $(document).ready(function() { $("#mydivid").click(function() { // if #mydivid is "Show +" do: $("#mydivid").html("Show -"); // else if #mydiv is "Show -" do: $("#mydivid").html("Show +"); }); }); </code></pre> <p>How can i use this ifs? or can i use toggler with only one div element? Thanks!</p>
javascript jquery
[3, 5]
5,307,679
5,307,680
How can I access my PHP variables when calling ajax in jQuery?
<p>I am attempting to create a simple comment reply to posts on a forum using the AJAX function in jQuery. The code is as follows:</p> <pre><code>$.ajax({type:"POST", url:"./pages/submit.php", data:"comment="+ textarea +"&amp; thread="+ currentId, cache:false, timeout:10000, success: function(msg) { // Request has been successfully submitted alert("Success " + msg); }, error: function(msg) { // An error occurred, do something about it alert("Failed " + msg); }, complete: function() { // We're all done so do any cleaning up - turn off spinner animation etc. // alert("Complete"); } }); </code></pre> <p>Inside the submit.php file I have this simple if->then:</p> <pre><code> if(System::$LoggedIn == true) { echo "Yes"; } else { echo "No"; } </code></pre> <p>This call works on all other pages I use on the site, but I cannot access any of my variables via the AJAX function. I've tested everything more than once and I can echo back whatever, but anytime I try to access my other PHP variables or functions I just get this error:</p> <blockquote> <p>Failed [object XMLHttpRequest]</p> </blockquote> <p>Why am I unable to access my other functions/variables? I must submit the data sent into a database inside submit.php using my already made $mySQL variable, for example. Again these functions/variables can be accessed anywhere else except when I call it using this AJAX function. After hours of Googling I'm just spent. Can anyone shed some light on this for me? Many thanks.</p>
php javascript jquery
[2, 3, 5]
4,464,193
4,464,194
Problem returning a value from clicked link
<p>I have a set links on a page like this</p> <pre><code>&lt;a href='' class='contact' data-index='1'&gt;One&lt;/a&gt; &lt;a href='' class='contact' data-index='2'&gt;One&lt;/a&gt; &lt;a href='' class='contact' data-index='3'&gt;One&lt;/a&gt; </code></pre> <p>I am trying to return the value of the data-index of each link when it is clicked but Whenever I click on each link, the data-index of the first link is always returned because jQuery will select all the links with class = 'contact' on the page. I am trying to figure out how to select the data-index of the clicked link.</p> <p>I use something like this :</p> <pre><code>var m_data = $("a#contact").attr("data-index"); </code></pre> <p>I've also tried something like this :</p> <pre><code>$("a#contact").click(function() { var data = $(this).data('index'); }); </code></pre> <p>but data was undefined.</p> <p>Please how do I do this? Thanks.</p>
javascript jquery
[3, 5]
1,055,502
1,055,503
PHP's $_POST doesn't like how I post
<p>As everyone knows, PHP has a <code>$_POST</code> variable that stores data from POST requests.</p> <p>I'm trying to use it with XHR..</p> <pre><code>xhr.send('hey=hello&amp;hi=there'); </code></pre> <p>..but it doesn't work..</p> <pre><code>echo $_POST['hey'] . ' ' . $_POST['hi']; # The page should say "hello there", but it doesn't. </code></pre> <p>I'm am I sending the data wrong?</p> <p>Do I need to change my php.ini?</p> <p>How do I get this to work? :(</p>
php javascript
[2, 3]
788,388
788,389
How to write a map into a parcel?
<p>In my android app I have an activity containing a Parcelable object (Implements Parcelable).</p> <p>That object contains a map.</p> <p>When I try to do the following in the "writeToParcel" class:</p> <pre><code>parcel.writeMap(myMap); </code></pre> <p>I get the following comment from the API:</p> <blockquote> <p>Please use writeBundle(Bundle) instead. Flattens a Map into the parcel at the current dataPosition(), growing dataCapacity() if needed. The Map keys must be String objects. The Map values are written using writeValue(Object) and must follow the specification there.</p> </blockquote> <p>How am I supposed to do it? How am I supposed to use the writeBundle(myMap) here?</p>
java android
[1, 4]
3,341,787
3,341,788
jquery not working in asp.net mvc after publishing to localhost
<p>I've built an mvc application which contains some jquery code. When I run the app from my ide, everything works perfectly. When I publish to the server and open the page, the jquery does not work. I get object expected errors.</p> <p>i am not getting anything in the page,it shows error in loading dhtmlxsheduler.js can you help me out </p>
c# javascript jquery
[0, 3, 5]
1,577,659
1,577,660
Set image of a button to apps icon
<p>I have a button in my app that launches another app (the user can choose which one with a longClick like this)</p> <pre><code>btnNavigation.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { // Pick an application Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY); pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent); startActivityForResult(pickIntent, 1); return false; } }); </code></pre> <p>with the onActivityResult i get back an intent</p> <p>Now i'd like to set the image of btnNavigation to the icon of the app the user has chosen</p> <p>How can i get the icon from the package the user chose?</p>
java android
[1, 4]
6,005,162
6,005,163
update the textview when user slides right or left
<p>I have a textview which changes the text on click. I would like to add a feature when it changes when user slides right or left. Can anyone please let me know how?</p>
java android
[1, 4]
2,421,711
2,421,712
What is the recommended way of showcasing user public profiles in other websites?
<p>I have user public profile as a functionality. I need to provide the users with some code that he can integrate in other websites and showcase his profile to public. Basically my idea is to have a script that embeds a clickable image on other websites and if anybody clicks on it he is taken to the users profile in a new tab or new window. </p> <p>I am not aware of any other apps that does similar way. Any examples also would be very helpful.</p>
javascript jquery
[3, 5]
3,518,111
3,518,112
Event not getting fired
<p>I have a form in which i have a text box for email and many other textboxes. The email has a functionality that it should not match with previously entered email but it can be blank.</p> <p>I fired my code at the text change event of the textbox and it is working fine. But when i click on the update button without taking my cursor off the textbox. The click of the button is not working.Only textchanged event of textbox fires nothing else happen.</p> <p>Please help me with the same.</p> <pre><code> string emailid = txtemail.Text; var emailcnt2 = (from r in context.Customers where r.Email == Convert.ToString(emailid) select r).SingleOrDefault(); if (emailcnt2 != null) { lblemail.Text = "Email already exists for customer " + emailcnt2.FirstName + " " + emailcnt2.LastName + ""; // emaildisplay.Attributes.Add("style", "display:block;"); txtemail.Focus(); } </code></pre>
c# asp.net
[0, 9]
3,441,088
3,441,089
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]
3,117,592
3,117,593
Valid data in a text box
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5692232/jquery-validate-phone-number-with-with-regex">jQuery validate phone number with with RegEx</a> </p> </blockquote> <p>we have to allow only 10 digits in a text field along with , . ( ) - also. (US phone number format.) It should not allow 11 th digit when i am entering data in this text field.If i delete all the data it will again allow me to enter upto 10 digits. this field is also using to enter email to login. For Email and mobile number same text field. Please help me out to do it.</p>
javascript jquery
[3, 5]