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
4,902,133
4,902,134
loop through li elements up the dom
<p>I have li elements</p> <pre><code>&lt;ul class=""&gt; &lt;li class="current-rating" id="current-rating" style="width: 0px"&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" title="1 star out of 5" class="one-star star star-rating stars-1"&gt;1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" title="2 star out of 5" class="two-stars star star-rating stars-1"&gt;2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" title="3 star out of 5" class="three-stars star star-rating stars-1"&gt;3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" title="4 star out of 5" class="four-stars star star-rating stars-1"&gt;4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#" title="5 star out of 5" class="five-stars star star-rating stars-1"&gt;5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>When I mouse over say 3 how can i get all the elements up the dom? ie when i click or mouse over 3rd li i want 3 li's. when i mouse over 5th i have all 5. I am not sure how can i traverse up the dom i tried using parent() and parents() but didnt work.</p>
javascript jquery
[3, 5]
4,006,376
4,006,377
Variable scope in anonymous function
<p>I'm trying to populate an array in JavaScript using an anonymous function in the jQuery <code>getJSON()</code> function as follows.</p> <pre><code>$(document).ready(function() { function Link(url, title) { this.url = url; this.title = title; } var links = []; $.getJSON("http://reddit.com/r/programming/.json?jsonp=?", function(data) { $.each(data.data.children, function(i, item) { var title = item.data.title; var url = item.data.url; links.push(new Link(url, title)); }) }); for(var i=0; i&lt; links.length; i++) { var output = "&lt;a href='" + k + "'&gt;" + links[k] + "&lt;/a&gt;"; $('&lt;p&gt;' + link + '&lt;/p&gt;').appendTo('#content'); } }); </code></pre> <p>But, when I hit the for loop, the links array shows up empty. What's going on here?</p>
javascript jquery
[3, 5]
4,093,695
4,093,696
How do i get selected radiobuttonlist in asp.net?
<p>I am using following code for a radiobuttonlist with default value of yes.</p> <pre><code> &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server" onselectedindexchanged="radiobtnlist_SelectedIndexChanged"&gt; &lt;asp:ListItem Selected="True"&gt;YES&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;NO&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; </code></pre> <p>Every time when the value of the radiobtnlist is changed an event is fired.I am using following c# code for selected index changed</p> <pre><code>protected void radiobtnlist_SelectedIndexChanged(object sender, EventArgs e) { //do work } </code></pre> <p>Problem is that when radiobtnlist value is set as No and the selection is not changed but the selectedindex change event is fired and when radiobtnlist is set as Yes, the selectedindex change event is not fired.</p> <p>I have to find the selection of radiobtnlist everytime before postback and if its value is changed then saved data in db but how to find the selected value of radiobtnlist with a default value on a ListItem.</p>
c# asp.net
[0, 9]
3,839,969
3,839,970
Unable to give focus to specific fields with jQuery
<p>I'm validating a simple form with jQuery:</p> <pre><code>$('input:text').blur(function(){ if ($(this).val() == "") { $("#" + $(this).attr("name") + "_error").show(); $(this).css("border", "2px solid red"); $(this).focus(); return false; } }); </code></pre> <p>The <code>$(this).focus();</code> doesn't keep the focus on the current field - is there a reason this shouldn't be allowed, or am I missing something? </p> <p><strong>UPDATE</strong></p> <p>I've been playing around with the code a little; when I try to focus a specific field by selecting it by its id, the focus will never remain on the field that the <code>blur</code> event was called from; for example if I've got 5 fields, with ids <code>field1</code>, <code>field2</code>,...<code>field5</code>, and have the following code:</p> <pre><code>$('input:text').blur(function(){ if ($(this).val() == "") { $(this).css("border", "2px solid red"); $("#field4").focus(); return false; } }); </code></pre> <p>if I take the focus away field 1 when it is empty using the tab key, then the focus <em>is</em> switched to <code>#field4</code>, however, if I tab off field 4 when it is empty, the focus does not remain on field 4, but switches to field 5. Is this expected / documented behaviour?</p>
javascript jquery
[3, 5]
1,117,887
1,117,888
ASP.NET, The status code returned from the server was: 500
<p>A customer using a ASP.NET program I have just sent them is experiencing the error below, I had personally tested the program on 4 web server IIS6, 7, and 7.5, on 4 different networks and I never got this, the customer is using IIS6 with .Net 2.0 (as required). The program uses Windows authentication which may or may not be part of the problem. I'm stuck I don't know where to start with this. Any help is very much appreciated.</p> <blockquote> <p>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500</p> </blockquote>
c# asp.net
[0, 9]
1,261,312
1,261,313
How to use method get value in "input[type=radio]"
<pre><code>&lt;script&gt; $(document).ready(function(){ $('#btnSubmit').bind('click', function(){ var option = $('#form input[type=radio]').val(); if(!option){ alert('Answer empty'); return false; } $('#form').submit(); }); }); &lt;/script&gt; &lt;form id="form" method="post"&gt; &lt;input type="radio" id="option1" name="option1" /&gt; &lt;input type="submit" name="btnSubmit" id="btnSubmit" value="submit" /&gt; &lt;/form&gt; </code></pre> <p>I think it wrong in function call <code>$('#form input[type=radio]').val();</code></p>
php jquery
[2, 5]
3,764,256
3,764,257
Are zero length timers still necessary in jQuery?
<p>I am finally getting around to really implementing some jQuery solutions for my apps (which is seeming to also involve a crash course in javascript).</p> <p>In studying examples of plugins, I ran across this code. I'm assuming the author created the zero length timer to create some seperation of the running code, so that the init functon would finish quickly.</p> <pre><code>function hovertipInit() { var hovertipConfig = {'attribute':'hovertip', 'showDelay': 300, 'hideDelay': 700}; var hovertipSelect = 'div.hovertip'; window.setTimeout(function() { $(hovertipSelect).hovertipActivate(hovertipConfig, targetSelectById, hovertipPrepare, hovertipTargetPrepare); }, 0); } </code></pre> <p>Is needing this type of seperation common? <br/> Is creating the zero length timer still the best way to handle this situation, or is there a better to to handle this in jQuery?<br/> </p> <p>Thanks,<br/> Jim</p>
javascript jquery
[3, 5]
128,391
128,392
select a range of dom elements based on index
<p>I need to select a specific grange of jquery elements based on there index using <code>:eq()</code> (or something else if you have a better solution)</p> <p>my html structure is the following:</p> <pre><code>&lt;ul&gt; &lt;li&gt;slide0&lt;/li&gt; &lt;li&gt;slide1&lt;/li&gt; &lt;li&gt;slide2&lt;/li&gt; &lt;li&gt;slide3&lt;/li&gt; &lt;li&gt;slide4&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>When the user hovers slides over the slide2 i need to select <code>li:eq(0), li:eq(1)</code> and <code>li:eq(3), li:eq(4)</code> separatly, because they have a different animation.</p> <p>This is my solution, but this feels a little messy...</p> <pre><code>var $slides, theOthers, slidesTotal; $slides = $('ul &gt; li'); slidesTotal = $slides.length; theOthers = function(slideIndex ,slidesTotal){ var before = [], after = [], i=0; while (i&lt;=slideIndex - 1){ before[i] = ":eq(" + i + ")" i++ }; while (i &lt;= slidesTotal) { after[i] = ":eq(" + i + ")" i++ }; return [ before.join(",") , after.join(",") ] } $slides.mouseenter(function(){ var groups, slideIndex, $that = $(this); slideIndex = $that.index(); groups = theOthers(slideIndex, slidesTotal); $slides.filter(groups[0]).dosomething(); $slides.filter(groups[1]).dosomethingelse() }) </code></pre> <p>is there a more simple way to do this with jQuery?</p>
javascript jquery
[3, 5]
5,405,552
5,405,553
how to prevent $(document).ready(function() {} from calling a function
<p>i have a simple but bit complicated problem. what i want to do is that in my php page i have added this</p> <pre><code>$(document).ready(function() { $("a[rel^='prettyPhoto']").prettyPhoto({social_tools:false,overlay_gallery:false}); }); </code></pre> <p>now this page get call through ajax too.normal call of page does <strong>nothing</strong>.but when i click i mean <code>a[rel^='prettyPhoto']</code> so it call this function prettyPhoto() and that is what i want to do. when this page call through ajax so it directly execute the function although i have not click any thing.</p> <p>i have tried this</p> <pre><code>event.preventDefault(); </code></pre> <p>but nothing working. also i put this line of code in a function and call it but nothing happens.also remove <code>$(document).ready(function() {}); but still not working any clue</code></p>
javascript jquery
[3, 5]
1,235,532
1,235,533
Use jquery to fire off my timer
<p>I have a timer on my web app called Timer1 and the <code>enabled = false</code>. I want to use jquery to fire off my timer. I thought that <code>$("Timer1").enableSelection('True');</code> would work but it doesnt appear to be working. </p> <p>Any suggestions here? </p> <p>Thanks guys!</p> <p>My jquery code: </p> <pre><code>var lastupdate; $(function () { $.ajaxSetup({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", data: "{}", error: function (a, b, c) { try { var err = (JSON.parse(a.responseText)).Message; alert(err); } catch (ero) { alert(a.responseText); } } }); // updateSettings(); $("#refreshBaan").click(function () { $.ajax({ url: "Default.aspx/refreshBaan", success: function (msg) { $("#lastBaanUpdate").html(""); $("#lastBaanUpdate").progressbar({ value: 0 }); $("#refreshBaan").attr("disabled", "disabled"); //** $(function () { $("Timer1").enableSelection('True'); $("#progressbar").progressbar({ value: 0 }); setTimeout(updateProgress, 200); }); function updateProgress() { var progress; progress = $("#progressbar") .progressbar("option", "value"); if (progress &lt; 100) { $("#progressbar") .progressbar("option", "value", progress + 2); setTimeout(updateProgress, 200); } }` </code></pre> <p>My C#:</p> <p><code>&lt;asp:Timer ID="Timer1" runat="server" Interval="17000" ontick="Timer1_Tick" Enabled="False" /&gt;</code></p>
c# jquery
[0, 5]
2,184,757
2,184,758
ASP.NET Login, Convert.ToInt32();
<p>I'm making a login script and can't get the <code>Convert.ToInt32()</code> to work for me.</p> <p>The error: Error </p> <blockquote> <p><em>'System.Convert.ToInt32(object)' is a 'method' but is used like a 'type'</em></p> </blockquote> <p>snippet:</p> <pre><code> con.Open(); string mysql; // generate an sql insert query for the database mysql = "SELECT * FROM [Users] UserName='" + tbUser.Text + "'"; OleDbCommand CheckUser = new OleDbCommand(mysql, con); int temp = new Convert.ToInt32(CheckUser.ExecuteScalar().ToString()); </code></pre> <p>Appreciate any help.</p>
c# asp.net
[0, 9]
4,292,821
4,292,822
ASP:Checkbox Bind Issues
<p>I am using a MSsql Database and trying to bind a checkbox to one of the fields. The field in the DB is a Bit so it is looking for a 1 or 0, but the asp:checkbox deals with Boolean values. How do I go about doing this binding?</p>
c# asp.net
[0, 9]
1,599,847
1,599,848
Add chars on line break
<p>Hi I have list (ul) and in it some "li".</p> <p>With Javascript (jQuery) how do I detect when line breaks and add some chars on beginning.</p> <p>So for example:</p> <pre><code>I have a very looooong text in 200px width li. </code></pre> <p>Result is:</p> <pre><code>I have a very looooong text in 200px width li. </code></pre> <p>And I want to add " + " on the beginning of new line => result:</p> <pre><code>I have a very looooong text + in 200px width li. </code></pre> <p>thx</p>
javascript jquery
[3, 5]
1,946,626
1,946,627
How to open URI in the native browser (android)
<p>I want to open the page ya.ru in the native browser. That's what I have</p> <pre><code>list.setOnClickListener(new OnClickListener() { public void onClick(View v) { // TODO Auto-generated method stub String url = "http://ya.ru"; Intent intent1 = new Intent(Intent.ACTION_VIEW); intent1.setData(Uri.parse(url)); startActivity(intent1); } }); </code></pre> <p>Could you tell me what I should write in <code>uses-permissions</code> except</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt; </code></pre> <p>or is there anything wrong in the code?</p>
java android
[1, 4]
1,259,093
1,259,094
Move focus from one control to another control just pressing enter key by Jquery
<p>suppose i have many html control in the page and all the control has a sequentially tab stop set.so if i press tab then focus move properly but i want to move focus just by pressing enter key instead of tab. so please tell me how could i programatically press tab when user will press enter key in my web page just by javascript or jquery. expecting small smaple code to achieve the effect i need.</p> <p>thanks.</p>
javascript jquery
[3, 5]
1,270,403
1,270,404
C# Rollback sendemail
<p>I wrote a code to recover passwrod in my website.The user enter his email address and we send a new password to him.In additcion,we also change his password in DB to newest password.</p> <p>Problem: If code for send mail fails,i cant change his password in DB,and if code to change password fails i cant send mail.</p> <p>Take a look:</p> <pre><code>public bool RecoverPassword(string email) { try { SceLoginMail sceEmail = new SceLoginMail(email, "Recuperação de senha", 5); ChangeUserPassword(sceEmail.NovaSenha, email); sceEmail.SendEmail(); sceUsers.CommitOrRollBack(true); return true; } catch (Exception ex) { sceUsers.CommitOrRollBack(false); return false; } } </code></pre> <p>I try to rollback in DB if an exceptions occurs in SendEmail method.But,i cant "RollBack" the SendMail method if an exceptions throws in CommitOrRollback method.If so,system will send the mail and wont change it on DB.</p> <p>Any ideias?</p>
c# asp.net
[0, 9]
3,296,558
3,296,559
GridView Records are inserted / not
<p>I have a 3 GridvViews : <strong>To</strong>, <strong>Cc</strong>, and <strong>Bcc</strong>. After entering the values to Grids, I want to save those Records.</p> <p>My question is: at the time of saving, how do I check if there is there in 3 Grids or not? e.g. If I insert records for <strong>To</strong>, but not for <strong>Cc,Bcc</strong> , then I would like it to show an error message:</p> <pre><code>"error enter at least one record..." </code></pre> <p>I tried the following script hooked into the <strong>Save</strong> button by using the <strong>OnClientClick</strong> callback. But it isn't working.</p>
c# javascript
[0, 3]
4,215,161
4,215,162
Change Enter from submission to Tab?
<p>Users don't like the fact that the Enter key submits the page. So I am tasked with preventing the submission and changing the Enter key to a Tab to the next field.</p> <p>I have tried many javascript snippets found on the net but none have worked so far. The only one that has even come close to having an effect was e.preventDefault() of the jQuery API, which stops the submit, but nothing I have tried emulates the tab behavior.</p> <pre><code>e.returnValue = false; e.cancel = true; </code></pre> <p>Page still submits with the above in the keydown event handler. Same effect with <code>return false</code> in the keydown event handler. The handler is firing, tested by putting a breakpoint in it with firebug.</p> <p>This needs to work with both IE and Firefox.</p> <p>Don't say "don't do this".<br> 1) I'm already convinced that I shouldn't do it, but it's not a choice that is mine, so the discussion is mute.<br> 2) It would be an answer to the question "Should I do this?", which is not the question that I am asking.</p>
javascript asp.net
[3, 9]
769,554
769,555
Loading Content best practices
<p>I am sort of new to JavaScript and something has been bugging me. Say I have some code like this:</p> <pre><code>$('button').on('click', function() { var id = $(this).attr("id") // id being a file name sans extension $('.content').load(id + '.php'); }); </code></pre> <p>Everything works just fine, but something in the back of my head tells me that this is bad practice. Any thoughts?</p>
javascript jquery
[3, 5]
4,755,117
4,755,118
How to work with JSON
<p>Okay I'm really sorry if this question has been asked, but I can't seem to find any good help on this. </p> <p>I coded myself a little API for my android app using PHP and Codeigniter. It works through GET requests, so I'll send it some info and it'll return something. When I send it a login request, I want it to validate the user data, and if correct return the user's credentials (uid, email, etc). All of this information can either be returned as formatted XML or a JSON array. My question is which would be easier to work with in Java, and can you help me with a quick example?</p> <p>Any help is much appreciated.</p> <p>EDIT:</p> <p>Requested Code</p> <pre><code> // Parse JSON array JSONObject obj = (JSONObject) JSONValue.parse(response); String uid = (String) obj.get("uid"); String email = (String) obj.get("email"); </code></pre>
java android
[1, 4]
1,800,065
1,800,066
Using variable in a regex
<p>say i have the following variables:</p> <pre><code>myId; //Email_PDF currentHoverOnItem; //Email_PDF_english of Email_PDF_Dutch or ... </code></pre> <p>So the first value is "Email_PDF" and the second is "Email_PDF_english". What i want i when currentHoverOnItem contains myId, then something can be executed. This is what i have so far:</p> <pre><code>var pattern = new RegExp("^/"+myId+"/$"); if (currentHoverOnItem.match(pattern)) { //Do something } </code></pre> <p>Is this the right way to use the regex? It should match part of the string, there can be text before or after the match.</p>
javascript jquery
[3, 5]
5,475,062
5,475,063
javascript: completing action only if a div is visible
<pre><code>$.swapImage.swapOut = function() { if ($(this).find('.popup').is(':visible') !== true) { alert(ASDASD) $.swapImage.swap(this, "sout"); } </code></pre> <p>I am trying to find if the div "popup+this" (example popup1) is visible before completing the action. Any i ideas?</p>
javascript jquery
[3, 5]
3,748,361
3,748,362
Reading custom format files in C#
<p>I would like to fetch n bytes from specific place in a file into my specific data structure (a struct). </p> <p>The old C - application (which we are porting) uses fseek() and fread().</p> <p>Is where a comparable solution in C#/.Net, without using the Win32-API?</p>
c# c++
[0, 6]
5,347,251
5,347,252
String manipulation - getting value after the last position of a char
<p>How I can get the value after last char(. ; + _ etc.): e.g.</p> <blockquote> <p>string.name+org.com</p> </blockquote> <p>I want to get "com". Is there any function in jQuery?</p>
javascript jquery
[3, 5]
5,205,544
5,205,545
How to load image from a website in android?
<p><a href="http://www.bestandroidblog.com/android-phones/which-android-phone-will-take-the-title-of-the-best-android-phone-of-2012/" rel="nofollow">This</a> site contains more than one image. But in a webview I just want to load any one of these images. How to do it?</p>
java android
[1, 4]
4,650,795
4,650,796
How to create Notification which avoid TaskManager's killing?
<p>I want to create Notification in Android. But, If I kill the application via TaskManager, it terminate the Notification too.. It is the code-snipet.</p> <p>it is the caller.</p> <pre><code>Intent intent = new Intent(myActivity, NotificationReciever.class); String appName = myActivity.getTitle().toString(); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(System.currentTimeMillis()); calendar.add(Calendar.SECOND, time); AlarmManager alarmManager = (AlarmManager) myActivity.getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender); </code></pre> <p>it is the Reciever.</p> <pre><code>public class NotificationReciever extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { </code></pre> <p>I added the code, but it can't</p> <pre><code>intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); </code></pre> <p>I' like to make alive the Notification. Would you tell me how to avoid the TaskManager's killing?</p>
java android
[1, 4]
452,613
452,614
Access $('selector').data in functions/objects
<p>How do I access values set by $.data() inside a function or object</p> <pre><code> $('#timers').data('firsttimer', 100); //prints 100 document.write($('#timers').data('firsttimer')); function blah(){ //Prints nothing document.write($('#timers').data('firsttimer')); } blah(); </code></pre> <p>See this jsfiddle for easy access to test the code <a href="http://jsfiddle.net/JUfd8/" rel="nofollow">http://jsfiddle.net/JUfd8/</a></p>
javascript jquery
[3, 5]
1,242,219
1,242,220
Print content from a list with a delay in Javascript/jQuery
<p>I have a list of strings in Javascript that I would like to print into a HTML div. This is the Javascript code:</p> <pre><code>$(document).ready(function(){ list = ["One","Two","Three"]; for (var i = 0; i &lt; list.length; i++){ $("#content").html(list[i]); } }); </code></pre> <p>Which print into the HTML div with the id "content". But of course only the last word shows up. What I would like is control the delay between each $("#content").html(list[i]); so I can see every word of the list one after each other. Is there a solution in Javascript or jQuery ?</p> <p>Thanks !</p>
javascript jquery
[3, 5]
1,702,485
1,702,486
PHP and JQuery Question
<p>Is there a way I can pass a PHP variable from a PHP page to a JQuery page and back to a PHP page?</p>
php jquery
[2, 5]
4,526,730
4,526,731
Open Image from assets using external program
<p>I've wrote content provider to open a png file in my app package with an external application (standard image viewer of Android). Image is stored in asset folder.</p> <p>I cannot understand where is a problem, but it doesn't work for me.</p> <p>openFile of ContentProvider:</p> <pre><code> @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { URI file_uri = URI.create("file:///data/data/com.package/assets/image.png"); File file = new File(file_uri.getPath()); ParcelFileDescriptor parcel = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY); return parcel; } </code></pre> <p>Starting activity:</p> <pre><code>Uri uri = Uri.parse("file:///android_asset/image.png"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(uri, "image/*"); startActivity(intent); </code></pre> <p>Is this approach correct and where is my mistake? Or am I totally wrong?</p>
java android
[1, 4]
5,739,352
5,739,353
HttpContext.Current.Session vs Context.Session
<p>Are they the same thing? Or are they different?</p> <p>I'd read this SO <a href="http://stackoverflow.com/questions/7954844/what-is-the-difference-between-these-two-httpcontext-current-session-and-session">post</a> and <a href="http://stackoverflow.com/questions/940742/difference-between-session-and-httpcontext-current-session">this</a> but they are comparing HttpContext.Current.Session and Session not Context.Session. What am I missing/misunderstanding?</p>
c# asp.net
[0, 9]
3,230,403
3,230,404
Remove leading and trailing spaces in object keys and values
<p>Using the following function:</p> <pre><code>// remove multiple, leading or trailing spaces function trim(s) { s = s.replace(/(^\s*)|(\s*$)/gi,""); s = s.replace(/[ ]{2,}/gi," "); s = s.replace(/\n /,"\n"); return s; } </code></pre> <p>removing the leading and trailing whitespaces in the value is not a problem. I know you can't rename keys, but I'm having difficulty acheiving the output I'm after.</p> <pre><code>$.each(data, function(index) { $.each(this, function(k, v) { data[index][trim(k)] = trim(v); data.splice(index, 1); }); }); </code></pre> <p>This is not achieving the desired output.</p> <p>Any ideas? Would it be best to create a new object and then destroy the original? What would that syntax look like?</p> <p>Example of data:</p> <pre><code>var data = [{ "Country": "Spain", "info info1": 0.329235716, "info info2": 0.447683684, "info info3": 0.447683747}, { " Country ": " Chile ", "info info1": 1.302673893, "info info2 ": 1.357820775, "info info3": 1.35626442}, { "Country": "USA", "info info1 ": 7.78805016, "info info2": 26.59681951, "info info3": 9.200900779}]; </code></pre>
javascript jquery
[3, 5]
4,795,632
4,795,633
Hide all the id in JavaScript
<p>I need to hide all the tags which has the ID 'media'</p> <p>E.g.:</p> <pre><code>`&lt;div id='media'&gt;contents&lt;/div&gt;` `&lt;div id='media'&gt;content&lt;/div&gt;` </code></pre> <p>How to do this using JavaScript?</p>
javascript jquery
[3, 5]
4,781,898
4,781,899
not able get message in chat application when successfully logs in
<p>I want to make a simple chat application.. I have used the below link <a href="http://www.codeproject.com/Articles/17617/Create-a-Chat-System-using-Ajax-and-ASP-NET" rel="nofollow">http://www.codeproject.com/Articles/17617/Create-a-Chat-System-using-Ajax-and-ASP-NET</a></p> <p>After writing below code able to redirect to chat.aspx page</p> <pre><code> protected void btnJoin_Click(object sender, EventArgs e) { if (getUser(txtUserName.Text, txtPassword.Text)) { if(c.CheckUser(txtUserName.Text)) { // lblError.Text = "You are in the chat room already!"; Session["UserName"] = txtUserName.Text; Response.Write("&lt;script language=\"javascript\"&gt;" + "\n"); Response.Write("window.open(\"Chat.aspx\",\"chat\",\"width=800\",\"height=600\",\"toolbar=no\",\"menubar=no\")" + "\n&lt;/script&gt;"); } else { c.AddCustomer(txtUserName.Text); cc.joinRoom(txtUserName.Text); Session["UserName"] = txtUserName.Text; Response.Write("&lt;script language=\"javascript\"&gt;" + "\n"); Response.Write("window.open(\"Chat.aspx\",\"chat\",\"width=800\",\"height=600\",\"toolbar=no\",\"menubar=no\")" + "\n&lt;/script&gt;"); //Response.Redirect("Chat.aspx"); } } else { lblError.Text = "Login Failed"; } } </code></pre> <p>But i can see the name of user repeatedly in a right panel...I f two user are online the only the name of two user should display but i can see the name of same user more than once</p>
c# asp.net
[0, 9]
49,788
49,789
login to site and download a file?
<p>I have implanted a login code to a site , after that I want to download a file from a server . </p> <pre><code> HttpWebRequest http = WebRequest.Create(@"http://www.website.com") as HttpWebRequest; // http.Connection = "Keep-alive"; //uncertain http.Method = "POST"; http.ContentType = "application/x-www-form-urlencoded"; string postData = "FormNameForUserId=" + @"username" + "&amp;FormNameForPassword=" + "pass"; byte[] dataBytes = UTF8Encoding.UTF8.GetBytes(postData); http.ContentLength = dataBytes.Length; using (Stream postStream = http.GetRequestStream()) { postStream.Write(dataBytes, 0, dataBytes.Length); } HttpWebResponse httpResponse = http.GetResponse() as HttpWebResponse; // Probably want to inspect the http.Headers here first http = WebRequest.Create(@"http://www.codeproject.com") as HttpWebRequest; http.CookieContainer = new CookieContainer(); http.CookieContainer.Add(httpResponse.Cookies); HttpWebResponse httpResponse2 = http.GetResponse() as HttpWebResponse; </code></pre> <p>How can I find out I have loged in correctly , also What should I do after login to download a file ?</p>
c# asp.net
[0, 9]
3,349,694
3,349,695
How can I trigger on URL change in jQuery?
<p>How can I trigger a function when the URL changes? I try something like:</p> <pre><code>$(windows.location).change(function(){ //execute code }); </code></pre> <p>So my URL is something like <code>http://www.mysite.com/index.html#/page/1</code>. How can I execute jQuery or JavaScript code when the URL becomes something like <code>http://www.mysite.com/index.html#/page/2</code>?</p>
javascript jquery
[3, 5]
261,430
261,431
getting content of a span in jquery
<p>I have a structure as follows and I want to get content of spans using jquery. How can I do it? Thanks. </p> <pre><code>&lt;div id="question"&gt; &lt;span id="question_zone_0"&gt; &lt;span class="myclass"&gt; &lt;span id="myword0"&gt;myword0&lt;/span&gt; &lt;/span&gt; &lt;span class="myclass"&gt; &lt;span id="myword1"&gt;myword1&lt;/span&gt; &lt;/span&gt; &lt;/span&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,564,906
1,564,907
How to get soap address location attribute from wsdl document in JavaScript
<p>How can I get or retrieve the address location from this tag in JavaScript and Java?</p> <pre><code>&lt;soap:address location="http://www.webservicex.net/geoipservice.asmx"/&gt; </code></pre> <p>I am using this WSDL: <a href="http://www.webservicex.net/geoipservice.asmx?wsdl" rel="nofollow">http://www.webservicex.net/geoipservice.asmx?wsdl</a></p>
java javascript
[1, 3]
5,758,376
5,758,377
encoding empty array in JavascriptSerializer using custom JavascriptConverter
<p>I'm using a custom converter to encode an object model. On the client, I need an empty array but I don't want to include this array in the object model on the server because the array is only used client-side.</p> <p>This is what I have:</p> <pre><code>public override IDictionary&lt;string, object&gt; Serialize(object obj, JavaScriptSerializer serializer) { MyObjectModel TheObjectModel = obj as ObjectModel; Dictionary&lt;string, object&gt; OutputJson = new Dictionary&lt;string, object&gt;(); OutputJson.Add("MyEmptyArray", new Array()); // not working here </code></pre> <p>What do I need to put instead of <code>new Array()</code>?</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,690,055
2,690,056
Retrieving DataGrid Cell value
<p>I Have just started learning ASP.Net. Last night i was working on Grid View in which i fill data by directly giving command to database. I haven't defined any template field for my grid and i have set AutoGenerated edit button to true. Data is getting displayed corrrectly but While trying to handle update event i'm facing problem as i'm unable to retrieve cell value for the row i'm updating. </p> <p>I googled a lot but all the examples for retrieving cell value are based on template field but in my case i'm not defining the columns of the grid at design time. Please help me.</p> <p>My Code is below: (GridView1_RowUpdating method is giving empty value when i checked by applying break point)</p> <pre><code> private void FillGrid() { SqlConnection con = new SqlConnection("Data Source=.\\sqlexpress;Initial Catalog=TestDatabase;Integrated security=true;"); DataTable dt = new DataTable("Student"); using (SqlDataAdapter adapter = new SqlDataAdapter("select name,age,Fathername,dob from student", con)) { adapter.Fill(dt); } GridView1.DataSource = dt; GridView1.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { FillGrid(); } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { //Response.Write("RowDataBoundEvent Occured"+" "+e.Row.RowType+"\n"); } protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView1.EditIndex = -1; FillGrid(); } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; FillGrid(); } protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { string name = GridView1.Rows[e.RowIndex].Cells[2].Text; string age = GridView1.Rows[GridView1.EditIndex].Cells[3].Text; string salary = GridView1.Rows[GridView1.EditIndex].Cells[4].Text; } </code></pre>
c# asp.net
[0, 9]
5,689,651
5,689,652
Javascript alert() after Response.Redirect
<p>I am calling this in my code behind: </p> <pre><code>(test.aspx) Response.Redirect("~/Default.aspx"); </code></pre> <p>I want to include a javascript alert after/before being redirected to Default.aspx, is it possible? I'm doing this because I'm passing a value to another page (test.aspx) and that page checks the db, if reader HasRow(), then redirect to Default.aspx. </p>
c# javascript jquery asp.net
[0, 3, 5, 9]
5,172,558
5,172,559
How to use modalDialog to display pop-up which can work in all browser
<p>I just tried to create pop-up window but its parent window get active while pop-up is still open , in Chome. My code is as blow</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function showModalWindow() { window.showModalDialog('URL, "Sample.jpg", "resizable: yes"); } &lt;/script&gt; how to make this code browser specific. </code></pre>
javascript jquery
[3, 5]
4,809,353
4,809,354
over text mark another text
<p>I'm looking for js code (maybe jquery) that will mark some text when I overmouse on another text (they both will have the same ID)</p> <p>I have number of URLs and I want that overmouse on them will change table cell color</p> <p>for example: </p> <p>overmouse on url1 will mark cell ID 20</p> <p>overmouse on url2 will mark cell ID 18</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,825,122
3,825,123
Disabling parent page while displaying MessageBox.Show
<p>I created an alert using MessageBox.Show method. But I'd like to forbid the editing of the controls in the page which is still accessible behind the messagebox. If I try to disable every control manually before firing the messagebox the controls are disabled only after picking a choice in the messagebox.</p> <p>Please Help :)</p>
c# asp.net
[0, 9]
4,939,741
4,939,742
Search gridview based on the value typing in textbox?
<p>I am using ASP.NET and C#.This is my code.</p> <pre><code>&lt;asp:UpdatePanel ID="gridSearch" runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="jobcardSearch" runat="server"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;HeaderTemplate&gt; &lt;asp:LinkButton ID="LinkButton1" Text="First Name" CommandName="sort" CommandArgument="FirstName" runat="server"&gt;&lt;/asp:LinkButton&gt; &lt;asp:TextBox ID="search" runat="server" Width="70px"&gt;&lt;/asp:TextBox&gt; &lt;/HeaderTemplate&gt; &lt;ItemTemplate&gt; &lt;%# Eval("FirstName")%&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>So while typing on the textbox, I need to filter the grid then I need to perform this without postback.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
3,053,261
3,053,262
jQuery reversing the direction of an effect
<pre><code>$("#left_image1").delay('1000').animate({width:'toggle'}, 1000); </code></pre> <p>This causes the element to collapse in such a way that it appears to be moving off the LEFT side of the screen. How can I reverse the effect so that the element appears to be moving off the right side of the screen?</p>
javascript jquery
[3, 5]
4,383,441
4,383,442
How to stay within a 'instance' using JQuery
<p>I'm currently learning JavaScript/JQuery, but have an issue at work that I'm running into.</p> <p>I've assigned a class of 'question' to an<code>&lt;a&gt;</code>tag, and 'answer' to a<code>&lt;div&gt;</code>. When a user clicks on the question, the answer will slide down. However, the problem I'm running into is that when they click on a <code>&lt;a href="#" class="question"&gt;</code>, all of the <code>&lt;div class="answer"&gt;</code>'s are displayed.</p> <p>How can I make it so that only one .answer for it's parent .question is displayed when clicked?</p> <p>Here is my HTML:</p> <pre><code>&lt;li class="question"&gt;&lt;a href="#"&gt;Question 1&lt;/a&gt; &lt;div class="answer"&gt;&lt;p&gt;This is answer for question 1&lt;/p&gt;&lt;/div&gt;&lt;/li&gt; &lt;li class="question"&gt;&lt;a href="#"&gt;Question 2&lt;/a&gt; &lt;div class="answer"&gt;&lt;p&gt;This is answer for question 2&lt;/p&gt;&lt;/div&gt;&lt;/li&gt; </code></pre> <p>Here is my jquery:</p> <pre><code>&lt;script&gt; jQuery(document).ready(function ($) { $('div.answer').hide(); $('li.question').click(function() { $('div.answer').slideDown('fast'); return false; }); }); &lt;/script&gt; </code></pre> <p>and the site is: <a href="http://topactioninvestments.com/faq/" rel="nofollow">http://topactioninvestments.com/faq/</a></p> <p>Thanks!</p>
javascript jquery
[3, 5]
969,927
969,928
alternative to onbeforeunload
<p>I want to update database when user leave the site. I am using php for my site. I am using javascript function onbeforeunload and call php through ajax to update database. </p> <p>Now the problem is that the function onbeforeunload is not supported by Opera and Safari, and so the entry should be deleted from database is still over their and affect my database and site.</p> <p>Any idea or suggestion what i can do?</p>
php javascript
[2, 3]
4,907,871
4,907,872
Convert php to java/android arrays
<pre><code>$tagArray = array( "apples" =&gt; 12, "oranges" =&gt; 38, "pears" =&gt; 10, "mangos" =&gt; 24, "grapes" =&gt; 18, "bananas" =&gt; 56, "watermelons" =&gt; 80, "lemons" =&gt; 12, "limes" =&gt; 12, "pineapples" =&gt; 15, "strawberries" =&gt; 20, "coconuts" =&gt; 43, "cherries" =&gt; 20, "raspberries" =&gt; 8, "peaches" =&gt; 25 ); </code></pre> <p>How I can do this in Java, and how to calling for the first and second params?</p>
java php
[1, 2]
4,080,702
4,080,703
calling a Asp.net web API from c# with multiple of parameters
<p>I have a web api that has parameters. I am trying to call the api from another application. This is not a problem on the client side using, but i cannot find a way to do it on the server side in c#. Thanks for any advice.</p>
c# asp.net
[0, 9]
5,605,989
5,605,990
How to retrieve rowId from javascript postBack
<p>Hi I bound in my gridview, <code>OnRowCreated</code> event to each row following javascript code</p> <pre><code>e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.GridViewCategory, "Select$" + e.Row.RowIndex); </code></pre> <p>And now my question is how can I retrieve this <code>rowIndex</code> in postback?</p>
c# asp.net
[0, 9]
5,718,059
5,718,060
C# - asp.net - Couple questions on this coding
<p>1) It loads extremely slow, takes over 20 seconds, but it does load the DataBase. Is that normal?</p> <p>2) I put the hello and bye response to test if it connected well. It writes hello and bye numerous of times like hellohellohellohello...byebyebyebye... is this normal? I was thinking this has something to do with question 3.</p> <p>3) When I comment out the catch(exception) I get an error saying InvalidOperationException "timeout expired." I think catch was good for catching those occasional errors, not the same error over and over. I think that means something is wrong?</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { SqlConnection Conn = new SqlConnection("Data Source=aserver;Initial Catalog=KennyCust;Persist Security Info=True;user id=sa;pwd=qwerty01"); SqlDataReader rdr = null; string commandString = "SELECT * FROM MainDB"; string commandString2 = "SELECT * From DetailDB"; try { Conn.Open(); SqlCommand Cmd = new SqlCommand(commandString, Conn); SqlDataAdapter sdp = new SqlDataAdapter(Cmd); DataSet ds = new DataSet(); if (Conn != null) { Response.Write("Hello"); } ds.Clear(); sdp.Fill(ds); MasterCust.DataSource = ds.Tables[0]; MasterCust.DataBind(); } catch (Exception) { } finally { if (rdr != null) { rdr.Close(); } if (Conn != null) { Conn.Close(); if (Conn != null) { Response.Write("Bye"); } } } </code></pre>
c# asp.net
[0, 9]
2,807,175
2,807,176
post data and get back response in asp.net
<p>i am trying to post a data to a website and get the response back from the server. This is the code that i am using:</p> <pre><code> // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create("http://www.indianrail.gov.in/train_Schedule.html"); ((HttpWebRequest)request).UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20100101 Firefox/9.0"; // Set the Method property of the request to POST. request.Method = "POST"; // Create POST data and convert it to a byte array. string postData = lccp_trnname.Text; byte[] byteArray = Encoding.UTF8.GetBytes(postData); // Set the ContentType property of the WebRequest. request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. request.ContentLength = byteArray.Length; // Get the request stream. Stream dataStream = request.GetRequestStream(); // Write the data to the request stream. dataStream.Write(byteArray, 0, byteArray.Length); // Close the Stream object. dataStream.Close(); // Get the response. try { WebResponse response = request.GetResponse(); // Display the status. Response.Write(((HttpWebResponse)response).StatusDescription); // Get the stream containing content returned by the server. dataStream = response.GetResponseStream(); // Open the stream using a StreamReader for easy access. StreamReader reader = new StreamReader(dataStream); // Read the content. string responseFromServer = reader.ReadToEnd(); // Display the content. Response.Write(responseFromServer); // Clean up the streams. reader.Close(); dataStream.Close(); response.Close(); } catch (WebException ee) { Label1.Text = ee.Message; } </code></pre> <p>instead of getting the reply back from the server, i am getting redirected to the same webpage in which i am posting the data. Plz help me if anyone has got any idea as what has gone wrong with my code. i've been trying since long back but all efforts went in vain. So plz help</p>
c# asp.net
[0, 9]
5,761,340
5,761,341
How to set drop down list option up to specific value
<p>If I have valvo that obtain from database, How can I set volvo option status into active(checked) by using JQuery?</p> <pre><code>&lt;select name="car"&gt; &lt;option value="volvo"&gt;Volvo&lt;/option&gt; &lt;option value="saab"&gt;Saab&lt;/option&gt; &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt; &lt;option value="audi"&gt;Audi&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I don't know how to manager control that have same identity. <br/> <code>??? $('input[name="car"]').attr('checked', true);</code></p>
javascript jquery
[3, 5]
4,059,267
4,059,268
Passing variables in a multi-project solution
<p>I am working with a progaram called aspdotnetstorefront. This is a shopping cart program The solution has 7 projects in it</p> <p>There is a file in the web project that is called checkout1.cs that has the checkout1.aspx file</p> <p>The checkout1.aspx file has a field for state. In the solution, there is project called aspdnsfcommons which has a file called Shoppingcart.cs.</p> <p>I have tried everything to take the value of the state textbox from web/check1.aspx and pass it to aspdnsfcommons/shoppingcart.cs</p> <p>Please advice me of the direction I should take.</p>
c# asp.net
[0, 9]
5,853,276
5,853,277
Can I have a raised edge on a layout or component box?
<p>I am writing an Android application and I have a box within a box on my UI. I changed the color of the backgrounds so the user can differentiate them. However, I want to know if I can have a raise edge or different color "edge" of a layout. </p> <pre><code>+_____________+ | _______ | | | | | | | | | | |______| | +_____________+ </code></pre> <p>Imagine that horrible box is the screen, and the outer box has a background of white and the inner box's background is blue. Can I can make the 'edges' a different color and appear raised so the user can see a a better distinction between the boxes? </p>
java android
[1, 4]
1,954,074
1,954,075
jQuery find - What order does it return elements in?
<p>I have been using jQuery's <code>find</code> method and it's been very useful. </p> <p>However, I came across an example where the <code>find</code> seemed to be duplicating things and not returning elements in the order they appeared in the document. (I'm not sure if find is supposed to do this - I doubt it). </p> <p>However, it shouldn't have duplicates in the elements it finds and show the wrong order, surely?</p> <p>Full example can be found here: <a href="http://jsfiddle.net/EMzDn/3" rel="nofollow"><strong>jsFiddle</strong></a> - Notice how span[9] and span[10] are in the wrong order and duplicated.</p> <p>Why is this the case?</p> <h2>Update</h2> <p>Updated so that output is written to document, please use new link above.</p>
javascript jquery
[3, 5]
3,526,813
3,526,814
Cons of external JavaScript file over inline JavaScript
<p>What are some of the disadvantages of using an external JS file over including the JS as a part of the ASPX page?</p> <p>I need to make an architectural decision and heard from coworkers that external JS does not play nice sometimes.</p>
asp.net javascript
[9, 3]
5,845,140
5,845,141
How to control RIL daemon?
<p>I'm trying to write an application which will be able to show you <code>available network operators</code> and <code>select</code> one you choose. I don't want to send user to <code>network settings</code> from <code>my app</code>. I want to do that in my application. At the moment I'm able to <code>import com.android.internal.telephony.gsm</code> package but I don't know which classes to use or how. Can someone help me? Thanks.</p>
java android
[1, 4]
995,491
995,492
how to get users from SharePoint user profile db using jquery
<p>I just want to know, is there any way to get a SharePoint user using javascript / jquery from default SharePoint 2010 user profile db?</p> <p>My requirement is to form an array of all SharePoint site users (user name) and use this array in a java function (that run behind the page at client side ) as a data source for a SPServices function.</p> <p>Please provide any fisible solution or any other approach for building the array for javascript.</p>
javascript jquery
[3, 5]
2,470,618
2,470,619
Drop down list issue
<p><strong>Html</strong></p> <pre><code> &lt;a id="btn" class="btn" href="#."&gt;&lt;/a&gt; &lt;div id="main-dropdown" class="hide"&gt; &lt;ul id="dropdown"&gt; &lt;li&gt;&lt;a href="/"&gt;Back &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/foo"&gt;Foo &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/bar"&gt;Bar &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/baz"&gt;Baz &lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/no"&gt;No Bar &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>Jquery</strong></p> <pre><code>$(".btn").click(function(e) { e.preventDefault(); $("#main-dropdown").removeClass('hide'); $("#main-dropdown").addClass('show'); return false; }); $("#dropdown").mouseup(function() { return false }); $(document).mouseup(function(e) { if($('#main-dropdown').hasClass('show')) { $("#main-dropdown").removeClass('show'); $("#main-dropdown").addClass('hide'); return false; } $("#main-dropdown").removeClass("show"); $("#main-dropdown").addClass("hide"); }); </code></pre> <p>Problem: When I click on the href (id = btn) a drop down comes but when I again click on that button is should hide which is not happening. Where i am doing wrong.</p>
javascript jquery
[3, 5]
5,334,271
5,334,272
Displaying Progress Bar in a Multi-Branch Wizard
<p>I am creating a wizard. One of the requirements is to display where the user is in the workflow (ie: Step 1 of 5). My problem is at any point the steps remaining could change depending on what the user answers. Let me highlight with an example.</p> <p>Q1: What is your name?</p> <p>Q2: What is your age? </p> <pre><code>(a) 0-18 =&gt; User selects a, there are 3 questions remaining (b) 19-65 =&gt; User selects b, there are 4 questions remaining. (c) 65+ =&gt; User select c, there is 1 question remaining. </code></pre> <p>So in Q1, there is no way to know which answer the user is going to pick in Q2. What would I display to the user in Q1? Has anyone encountered this before? If so I would love to hear your opinion. Please keep in mind that the example is simplified and I have many branches in my workflow. Thanks!</p>
c# asp.net
[0, 9]
4,394,189
4,394,190
browser compatibility
<p>How can i check which fuctions of javascript the browser support which i am using.It can be any browser. Thank you in advance.</p>
javascript jquery
[3, 5]
4,092,753
4,092,754
how to dynamically assign numbers to several ids?
<p>This seem like long way of doing things, is it possible to dynamically assign numbers to ids?</p> <pre><code> $(function () { $('#Button1').click(function(){ $('#RegularExpressionValidator1, #RegularExpressionValidator2, #RequiredFieldValidator1, #RequiredFieldValidator2, #RequiredFieldValidator3, #RequiredFieldValidator4, #RequiredFieldValidator5, #RequiredFieldValidator6, #RequiredFieldValidator7, #RequiredFieldValidator8, #RequiredFieldValidator9').css("display", "block"); }); }); </code></pre> <p>These are .NET generated ids which I don't have access to.</p>
javascript jquery
[3, 5]
6,021,966
6,021,967
Int values get automatically converted into float values on Binding the text values in gridview
<p>I am getting int values from the stored procedure. But when i bind this datasource with the gridview i am seeing the values being converted into float. i am using <strong>Text='&lt;% # Bind("Quantity") %'</strong> <br/> I wanna that to be displayed as int, with out zero's eg: let the value be 233, when i bind that its getting displayed as 233.00</p>
c# asp.net
[0, 9]
829,106
829,107
How can I write below programming in jquery
<pre><code>function abc(a,b,c) { alert('a :'+a+' b:'+ b); xyz(c); } function xyz(c) { alert('c :' + c); } &lt;a href="javascript:abc(1,2,3)" &gt;click here to check value of abc &lt;/a&gt; </code></pre>
javascript jquery
[3, 5]
5,316,613
5,316,614
Can I remove inline event handlers using jQuery?
<p>I have some HTML with an <code>onclick</code> attribute. I want to override that attribute using jQuery. Is there any way to remove the click handler using jQuery? Using <a href="http://jsfiddle.net/qu5zZ/1/" rel="nofollow">unbind doesn't work</a>.</p>
javascript jquery
[3, 5]
4,403,451
4,403,452
Jquery and SQL data table
<p>Learning Jquery here and I would like to show my SQL table on my webpage. I have the "shell" of my jquery that matches the SQL table and my web.config is setup correctly but my jquery doesnt load data. Where it says <code>url: 'ConnectionString',</code> I would like for it to point to my table or the web.config file. What can I do here. I need some guidance as this is something Im learning. </p> <p>Thanks</p> <pre><code>&lt;script type='text/javascript'&gt; $(function () { $("#list").jqGrid({ url: 'Default.aspx', datatype: 'xml', mtype: 'GET', colNames: ['Inv No', 'Date', 'Amount', 'Tax', 'Total', 'Notes'], colModel: [ { name: 'ID', index: 'ID', width: 55 }, { name: 'Date', index: 'Date', width: 90 }, { name: 'amount', index: 'amount', width: 80, align: 'right' }, { name: 'tax', index: 'tax', width: 80, align: 'right' }, { name: 'total', index: 'total', width: 80, align: 'right' }, { name: 'note', index: 'note', width: 150, sortable: false } ], pager: '#pager', rowNum: 10, rowList: [10, 20, 30], sortname: 'invid', sortorder: 'desc', viewrecords: true, caption: 'Joshs first grid' }); }); &lt;/script&gt; </code></pre> <p>My Aspx part as follows</p> <pre><code>&lt;div class="ui-widget"&gt; &lt;table id="list"&gt;&lt;/table&gt; &lt;div id="pager"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre>
jquery asp.net
[5, 9]
248,956
248,957
How to create simple javascript/jquery client side captcha?
<p>How to create simple javascript/jquery client side captcha? </p>
javascript jquery
[3, 5]
2,916,899
2,916,900
Is using ObjectDataSource a good practice?
<p>In my company few of the employees are using ObjectDataSource. Example snippet is :</p> <pre><code>&lt;asp:ObjectDataSource ID="odsRequirement" runat="server" EnablePaging="True" MaximumRowsParameterName="intMaxRows" SelectMethod="GetAll" StartRowIndexParameterName="intRowIndex" TypeName="MyNamespace.MyType" SortParameterName="SortString" OnSelecting="odsRequirement_Selecting" SelectCountMethod="GetAllCount"&gt; &lt;SelectParameters&gt; &lt;asp:Parameter Name="A" DefaultValue="null" /&gt; &lt;asp:Parameter Name="B" DefaultValue="null" /&gt; &lt;asp:Parameter Name="C" /&gt; &lt;asp:Parameter Name="D" /&gt; &lt;asp:Parameter Name="E" /&gt; &lt;/SelectParameters&gt; &lt;/asp:ObjectDataSource&gt; </code></pre> <p>Will the SelectCountMethod <strong>GetAllCount</strong> be always fired after the SelectMethod <strong>GetAll</strong>? And is there a better way we should be doing this?</p> <p>Thanks in advance:)</p>
c# asp.net
[0, 9]
1,905,171
1,905,172
jquery update page when db update
<p>I've a page that show data inserted in a mysql db; I'd like (if it is possible) that this view page automatically update when a record is added to the db (data are not inserted from the same page or may be inserted from another user).</p> <p>thanks in advance ciao h.</p>
php jquery
[2, 5]
4,758,246
4,758,247
Unable to Access the Dynamic control
<p>I have created Views for Multiview dynamically . In the view control I have a Gridview control which has a checkbox control. I have a button in the main aspx page on click of which it will check(if checked or not) for all the checkbox and fetch the corresponding row from the gridview. The view is for tabbed menu. In each tab the the gridview populates the data in the runtime. Have defined the dynamic control in Page_PreInit. I'm not able to access the checkbox . How would I achieve this .</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,199,413
4,199,414
loading image before switching div background in jquery
<p>I have a web page where I want to switch the background image of a div in response to user interaction. What I have so far is:</p> <pre><code>function updateImg() { imgurl=buildImgURL(); // constructs a URL based on various form values $('#mainImage').css("background-image", "url("+imgurl+")"); } </code></pre> <p>This works exactly like I want it to except for one thing. Due to a combination of relatively large background images and a relatively slow server (neither of which can easily be fixed) it takes a while for the image to load. So when the updateImg() function is called the div goes white for half a second or so before the new background image is loaded. What I want is for the old background image to remain until the new image is finished loading and then to switch instantly. Is this possible to do?</p> <p>The background image is generated on the fly by the server so any sort of client side caching or preloading isn't possible.</p>
javascript jquery
[3, 5]
2,220,612
2,220,613
File upload and delete
<p>I'm trying to upload a file, and have the name of the uploaded file displayed along with a "remove" link to remove the uploaded file (in order to uploaded another one). <a href="http://jsfiddle.net/kTNuB/2/" rel="nofollow">Here</a> is what I've got so far. Everything works fine except that when I remove the uploaded file, and try to upload another one by clicking on "Choose file" button, the same file name pops up. How can I remove the file name from the memory (I guess), so button works like new, and also no file gets sent when the form is submitted WITHOUT the file name, but if the uploaded file ISN'T DELETED, it should be available for submit. Many thanks for your help in advance.</p>
javascript jquery
[3, 5]
3,221,867
3,221,868
Call a jQuery function with input data that comes from a PHP script
<p>I have this function <a href="http://jsfiddle.net/wnFsE/" rel="nofollow">http://jsfiddle.net/wnFsE/</a> . As you can see every time the user writes a languages on the textfield and then hits the button <em>add</em> a new language is added to the list. Then when the user hits save, all the info is sent with <strong>POST</strong>.</p> <p>Until now, everything is ok. BUT, when the user sends the info, the info is stored on my MySQL database. So, every time when the user comes again to the page, he needs to see the languages already saved in the last session.</p> <p>In my PHP script every time the user comes, I retrieve the languages from my database, but I don't know how to add them to the list. The solution would be call the <code>$("#add").click(function() {</code> from the PHP script who retrieve the data from the MySQL, but I don't know how to do this.</p> <p>If it serves for any help, this is the simple PHP function which retrieves the languages from the user:</p> <pre><code>function list_lang() { $this-&gt;DBLogin(); $result = mysql_query("SELECT * FROM ".table_lang." WHERE id_user=1"); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $row['lang']." ".$row['level']."&lt;br&gt;"; //instead of the echo, here will be the call to jquery (if possible) } } </code></pre>
php jquery
[2, 5]
235,323
235,324
How to renable document.write after jQuery ajax has completed
<p>I have to grab a snippet of JS that has document.write in it - this causes the page to go blank once the document.write renders. I was able to work around this by redefining document.write and pass the response of the script to a function that I use to output the response from the getScript() jQuery function. I am having an issue however with other elements and scripts that load later in the page that my redefining is preventing to output on the page. How can I set document.write back to the default functionality after the jQuery getScript() has completed?</p> <pre><code>$.getScript('somescript.com/script/', function(){ //Prevent document.write normal behavior document.write = function(markup) { fullMarkup += markup; appendResponse(markup); } } }); </code></pre>
javascript jquery
[3, 5]
1,159,419
1,159,420
How to detect the key code while keyboard key pressed by using java script
<p>I am developing a website, in order to do some security measures, i need to detect some key-code while key board key is pressed.Any one please help me to solve this problem by using java script or any other method...</p> <p>Thanks in advance..</p>
c# javascript asp.net
[0, 3, 9]
3,429,281
3,429,282
JavaScript alert boxes combined with PHP
<pre><code>echo "&lt;td&gt;&lt;a href='delete.php?id=$row[id]&amp;&amp;category=$a' onclick='return confirm(\'are you sure you wish to delete this record\');'&gt;delete&lt;/a&gt;&lt;/td&gt;"; </code></pre> <p>Above is the code I am trying to use. Every time it does nothing and I cannot see how I can use 'proper' JavaScript methods. What is the reason?</p>
php javascript
[2, 3]
2,828,582
2,828,583
JQuery - add value to the hidden input
<p>How can add value to the hidden input filed? In this case input is being created as variable, and latter on inserted into the DOM if needed. The code:</p> <pre><code>&lt;script&gt; var forma = $('form#mali_oglas'), pomoc = $('div[role=pomoc]'), div = $('.mali_oglas_pomoc'), input = forma.find('input, textarea'), code = forma.find('#code') time_input = '&lt;input type="hidden" name="time" /&gt;', paid_input = '&lt;input type="hidden" name="paid" value="1" /&gt;'; $('textarea').autosize(); input.on('click', function(e){ var name = $(':input:focus').attr("name"); pomoc.fadeOut('slow').promise().done( function(){ div.find("[data-pomoc='" + name + "']").fadeIn('slow'); }); }); code.on('focusout', function(){ var url = '&lt;?php echo base_url() ?&gt;global_info/gi_get_payment_code', kod = $(this).val(); if ($('input[name=paid]').length != 1) { $.post(url, {code : kod}, function(data){ console.log(kod); $('.mali_oglas_img_paid').slideDown('slow'); code.next('.mali_oglas_greska').remove(); code.after(time_input.val(data) + paid_input) .css({'border' : '1px solid rgba(34,139,34,.5)'}); }); }; }); code.ajaxError(function() { $(this).next('.mali_oglas_greska').remove(); $(this).after('&lt;p class=mali_oglas_greska&gt;Uneti kod je pogresan.&lt;/p&gt;').css({'border' : '1px solid rgba(255,0,0,.5)'}); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,865
3,866
Services used to store user info and photo
<p>So recently i am building an app that will use some social functions such as users making friend request, and having a profile photo. The user will be able to create a profile and i need a service to use that will store the information of each unique user, and there photo. I am not sure how i will manage the users sending friend request just yet, or better yet how i will manage a specific users friends. Hmm...</p> <p>Right now i am looking a service that will allow me to do this? I dont have a infrastructure of my own so it would be nice to find a service to use. I have heard of windows azure, Amazons web services such as simpleDB and DynamoDB. Has anyone had experience with building an app like this?</p> <p>If so what is the best practices, and service to use?</p>
java android
[1, 4]
2,167,228
2,167,229
When does function order matter?
<p>I understand that JS does a pre-compilation of functions before it executes code. So function order does not matter. But, function order somehow becomes a problem when linking *.js files.</p> <p>For example,</p> <pre><code>&lt;script src="@Url.Content("~/Scripts/Personal/MyJScript.js")" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { hello(); afterCall(); hello2(); //fails, defined in MyJScript2.js }); function afterCall() { alert('inline function defined after call'); } &lt;/script&gt; &lt;script src="@Url.Content("~/Scripts/Personal/MyJScript2.js")" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>In the code above, the function <code>hello2()</code> is defined in a file that is linked after the call is defined. The call fails. So, intuitively I assume now function order <em>does</em> matter in this case. </p> <p>Considering I perform <code>$(document).ready</code>, the document should be as ready as it gets. So, why does this happen?</p> <p><hr /> As requested, here is the client side HTML</p> <pre><code>&lt;body&gt; &lt;script src="/Scripts/Personal/MyJScript.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { hello(); afterCall(); hello2(); //fails }); function afterCall() { alert('inline function defined after call'); } &lt;/script&gt; &lt;script src="/Scripts/Personal/MyJScript2.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/body&gt; </code></pre>
javascript jquery
[3, 5]
3,726,984
3,726,985
Giving html list elements that only contain a specified text a background color using Jquery
<p>I have the following html script:</p> <pre><code>&lt;ul&gt; &lt;li class="container"&gt; &lt;div class="age"&gt;24&lt;/div&gt; &lt;div class="married"&gt;no&lt;/div&gt; &lt;/li&gt; &lt;li class="container"&gt; &lt;div class="age"&gt;27&lt;/div&gt; &lt;div class="married"&gt;yes&lt;/div&gt; &lt;/li&gt; &lt;li class="container"&gt; &lt;div class="age"&gt;56&lt;/div&gt; &lt;div class="married"&gt;&lt;!--empty--&gt;&lt;/div&gt; &lt;/li&gt; &lt;li class="container"&gt; &lt;div class="age"&gt;34&lt;/div&gt; &lt;div class="married"&gt;no&lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I would like that only the <code>li</code> elements that contain a <code>no</code> in their <code>div.married</code> get a green background using Jquery.</p> <p>I don't understand why <a href="http://jsbin.com/urodit/144/edit" rel="nofollow">this code</a> does not work. How do I get the intended result?</p>
javascript jquery
[3, 5]
1,135,816
1,135,817
Jquery | Function inside same function. It bad practice?
<p>I am using this function for easiness, as I am going to use fadeTo a lot:</p> <pre><code>function fade_to(div, speed, opacity, after_fade) { $(div).fadeTo(speed, opacity, after_fade); } </code></pre> <p>Then I am calling the same function for after_fade parameter:</p> <pre><code>fade_to('#div', 3000, 1, function() { fade_to('#another_div', 3000, 1)}); </code></pre> <p>Is that a bad thing to do? Will I have speed/smoothness issues? Is it better to just use jQuery's default fadeTo function?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
3,968,551
3,968,552
Where is file after create in android, where it is?
<p>I create a file in android emulator, after that I try it on phone but I don't have the same dir. Where can I find my file on PHONE?</p> <pre><code>public void costam (String text) { try { FileOutputStream fOut = context.openFileOutput("samplefile.txt", context.MODE_WORLD_READABLE); OutputStreamWriter osw = new OutputStreamWriter(fOut); osw.write(text); osw.flush(); osw.close(); }catch(Exception e){ } } </code></pre>
java android
[1, 4]
5,900,411
5,900,412
jQuery: How to handle submit callback with upload control in dialog?
<p>In a modal jQuery dialog I have form with inputs among them I have upload control. Due above thing form is marked by enctype = "multipart/form-data". Form action refers to controller action that will return partial view that should be placed on a page on callback handling.</p> <p>To handle submit callback was trying by following (using plugin and simply posting):</p> <pre><code> var event = jQuery.Event("submit"); e.preventDefault(); $("form:first").trigger(event); $(this).ajaxSubmit(options); OR SUCH: $.ajax({ url: '/Controller/Action', type: 'POST', success: function (data) { $("#divContainer").html(data); } }); </code></pre> <p>But these ways are not successfull. No it works like following, without callback handling. </p> <pre><code> var event = jQuery.Event("submit"); $("form:first").trigger(event); </code></pre> <p>So, how submit callback can be handled?</p> <p>Thanks.</p> <p><strong>MY IS SOLUTION</strong></p> <pre><code> var options = { target: '#targetDiv' }; $('#form').ajaxSubmit(options); </code></pre>
javascript jquery
[3, 5]
2,436,228
2,436,229
Facing Issue in my Image Gallery
<p>I am creating a thumbnail gallery with images and videos. I am having a thumbnail gallery and when I click on any of the thumbnails, then that particular thumbnail should pop out and then display whatever was in it.</p> <p>Every thing is working fine but I added an extra new div for video part its not working fine, If I remove that added div then its working fine.</p> <p>But something is missing in my functionality.</p> <p>Here it is what I have tried.</p> <p><a href="http://jsfiddle.net/T657N/8/" rel="nofollow">http://jsfiddle.net/T657N/8/</a></p> <p>I need some Help.</p>
javascript jquery
[3, 5]
40,763
40,764
How to trigger an alert in Javascript from PHP
<p>PHP newbie here...</p> <p>I am trying to trigger an alert in JavaScript from PHP, but it doesn't seem to work. :</p> <pre><code>if(isset($_POST['save-text'])){ // get form data, making sure it is valid $submit_date = date('Y-m-d H:i:s'); $content = mysql_real_escape_string(htmlspecialchars($_POST['editor'])); $new_url = 'example.com/' . $key; echo "&lt;script&gt;alert('$new_url');&lt;/script&gt;"; // build query mysql_query("INSERT INTO `source`(`id`, `key`, `submit_date`, `ip`, `content`) VALUES (null, '$key','$submit_date','$ip','$content')") or die(mysql_error()); } </code></pre>
php javascript
[2, 3]
1,747,777
1,747,778
Cross-Page Posting a GridView
<p>I have a problem with Cross-Page Posting a GridView.</p> <p>The error I'm getting is the following: <strong>Object reference not set to an instance of an object.</strong></p> <p>Steps I took:</p> <ol> <li>Create the new Page and add a GridView</li> <li><p>Create a button with PostBack to the new page.</p> <pre><code>&lt;asp:Button ID="Button1" Text="Button 1" PostBackUrl="~/Page2.aspx?button=1" runat="server" /&gt; </code></pre></li> <li><p>Adding code behind to the new Page.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (Page.PreviousPage == null) { Label1.Text = "Vul een planing in."; } else { ContentPlaceHolder pageContent = (ContentPlaceHolder)(Page.PreviousPage.FindControl("Content1")); GridView1.DataSource = pageContent.FindControl("GridView2"); // In this line I'm getting the error } } </code></pre></li> </ol> <p>Looking at the error I forgot a reference. Thnx for the help:)</p>
c# asp.net
[0, 9]
5,893,759
5,893,760
Prevent validation when using __doPostBack
<p>I am using __doPostBack manually in JavaScript, however it is triggering my validation on the server side. When the page refreshes, it has validated the fields on the page and is displaying the errors in the ValidationSummary control.</p> <p>Is there a way to prevent this? </p> <p>I am not calling Page.Validate() on the server.</p>
javascript asp.net
[3, 9]
1,060,092
1,060,093
Log into website and retrieve data
<p>I wanted to make a C++ or Java program that logged me into a <a href="https://portal.bvsd.org/campus/portal/boulder.jsp" rel="nofollow">website</a> and retrieved data (or, more specifically, my grades). The grades are in an HTML tag, but they are also being retrieved from a database (obviously). I don't care how they are achieved, but I don't want the user to need to have a web browser open.</p>
java c++
[1, 6]
175,307
175,308
How to get label control value from gridview templatefield
<p>I have a gridview and sqldatasource.</p> <p>I have a templatefield column and below the textbox of edit item template I have a simple label .</p> <p>Is there any way of getting the label value in ROW UPDATING event?</p> <p>I've tried : <code>String llbl = ((Label)row.Cells[6].FindControl("label1")).Text;</code> Hmm I think it shouldnt be <code>cells[6]</code> since I want to get the label .</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,306,710
2,306,711
How to connect servlet
<p>I am doing client server process. I dont know how to connect with Servlet . In servlet i have JDBC that collects data from oracle. I want to connect servlet and to show all the details from oracle database in android. </p>
java android
[1, 4]
3,714,652
3,714,653
dropdownlist auto post back errors
<p>there are some item in my database,on page load, my dropdownlist will load all the item from db, what i want to achieve is whenever user selected any item from dropdownlist, there are some output will be display</p> <p><strong>item inside my db</strong></p> <p>a</p> <p>b</p> <p>c</p> <p>once i set dropdownlist auto post back =true (it can achieve one of my requirement, once there are item selected, some output display, but there are problems for data load)</p> <p><strong>output in dropdownlist</strong></p> <p>a</p> <p>b</p> <p>c</p> <p>a</p> <p>b</p> <p>c</p> <p>a</p> <p>b</p> <p>c</p> <p>it will repeated for 3 time</p> <p>once i set autopostback =false (data load no problem,but cant display my output)</p> <p>below is the code for my dropdownlist</p> <pre><code>while (dtrLoad.Read()) { ddlCourse.Items.Add(dtrLoad["subject"].ToString()); if(ddlCourse.SelectedItem.Text=="Please Select"){ p1.InnerHtml = "Welcome"; }else if(ddlCourse.SelectedItem.Text==dtrLoad["subject"].ToString()){ p1.InnerHtml=dtrLoad["subjectIntroduction"].ToString(); }else{ } } </code></pre>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,596,241
1,596,242
Is programming for Android completely different fron programming for iPhone?
<p>I have made apps for the iPhone, but want to also code for the Android but want to know if it is first worth my time, second worth my having to learn another language, and third worth the effort in the sense that am I going to make a profit from this. Also if in any way Android code is similar, then will it be hard to bring the iPhone (Xcode) files, or copy and paste my iPhone code into the Android code.</p>
iphone android
[8, 4]
1,911,584
1,911,585
How to package apk with external library to android mobile
<p>I have added the external library using eclipse. Everything is fine in the emulator. However, when I tried to install the apk file in real android mobile, it cannot be installed. Actually, I followed this steps to add external library.</p> <p><a href="http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary" rel="nofollow">http://developer.android.com/guide/appendix/faq/commontasks.html#addexternallibrary</a></p> <p>Hope someone can help. Thank You.</p>
java android
[1, 4]
4,222,983
4,222,984
opening a new page?
<p>in my web application I have a button when I click I want to open a new page, the page should width 220, height 300 like this please help me thank you.</p>
c# asp.net
[0, 9]
3,837,648
3,837,649
asp.net unable to locate a resource file
<p>Im attempting to utilize some custom script and css files within an asp page. In Visual Studio 2010 I am not getting any warnings or errors as to the status of these files, but when I attempt to run the page, and I open the javascript console I get the error: </p> <pre><code>Failed to load resource: the server responded with a status of 404 (Not Found) </code></pre> <p>Here's how I am attempting to load the files in my ascx file:</p> <pre><code>&lt;script type="text/javascript" src="scripts/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="scripts/jquery.scripts.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="scripts/jquery.alerts.js"&gt;&lt;/script&gt; &lt;link href="styles/jquery.alerts.css" rel="stylesheet"/&gt; </code></pre> <p>Anyone know whats going on here, why the browser can't locate the files but visual studio can?</p>
javascript asp.net
[3, 9]
5,366,053
5,366,054
Jquery append to (dynamic by id)
<p>Lets say i have function with id paremeter and two select box</p> <pre><code>&lt;select id="one" onchange="Fill(2)"&gt;&lt;/select&gt; &lt;select id="two" onchange="Fill(3)"&gt;&lt;/select&gt; &lt;select id="three"&gt;&lt;/select&gt; </code></pre> <p>My function</p> <pre><code>function Fill(id){ //some manupulation $('&lt;option/&gt;').val(substr[0]).html(substr[1]).appendTo('#two'); } </code></pre> <p>But instead of doing many </p> <pre><code>if(id==2) {$('&lt;option/&gt;').val(substr[0]).html(substr[1]).appendTo('#two');} if(id==3) {$('&lt;option/&gt;').val(substr[0]).html(substr[1]).appendTo('#three');} </code></pre> <p>i want something like</p> <pre><code>$('&lt;option/&gt;').val(substr[0]).html(substr[1]).appendTo(DYNAMIC); </code></pre>
javascript jquery
[3, 5]
2,022,022
2,022,023
Jquery help repeated ajax call
<p>When I submit my form, a repeated ajax call is made it never stop.</p> <p>Here is my Jquery for the ajax call on form submit:</p> <pre><code>$('form#formgo').submit(function(e) { e.preventDefault(); $('#comparecontent').empty().html( '&lt;p style="text-align:center;"&gt;' + '&lt;img src="../images/ajax.gif" /&gt;&lt;/p&gt;'); var form = $(this).closest('form'); $.ajax({ type: form.attr('method'), url: form.attr('action'), data: form.serialize(), success: function(msg){ $('#comparecontent').html(msg); } }); return false; }); </code></pre>
javascript jquery
[3, 5]
147,447
147,448
content not showing when clicking nav
<p>I'm trying to figure out why my jquery isn't working correctly. I click on my navbar link and the content space shows for .0923202 of a second and goes back to be hidden. Thank you.</p> <pre><code>$(document).ready(function() { $(".content").hide(); $("a").click(function() { $(".content").show(); }); }); </code></pre> <p><a href="http://jsfiddle.net/NHgpg/" rel="nofollow">http://jsfiddle.net/NHgpg/</a></p>
javascript jquery
[3, 5]