Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
2,741,599
2,741,600
How to Retrieve Particular ID Elements within a Web Page using jQuery
<p>Hoping someone can assist as I am unsure how to approach but for the web page that I am on (i.e. in my web app), using jQuery, I would like to be able to add to an array in order of appearance through the web page, all elements where the id matches the string "_AB_Q_"</p> <p>For example, scattered through the web page will be instances of the following:</p> <pre><code>&lt;id="P1_AB_Q_101"&gt;... &lt;id="P1_AB_Q_102"&gt;... &lt;id="P1_AB_Q_103"&gt;... &lt;id="P1_AB_Q_104"&gt;... .. ... .... &lt;id="P1_AB_Q_500"&gt;... </code></pre> <p>As mentioned, I only want to retrieve full id names where the id matches the pattern "_AB_Q_" and then store these in an array for later processing.</p> <p>So using the test data above, I want to only return:</p> <pre><code>P1_AB_Q_101 P1_AB_Q_102 P1_AB_Q_103 P1_AB_Q_104 P1_AB_Q_500 </code></pre> <p>Thanks.</p>
javascript jquery
[3, 5]
5,848,560
5,848,561
Javascript object within object
<p>I'm having a few issues with creating an object within an object, it's syntax related but can't seem to remember how I can achieve this. </p> <pre><code>ajaxRequest = { that: null, request: null, multiRun: null, multiRunTimer: null, defaults={ ext: '', url: '', type: "POST", dataType: "json", payload: null, beforeSend: 'handleBefore', error: 'handleError', complete: 'handleCompletion', pass: false, debug: false, multiRunBlock: false }} </code></pre> <p>I get a syntax error of Uncaught SyntaxError: Unexpected token =</p>
javascript jquery
[3, 5]
2,339,280
2,339,281
Enabling/disabling asp.net checkboxes through javascript
<p>Enabling and disabling checkboxes through javascript for example when I check chk1 and then chk2, chk3 and chk4 will be enabled and if I uncheck chk1 then chk2, chk3 and chk4 will be disabled through javascript?</p> <p>here's my code:</p> <pre><code>&lt;script type="text/javascript"&gt; $('chkTAR').clicked(function(){ { if($('chkTAR :checked').length == 2) $('chkOasis, chkPOT').disabled = true; else $('chkOasis, chkPOT').disabled = false }); &lt;/script&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
2,874,015
2,874,016
Nested linq Select
<p>How, I am trying to bind my 2 of my dropdownlist based on a ProductID and it's available size and available color hence if a user selects say grey, only sizes available for grey will appear and vice versa for the size. I am trying the below linq statement below, apparently it throws a "LINQ to Entities does not recognize the method 'System.String ToString()' method", I am not sure if the linq construction is right either. Can anyone please advice? Thanks.</p> <pre><code>if (!Page.IsPostBack) { using (CommerceEntities db = new CommerceEntities()) { int tempNum; // ----&gt; The ProductId if (Int32.TryParse(litTypeSel.Text, out tempNum)) { if ((ddlColor.SelectedValue == "") &amp;&amp; (ddlSize.SelectedValue == "")) { ddlColor.DataSource = (from p in db.ProductTypes where p.ProductID == tempNum &amp;&amp; (p.Size == (from s in db.ProductTypes select s.Size).ToString()) orderby p.Color select new { p.Color }).Distinct(); ddlColor.DataTextField = "Color"; ddlColor.DataBind(); ddlColor.Items.Insert(0, new ListItem("Select Color", "NA")); ddlSize.DataSource = (from p in db.ProductTypes where p.ProductID == tempNum &amp;&amp; (p.Color == (from c in db.ProductTypes select c.Color).ToString()) orderby p.Size descending select new { p.Size }).Distinct(); ddlSize.DataTextField = "Size"; ddlSize.DataBind(); ddlSize.Items.Insert(0, new ListItem("Select Size", "NA")); } } } } </code></pre>
c# asp.net
[0, 9]
4,378,557
4,378,558
Check the value of multiple element with the same class name
<p>I have 7 dropdown with the class name="dd". and i have 7 textbox with the class name ="tt". each text box corresponds to each dropdown. now, i have to check </p> <pre><code>if(dropdown value is equal to 1) text box can not be empty. </code></pre> <p>so to do this what i am doing:</p> <pre><code>function checkOpenHours() { if ($('.dd').val() == 1 &amp;&amp; $('.tt').val() == "") { alert("Please select an opening hour."); return false; } } </code></pre> <p>and i am calling this function like </p> <pre><code>&lt;asp:Button ID="btnSave" runat="server" Text="Update hour" Height="35px" onclick="btnSave_Click" OnClientClick="return checkOpenHours()"/&gt; </code></pre> <p>BUT The problem is, this only works for the first dropdown and textbox. It does not work for the other 6 dropdown and textbox ..!!</p> <p>what am i doing wrong?? any help?</p>
javascript jquery asp.net
[3, 5, 9]
703,828
703,829
Shorthand way to append multiple dynamic key names to a javascript object
<p>I find myself making (potentially) more work for myself, by having to specify each dynamic key one line at a time.</p> <p>What I am doing now to add additional keys to an existing object:</p> <pre><code>create_request[('title_' + id)] = field_data[0]; create_request[('field_' + id)] = field_data[1]; </code></pre> <p>What I was hoping to be able to do is something like:</p> <pre><code>jQuery.extend({('title_' + id) : field_data[0], ('field_' + id) : field_data[1]}); </code></pre> <p>Is there an easier way than what I am doing now (since what I was hoping would work doesn't)? Or is this just a limitation of the language?</p> <p>Edit for clarity:</p> <p>Okay, so you can create an object in javascript like this:</p> <pre><code>{ a : 1 } </code></pre> <p>But that assumes that a is the string value for the key. What if I wanted the key to be the value of a variable?</p> <p>I could do:</p> <pre><code>the_object[variable] = 1 </code></pre> <p>But what if I wanted to do more than one of these dynamic insertions into the object? Is there a convenient way to do that?</p>
javascript jquery
[3, 5]
540,493
540,494
Structuring javascript / jQuery
<p>I work in a lot of ASP.NET webforms projects. Since im not a big fan of postbacks, i tend to write a lot of jquery ajax calls to handle the cilent -> server calls. </p> <p>But keeping most of the logic in script tags / javascript files usually gets messy pretty fast, even though im trying to use a lot of functions and also simulating classes. I should add that 99% of the code is jquery, not "pure" javascript. </p> <p>So i would like to know how you guys deal with this issue. I cant be the only one :-) Thanks in advance</p>
jquery asp.net
[5, 9]
922,219
922,220
In C#, how can I reference a specific product record based on a button that's clicked in a gridview row
<p>I have a page that displays a gridview of products. Inside this table is a column with a hyperlink called "Details." I want to make it so that if the user clicks the details cell for that specific product, a new page will open that gives more information on that product. I'm not sure how I would determine which <code>Product</code> record the details link is in and how I would carry that over to the next page.</p>
c# asp.net
[0, 9]
150,564
150,565
javascript, jQuery: how to save values instead of the references
<p>I'm using the following lines to store the location of an object.</p> <pre><code>var lightboxTop = $('#lightbox').css('top'); var lightboxLeft = $('#lightbox').css('left'); </code></pre> <p>I'm successively moving this object in my element, and I want to restore it previous position with the stored variables.</p> <p>But, I'm afraid javascript is saving the values by reference so I lose the initial positions. Am I correct ? How can I solve this ?</p> <p>thanks</p>
javascript jquery
[3, 5]
4,273,960
4,273,961
How can I extract images from urls which are in a csv file?
<p>i have a csv file which has S.no and Url of the 1500 images : i need to save all the images at a time how can i do it in .net with C# ?</p>
c# asp.net
[0, 9]
4,729,446
4,729,447
Need to save a high score for an Android game
<p>It's quite simple, all I need to do is save a high score (an integer) for the game. I'm assuming the easiest way to do this would be to store it in a text file but I really have no idea how to go about doing this.</p>
java android
[1, 4]
3,026,013
3,026,014
php JQuery ajax implementation
<p>i am trying to use the Jquery ajax function to call a php page to run a query and return xm the only problem is i dont know how to read the Jquery API page</p> <pre><code>http://api.jquery.com/jQuery.ajax/ </code></pre> <p>it gives this example </p> <pre><code>$.ajax({ url: "test.html", context: document.body, success: function(){ $(this).addClass("done"); }}); </code></pre> <p>is there a better example to call a php page to run a sql query and return a json i can encode</p>
php jquery
[2, 5]
4,402,347
4,402,348
What does this error mean "setDataSource: outside path in JNI is ?x@"
<p>Hi I am keep getting this <code>E/MediaPlayer-JNI(14285): setDataSource: outside path in JNI is ?x@</code> in my logcat. What this means?</p>
java android
[1, 4]
4,692,358
4,692,359
How to check if an variable is an class or id(jQuery)
<p>I am building a jQuery plugin and i'm using a variable in it which can be an class or id. I dont want to use the . or # in the variable, so is there an way to check if an variable is a class or id.</p> <p>Coudn't find anything on the web about this.</p> <p>some of the code</p> <pre><code>var defaults = { trigger: '' }; var opt = jQuery.extend(defaults, opt); jQuery(opt.trigger).click(function(){ //run code }); </code></pre>
javascript jquery
[3, 5]
886,856
886,857
Want to Not Show title if HoverOut
<p>I am creating a hover function in jquery that when you hover over an image, it shows its title in div box. suppose all images are together one after another with no space between them, if i start hover from 1st till last of line it shows me title of all. i set the delay of 1 sec</p> <p>heres code</p> <pre><code> $('.media-content img').hover(function(e){ var x = -5; var y = 15; var detail= $(this).attr('alt'); $('&lt;span class="hovercontent"&gt;'+ detail +'&lt;/span&gt;') .delay(800) .css('top', e.pageY + y) .css('left', e.pageX + x) .appendTo('body') .fadeIn('fast'); }, function() { $('.hovercontent').fadeOut(50); }); </code></pre> <p>In this if i hoverout from image then after a second it display. I wanted that if I hoverout immediately then the title of that image won't display. you can say like in operating system when u hover a file it show details if you bypass then it won't. similar i wanted here//</p>
javascript jquery
[3, 5]
4,741,271
4,741,272
right click menu using both key board and mouse
<p>I am looking for some java script right click menu using both key board and mouse.</p> <p>have any one seen a good plug in?</p>
javascript jquery
[3, 5]
3,445,917
3,445,918
How can i differentiate items in list in c#
<p>I have one listitem and i am adding this listitem to a list multiple times with one property difference... i.e listitem have DateOfService property..k... then i am adding first item to list... it's fine and i am changing DateOfService property and adding again... but the previous added item DateOfService also changeing.... how can i overcome this problem...</p> <p><strong>sampleCode</strong></p> <pre><code> if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily)) { for (int day = 0; day &lt; remainedDays; day++) { bills[index].DateOfService = DateTime.Now.Date.AddDays(day).Date; remainedBills.Add(bills[index]); } } </code></pre> <p>Hi i did this also but no use...</p> <pre><code>if (bills[index].FrequencyId == Convert.ToInt32(Frequency.Daily)) { AdmissionEntryVo objAdmissionEntryVo = null; for (int day = 0; day &lt; remainedDays; day++) { objAdmissionEntryVo = new AdmissionEntryVo(); objAdmissionEntryVo = bills[index]; objAdmissionEntryVo.DateOfService = DateTime.Now.Date.AddDays(day).Date; remainedBills.Add(objAdmissionEntryVo); } } </code></pre>
c# asp.net
[0, 9]
5,873,897
5,873,898
JQuery Dialog modal option not working
<p>This is the HTML code:</p> <pre><code>&lt;div id="dialog" title="lala" style="display:none;"&gt; &lt;p&gt;This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.&lt;/p&gt; &lt;/div&gt; </code></pre> <p>This is the JavaScript</p> <pre><code>$bb('#addTopicButton').live('click',function() { $bb( "#dialog" ).dialog({ modal:true, closeOnEscape: false, draggable:false, resizable:false }); }); </code></pre> <p>Why modal is not working? When it is opened I still can click other links on the page and do things in the background.</p> <p>Thanks a lot</p> <p><strong>UPDATE:</strong> It seems to be working though. Only the links are active in the background and working. How can I disable everything, including links? </p>
javascript jquery
[3, 5]
5,817,652
5,817,653
How to get highest row number using query?
<p>I have an sqlitedb, row _id auto increments. How do I form a query to get the highest number in row _id and put that into a variable? I know how to do it in sql but not using the query method.</p>
java android
[1, 4]
3,055,806
3,055,807
How to generate a view id in code?
<p>I need to create some views in code and want to assign an id for the view. How can I generate a view id that is guaranteed to be unique among the rest of the view ids but do this at runtime? </p>
java android
[1, 4]
5,891,955
5,891,956
How to Add Gridviews Dynamically to a page depending on variable count
<p>Good morning.</p> <p><b>Situation:</b> I have department table and in each department I have some parameter types. lets say Dept1 has param1,param2 and Dept2 has param1,param2 and param3</p> <p>This parameters count varies from department to department.</p> <p>I have to design a page for each department in that page we have individual tabs for each parameter. So here what I need is adding a Gridview for each parameter type under each tab.</p> <p>Can any one suggest how to achieve this. Thanks in advance.</p>
c# asp.net
[0, 9]
5,493,281
5,493,282
How to get full file path in form upload field using jQuery?
<p>I need to get the full upload path in a file upload field. I attached a change lister to the upload field, when a file is selected I alert the file path and I get just the file name. Not the full file path as it appears in the form field. For example instead of this:</p> <pre><code>C:\Users\Toshiba\Desktop\me.jpg </code></pre> <p>I get</p> <pre><code>me.jpg </code></pre> <p>the code:</p> <pre><code> $('input[type="file"]').change(function() { var fileLocation = $(this).val(); alert(fileLocation); }); </code></pre> <p>How to get the full file path?</p>
javascript jquery
[3, 5]
3,800,849
3,800,850
Android ACTION_WEB_SEARCH
<p>I am not able to get the ACTION_WEB_SEARCH to work correctly, does this require any permissions on the AndriodManifest.xml?</p> <p>This is my code:</p> <pre><code> String q = edittext.getText().toString(); Intent myIntent = new Intent(Intent.ACTION_WEB_SEARCH, Uri.parse(q)); startActivity(myIntent); </code></pre> <p>Any help would be much appreciated.</p> <p>Platform 2.0.</p>
java android
[1, 4]
4,461,843
4,461,844
Storing methods and functions in an array
<p>I dont know if its posible but can I store methods or functions in an array? I know Multi dimensional array now and use it to store many arrays as i want. What i would like to do now is to store the methods or functions I create in a certain class. Because i want to store all of my functions to a certain class then call it if i want using loop. And to make my coding cleaner and easy to understand. Example:</p> <pre><code>public String[] getDesiredFunction = {getName(),getLastname(),getMiddle()}; for(int i = 0;i&lt;3;i++){ if(i == 1){ getDesiredFunction[i]; } } </code></pre> <p>like that? Is it posible?</p>
java android
[1, 4]
3,448,724
3,448,725
Jquery operation on DOM element with '.' in ID has no effect
<p>e.g. "Live" version here: <a href="http://jsfiddle.net/Ltmbd/5/" rel="nofollow">http://jsfiddle.net/Ltmbd/5/</a></p> <pre> &lt;html> &lt;body> &lt;select id="some.list" > &lt;option value="1" >AAA&lt;/option> &lt;option value="2" >BBB&lt;/option> &lt;/select> &lt;/body> &lt;/html> </pre> <p>and corresponding javascript/jquery:</p> <pre> $(function() { $("select").each(function() { $(this).val("2"); }); }); </pre> <p>This should select "BBB" in the select list (and if you remove the '.' from the ID "some.list", it works as expected). Note that the <a href="http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F" rel="nofollow">jquery FAQ</a> mentions a related but slightly different problem.</p> <p>The obvious answer is "don't put a . in your IDs" - however I'm using scaffolded (generated) grails views, so it would be a lot of work to go against this convention.</p> <p>Using Jquery 1.4.4</p>
javascript jquery
[3, 5]
2,288,927
2,288,928
Cant access class object variable of javascript in IE and Mozilla
<p>I am having a class in javascript , in which i have defined few properties and methods and i have created an array and created and instance values of the class and pushed into it. After that i have iterated the array and checked a property from a particular method, but in IE and mozilla it is showing as undefined. I have given below the code for your details.</p> <p>Class:</p> <pre><code>function DateDetail(date, isBefore, isAfter, isNow) { this.Date = date; this.MonthNo = this.Date.getMonth(); this.DayNo = this.Date.getDate(); this.Year = this.Date.getFullYear(); this.IsAfter = isAfter; this.IsBefore = isBefore; this.IsNow = isNow; this.GetMonthValue = function () { return this.Date.toString("MMM-yyyy"); }; } </code></pre> <p>Method</p> <pre><code>function GetTableDataClass(data) { if (data.IsAfter) return "after"; else if (data.IsBefore) return "before"; else if (data.IsNow) return "now"; else return " "; } </code></pre> <p>Calling method</p> <pre><code>GetTableDataClass(item) </code></pre> <p>I am getting data is undefined in mozilla and IE. Please let me know any suggestions.</p>
javascript jquery
[3, 5]
3,602,195
3,602,196
onclick -> mysql query -> javascript; same page
<p>I need button to begin a mysql query to then insert the results into a javacript code block which is to be displayed on the same page that the button is on. mysql queries come from the values of drop-down menus. </p> <p>Homepage.php contains </p> <pre><code>two drop down menus div id='one' to hold the results javscript code block a button to stimulate the mysql query to be displayed in div id ='one' through Javascript flow of the process is as such 1. user chooses an option from each drop down 2. when ready, the user clicks a button 3. the onclick runs a mysql query with selections from the drop down menu. 4. send the results as array from the mysql query into the javascript code block 5. display the results in div id ='one' </code></pre> <p>all of this needs to happen on the same page!</p> <p>The problem I am having is that as soon as the page is loaded, the javascipt is static. I am unable to push the mysql results into the javascript on the page which I need it to appear on. Having everything on the same page is causing trouble.</p> <p>I'm not looking for the exact code laid out for me, just a correct flow of the process that should be used to accomplish this. Thank you in advance! </p> <p>I've tried </p> <p>using both dropdowns to call the same javascript function which used httprequest. The function was directed towards a php page which did the mysql processing. The results were then return back through the httprequest to the homepage. </p> <p>I've tried to save the entire Javascript code block as a php variable with the mysql results already in it, then returning the variable into the home page through HTTPRequest, thinking I could create dynamic javascript code this way. Nothing has worked</p>
php javascript
[2, 3]
3,502,847
3,502,848
Can you mix ASP.Net and Unobtrusive JavaScript
<p>Is it possible to mix the concept of Unobtrusive JavaScript with the event model of ASP.Net?</p>
javascript asp.net
[3, 9]
3,758,816
3,758,817
How to set a text of label in javascript by using the text of dynamically generated label's?
<pre><code>{ SqlDataReader reader = cmdAuthors.ExecuteReader(); RadioButton rb; Label lb; while(reader.Read()){ rb=new RadioButton(); lb=new Label(); lb.Text=reader[0].ToString(); rb.Attributes.Add("OnClick","getSelectedAuthor('"+lb.Text.ToString()+"')"); PlaceHolder1.Controls.Add(rb); PlaceHolder1.Controls.Add(lb); PlaceHolder1.Controls.Add(new LiteralControl("&lt;br /&gt;")); } } </code></pre> <p>// I dont know what to write in this function in order to Label2.text=Text; // document.getElementById("Label2").value=text does not work</p> <p>function getSelectedAuthor(text) {</p> <p>}</p> <pre><code> &lt;div&gt; &lt;asp:Label ID="Label2" runat="server" Text="" &gt;&lt;/asp:Label&gt; &lt;/div&gt; </code></pre>
javascript asp.net
[3, 9]
2,252,439
2,252,440
Add button after script tag
<p>I have a javascript that I want my users to be able to put on their sites. In this javascript, I want to generate a simple button, that is located exactly where the javascript has been pasted into the site. How can I do this? It would be simple if I could give my <code>&lt;script&gt;</code> tag an id and then just getting the element with the specific ID and appending after it, but I can't.</p> <p>For example if I have something like this:</p> <pre><code>&lt;body&gt; &lt;p&gt;test para&lt;/p&gt; &lt;p&gt;test para&lt;/p&gt;&lt;p&gt;test para&lt;/p&gt;&lt;p&gt;test para&lt;/p&gt; &lt;p&gt;test para&lt;/p&gt; &lt;div&gt;test div&lt;/div&gt; &lt;script src="embed.js" type="text/javascript"&gt;&lt;/script&gt; &lt;div&gt;last div&lt;/div&gt; &lt;/body&gt; </code></pre> <p>I want my button to be placed right between <code>test div</code> and <code>last div</code> (before or after the <code>script</code> tag, it doesn't matter). Can I do this?</p>
javascript jquery
[3, 5]
5,807,514
5,807,515
JQuery Changing form url after submitting form
<p>I have run into a strange problem, I am changing form url after form submission. I have changed form fields and they are changing perfectly but action url is not changing... Here is HTML code..</p> <pre><code>&lt;form action="" method="post" id="payment-form"&gt; &lt;input type="hidden" id="email" name="email" value=""&gt; .... &lt;/form&gt; </code></pre> <h2>JQuery Code</h2> <pre><code>$.ajax({ url: form_url, type: 'post', context:this, data: $("#payment-form").serialize(), dataType: 'json', success: function(data) { if(data.success) { $('#payment_form').attr("action", data.url); $('#email').val(data.email); alert($("#payment-form").attr('action')); //$("#payment-form").submit(); } else { $('#error').html(data.errors).addClass('error').fadeIn("slow").fadeOut(9000); } } }); </code></pre> <p>The alert shows me no url, why is that?</p> <h2>Update</h2> <p>I have setup <code>$('#payment_form').attr("action", data.url);</code> it shows me no url but <code>alert(data.url)</code> shows me url.</p>
javascript jquery
[3, 5]
1,919,383
1,919,384
click row in gridview
<p>hiiiiiiiii I am trying to do the following : I have a gridview and I want to fire a function(C# function) when I click over the row (any where) this my code :</p> <pre><code>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { string alertBox = "alert('"; if (e.Row.RowType == DataControlRowType.DataRow) { alertBox +=e.Row.Cells[0].Text; alertBox += "')"; e.Row.Attributes.Add("onclick", alertBox); } } public void test() { Response.Write("ffff"); } </code></pre> <p>this is working ..and every time I click over the gridview I found an alert ...but I want to fire C# function(like test function in the code) how to do that thanks</p>
c# asp.net
[0, 9]
2,203,382
2,203,383
ASP.Net auto-generated Admin tool
<p>I need to create an administrative site for managing my web site's db. I don't want to build this myself, I simply want the framework in place so that I can add customization myself after it is in place.</p> <p>Django has a great auto-generated admin. What's an equivalent auto-generated admin site built under asp.net?</p>
c# asp.net
[0, 9]
3,723,449
3,723,450
Check and Uncheck Checkbox when Table Row is Clicked
<p>Right now I have my script setup so that when each checkbox inside a table row is checked it performs the functions required (addClass and some others). </p> <p>I would also like the checkboxs to check/uncheck and perform the same functions when the individual table row is clicked.</p> <p><strong>Here is my code for the checkbox functions:</strong></p> <pre><code>$('input[type="checkbox"]').bind('click',function(e) { var $this = $(this); if($this.is(':checked')) { num += 1; $('#delete_btn').fadeIn('fast'); $this.parents('tr').addClass('selected'); select_arr.unshift(this.id); } else { num -= 1; if(num &lt;= 0) { $('#delete_btn').fadeOut('fast'); } $this.parents('tr').removeClass('selected'); select_arr.shift(this.id); } }); </code></pre> <p>What would be the best way to achieve the same result that this code does by just clicking the table row itself rather than the checkbox, but still allowing the checkboxes to function the same.</p> <p><strong>Here is the table:</strong> <img src="http://i.stack.imgur.com/a06y6.gif" alt="enter image description here"></p> <p>Thanks in Advance.</p>
javascript jquery
[3, 5]
5,989,444
5,989,445
how to use try catch blocks in a value returning method?
<p>I am checking the uploaded image in a registration form , where i need to use try catch blocks. here is my code:</p> <pre><code>public bool CheckFileType(string FileName) { string Ext = Path.GetExtension(FileName); switch (Ext.ToLower()) { case ".gif": return true; break; case ".JPEG": return true; break; case ".jpg": return true; break; case ".png": return true; break; case ".bmp": return true; break; default: return false; break; } } </code></pre> <p>please suggest me how to use the try catch blocks here.</p> <p>thanks in advance.</p>
c# asp.net
[0, 9]
3,327,681
3,327,682
JSON to Javascript object literal notation?
<p>The methods of the dynamic Google Graph API want Javascript object literals as their argument, but I only have the data as JSON. What do I do? Is there any way that I could convert my JSON to an object literal?</p> <p>The format they want is here: <a href="http://code.google.com/intl/sv-SE/apis/chart/interactive/docs/reference.html#DataTable" rel="nofollow">http://code.google.com/intl/sv-SE/apis/chart/interactive/docs/reference.html#DataTable</a></p> <p>I PHP, and also jQuery front end. I would appreciate front end or back end solutions. In the back end, I actually have the data in associative arrays so I can do anything with it there.</p>
php javascript jquery
[2, 3, 5]
5,546,598
5,546,599
Multiple click events on one element
<p><a href="http://jsfiddle.net/rHVcX/1/" rel="nofollow">http://jsfiddle.net/rHVcX/1/</a></p> <p>Is it possible to have multiple click events on one elements, when using different selectors?</p> <pre><code>&lt;button id="test" class="testclass"&gt;test&lt;/button&gt; &lt;button id="test2" class="testclass2"&gt;test 2&lt;/button&gt; //only B $('.testclass')[0].click(function(){alert('A');}); $('#test').click(function(){alert('B');}); // A and B $('#test2').click(function(){alert('A2');}); $('#test2').click(function(){alert('B2');}); </code></pre>
javascript jquery
[3, 5]
5,915,927
5,915,928
Javascript - how to set child drop down menu based on parent dropdown menu selection
<p>For example take a look at <a href="http://katz.cd/submit.php" rel="nofollow">http://katz.cd/submit.php</a>. Notice when you select a type, that type is carried through to all the other type dropdown menus.</p> <p>How do I do this?</p>
javascript jquery
[3, 5]
2,096,447
2,096,448
Non-Extended Classes in android
<p>I have a class Scores.java I need to know whats the correct way to create these. I get "The constructor Scores is not defined. Do I have to extend off everything in Android??</p> <pre><code>package com.threeuglymen.android.stuff; import android.app.Application; import android.app.Service; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; import android.preference.PreferenceManager; import android.util.Log; public class Scores { private Context mycontext; public Scores (Context context) { // TODO Auto-generated method stub this.mycontext = context; } public void resetScores(){ try { SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(mycontext); Editor edit = pref.edit(); edit.putInt("correct", 0); edit.putInt("incorrect", 0); edit.commit(); } catch (Exception e) { Log.d("Scores", "Exception:" + e.toString()); } return; } } </code></pre> <p>Thx for any guidance</p> <p>Eric</p>
java android
[1, 4]
1,139,646
1,139,647
Passing PHP variables to non-native JavaScript
<p>Basically, the problem is this: </p> <pre><code>&lt;?php $test="foobar"; ?&gt; </code></pre> <p>If within the html document I call</p> <p><code>&lt;script type="text/javascript"&gt;alert("&lt;?php echo $test; ?&gt;")&lt;/script&gt;</code></p> <p>, everything is fine.</p> <p>However, if I do the same thing in an external jS document included with </p> <pre><code>&lt;script type="text/javascript" src="foo.js"&gt;&lt;/script&gt; </code></pre> <p>it does not work. </p> <p>Is there any way to do this? </p>
php javascript
[2, 3]
4,909,720
4,909,721
JQuery change Image dynamically loaded from aspx in DIV
<p>I have a DIV and loading a Image in that div at runtime from a aspx file as src. </p> <p>I use JQUERY .Post(..) to post the aspx page and get the Image and load that Image in div by following code.</p> <pre><code> function UpdateCapticha() { $.post("../JqueryCapticha.aspx", {}, function (data) { $("div#CapDiv").html(data); }); } </code></pre> <p>I call this function on click of a button and expect a different Image in div as <strong>JqueryCapticha.aspx</strong> is posted everytime. But everytime I get same Image. I think that <strong>JqueryCapticha.aspx</strong> is not getting posted but the Image is comming from cache. </p> <p>Can someone please suggest me that what should i do so <strong>JqueryCapticha.aspx</strong> is posted everytime and a new Image should come.</p> <p>Also i tested <strong>JqueryCapticha.aspx</strong> seperatly on browser and it works fine by providing different image on each post.</p> <p>Thanks in Advance.</p>
jquery asp.net
[5, 9]
3,441,611
3,441,612
How do I convert several web pages into one pdf document?
<pre><code>public FileResult Download() { var doc = new EO.Pdf.PdfDocument(); EO.Pdf.HtmlToPdf.ConvertUrl("http://www.google.com/", doc); var ms = new MemoryStream(); doc.Save(ms); ms.Position = 0; return new FileStreamResult(ms, "application/pdf") { FileDownloadName = "download.pdf" }; } </code></pre> <p>Can you please show if possible, how to extend the code above to be able to convert several web pages into one pdf document?</p> <p>The tricky part is that we don't know what pages a user is likely to attempt to convert.</p> <p>So, hardcoding the webpages as the code above shows isn't helping us.</p> <p>Any help is greatly appreciated.</p> <pre><code>//Create a new PdfDocument object var doc = new EO.Pdf.PdfDocument(); //Convert two ore more different pages into the same PdfDocument EO.Pdf.HtmlToPdf.ConvertUrl("c:\\1.html", doc); EO.Pdf.HtmlToPdf.ConvertUrl("c:\\2.html", doc); </code></pre> <p>Latest code:</p> <pre><code>public FileResult Download() { var doc = new EO.Pdf.PdfDocument(); foreach(var url in passedUrls) { EO.Pdf.HtmlToPdf.ConvertUrl(url, doc); doc.Save(ms); } ms.Position = 0; return new FileStreamResult(ms, "application/pdf") { FileDownloadName = "download.pdf" }; } </code></pre> <p>Latest from Adam (thank you sir)</p> <pre><code>public FileResult Download() { var documents = new List&lt;EO.Pdf.PdfDocument&gt;(); foreach(var url in passedUrls) { var doc = new EO.Pdf.PdfDocument(); EO.Pdf.HtmlToPdf.ConvertUrl(url, doc); documents.Add(doc); } EO.Pdf.PdfDocument mergedDocument = EO.Pdf.PdfDocument.Merge(documents.ToArray()); } </code></pre> <p>Hopefully, others find these codes useful.</p>
c# asp.net
[0, 9]
2,017,114
2,017,115
Javascript multidimensioned isset()
<p>When running:</p> <pre><code>if (data.custaccount.webaddress) { alert('found it'); } </code></pre> <p>I get the error </p> <pre><code>data.custaccount is undefined </code></pre> <p>The only way i can get around it seems to be with multiple IFs like so:</p> <pre><code>if (undefined != data &amp;&amp; undefined != data.custaccount &amp;&amp; undefined != data.custaccount.webaddress) { alert('found it'); } </code></pre> <p>Is there any way i could do this more simply? </p> <p>In php we'd normally use the isset(data.custaccount.webaddress) and that worked quite well. is there an equivalent in javascript (or jquery)?</p> <p>We have used try / catch, but found that to slow down performance of the script considerably.</p> <p>I've seen someone else asking something similar on <a href="http://verens.com/2005/07/25/isset-for-javascript/" rel="nofollow">http://verens.com/2005/07/25/isset-for-javascript/</a> without any success, but am hoping that stackoverflow will do it's normal job of saving the day :)</p> <p>Thanks!!!</p> <p>Justin</p>
javascript jquery
[3, 5]
3,881,373
3,881,374
Get all folders and files in a directory
<p>i have this directory: </p> <p>/mnt/sdcard/App/Downloads/Files/Documents/ as the root directory or folder of my app. the said directory contains other set of folder and files which i need to show the folder, subfolder and files exact paths in the Logcat.</p> <p>how can i do that without needing to click anything in the view, just on launch, the exact paths will show up in the Logcat.</p>
java android
[1, 4]
3,891,441
3,891,442
Frequent Layout activity : @489.28s - Event triggered 348 layouts taking 105ms
<p>hi i am making web application with complex javascript (jQuery) functions for adding and modifying data of clients. Profile of client has 8 modules (means 8 separated javascript files using jQuery library and some plugins, my own jQuery plugin and lot of javascript functions)</p> <p>Problem is very simple. Sometimes rendering of one profile of client spent lot of time for example 489.28 s and sometimes this block of operations in speed tracer spent only 20 ms.</p> <p>can you help me? </p>
javascript jquery
[3, 5]
5,292,586
5,292,587
Media Gallery realisation in php
<p>need to provide an "add from existing" functionality for uploaded images. What is a basic approach to do that? Thought of displaying a modal window but thought that if there will be a lot of images it will definitely pull back the performance. Had anybody a similar task? Thanks.</p>
php jquery
[2, 5]
3,523,692
3,523,693
How to download and display excel spread sheet within the browser
<p>Need to navigate to Excel spread sheet and display in the browser. how could I do that ? </p>
c# asp.net
[0, 9]
4,502,745
4,502,746
Passing javascript parameter from codebehind error
<p>I use this script to call a javascript from codebehind.</p> <pre><code>ClientScript.RegisterStartupScript(this.GetType(), "Exist", "&lt;script language='javascript'&gt;ConfirmRedirect('" + url + "','" + msg + "');&lt;/script&gt;", true); </code></pre> <p>and my javascript code is</p> <pre><code>function ConfirmRedirect(url,msg) { alert(msg); window.location.href = url; } </code></pre> <p>Am getting ')' expected error. What am missing here? If am calling javascript without paramters then it is working.</p>
javascript asp.net
[3, 9]
5,619,817
5,619,818
opacity in jQuery
<p>I want to make the opacity black ( if possible )</p> <p>My jQuery is:</p> <pre><code>jQuery('#list a[rel^="myPhoto"]').my422PortfolioThumbsHover({ defaultOpacity: 1, onMouseOverOpacity: 0.6, speed: 300, zoomImg: 'zoom.png' }); </code></pre> <p>I tried adding:</p> <p>background-color: #000000, into the above code... but doesnt wanna play.</p> <p>Also thought hmm, perhaps I need to wrap the hex color in ' and ' but again zilch ...</p> <p>Then wondered if I am just going MAD lol</p> <p>As it is it whitens opacity on hover to 60% , I need that opacity to be 60% but blackened not whitened.</p>
javascript jquery
[3, 5]
3,323,459
3,323,460
Javascript function returns undefined on firebug
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call-from-a-function">How to return the response from an AJAX call from a function?</a> </p> </blockquote> <p>on my App namespace i've just defined a function:</p> <p>version 1</p> <pre><code>window.App = { isLogged: function () { $.get('/user/isLogged', function (data) { if (data == 'true') { return true; } return false; }); } }; </code></pre> <p>version 2</p> <pre><code>window.App = { isLogged: function () { var test = $.get('/user/isLogged'); console.log(test.responseText); } }; </code></pre> <p>On version 1 when i try the function on firebug 'App.isLogged()' i got a nice undefined :S</p> <p>On version 2 when i try the function on firebug, the responseText seems to be undefined :stuck:</p> <p>I'm pretty new about javascript, and maybe a scope issue...</p> <p>The goal of my function is clear i think, there's a better way to achieve this?</p>
javascript jquery
[3, 5]
2,177,034
2,177,035
Delete from Link Dynamically named form
<p>I want to pass the form name to the function and then confirm they are read to delete it after that I want to change the action then submit the form.</p> <pre><code>function deletePhone(myForm){ var r=confirm('Are you sure you want to delete this phone?'); if(r==true){ $(myForm).attr("action","index.cfm?deleteThis=1"); $(myForm).submit(); } } </code></pre> <p>currentrow is a variable that I am using because I am creating multiple forms and it holds the currentCount for the form.</p> <pre><code> &lt;a href="javascript:deletePhone('EditPhone_form_#currentrow#');"&gt;X Delete Phone&lt;/a&gt; </code></pre> <p><strong>Example:</strong></p> <ul> <li>EditPhone_form_1 </li> <li>EditPhone_form_2 </li> <li>EditPhone_form_3 </li> <li>EditPhone_form_4</li> </ul>
javascript jquery
[3, 5]
3,579,314
3,579,315
android call a timer run function from widget
<p>i have a timer in my widget that runs every 10 minutes, but i need to call the timers run function when I press a button. is any way of doing that?</p> <pre><code>public class MyWidget extends AppWidgetProvider { @Override public void onReceive(Context context, Intent intent) { final String action = intent.getAction(); if (AppWidgetManager.ACTION_APPWIDGET_DELETED.equals(action)) { final int appWidgetId = intent.getExtras().getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); if (appWidgetId != AppWidgetManager.INVALID_APPWIDGET_ID) { this.onDeleted(context, new int[] { appWidgetId }); } } else { // check, if our Action was called if (intent.getAction().equals(ACTION_WIDGET_RECEIVER)) { //call the run function of the timer } super.onReceive(context, intent); } } @Override public void onUpdate( Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds ) { if(tt==0) { Timer timer = new Timer(); timer.scheduleAtFixedRate(new MyTime(context, appWidgetManager), 1000, 600000); tt=1; } } private class MyTime extends TimerTask { public MyTime(Context context, AppWidgetManager appWidgetManager) { } @Override public void run() { } </code></pre> <p>i need to cal that function from onReceive()</p>
java android
[1, 4]
40,292
40,293
change this to jquery
<p>How would I change the below to jquery? It works in IE but not Firefox so I am hoping if I change it to jquery it will work for both.</p> <p>THIS</p> <pre><code>function subform() { if (parent.option_view.document.vform_.dispatchEvent('onsubmit') != false) { parent.option_view.document.vform_.submit(); } } </code></pre> <p>AND THIS</p> <pre><code>img class="save_bttn" src="/images/save.gif" height="16" width="16" border="0" onclick="subform()" </code></pre> <p>IS INSIDE ONE CHILD FRAME</p> <p>and</p> <p>It is trying to init in another child frame that is why its going to parent option_view.</p> <p>*note: I was not trying to scream with the caps I was just trying to show where talking was and where the javascript is</p>
javascript jquery
[3, 5]
2,875,413
2,875,414
Showing a loading image when a function is being called
<p>Im trying to show a loading image whilst a javascript function runs. Its crunching a lot of numbers and on slower pc's it can take a few seconds to run.</p> <p>I thought this would work</p> <pre><code>function myFunction(){; $('#loading').show(); // The bit that takes ages to run $('#loading').hide(); } </code></pre> <p>However it doesn't seam to unhide the #loading div. </p> <p>Is there a better way to do this?</p>
javascript jquery
[3, 5]
3,435,675
3,435,676
How I can passing an array into getView method from GridView?
<p>I do something like this:</p> <pre><code>grid = new GridView(this); imagesPreviewH={1,2,3,4} mAdapter = new HorizontalImageAdapter(this, imagesPreviewH); grid.setAdapter(mAdapter); grid2 = new GridView(this); imagesPreviewH={5,6,7,8} mAdapter = new HorizontalImageAdapter(this, imagesPreviewH); grid2.setAdapter(mAdapter); public View getView(final int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { // if it's not recycled, initialize // imageView = new ImageView(mContext); imageView.setImageDrawable(imagesPreviewH.get(position)); int x = (int) (imagesPreviewH.get(position).getBitmap().getWidth() * 1.6); int y = (int) (imagesPreviewH.get(position).getBitmap().getHeight() * 1.6); imageView.setLayoutParams(new GridView.LayoutParams(x, y)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(40, 20, 0, 1); imageView = (ImageView) convertView; } return imageView; } </code></pre> <p>But into GriView loading only {5,6,7,8}. How to do it two GridViews with {1,2,3,4} and {5,6,7,8} data, but not two GridViews with {5,6,7,8} and {5,6,7,8} data as is now?</p>
java android
[1, 4]
3,894,327
3,894,328
Passing optional arguments into javascript functions from jQuery
<p>I'm trying to pass an optional argument to a javascript function from jQuery. In the below example the function receiving the argument is 'foo'. It works fine with the second bit of jQuery which passes the argument. The first bit of jQuery doesn't have any arguments that I pass in, but jQuery still seems to pass an object. </p> <p>Ultimately I want 'bar' to be an optional parameter, and set to 0 if I don't pass anything in.</p> <pre><code> //jQuery Bit #1 $('#id').change(foo); //jQuery Bit #2 $('#id2').click(function(e){ var bar = $(e.target).text(); foo(bar); }); function foo(bar) { if (!bar) var bar = 0; //do stuff here } </code></pre> <p>Since jQuery is passing in an object should I just pass 'bar' in as an object and check for it as an attribute of the object? Or am I missing something that jQuery does or that I should be doing with jQuery in this situation?</p>
javascript jquery
[3, 5]
1,698,189
1,698,190
Append/prepend not work with load? And some questions
<p>I have two problems with append/prepend on JQuery. My code:</p> <pre><code>function toselect(f,d){ $('#workcont').remove('h2').load('pages/' + f + '.html #' + d).prepend('&lt;h2&gt;Some text&lt;/h2&gt;'); calculate(); } </code></pre> <p>Div on default is clear <code>&lt;div id="workcont"&gt;&lt;/div&gt;</code></p> <p>Problems:</p> <ol> <li><p><code>prepend</code> add code for a second and then disappears, why? (not hide! removed)</p></li> <li><p><code>remove('h2')</code> don't remove added by prepend code. (if prepared wil be work) It's some function in my .js file.</p></li> <li><p>function <code>calculate();</code> does not apply to loaded content. Use with live() also not work.</p></li> </ol>
javascript jquery
[3, 5]
683,986
683,987
why do I keep getting a "displaymessage is not defined" error message?
<p>Can anyone tell me why I keep getting a "displaymessage is not defined" error message with this code.. Thanks in advance :)</p> <pre><code>&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&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;TEST PAGE&lt;/title&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { function displaymessage() { alert("Hello World!"); } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;&lt;input type="button" name="start" id="start" value="start" onclick="displaymessage()" /&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
3,108,634
3,108,635
jQuery removeClass except on current id
<p>[ <a href="http://www.jsfiddle.net/brianrhea/5Hqs3/5/" rel="nofollow"><strong>Live Demo</strong></a> ]</p> <p>I have a navigation menu that displays a certain state when hovered and also displays text in a different div.</p> <p>In the event that the user does not interact with the menu, the divs auto cycle on their own and the navigation menu displays the corresponding hover state as if the user were interacting.</p> <p>However, as it is cycling, if the user hovers over another link on the navigation menu, I need to removeClass on the previously highlighted element.</p> <p>How do I write, "if id is not currently hovered id, then removeClass('hoverBold') on all other navigation links"</p>
javascript jquery
[3, 5]
5,871,073
5,871,074
Show popup when the browser closes
<p>popup when the browser closes</p> <p>I am using onbeforeunload event</p> <pre><code>&lt;script&gt; function showPopup() { urlstring = "http://www.mydomain.com/popup.php"; window.open(urlstring,'mywin',"height=400px,width=500px,status=no,toolbar=no"); } &lt;/script&gt; &lt;body onbeforeunload="showPopup(); "&gt; </code></pre> <p>but it also show popup when ever I hit back space and page refresh.</p> <p><strong>I want show popup only when browser close and not show when hit back space.</strong></p> <p>but it shows all conditions.</p> <p>Please suggest me any other solution for this.</p>
php javascript
[2, 3]
716,445
716,446
how to access the functions defined in scripts of url loaded in iframe?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1952359/calling-iframe-function">calling iframe function</a> </p> </blockquote> <p>Hi All, How to access the functions defined in scripts of URL loaded in iframe using jquery ? Following is the much more elaboration of question :</p> <p><strong>I have Sample.html :</strong></p> <pre><code>&lt;html&gt; &lt;head&gt;&lt;script type="javascript"&gt; function sumfunction(var i, var j) { var k = i + j ; alert("sum of the variebles : " + k); } &lt;/script&gt;&lt;/head&gt; </code></pre> <p><strong>Test.html : This html file contains iframe with src=sample.html</strong></p> <pre><code>&lt;script type="text/javascript" src="jquery-1.5.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $document.ready(fuction()) { var i=10; $('#frame1').ready(function()){ // Need to access the function (sumfunction(10,20)) defined // in scripts of Sample.html of iframe (frame1) ?? } &lt;/script&gt;&lt;head&gt; &lt;body &gt; &lt;iframe id="frame1" src="sample.html" /&gt; &lt;body&gt; </code></pre> <p><strong>In Above code of test.html , i want to access function(sumfunction(20,30)) defined in sample.html of iframe from test.html using jquery. Please suggest, how can i achieve this ?</strong></p>
javascript jquery
[3, 5]
3,318,181
3,318,182
Why does jQuery do this in its constructor function implementation?
<p>If we look at the latest jQuery source at <a href="http://code.jquery.com/jquery-latest.js" rel="nofollow">http://code.jquery.com/jquery-latest.js</a> we see the following:</p> <pre><code>var jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' return new jQuery.fn.init( selector, context ); } </code></pre> <p>My understanding of the new keyword in Javascript is essentially JavaScript passes the function an empty object <code>{}</code> and the function sets stuff on it via <code>this.blah</code>.</p> <p>Also from my understanding <code>new</code> differs from <code>.call</code>/<code>.apply</code> etc.. in that the return object also has the prototype set to that of the function. So the return value should have a prototype that the same as <code>jQuery.prototype.init.prototype</code> (or <code>jQuery.fn.init.prototype</code>). However from what I see its prototype is set to <code>jQuery.prototype</code> thus all the commands available to work on the set.</p> <p>Why is this? What am I missing in my understanding?</p>
javascript jquery
[3, 5]
3,309,082
3,309,083
Android : Is there any way to change the default language of android to new language?
<p>I'm trying to know whether it is possible to change the default android OS language to other. For which the language is not in the settings for instance: how to set the device 's language to burmese programmatically.</p>
java android
[1, 4]
4,788,344
4,788,345
How to write jQuery code
<p>I've been writing Javascript code and using extensively the jQuery library. My code is not very big although for me is a mesh right now. I would to know if there is a jQuery best practices related to the way you write the code and how to structure it, not only related to performance.</p> <p>I am asking this because from my point of view using jQuery configures a different way of writing code and I think that people who are used to writing a lot of jQuery + Javascript code have methods to organise the code.</p> <p>I also would like to know if there is a "common &amp; good" way of documenting jQuery code just like Javadoc.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
3,328,580
3,328,581
Mouse in-out events for Javascript
<p>question from a beginner..</p> <p>I want to show/hide an inner div when the mouse enter/out from the parent div. I tried first with <code>onmouseover</code>, <code>onmouseout</code> events, but the problem is that <code>onmouseover</code> keep firing while the mouse over the div, and I want it to fire one time only.</p> <p>I found <a href="http://api.jquery.com/mouseenter/" rel="nofollow">JQuery</a> events that might help me, but I don't know where can I put this code because my divs exist in a template for a control, and there is no <code>onload</code> event for the div.</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; // Where should I call this !!! function Init(sender) { $(sender).bind("mouseenter", function () { $(sender.childNodes[1], this).show(500); }).bind("mouseleave", function () { $(sender.childNodes[1], this).hide(500); }); } &lt;/script&gt; </code></pre> <p>Any help!</p>
javascript jquery asp.net
[3, 5, 9]
1,806,799
1,806,800
Errors in Jquery code
<p>This code doesn't work, anyone have any recommendations?</p> <p>Perhaps I did something wrong? Anyone could check this code please? Is that because I used jquery?</p> <pre><code>$(document).ready(function showCart(next) { var ca = document.getElementById("cartArea"); var params = ""; for (i = 0; i &lt; document.clientCart.elements.length; i++) { param = getElemValue(document.clientCart.elements[i]); if (param != "") params += param + "&amp;"; } if (next) params += "Next=1"; ca.innerHTML = postIt(params); makePie(); } }); </code></pre>
javascript jquery
[3, 5]
5,248,123
5,248,124
Jquery append input element and send data from that input element
<p>I have this simple HTML code:</p> <pre><code>&lt;div id="new_gallery"&gt; &lt;p id="add_gallery"&gt;Add new gallery&lt;/p&gt; &lt;/div&gt; </code></pre> <p>and jQuery code:</p> <pre><code>&lt;script&gt; $("#add_gallery").click(function() { $("#new_gallery").append('&lt;input name"new_gallery" /&gt;&lt;a href="#" id="create_new_gallery"&gt;Add&lt;/a&gt;'); $(this).remove(); }); $("#create_new_gallery").on('click', function(){ alert('1'); }); &lt;/script&gt; </code></pre> <p>First function is working, but second one is not. I need to create new <code>input</code> element, send data via ajax, and then delete the <code>input</code> element and append a <code>p</code> element once again. How can I do this?</p>
javascript jquery
[3, 5]
2,552,742
2,552,743
the this in jquery plugin is giving back undefined
<p>Could someone explain why this.rel is giving back undefined and also what the regex is supposed to do. If this.rel is undefined the regex will not work either and is causing some kind of error because the alert underneath will not fire? </p> <pre><code>$.fn.facebox= function(settings) { init(settings) function clickHandler() { $.facebox.loading(true) alert($(this).attr('rel')); //alert(String(this.rel)); // support for rel="facebox.inline_popup" syntax, to add a class // also supports deprecated "facebox[.inline_popup]" syntax var klass = this.rel.match(/facebox\[?\.(\w+)\]?/) alert(klass); alert('ppp'); // if (klass) klass = klass[1] //fillfaceboxFromHref(this.href, klass) return false } return this.click(clickHandler) } </code></pre> <p>thanks, richard</p>
javascript jquery
[3, 5]
1,222,492
1,222,493
What imports do I need to make a jQuery popup dialog work?
<p>I am very confused :)</p> <p>I have these 2 jQuery imports:</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.16/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" /&gt; </code></pre> <p>and I think the bottom one is giving me errors on this page: <a href="http://www.problemio.com" rel="nofollow">http://www.problemio.com</a></p> <p>The error is 404 not found. What should be the import so I can get the out of the box library to work that will enable me to create popup dialog boxes for the user?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
1,752,338
1,752,339
How to hide $0.00 Product price using jQuery
<p>I want to hide the price of products which have $0.00 price.</p> <p>This is the code, I have to use for displaying price.</p> <pre><code>&lt;span id="product-price-170" class="regular-price"&gt; &lt;span class="price"&gt;$0.00&lt;/span&gt; &lt;/span&gt; </code></pre> <p>Can you please give me an idea, how to remove it through jQuery.</p>
php javascript jquery
[2, 3, 5]
2,372,961
2,372,962
How do I force a blur event to occur in JavaScript?
<p>Here's what I want to do. I want to trigger an event every time a select element changes. I have a multiline select and when I make changes (click on elements), it does not change until the select box loses focus. So I'm trying to force a blur every time the select box is clicked. That way if it changes, it will trigger the changed event. If it doesn't change, nothing will happen.</p> <p>How do I do this? Am I even approaching this the right way? Jquery answers are okay as well.</p>
javascript jquery
[3, 5]
70,574
70,575
how to decide user's timezone withount depending on javascript
<p>I solved this problem using this method:</p> <p>Set the php.ini timezone = UTC</p> <p>and then using javascript new Date() convert that to get the clients equivalent time.</p> <p>But a serious drawback of this method is that it changes if the client changes the timezone of his system or even the time of the system. Javascript uses the OS time and timezone which it can send to the server for calculations that too suffers from the same problem i.e the client can fool you. Meanwhile i also saw that the birthday's on facebook are not affected by our client changing the time or the timezone.</p> <p>In my case i need presently the solution for displaying the birthday today. Due to difference in server and client timezone. The birthday changes at 5:30 in the morning as i have set UTC as timezone in php and i am located in India. I tried and pointed out the problem in that approach.</p> <p>Please suggest a solution free from the bugs mentioned above.</p>
php javascript
[2, 3]
2,087,027
2,087,028
Perform at same time javascript and asp.net rendering
<p>Suppose I have a <code>.gif</code>:</p> <pre><code>&lt;img alt="" src="./wait.gif" /&gt; </code></pre> <p>And I have a Label:</p> <pre><code>&lt;asp:Label ID="tbnotif" runat="server" ReadOnly="True" Text="" &gt;&lt;/asp:Label&gt; </code></pre> <p>And a button:</p> <pre><code>&lt;asp:Button ID="Button1" runat="server" Text="Pubblica" OnClientClick="show_table();add_gif();" OnCommand="Button1_Click" /&gt; </code></pre> <p>I'm using aspx pages, the question is:</p> <p>Can I click on the button and at same TIME show the <code>.gif</code> with JavaScript and change the Label from code behind? Or will things never be shown at same time?</p>
javascript asp.net
[3, 9]
3,732,363
3,732,364
Max amount of elements to append
<p>What I'm trying should be easy, but I don't seem to be able to figure it out (ore google the problem)</p> <p>I have elements that I find, after finding them I want to append them to a container. But I don't want to many items so I want to be able to limit the amount of items to be appended.</p> <p>For example:</p> <pre><code>&lt;div class="appending"&gt; &lt;/div&gt; &lt;div class="toAppend"&gt; &lt;div class="box project"&gt; &lt;h3&gt;Project Box&lt;/h3&gt; &lt;/div&gt; &lt;div class="box project"&gt; &lt;h3&gt;Project Box&lt;/h3&gt; &lt;/div&gt; &lt;div class="box social"&gt; &lt;h3&gt;Social Box&lt;/h3&gt; &lt;/div&gt; &lt;div class="box video"&gt; &lt;h3&gt;Video Box&lt;/h3&gt; &lt;/div&gt; &lt;div class="box project"&gt; &lt;h3&gt;Project Box&lt;/h3&gt; &lt;/div&gt; &lt;div class="box social"&gt; &lt;h3&gt;Social Box&lt;/h3&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Here are 3 items in div.toAppend that I would like to append to the div.appending</p> <pre><code>var appenditems = $(".toAppend").find(".project"); appenditems.appendTo(".appending"); </code></pre> <p>This is easy, but my problem is that I want to limit the amount of div.project that are appended , for example, only append the first 2 that I find. I'm unsure of any way to do this.</p>
javascript jquery
[3, 5]
2,659,169
2,659,170
Custom fonts in android
<p>I am trying to use custom fonts in a textview:</p> <pre><code>tv=(TextView)findViewById(res); Typeface font = Typeface.createFromAsset(this.getAssets(), "fonts/font.ttf"); tv.setTypeface(font); </code></pre> <p>But when I run I get the following error:</p> <pre><code>W/System.err( 542): java.lang.RuntimeException: native typeface cannot be made </code></pre> <p>Whats the issue?</p>
java android
[1, 4]
2,465,107
2,465,108
Only perform jquery effects/operations on certain pages
<p>Up until now i've been dropping all my jquery code right inside the document.ready function. I'm thinking that for certain situations this isnt the best way to go. </p> <p>for example: If i want an animation to perform when a certain page loads what is the best way to go about that.</p> <pre><code>$(document).ready(function() { $("#element_1").fadeIn(); $("#element_2").delay('100').fadeIn(); $("#element_3").delay('200').fadeIn(); }); </code></pre> <p>If this is right inside of document.ready then every time <strong>ANY</strong> page loads it's going to check each line and look for that element. What is the best way to tell jquery to only perform a chunk of code on a certain page to avoid this issue.</p>
javascript jquery
[3, 5]
5,344,178
5,344,179
Can I use jQuery.extend to simulate method overloading?
<p>I'm quite familiar with jQuery. I'm trying to write common methods for my own purpose. Here is a sample below:</p> <pre><code>$.extend({ add : function(a, b) { return a + b; }, add : function(a, b, c) { return a + b + c; } }); </code></pre> <p>Is the above scenario possible? Can I use the same extender name and pass different parameters, like method overloading?</p>
javascript jquery
[3, 5]
5,970,772
5,970,773
accessing speicific array elements with jquery
<p>If my PHP returns a array with 6 elements how would I access each of them specifically in jquery?</p> <p>For example I want to create:</p> <p>var itemOne = value of first array element; var itemTwo = value of second array element; ...</p> <pre><code>$.get('ajax/employee_menu.php', { job: $('#job').val() }, function(data) { //i want to put each value from 'data' into variables here. }); </code></pre>
php jquery
[2, 5]
43,674
43,675
checkbox list -javascript
<p>In my aspx page i am having a checkbox list ..It has binded values from a table.. I need to validate the checkbox list ..I tried the following script </p> <pre><code> var checkBoxCount = 0; var elements = document.getElementById('&lt;%=ChkBoxList.ClientID%&gt;'); for(i=0; i&lt;elements.length;i++) { if(elements[i].checked) checkBoxCount++; } if (checkBoxCount == 0) { alert("Please choose atleast one"); return false; } </code></pre> <p>But I can't get the required output, it requires to select all the values in the checkbox list ..My need is atleast only one item must be selected from the checkbox list.. Using javascript</p> <p>Thanks in advance...</p>
c# javascript asp.net
[0, 3, 9]
5,277,078
5,277,079
Best way to store a file temporarily untill the usage of file
<p>As we all know that we can not get the full path of the file using <code>File Upload</code> control, we will follow the process for saving the file in to our application by creating a folder and by getting that folder path as follows</p> <p><code>Server.MapPath</code></p> <p>But i am having a scenario to select <code>1200</code> excel files, not at a time. I will select each and every <code>excel</code> file and read the requied content from that <code>excel</code> and saving the information to <code>Database</code>. While doing this i am saving the <code>files</code> to the <code>Application Folder</code> by creating a folder <code>Excel</code>. As i am having <code>1200</code> files all these files will be saved in to this folder after each and every run. </p> <p><code>Is it the correct method to follow or not I don't know</code></p> <p>I am looking for an alternative solution rather than saving the file to folder. I would like to save the full path of file temporarily until the process was executed.</p> <p>So can any tell me the best way as per my requirement.</p>
c# asp.net
[0, 9]
4,833,330
4,833,331
How to call Button OnCLick eventhandler in code behind with a value?
<p>I am trying to create Anchors in code behind and delete buttons as well for each Anchor. I dont know if i can call an event handler for each one of the link with an ID so i can delete the row specified from the database. This is what i have done. I created an anchor and an ASp button but not sure how i can call it with that ImageID. Is it possible? If so How? Thanks a lot in advance!! This is in C#, asp.net.</p> <pre><code> HtmlAnchor apdf = new HtmlAnchor(); apdf.ID = Guid.NewGuid().ToString("N"); string ImageID = ""; if (dsreport != null &amp;&amp; dsreport.Tables[0].Rows.Count &gt; 0) { apdf.InnerText = dsreport.Tables[0].Rows[0]["ImageName"].ToString(); apdf.Attributes.Add("style", "font-weight: bold; font-size: 13px; margin: 0px; font-family: Arial; color: #1e7c9b; text-decoration: underline"); apdf.Target = "_blank"; ImageSalesID = dsreport.Tables[0].Rows[0]["ImageID"].ToString(); apdf.HRef = "PDFdownload.aspx?ID=" + ImageID; } Button btnDelete = new Button(); btnDelete.ID = Guid.NewGuid().ToString("N"); btnDelete.OnClick += Eventhandler; btnDelete.Text = "Delete"; </code></pre>
c# asp.net
[0, 9]
651,808
651,809
Using a tab control, is it possible to dynamically load multiple tabs at runtime while maintaining state of each tab?
<p>The functionality I'm looking for is similar to a web browser with tabs. </p> <p>The main site navigation would consist of typical links. When a link is clicked, a tab is dynamically loaded with that pages content. The user can add multiple tabs by clicking navigation links.</p> <p>If they begin filling out a form on one tab, then switch tabs and come back, the form data should still be there.</p> <p>The tab controls I've looked at (DevExpress, AJAX tab control) don't allow this, or don't maintain tab data when switching from tab to tab. The tab control is regenerated with every post back.</p> <p>Maybe I am over thinking this and there is a simple solution. Any ideas? I can use DevExpress controls, jquery, or regular asp.net controls. Thanks! Kevin</p>
c# jquery asp.net
[0, 5, 9]
945,244
945,245
jquery listening to events
<p>I have a function A that does something (calls a web service in ajax request) and I have another function that is plugged in a calendar and that triggers on different events (click on day changes date, click on month changes calendar month... pretty typical calendar stuff).</p> <p>The calendar works with classes: when the user clicks on a day item, the function that handles this event first determines the attr('id') of the calendar that fired this event and then works on the calendar with this ID. There could be several calendars on the same page. When the user clicks on a date on a certain calendar, I want function A to execute. I could simply call function A from the calendar click functions by hard-coding the ID of the calendar and if the function executes on calendar ID xyz then do the regular things AND also call function A.</p> <p>In general terms, what I want to do is create a jquery event listener that calls function A when a certain event is raised on one of my calendars. Something "listen to this function being executed on calendar xyz and when you hear something, call function A". How do you setup an event listener like this in jquery?</p> <p>Thanks for your suggestions.</p>
javascript jquery
[3, 5]
4,002,574
4,002,575
membership authentication on Facebook logged in users
<p>I just got my login with facebook functionality to work, but its only client side. and its placed on masterpage. </p> <p>Problem i got is: </p> <p>On website each user have their own user Profile page. but i need to be able to see if some one who enter mywebsite.com/User/UserName is actualy owner of a profile, or is a visitor.</p> <p>With someone who is loged in by Membership authentication, their is no problem, i can just call current user, but facebook login is whole different story. </p> <p>How can i use membership authentication on Facebook logged in users? </p> <p>and bonus question, is it smart to actualy have user name in URl, or is it better to have userGuid?</p>
c# javascript asp.net
[0, 3, 9]
3,471,865
3,471,866
android compare 2 dates to find difference
<p>i have a booking form that requires a user to input their details alongside a date. the user cannot submit a date that is within 24 hours. a booking must be made after 24 hours.</p> <p>how can i implement this?. i have obtained the current date and time.</p> <p>so if the current date and time is 19062012 1324 the booking cannot be made until 20062012 1324</p> <p>what i tried to do is this:</p> <pre><code>long mdates = (long) (Long.parseLong(date.getText().toString())); long mprefered= (long) (Long.parseLong(date2.getText().toString())); long sub = mprefered - mdates; if (preferedDateEditText.getText().toString() != null &amp;&amp; !preferedDateEditText.getText().toString() .equalsIgnoreCase("") &amp;&amp; sub&gt;100000000) { emailBody += "Prefered date &amp; Time:" + preferedDateEditText.getText().toString().trim() + "\n sub="+sub; } else { errorMessage += "A booking cannot be made within 24 hours."; } </code></pre> <p>this works however if the prefered date is 01072012 1324 then it wont accept as being 24 hours in advance any help would be appreciated</p>
java android
[1, 4]
2,023,791
2,023,792
How to append <script> that will be executed?
<p>Tried <a href="http://jsfiddle.net/kxALH/2/" rel="nofollow">this</a> :</p> <pre><code>&lt;a href="#" id="showAlert"&gt;Click me&lt;/a&gt; &lt;div id="pasteContent"&gt;&lt;/div&gt; ​ var elemFunc = '&lt;script&gt;alert("myString");&lt;/script&gt;'; $("#showAlert").click(function () { $("#pasteContent").html(elemFunc); }); ​ </code></pre> <p>What I'd like to do is to append the string alert(myString); (which is a script) that must be executed... how can I do? Is it not correct?</p>
javascript jquery
[3, 5]
4,808,901
4,808,902
Tips to reduce app installed size using eclipse?
<p>I just built my first android app. A scientific calculator. Once installed I thought of checking it's size and comparing it with similar apps. My app is 650kb, the most popular currently on the play store is 500kb and the default one is 4kb.</p> <p>My app has only one activity, with a class and layout which before compiling are 20kb together. So how can my app be taking 100kb more than the most popular one? I'm just curious, I suppose there are files generated authomatically that can be eliminated to save space (like some images I found inside /res) but cannot just delete files randomly.</p> <p>What can I do to make the app lighter? How can I check which files are unused?</p>
java android
[1, 4]
2,360,561
2,360,562
Converting Javascript object to jquery object?
<p>when iam trying to convert javascript object to jquery object like obj = $(obj). The object obj is loosing one of the property values and setting the value as true.if iam using obj[0].Validated its returning the exact values.Please suggest on this.</p> <pre><code>obj = $(obj); objValue = obj.attr("Validate"); </code></pre>
javascript jquery
[3, 5]
2,165,678
2,165,679
Jquery Show & ScrollTop (or ScrollTo)
<p>Just as the topic says I'm trying to get a link to open a hidden div then scroll to it. I have the first part taken care of. As for the scrollTop or ScrollTo function I've been trying to use the ScrollTo plugin and for an unknown reason it's not working.</p> <p>First of all does this look correct?</p> <pre><code>&lt;li&gt; &lt;a href="#" rel="toggle[kov]" title="$.scrollTo('div#kov', 500);"&gt; Sara Kovanda &lt;/a&gt; </code></pre> <p>Then later down the page</p> <pre><code>&lt;section class="container" id="kov"&gt; </code></pre> <p>I'm using the dynamic drive script, <a href="http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm" rel="nofollow">http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm</a> For the first part since after hours of looking I cannot find a jquery plugin that allows for multiple divs that show on click and hides any current div that's open.</p> <p>Any help would be extremely helpful here.</p>
javascript jquery
[3, 5]
1,714,228
1,714,229
check the file size using jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1601455/check-file-input-size-with-jquery">Check file input size with jQuery</a> </p> </blockquote> <p>i need to check the uploaded image size is less than 5mb</p> <p>i using the following code</p> <pre><code>$("#fileUpload").change(function () { $file = $("#fileUpload"); var a = $file[0]; var iSize = ($file[0].files[0].size / 1024); if (iSize / 1024 &gt; 1) { iSize = (Math.round((iSize / 1024) * 100) / 100) alert('file size is ' + iSize); if (iSize &gt; 5) { $('#FileImageSizeValidation').show(); } } }); </code></pre> <p>in that, i got the undefined error on $file[0].files[0]. it shows error in this line. how to do this.</p> <p>thanks pooja</p>
jquery asp.net
[5, 9]
1,380,548
1,380,549
Rowdeleting event doesn't fire
<p>I have a gridview and I have a button on it.I want, if the user click on a button on a row,this row will be delted.I did this steps but I have no success.could you please help me to solve my problem?</p> <pre><code> protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int k=int.Parse(GridView1.DataKeys[e.RowIndex].Value.ToString()); Label1.Text = k.ToString(); } </code></pre> <p>I wanted to see the value in a lable but no success( I think this event doesn't fire)</p>
c# asp.net
[0, 9]
4,650,102
4,650,103
.aspx code errors "Element 'xxxx' is not supported."
<p>I'm getting a bunch of these errors for my image buttons, link buttons, text boxes, and labels. These errors are in my .aspx code. Why am I getting so many?</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmSearchPersonnel.aspx.cs" Inherits="frmSearchPersonnel" %&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 id="Head1" runat="server"&gt; &lt;title&gt;Untitled Page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;div align="center"&gt; &lt;/div&gt; &lt;/div&gt; &lt;asp:Label ID="Label1" runat="server" Text="Search for employee by last name"&gt;&lt;/asp:Label&gt; &lt;asp:TextBox ID="txtSearchName" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;p&gt; &lt;asp:Button ID="btnSearch" runat="server" PostBackUrl="~/frmViewPersonnel.aspx" Text="Search" onclick="btnSearch_Click" /&gt; &lt;/p&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;. </code></pre> <p>The errors are under Label, TextBox &amp; Button above in blue. The errors state:</p> <blockquote> <p>Validation (): Element 'xxxx' is not supported.</p> </blockquote>
c# asp.net
[0, 9]
5,732,207
5,732,208
why the second event is not started?
<p>Please help me figure out why the second event is not started (<a href="http://jsfiddle.net/7tLnq/1/" rel="nofollow">full code</a>)</p> <pre><code>&lt;input type="submit" value="disabled:false" /&gt; $(function(){ $('input:submit').bind({ mouseover : function(){ $('input:submit').each(function(){ $(this).attr('disabled', 'disabled'); $(this).val('disabled:' + $(this).attr('disabled')); }); }, mouseout : function(){ $(this).removeAttr('disabled'); $(this).val('disabled:' + $(this).attr('disabled')); } }); }); </code></pre>
javascript jquery
[3, 5]
2,838,273
2,838,274
Making exported excel sheet as readonly
<p>In my application i'm exporting gridview data to excel and storing it to a particular folder now what i want is to make this excel file as read only so that no one should edit it.</p> <p>i have written code like this:</p> <p>protected void Button5_Click(object sender, EventArgs e) {</p> <pre><code> this.GridView1.Page.EnableViewState = false; StringWriter tw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(tw); hw.WriteLine("&lt;b&gt;&lt;font size='5'&gt; Report&lt;/font&gt;&lt;/b&gt;"); this.GridView1.RenderControl(hw); string HtmlInfo = tw.ToString(); string DocFileName = "Report" + ".xls"; string FilePathName = Request.PhysicalPath; FilePathName = FilePathName.Substring(0, FilePathName.LastIndexOf("\\")); FilePathName = @"C:\Excel" + "\\" + DocFileName; FileStream Fs = new FileStream(FilePathName, FileMode.Create); BinaryWriter BWriter = new BinaryWriter(Fs,System.Text.Encoding.GetEncoding("UTF-8")); BWriter.Write(HtmlInfo); BWriter.Close(); Fs.Close(); } </code></pre> <p>any1 help me on this...</p>
c# asp.net
[0, 9]
2,211,452
2,211,453
insert into data base by javascript
<p>i have this code for get rss from other site </p> <pre><code>gfeedfetcher.prototype._displayresult=function(feeds){ var rssoutput=(this.itemcontainer=="&lt;li&gt;")? "&lt;ul&gt;\n" : "" gfeedfetcher._sortarray(feeds, this.sortstring) for (var i=0; i&lt;feeds.length; i++){ var itemtitle="&lt;a href=\"" + feeds[i].link + "\" target=\"" + this.linktarget + "\" class=\"titlefield\"&gt;" + feeds[i].title + "&lt;/a&gt;" var itemlabel=/label/i.test(this.showoptions)? '&lt;span class="labelfield"&gt;['+this.feeds[i].ddlabel+']&lt;/span&gt;' : " " var itemdate=gfeedfetcher._formatdate(feeds[i].publishedDate, this.showoptions) var itemdescription=/description/i.test(this.showoptions)? "&lt;br /&gt;"+feeds[i].content : /snippet/i.test(this.showoptions)? "&lt;br /&gt;"+feeds[i].contentSnippet : "" rssoutput+=this.itemcontainer + itemtitle + " " + itemlabel + " " + itemdate + "\n" + itemdescription + this.itemcontainer.replace("&lt;", "&lt;/") + "\n\n" } rssoutput+=(this.itemcontainer=="&lt;li&gt;")? "&lt;/ul&gt;" : "" this.feedcontainer.innerHTML=rssoutput } </code></pre> <p>then i need to insert title and linke of the new on table on data base this cod by javascript</p>
php javascript
[2, 3]
5,926,520
5,926,521
jQuery prepending textarea
<p>HTML</p> <pre><code>&lt;textarea id="photo-42-9" class="comment_box"&gt;Write a comment...&lt;/textarea&gt; </code></pre> <p>jQuery code that doesn't work, what am I missing?</p> <pre><code>$('#photo-42-9').prepend("&lt;div&gt;blah&lt;/div&gt;"); </code></pre> <p><strong>EDIT</strong> Corrected the ids mismatch, still doesn't work though</p>
javascript jquery
[3, 5]
3,762,567
3,762,568
jQuery.get(' not getting file
<p>Im trying </p> <p><code>jQuery.get('similar_products_stack.php');</code> </p> <p>and </p> <p><code>jQuery.get('./similar_products_stack.php');</code> </p> <p>Where similar_products_stack.php returns an html array and I am getting error 404 that the file is not found even though both files are in the same directory.</p> <p>what am I doing incorrectly?</p>
javascript jquery
[3, 5]
3,278,518
3,278,519
How to use jQuery to show a different page in ASP.NET
<p>I am trying to set up functionality similar to Netflix. Where if you mouseover a movie - you are presented with a window of movie details (all client-side). </p> <p>At high level, can someone in this forum help by telling me how this should be implemented? I.E., one or more .aspx pages, what would go in code-behind, and .js file, css, etc. Just trying to get an idea on how this would be set up to work.</p> <p>Basically, when I hover over an item, I need to query for details that belongs for that record being moused-over and display it in the window or div. I also need to have some functionality in that window (i.e. a textbox and button which will end up needing to get saved in a database). </p> <p>Thanks for any tips and suggestions - </p>
asp.net jquery
[9, 5]
4,521,900
4,521,901
Inserting one element inside another in jQuery
<p><strong>EDIT:</strong> Apologies, this was caused by an unrelated error!</p> <p><hr /></p> <p>Hi,</p> <p>I'm trying to figure out how to add one element inside another using jQuery.</p> <p>For example, if I have a list:</p> <pre><code>&lt;ul class="someList"&gt; &lt;li&gt;One&lt;/li&gt; &lt;li&gt;Two&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>...and I run <code>$("ul.someList").prepend("&lt;li&gt;Zero&lt;/li&gt;");</code> then I will end up with this:</p> <pre><code>&lt;ul class="someList"&gt; &lt;li&gt;Zero&lt;/li&gt; &lt;li&gt;One&lt;/li&gt; &lt;li&gt;Two&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>That's great. However, if the list is empty...</p> <pre><code>&lt;ul class="someList"&gt; &lt;/ul&gt; </code></pre> <p>...then <code>$("ul.someList").prepend("&lt;li&gt;Zero&lt;/li&gt;");</code> simply does not work. Is there a method of prepending the list item when there are no existing list items as well as if there are some already?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,745,009
2,745,010
adding css to custom reusable function
<p>i created a function in jQuery which lets me create a lightbox as following:</p> <pre><code>var lightbox = create_lightbox(params); </code></pre> <p>I would like to expand this function so i can add custom css to it and make it look like a feel in any given circumstance. I would prefer to be able to do the folowing:</p> <pre><code> lightbox.css = { "background-color" : "red", etc... } </code></pre> <p>What would be the best way to do this and how would i iterate over the css elements inside my function?</p> <p>tyvm </p>
javascript jquery
[3, 5]