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
3,766,978
3,766,979
how to automatically move in a website?
<p>What I'm trying to accomplish is whenever I click on my button It will read the link from the text file and open it in a browser, then in that opened browser I want to find a particular button and click on that.</p> <p>Can anybody give me an idea how I can start this?</p>
c# asp.net
[0, 9]
5,824,656
5,824,657
JavaScript JQuery setTimeout
<p>I'm a beginner in JavaScript and JQuery and I was trying to exercise something</p> <pre><code>var activetab = 0; $("li").click(function () { $("#tabs-"+activetab).hide("slide", { direction: "left" }, 1000); $("li").eq(activetab).css('background-color','white'); var index = $("li").index(this); $("span").text(index); $("li").eq(index).css('background-color','red'); $("#tabs-"+index).show("slide", { direction: "left" }, 1000); activetab = index; }); </code></pre> <p>Here is my fiddle:</p> <p><a href="http://jsfiddle.net/6WC4J/" rel="nofollow">http://jsfiddle.net/6WC4J/</a></p> <p>The problem is I'd like the show method to fire up after some time such that when the previous element will be hidden then the new one will show up, tried using setTimeout but didn't work, any ideas?</p> <p>Thanks Overall</p>
javascript jquery
[3, 5]
1,233,186
1,233,187
Application Navigation
<p>I have been asked to create an application that would serve as an Employment Application for the company I work with. But I can not seem to figure out any way to set up navigation. The application is about 4 steps long and each step is on a separate page. The user should be able to go back to pages they have completed but not forward (in this navigation, advancement is taken care of else where) </p> <p>I've tried using List items, and hyper links to no avail. The application pages have a master page, and the master page has a current step property that is set in the page load of each of the steps of the application. </p> <p>My first thought was to have the set method of the property enable or disable the links but that came up with Null References. </p> <p>Any thoughts?</p>
c# asp.net
[0, 9]
5,493,641
5,493,642
how to read html content from assets folder in android
<pre><code>try { File f = new File( "file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)") ; FileInputStream fis= new FileInputStream(f); System.out.println("_______YOUR HTML CONTENT CODE IS BELLOW WILL BE PRINTED IN 2 SECOND _______"); Thread.sleep(2000); int ch; while((ch=fis.read())!=-1) { fileContent=fileContent+(char)ch; // here i stored the content of .Html file in fileContent variable } System.out.print(fileContent); //} } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>This is my code. I want to read html content from asstes folder my file is available in asstes folder But it gives exception <code>FileNotFoundException</code>. So plz any one tell me how to read html content from asstes folder in android?</p> <p>File f = new File( "file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)") ; when i debug f gives= file:/android_asset/[2011]011TAXMANN.COM00167(PATNA)</p> <p>plz tell me how to get corrct directory and where i m doing wrong it shud me coming file:///android_asset/[2011]011TAXMANN.COM00167(PATNA)</p>
java android
[1, 4]
2,638,696
2,638,697
Display image in full page with transparent background in web
<p>I want to display the image on click like it displays in <a href="http://www.espncricinfo.com/" rel="nofollow">http://www.espncricinfo.com/</a> at this website when you click on the image it opens in same full window with transparent background. how i can do this.i'm developing a php website. Thanks</p>
javascript jquery
[3, 5]
4,164,918
4,164,919
cut completely and paste an element
<p>Can I cut (completely, with all styles and attributes) an element from a location and paste it in another location (like <code>body</code>) with jQuery?</p> <p>Also, I want to place a string (or tag) in the old location, because I want to change its place to old location at the end of the script.</p> <p>Can I? How?</p> <p>Thank you.</p>
javascript jquery
[3, 5]
2,280,959
2,280,960
How to access a c# variable's value in an .aspx page and use it inside String.Concat method?
<p>Hi I have this in my code behind:</p> <pre><code>string input = Request.Url.AbsoluteUri; string output = input.Substring(input.IndexOf('=') + 1); </code></pre> <p>This is my .aspx page:</p> <pre><code>&lt;asp:TemplateField ShowHeader="False" HeaderText="Some text"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtUrl" Text='&lt;%# String.Concat(@"\Uploads\",Eval("text")) %&gt;' runat="server" onclick="javascript:this.select();"&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>And I need to do this:</p> <pre><code>&lt;asp:TemplateField ShowHeader="False" HeaderText="Some text"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtUrl" Text='&lt;%# String.Concat(@"\Uploads\",output,Eval("text")) %&gt;' runat="server" onclick="javascript:this.select();"&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>- As you can see, I need to create custom "path" in textbox using string.concat joining <strong>\Uploads\</strong> + value of variable <strong>output</strong> + <strong>Eval("text")</strong></p> <p>Thank you very much in advance!</p>
c# asp.net
[0, 9]
5,173,911
5,173,912
Replace string Jquery
<p>I am doing the following thing to replace some part of the string. I want to replace all three occurence of the string but it is not working.</p> <pre><code> var hdnval = document.getElementById("hdnColgval").value = response; $("#ddcolgs").val($("#ddcolgs").val().replace(/'+hdnval+'/g, response)); </code></pre>
javascript jquery
[3, 5]
3,387,177
3,387,178
JQuery/JavaScript performance using $(this)
<p>I find myself doing a lot of this kind of JQuery:</p> <pre><code>$('.filter-topic-id').each(function () { var me = $(this); if (me.text() == topics[k]) { me.parent().show(); } }); </code></pre> <p>I store <code>$(this)</code> in a variable called <code>me</code> because I'm afraid it will re-evaluate <code>$(this)</code> for no reason. Are the major JavaScript engines smart enough to know that it doesn't have to re-evaluate it? Maybe even JQuery is smart enough somehow?</p>
javascript jquery
[3, 5]
691,995
691,996
How do you set report name from query string
<p>I am trying to set the report name for a telerik report from the query string. I am using <a href="/activeReportViewer.aspx?reportname=activecases">Cases</a> and I want to pass the reportname to the following line of code:</p> <pre><code>report = new Volunteer.MainApplication.Reports.*reportname* </code></pre> <p>I have tried </p> <pre><code>report = new Volunteer.MainApplication.Reports.*reportname* &lt;%request.querystring("reportname")%?&gt; var newRpt = "new Volunteer.MainApplication.Reports."; newRpt += Request.QueryString["Report"].ToString(); report = newRpt; </code></pre>
c# asp.net
[0, 9]
5,317,337
5,317,338
Accessing Request.QueryString[foo] is null but the URL shows the query string/parameter is right there
<p>I am calling an .aspx script through AJAX. In that script I am attempting to get a value from the query string using <code>Request.QueryString["i"]</code> but it always returns null even though, if I examine the Request object in debug mode, the query string <strong>IS</strong> right there.</p> <p><strong>Whats going wrong &amp; how can I retrieve the <code>i</code> parameter value from testScript.aspx?i=199?</strong></p> <p>Heres my simple code:</p> <pre><code> public partial class getData : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { short index = System.Convert.ToInt16(Request.QueryString["i"]); // BREAKPOINT } } </code></pre> <p>When I use a break point &amp; examine the Request Object I can see that the <code>Request.QueryString</code> variable is empty(just a {}). <code>Request.QueryString["i"]</code> is null. </p> <p><strong>If you look at the following img you can see the <em>form</em> has my <code>i</code> parameter(thats my query string <code>.aspx?i=4</code></strong></p> <p><img src="http://i.stack.imgur.com/D5xAn.png" alt="enter image description here"></p>
c# asp.net
[0, 9]
3,221,794
3,221,795
Second occurrence of checkbox
<p>How to get the second occurrence of checkbox ? Here is what I have tried:</p> <pre><code>&lt;div id="form"&gt; &lt;label for="first"&gt;First&lt;/label&gt; &lt;input type="checkbox" name="first" value="1" &gt; &lt;br /&gt; &lt;label for="second"&gt;Second&lt;/label&gt; &lt;input type="checkbox" name="second" value="2" &gt; &lt;br /&gt; &lt;/div&gt; $('#form').find('input[type=checkbox]').eq(1) </code></pre> <p>But it doesn't work for me.</p>
javascript jquery
[3, 5]
765,241
765,242
How can I access the value after a # in a URL?
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="http://stackoverflow.com/questions/1032242/how-to-obtain-anchor-part-of-url-after-in-php">How to obtain anchor part of URL after # in php</a><br> <a href="http://stackoverflow.com/questions/484113/is-it-possible-to-access-anchors-in-a-querystring-via-php">Is it possible to access anchors in a querystring via PHP?</a> </p> </blockquote> <p>i need to find a way to do this, facebook does it so it has to be possible.... </p> <p>If a user goes to this URL in the browser<br> <a href="http://localhost/index.php?photos=p#" rel="nofollow">http://localhost/index.php?photos=p#</a><strong>12345</strong></p> <p>Then I can have my PHP load a photo with the ID <strong>12345</strong> from mysql</p> <p>If a user went to<br> <a href="http://localhost/index.php?photos=p#" rel="nofollow">http://localhost/index.php?photos=p#</a><strong>123456</strong> Then it would load a photo with id <strong>123456</strong></p> <p>I just need help in getting the value in the URL after the <strong>#</strong> and accessing it with PHP if possible? IF it is not possible, then I maybe I can access it with jQuery and then make an AJAX call to load an image based on this value.</p> <p>So does anyone know how I can get that value?</p>
php javascript jquery
[2, 3, 5]
862,634
862,635
using php to check is a javascript file has been loaded?
<p>Can I use a script to check if a JS file is loaded? </p> <p>I have a function, which places a form on a page with javascript controls. I don't know where the user will use this form, and it might be loaded several times into a page. It strikes me as the best way to handle things if the form itself loads the script, so it doesn't load if not needed, but this leads me to need to check if the script is already loaded to avoid reloading and adding to page load times and bandwidth use.</p>
php javascript
[2, 3]
3,662,503
3,662,504
Counting how many times my Android app has been opened
<p>I am developing an android app and I want to know how many times it has been opened. Is there a way to do this?</p>
java android
[1, 4]
1,604,230
1,604,231
Score counter using PHP and JavaScript
<p>If I want to add a score counter to my website. for example if the user answers a question then it will be saved in a database and the correct answer is already saved in the same database table. I want to make a comparison between the answers. if the answer is correct the score raises. </p> <p>I am planning to code the score counter by using JAVASCRIPT. How can I call the javascript function within PHP.</p> <p>If I do like that:</p> <pre><code>&lt;?php if($_SESSION['Correct_answer'] == $_SESSION['User_answer']) echo "&lt;SCRIPT LANGUAGE='javascript'&gt;" echo count() "&lt;/SCRIPT&gt;"; </code></pre> <p>And the javascript function looks like:</p> <pre><code>&lt;script&gt; var x=0; function count(){ x+=1; document.getElementById( "counting" ).value = x; } </code></pre> <p>Where "counting" is a text field. When I tried to use this code it didn't work. Is the above code correct???</p> <p>Thank you in advance.</p> <p>Edited:</p> <p>Ok I did what u said but i still have a problem when refreshing the page the score increases by one. How can I stop the increasing of score when reloading the page???</p> <p>Here is my code:</p> <pre><code>if (!isset($_SESSION['score'])) $_SESSION['score'] = 0; else{ $sql10=mysql_query("select * from image WHERE fromUser='".$_SESSION['email']."' order by id desc"); $score1=mysql_fetch_array($sql10); $answer=$score1['answer']; $sql13=mysql_query("select * from image WHERE toUser='".$_SESSION['email']."' order by id desc"); $score2=mysql_fetch_array($sql13); $answer2=$score2['answer2']; strcasecmp($answer,$answer2); if(strcasemp) $_SESSION['score'] += 1; } </code></pre>
php javascript
[2, 3]
2,220,787
2,220,788
How to replace link with list element and then add new link in IE7/8 with jQuery?
<p>I can't control how the HTML is generated and need to put a string of links into a list and then add new links for each item.</p> <p>I have simplified the code at <a href="http://jsfiddle.net/jhASu/" rel="nofollow">http://jsfiddle.net/jhASu/</a> and it works in Chrome/Firefox and IE9 but not in IE 7 and 8 (no new links are generated). What could be the cause of this?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
5,054,084
5,054,085
C# java script code for checkexistring file in a folder code using uploadify
<p>I am able to upload file(s) from system to server using uploadify control(www.uploadify.com). Everything is working fine but thing is that I am not getting how to check the file existing or not in the server. I need help from you that how to check existing file(s) using java script or C# before uploading file(s) to server. I have code for checkexisting in php but I want in C# or java script so kindly please kindly do needful. </p> <p>Thanks PBN</p>
c# javascript asp.net
[0, 3, 9]
2,273,074
2,273,075
is it possible to change key layout inside android application?
<p>Can I change the layout of a bluetooth keyboard just inside my application? Or in other words rebind the keys? For example: pressing "a" enters "s" and pressing "s" enters "a"</p>
java android
[1, 4]
4,129,281
4,129,282
After function completes, redirect to URL
<p>I have a bit of HTML which is unfortanetly an inherited onclick:</p> <pre><code>&lt;a href="http:www.intendedlink.com" onclick="tracker(this, 'HondaAccord');return false;"&gt;Buy a Car&lt;/a&gt; </code></pre> <p>What I would like is for the image to be generated onclick, appened to the div <code>car</code> and then transfered to the URL. As so:</p> <pre><code>function tracker(theLink, trackID) { var trackUrl = "http://www.mysite.com?something=" + trackID + "&amp;val1&amp;val2;"; var img = $('&lt;img&gt;'); img.attr('src', trackUrl); img.appendTo('div.car'); $(function () {= $(this).on('click', function () { var url = theLink; if (url) { window.location = theLink; } }); }); } </code></pre> <p>The image is generated but I'm never sent to the new link. Perhaps I don't even need to bind? But I want to be sure I'm not sent until the image is appended to <code>car</code> otherwise the tracking response is cut off prematurely.</p>
javascript jquery
[3, 5]
2,633,980
2,633,981
Create list html from selected text in Textarea
<p>I have found various examples of using jquery to wrap selected text from a textarea in html tags, but I would like to adapt this slightly to create a list when multiple lines of text are selected.</p> <p>Currently the code below wraps the whole selection in the list tags but I would also like to replace all the carriage returns with the closing and opening tags for list items - so each line in the text area is a new list item.</p> <p>I think one of the problems might be that the .val function reads the text area as a single line.</p> <p>jquery:</p> <pre><code>function listText(elementID, openTag, closeTag) { var textArea = $('#' + elementID); var len = textArea.val().length; var start = textArea[0].selectionStart; var end = textArea[0].selectionEnd; var selectedText = textArea.val().substring(start, end); var replacement = openTag + selectedText + closeTag; textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); } $(document).ready(function () { $("#BoldIt").click( function() { listText("markItUp", "&lt;ul&gt;&lt;li&gt;", "&lt;/li&gt;&lt;/ul&gt;"); }); }); </code></pre> <p>body:</p> <pre><code>&lt;textarea id="markItUp" cols="80" rows="20"&gt;&lt;/textarea&gt; &lt;br /&gt; &lt;input type="button" value="Bold" id="BoldIt" /&gt; </code></pre>
javascript jquery
[3, 5]
1,558,483
1,558,484
Page state is lost while refreshing the page
<p>In my webpage, there is a repeater control which holds an image and its description. After the page is been loaded, the user can reorder the images(Jquery is used for reordering divs). After the reordering, if the user refresh the page or click any button, the page will go back to the previous state before reordering. How can I prevent this.</p> <p>The repeater control is in .aspx page.</p> <p>Thank you in advance. </p>
c# asp.net
[0, 9]
4,390,927
4,390,928
URI Scheme definition?
<p>I'm working off this tutorial: <a href="http://www.developer.com/ws/article.php/10927_3833306_2/Creating-a-Home-Screen-App-Widget-on-Android.htm" rel="nofollow">http://www.developer.com/ws/article.php/10927_3833306_2/Creating-a-Home-Screen-App-Widget-on-Android.htm</a></p> <p>It includes the following code:</p> <pre><code> widgetUpdate.setData( Uri.withAppendedPath(Uri.parse( ImagesWidgetProvider.URI_SCHEME + "://widget/id/"), String.valueOf(appWidgetId))); </code></pre> <p>My question is, what should URI_SCHEME be defined as and where?</p>
java android
[1, 4]
5,717,962
5,717,963
How can I call JavaScript function in a loop
<p>I would like to call JavaScript function many time . I have tried like that<br> In Script </p> <pre><code> function changeIt(strgr , idx) { //SomeCode return; } </code></pre> <p>In C# </p> <pre><code> protected void btn_Click(object sender, EventArgs e) { string strgr = 001; for(int i=0; i&lt;3; i++) { base.RunScriptBottom("changeIt(" + strgr + "," + i + ");"); } } </code></pre> <p>But it call the script function only one time. What could I do.<br> With regards</p>
c# javascript asp.net
[0, 3, 9]
3,700,962
3,700,963
Changing a control's style based on validation (ASP.NET)
<p>I've got a very simple form with the following troubled snippet:</p> <pre><code>&lt;asp:Panel class="normal" ID="Panel1" runat="server"&gt; &lt;strong&gt;&lt;asp:Label ID="Panel1Error" class="error" Visible="false" runat="server"/&gt;&lt;/strong&gt; &lt;label for="TextBox1"&gt;&lt;em&gt;*&lt;/em&gt; Don't leave this blank&lt;/label&gt; &lt;asp:TextBox ID="TextBox1" runat="server" /&gt; &lt;asp:RequiredFieldValidator ID="TextBox1RFV" runat="server" ControlToValidate="TextBox1" ErrorMessage="This field cannot be blank." Display="None" /&gt; &lt;--- other validators ---&gt; &lt;/asp:Panel&gt; </code></pre> <p>There are two things I want to do when the page fails validation:</p> <ol> <li><p>Change the style of Panel1 (to one which shows different colors to indicate an error). I was able to do this by calling Page.Validate in Page_Load, then iterating over Page.Validators, getting each validator's parent control, casting it to a Panel, then setting .CssClass Doesn't seem like a superb solution, but it got the job done - is there a better way?</p></li> <li><p>I want to take whatever validation error(s) are thrown and put them in the Panel1Error label, as well as set it to visible. This is where I am a bit baffled. I thought at first I could possibly specify the Label in which a validator writes its ErrorMessage, but I had no such luck. If I just toss the validator inside the Label, its formatting messes up the entire layout of the page, regardless of whether I directly assign it the 'error' CSS class or just leave it in the Label.</p></li> </ol> <p>Just to clarify, in production, I would be doing this process for multiple Panels on a page, each with one form element, preventing me from calling the Panels explicitly and just saying Panel1.CssClass, etc.</p>
c# asp.net
[0, 9]
4,160,197
4,160,198
What is the C# equivalent for Java Socket.getInetAddress()?
<p>I am developing a http program in C# while referring to some source code written in Java! I would like to know if there is a C# equivalent way for the the method <strong>getInetAddress()</strong> . In other words how to get the ip address from a socket object in C# ?</p>
c# java
[0, 1]
5,927,726
5,927,727
how can i trigger click function as auto (every 15 second)
<p>For example if i have a random div..</p> <pre><code>$("#random").click(function{ $("#random").toggle("slow"); }); </code></pre> <p>How can i trigger to click function as auto(every 15 seconds).</p> <p>Thanks for helps..</p>
javascript jquery
[3, 5]
1,757,172
1,757,173
Fading in appended elements one at a time
<p>I have an array with IDs and I am loading elements with these IDs from another page.</p> <pre><code> $.each(idArr, function() { var divline = '&lt;div class="line" id="' + this + '"&gt;'; var url = 'allitems.php #' + this + ' div'; $('#the-list').append($(divline).load(url).hide().fadeIn()); }); </code></pre> <p>It works fine but I would like the loaded elements to fade in one at a time, or at least not all att once. I cannot figure out how to use .delay with my code. Or is there maybe another way?</p> <p>Thank you :)</p>
javascript jquery
[3, 5]
5,825,023
5,825,024
PHP development framework and ide (like asp.net)
<p>We have to develop an specific webpage with php and up until now we have used asp.net, the problem is that we arent able to take the tipical development steps in php.</p> <p>For asp.net:</p> <ol> <li>Design interface (aspx/html) (With visual designer)</li> <li>Create controls events (Button click, combo select etc...) (for ex. double click on x control creates the asociated click event in codebehind)</li> <li>Add control/bussines logic (X button clicked-> make x control visible/enabled/change its text. Intellisense or autocompletion or so, detecting the objetcs and controls that exist in the design page)</li> </ol> <p>In php there doesnt seem to be clear relation between a designed page and php code (its like striping all the intellisense in asp.net and using only response.write() to do the visual changes :S)</p> <p>After some searching the model we use is WebForms asp.net (not mvc .net) so the desired option would be a framework + designer as alike as WebForms as posible...</p> <p>So...is there any framework + ide that helps with this problem?</p>
php asp.net
[2, 9]
2,180,498
2,180,499
Jquery queue issue
<p>I have the following</p> <pre><code>function test(){ var top = numGanadores + numSuplentes; var cuponesList = itemsFromAnArray; for (var g = 0; g &lt; numGanadores; g++) { $(cuponesList[g]).delay(2000 * g).queue(function (next) { addNewRow('ganadores', this.parCedula, this.parNombre, this.cupNro, this.cupNroTarjeta, this.cupClaseTarjeta, this.parMonto, this.cupMonto); next(); }); } for (var s = numGanadores; s &lt; top; s++) { $(cuponesList[s]).delay(2000 * s).queue(function (next) { addNewRow('suplentes', this.parCedula, this.parNombre, this.cupNro, this.cupNroTarjeta, this.cupClaseTarjeta, this.parMonto, this.cupMonto); next(); }); } alert('end'); } </code></pre> <p>I want to show an alert when the 2 queue functions ends, at this moment the <code>alert()</code> shows when I execute the function <code>test()</code> then execute the queue.</p> <p>Is there any way to get best performance on this funtion?</p>
javascript jquery
[3, 5]
232,420
232,421
Javascript Error (IE): Object doesn't support this property or method
<p>This code works PERFECTLY in Firefox, and in IE the line ending 'negative'); breaks. I have no idea how to fix it! Argghhh!</p> <pre><code>$(".topline strong").digits().each(function () { s = $(this), c = "change"; if ($(s).hasClass(c) &amp; $(s).text().replace(/%/gi, "") &gt; 0) { $(s).addClass("positive"); } if ($(s).hasClass(c) &amp; $(s).text().trim().charAt(0) == "-") $(s).addClass("negative"); }); </code></pre>
javascript jquery
[3, 5]
4,474,849
4,474,850
ASP.NET: Page HTML head rendering
<p>I've been trying to figure out the best way to custom render the <code>&lt;head&gt;</code> element of a page to get rid of the extra line breaks which is caused by <code>&lt;head runat="server"&gt;</code>, so its properly formatted.</p> <p>So far the only thing i've found which works is the following:</p> <pre><code> protected override void Render(HtmlTextWriter writer) { StringWriter stringWriter = new StringWriter(); HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter); base.Render(htmlTextWriter); htmlTextWriter.Close(); string html = stringWriter.ToString(); string newHTML = html.Replace("&lt;title&gt;\r\n\t", "&lt;title&gt;") .Replace("\r\n&lt;/title&gt;", "&lt;/title&gt;") .Replace("&lt;/head&gt;", "\n&lt;/head&gt;"); writer.Write(newHTML); } </code></pre> <p>Now i have 2 questions:</p> <ol> <li>How does the above code affect the performance (so is this viable in a production environment)?</li> <li>Is there a better way to do this, for example a method which i can override to just custom render the <code>&lt;head&gt;</code>?</li> </ol> <p>Oh yeah ASP.NET MVC is not an option.</p> <p><strong>EDIT:</strong></p> <p>Im asking this with regards to SEO and just little bit perfectionism.</p>
c# asp.net
[0, 9]
4,823,259
4,823,260
function callback to reload a jquery plugin
<p>im new to jquery/javascript and im trying to make a function callback to reload a jquery plugin. what would be the appropriate way to do that?</p> <pre><code>$(function() { var newHash = "", $mainContent = $("#main-content"), $el; $("nav").delegate("a", "click", function() { window.location.hash = $(this).attr("href"); return false; }); $(window).bind('hashchange', function(){ newHash = window.location.hash.substring(1); if (newHash) { $mainContent .find("#guts") .fadeOut(200, function() { $mainContent.hide().load(newHash + " #guts", function() { $mainContent.fadeIn(200, function() { /*rebind plugin*/ }); $("nav a").removeClass("current"); $("nav a[href="+newHash+"]").addClass("current"); }); }); }; }); $(window).trigger('hashchange'); }); </code></pre>
javascript jquery
[3, 5]
3,518,176
3,518,177
Populate a input with a date based on selected option (date today + days)
<p>How to do this using jQuery</p> <p>i have a select like </p> <pre><code>&lt;select id="Plan_Id" name="Plan_Id"&gt; &lt;option value="30"&gt;Month&lt;/option&gt; &lt;option value="365"&gt;Annual&lt;/option&gt; &lt;/select&gt; </code></pre> <p>then i have a input </p> <pre><code>&lt;input name="date" id="date_picker" type="text" class="text date_picker" /&gt; </code></pre> <p>so based on the option i select i want to get the date today + value and show on the input was</p> <p>m-d-Y.</p> <p>so if today is january 07 and i select 30 -> month</p> <p>my input will be populated with 02-06-2012</p>
javascript jquery
[3, 5]
2,928,050
2,928,051
remove everything after a certain character
<p>Is there a way to remove everything after a certain character or just choose everything to that character, either way. my scenario is like this that its always gone be different amount of characters and im getting the value from a href and up to the ? </p> <pre><code>like /Controller/Action?id=11112&amp;value=4444 </code></pre> <p><strong>EDIT</strong><br /> I want the href to be <code>/Controller/Action</code> only, so i remove everything after the ?</p> <p>im using this now</p> <pre><code> $('.Delete').click(function (e) { e.preventDefault(); var id = $(this).parents('tr:first').attr('id'); var url = $(this).attr('href'); alert(url); </code></pre>
javascript jquery
[3, 5]
3,049,509
3,049,510
jQuery plug-in to remap numeric keypad
<p>Is there a jQuery plug-in to remap the "dot" key in the numeric keypad? The purpose is to make it print a decimal separator, rather than a dot, in languages that use commas or other characters. I'd like to mimic the behaviour of some desktop applications like MS Excel.</p> <p>(It's okay to hard-code the output character.)</p>
javascript jquery
[3, 5]
1,621,239
1,621,240
how to create pluggable ASP.Net website?
<p>what are the best practices to create a site, with ability to develop plug ins for it ? </p> <p>like you want to create a Blog module, and you want users or co developers to add plugins to extend this module functionality</p> <p>thanks in advanced.</p> <p><strong>Update:</strong> man thanks so much for hte ultra speed answers, but i think this is over kill for me, is int there simpler solution, like i have seen blogengine plugin creation system is you just have to decorate the class plugin with [Extension].</p> <p>i am kind of mid core developer, so i was thinking of base class, inheritance, interfaces , what do you think ?</p>
c# asp.net
[0, 9]
1,143,498
1,143,499
Calling C++ executable from JAVA
<p>I have poker bot written in C++. I want to compete it with another Poker Academy agent. In order to do that there is an API in JAVA namely "meerkat api". </p> <p>I have no idea how to call my c++ executable from java api, how does one go about communicating with the independent c++ executable from within a java package?</p>
java c++
[1, 6]
5,503,734
5,503,735
Retrieving exact clients time in C#
<p>Till today I am using <code>DateTime.Now;</code> function to save the time and data of users. Well, at later stage I used JavaScript to get the client's date and time to maintain Time Zone. But when I change my system's date and time and try that JavaScript. It show the changed time of my computer. I need how to get clients correct current date and time value. How to get it.</p> <p>Please do not exceed answer more than C# &amp; JavaScripts.</p>
c# javascript
[0, 3]
3,117,359
3,117,360
Calling server side function from JS using hidden button
<p>I've came into a need of calling a server-side function from a javscript function.</p> <p>As much as I know, this isn't really possible since JS is running on the client, thus it is only possible to call a static function (which is not in the same context).</p> <p>I've read somewhere about the hidden button method, of hiding an asp server-side button, and then clicking it programmatically from JS, hence making postback and then calling the eventhandler.</p> <p>Few questions about this method -</p> <ol> <li><p>How good is this method? I mean, is this method is widely used or it considered to be primitve and old?</p></li> <li><p>What are the down sides of this method?</p></li> <li><p>Another thing I read about this method is that if you came to use this method it means that something is wrong with the overall page logic design. Is that on some level true? Is there perhaps a better way to deal with this problem?</p></li> </ol> <p>Thanks ahead</p>
javascript asp.net
[3, 9]
3,537,039
3,537,040
Which library/framework can be used for this specific project?
<p>I have a project, but I don't know which library that I could use for this project:<br> <em>Project requirement</em></p> <ol> <li>Log into hotmail.com</li> <li>Click on each email individually and take a specific link out of the email. </li> <li>Copy and add the link i want into a txt file. </li> </ol> <p>I've used to try Watir with Ruby, however I would like to try C++ and C# libraries this time. Plus, non-commercial please since I'm still a student. Any idea?</p> <p>Thank you,</p>
c# c++
[0, 6]
3,092,715
3,092,716
Run JS function on page load if condition
<p>I have the following link which opens a dom window...</p> <pre><code>&lt;a href='#inlineContent' class='defaultDOMWindow'&gt;(edit interests)&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;";?&gt; &lt;script type='text/javascript'&gt; $('.defaultDOMWindow').openDOMWindow({ eventType:'click', loader:1, loaderImagePath:'animationProcessing.gif', loaderHeight:16, loaderWidth:17 }); &lt;/script&gt; &lt;div id='inlineContent' style='display: none;'&gt; &lt;h1 class='login-hdr'&gt;Your Interests!&lt;/h1&gt; </code></pre> <p>What I need to do is if a user visits a certain url eg, www.mysite.com#DOMwindow the DOM window would then load without the user having to click the link, but if he visits the url normally with www.mysite.com the window would not load, im not sure if this is possible but thought id ask...</p>
javascript jquery
[3, 5]
4,454,704
4,454,705
how to delete the content of text file without deleting itself
<p>I want to copy the content of file 'A' to file 'B'. after copying done I want to clear the content of file 'A' and want write on file 'A' from it's beginning . I can't delete the file 'A' as it is connected with some other task.</p> <p>I was able to copy the content using java's file API(readLine() ), but don't know how to clear the content of file and set the file pointer to beginning of the file.</p> <p>Plz help how to do this.</p> <p>pl. let me know if there's any alternative for this..</p>
java android
[1, 4]
5,724,053
5,724,054
WEIRD: jquery .show and .hide not responding or changing css of corresponding div
<p><a href="http://playerspace.com/test.html" rel="nofollow">Sample Code of my error</a></p> <p>So as you can see in the above example, next to where it says "Disclaimer Question111", there is an expand/contract link. The script works halfway, in that the text change occurs, but it does not change the display css for the div its anchored to. </p> <p>Any idea why? I don't see any page errors. </p> <p>The code that triggers this is in my site.js file but i pulled it out here so you can see:</p> <pre><code> $('.accordion-trigger-settings').click(function(){ var target=$(this).attr('href'); if($(target).css('display')=='none') { $(target).show(); $(this).text('Collapse Settings'); } else { $(target).hide(); $(this).text('Expand Settings'); } return false; }); </code></pre> <p>It applies to this block:</p> <pre><code>&lt;a href="#accordion-season5160" class="accordion-trigger-settings"&gt;Expand View&lt;/a&gt; &lt;div class="padding5"&gt;&lt;/div&gt; &lt;div class="accordionContent" id="accordion-season5160"&gt; &lt;textarea name="str_disclaimer_header5160" id="str_disclaimer_header5160"&gt;&lt;/textarea&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
4,885,788
4,885,789
Can I compare two files: local and remote on http server without downloading?
<p>I want to compare two files (one file is located on local location and second is located on http server). Can I do that without downloading? I want to know that two files is completely the same.</p>
java android
[1, 4]
5,635,394
5,635,395
LinkedList<T> (2.0): removing items iteratively
<p>I need to iterate through a <code>LinkedList&lt;T&gt;</code> (in .NET 2.0) and remove all the items according to a given criteria. It was easy way under Java, since I could do the following:</p> <pre><code>Iterator&lt;E&gt; i = list.iterator(); while (i.hasNext()) { E e = i.next(); if (e == x) { // Found, so move it to the front, i.remove(); list.addFirst(x); // Return it return x; } } </code></pre> <p>Unfortunately, in the .NET behavior of <code>IEnumerator&lt;T&gt;</code> (the equivalent of <code>Iterator&lt;E&gt;</code>) there's no <code>remove</code> method to remove the current element from the collection. Also, in the <code>LinkedList&lt;T&gt;</code> there's no way to access an element at a given index, to accomplish the task by iterating back from the last to the first.</p> <p>Have you got any idea on how to do it? Thank you very much!</p>
c# java
[0, 1]
2,213,568
2,213,569
How to access javascript varibale which is set in jquery block?
<p>I've problem in javascript function, there are two variables which are declared in global scope of function and set within jquery plugin. How can i get these variable value out side of jquery.</p> <pre><code> function GetDirectionFromCurrentLocation(StoreAddress) { var positionStore = null; var positionCurrent = null; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ 'address': StoreAddress }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { positionStore = results[0].geometry.location; } if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function (position) { positionCurrent = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); }); } }); window.open("http://maps.google.com/maps?saddr=" + positionCurrent + "&amp;daddr=" + positionStore + "&amp;hl=en&amp;output=html"); } </code></pre> <p>These variables are always null. </p>
javascript jquery asp.net
[3, 5, 9]
5,988,855
5,988,856
How does one post nested JSON using JQuery?
<p>I have an admin page for a store where a user can modify item data. I'm trying to implement something for the admin to add and remove images by dragging them to and from a div. </p> <p>I can submit the data just fine until I add the "images" object to the mix as follows:</p> <pre><code>$("#saveButton").click(function() { $("form *, button").attr("disabled", "true"); formData = $("#itemForm").formHash(); formData["item"] = $("#itemSelector option:selected").val(); formData["action"] = "save"; formData["images"] = {}; $("#otherImages img").each(function(i){ formData["images"][i] = $(this).attr("src"); }); $.ajax({ type: "POST", url: "adminajax.php", data: formData }); }); </code></pre> <p>Here, the "images" value is submitted as "[object Object]".</p> <p>I would like to have "images" be an associative array on the server.</p> <p>One workaround is to simply have several image keys: "image1: source", "image2: source" etc, however, it would really be nice if it could be an object so that I can do a for-each on "images" instead of filtering the key strings.</p>
javascript jquery
[3, 5]
1,632,948
1,632,949
Progress Dialog on anything else but the index
<p>Here is my code:</p> <pre><code>public class MainActivity extends Activity { WebView mWeb; ProgressDialog mProgress; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // no need to use title bar requestWindowFeature(Window.FEATURE_NO_TITLE); // set webview as main content only mWeb = new WebView(this); setContentView(mWeb); // set Javascript WebSettings settings = mWeb.getSettings(); settings.setJavaScriptEnabled(true); // the init state of progress dialog mProgress = ProgressDialog.show(this, "Loading", "Please wait for a moment..."); // add a WebViewClient for WebView, which actually handles loading data from web mWeb.setWebViewClient(new WebViewClient() { // load url public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } // when finish loading page public void onPageFinished(WebView view, String url) { if(mProgress.isShowing()) { mProgress.dismiss(); } } }); // set url for webview to load mWeb.loadUrl("file:///android_asset/index.html"); } } </code></pre> <p>I want to only show the progress dialog on links/pages that are not " file:///android_asset/index.html". For instance, there is a link to cnn.com on the index file. When clicked, I want the progress dialog to popup but if the user then clicks back, the progress dialog will not show since its now on the "file:///android_asset/index.html"</p> <p>I hope this makes sense. Thanks!</p>
java android
[1, 4]
2,192,239
2,192,240
How to display something if variable is not set inside a each loop?
<pre><code>$.each(json.data,function(i,fb){ //some code here... if (msg.length &gt; 150) { msg = msg.substr(0,200)+"..."; } //more code here... }); </code></pre> <p>I have an issue here. If msg is not defined I got an error and I got nothing displayed on the browser.</p> <p>Possible Solution: create a default message for the cases where msg is not defined.</p> <p><strong>Try:</strong></p> <pre><code>if (msg = 'undefined') { msg = 'some default message'; } else if (msg.length &gt; 150) { msg = msg.substr(0,200)+"..."; } </code></pre> <p><strong>Issue:</strong> The above try didn't work because I get for each item, the same default message, instead of having the default message only for those cases were msg is no "set". </p> <p><strong>Request:</strong> Can I have your help in order to write the proper code so that, on each item, if msg is not defined show a default one, if otherwise, it's site, display it ?</p> <p>If you lack some information in order to proper help me, please, let me know. I'm really on a bad position right now. :s</p> <p>Thanks a lot, MEM</p>
javascript jquery
[3, 5]
3,221,800
3,221,801
Save base64 encoded image into the file in PHP
<p>I have the following code : </p> <pre><code>&lt;?php header('Content-Type: image/png'); $data = "iVBORw0KGgoAAAANSUhEUgAAAuAAAAI8CAYAAACwIh5dAAAgAElkZJgRCXxOAuIPzzTlg......"; define('UPLOAD_DIR', '/home/Desktop/image.png'); $img = $data; $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); $file = UPLOAD_DIR . uniqid() . '.png'; $success = file_put_contents($file, $data); print $success ? $file : 'Unable to save the file.'; ?&gt; </code></pre> <p>Here <code>$data</code> contain the encoded string of image in base-64. I want to save the image into the file. I did the previous code also go through lot of tutorial in google but it's not working. </p> <p>Can anyone help me where I am going wrong.</p> <p>Thanks in advance.</p>
php javascript jquery
[2, 3, 5]
3,821,573
3,821,574
Getting object values from a LinkedHashMap
<p>So for my local data structure I have the following</p> <pre><code>DataStructure ds = new DataStructure(); //Examples to put in the Data Structure "ds" ds.menu_item.put("Pizza", new DescItems("A Pizza",2.50,4)); ds.menu_item.put("Hot Dog", new DescItems("A yummy hot dog",3.50, 3)); ds.menu_item.put("Corn Dog", new DescItems("A corny dog",3.00)); ds.menu_item.put("Unknown Dish", new DescItems(3.25)); </code></pre> <p>The DataStructure class has a LinkedHashMap implementation such that</p> <pre><code>LinkedHashMap&lt;String, DescItems&gt; menu_item = new LinkedHashMap&lt;String, DescItems&gt;(); </code></pre> <p>And finally the DescItems class is</p> <pre><code>public final String itemDescription; public final double itemPrice; public final double itemRating; public DescItems(String itemDescription, double itemPrice, double itemRating){ this.itemDescription = itemDescription; this.itemPrice = itemPrice; this.itemRating = itemRating; } </code></pre> <p>There are other constructors to account for no itemDescription and/or itemRating</p> <p>I'm trying to apply a method to check to see if a value has itemRating other than 0 (0 indicating no rating)</p> <p>But specifically I came across this problem:</p> <pre><code>DescItems getC1 = (DescItems)ds.menu_item.get("Pizza"); System.out.println(getC1.toString()); </code></pre> <p>Only prints out reference information like DescItems@142D091</p> <p>What should I do to get a specific object variable instead of referencing the object?</p>
java android
[1, 4]
4,257,913
4,257,914
Error in for loop in datatable
<p>I've got an error in a datatable , that I want to present it in the aspx code. (%>)</p> <p>it throw me an exception : </p> <blockquote> <p>An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p> </blockquote> <p>this is the code :</p> <pre><code>&lt;%for (int i = 0; i &lt; DTview.Rows.Count; i++)%&gt; &lt;% {%&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["blog_total_views"].ToString(); %&gt;&lt;/tr&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["first_name"].ToString(); %&gt;&lt;/tr&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["is_affiliate"].ToString(); %&gt;&lt;/tr&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["rating"].ToString(); %&gt;&lt;/tr&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["price"].ToString(); %&gt;&lt;/tr&gt; &lt;tr&gt;&lt;%=DTview.Rows[i]["current_city"].ToString(); %&gt;&lt;/tr&gt; &lt;%}%&gt; </code></pre> <p>Thanks</p>
c# asp.net
[0, 9]
3,427,925
3,427,926
how to convert char to int in java for android
<p>how to convert char to int in java for android</p> <p>for example: </p> <pre><code>int MyInt; char MyChar = 'A'; </code></pre> <p>how to insert the value 65 into MyInt ?</p> <p>in C# it like: <code>MyInt = Convert.ToChar(MyChar);</code> </p> <p>thanks</p>
java android
[1, 4]
5,986,307
5,986,308
Find user is online or not
<p>In my project i have to implement an interface which shows whether a particular user is online or not as in social networking site(like orkut and facebook)</p>
c# asp.net
[0, 9]
4,581,654
4,581,655
What Javascript / jQuery pattern is this to enclosing and hiding everything but still can alter the page?
<p>Did somebody come up with this pattern so it is a famous and well-known pattern? I see this pattern for using Javascript / jQuery, such as in <code>init.js</code>:</p> <pre><code>var Initializations = {}; Initializations = (function($) { function doSomething(i, domElement) { // ... } $(function() { $("#foo").click(function() { // ... }); $(".bar").each(doSomething); }); })(jQuery); </code></pre> <p>So it looks like it can "hide" almost everything from the global scope, avoid conflict if another library also uses <code>$</code> as a variable, and the HTML page can be altered by this code using jQuery. The code does almost nothing to the global scope (except the variable <code>Initializations</code>), and even if there are 2 jQuery versions, and if they can be denoted by 2 variables <code>jQuery142</code> and <code>jQuery161</code>, then the code can be even using 2 jQuery libraries just by changing the last line of the code above to <code>jQuery161</code> (say, if some 3rd party code needs jQuery 1.4.2 and your code has been using jQuery 1.6.1 for new features and/or bug fixes).</p> <p>Can the above code be improved? I am wondering why the extra variable <code>Initializations</code>, why not just:</p> <pre><code>(function($) { function doSomething(i, domElement) { // ... } $(function() { $("#foo").click(function() { // ... }); $(".bar").each(doSomething); }); })(jQuery); </code></pre> <p>?</p>
javascript jquery
[3, 5]
3,218,185
3,218,186
asp.net error CS0123: No overload matches delegate 'System.EventHandler'
<p>CS0123: No overload for 'addItems' matches delegate 'System.EventHandler'</p> <pre><code>protected void addItems(System.EventHandler e) { DropDownList numDropDown = (DropDownList) Page.FindControl("DropDownNum"); foreach (numOption option in numConfigManager.numConfig.numOptions.Options) { numDropDown.Items.Add(option.Value); } } </code></pre>
c# asp.net
[0, 9]
5,129,316
5,129,317
Displaying Soft Keypad Via Code
<p>How could I keep the keypad visible, or display the keypad for the next EditText views via. I would like to keep the keypad visible if the input is invalid. Or, in the case of valid input, display the keypad after requesting focus on the next EditText.</p> <p>My validation:</p> <pre><code>private boolean processTextField( EditText str ) { Log.v( "Exfo. Processing: ", str.getText().toString() ); boolean notZero = ( (str.getText().toString().length() &gt; 0) &amp;&amp; (this.notZero(str.getText().toString())) ); // checks id value is zero if ( notZero ) { if ( this.frameSizeLength() == 0 ) { txtFrameSize.requestFocus(); // TO DO: display keyboard } else if ( this.thruPutLength() == 0 ) { txtThruPut.requestFocus(); // TO DO: display keyboard } else this.calcResults(Integer.valueOf(txtFrameSize.getText().toString()), Float.valueOf(txtThruPut.getText().toString()) ); } else { this.showMSG("Enter a value greater than zero."); // TO DO: keep focus on current EditTExt, display keypad } } } </code></pre> <p><strong>EDIT</strong>: There are only 2 EditText views: framesize and thruput.</p> <p>Right now, no matter what, the keypad is hidden after hitting the return/done button. I am targeting Android 2.2, but I focusing on touch only devices for now. Thanks, MD</p>
java android
[1, 4]
1,462,912
1,462,913
In Android I am Getting BuildConfig.java but not R.java File
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/6133186/r-java-missing-in-android-project-in-netbeans">R.java Missing in Android Project in NetBeans</a> </p> </blockquote> <p>In Android I am Getting <code>BuildConfig.java</code> file but it can not generate <code>R.java File</code>. </p> <p>Please Help me this regards. I tried with <code>Android Tool -&gt; fix project properties</code>. but still failed to run.</p> <p>I also tried Clean and build but again failed to generate R.Java.</p> <p>Thanks in advance.</p>
java android
[1, 4]
4,130,195
4,130,196
Suggest a good Android development workflow
<p>I'm interested in developing android applications. I've a background of Java/Swing/C++/ajax developer so I think I may find myself at home. As I installed the SDK I noticed that I can't follow my usual java development scheme: building base libraries, then the final app. In fact I'd like to develop libs and test them in a more convenient environment like, Swing. There is no way I can use android libs in pure swing apps... Do you have any suggestion about these topics and what's your development process?</p>
java android
[1, 4]
3,863,375
3,863,376
script link not working on all browsers
<p>all my browsers give me a blank page when i put the embeded script tag in the header for jQuery or for all script tags. Does anyone know why that is, my src attribute is pointing in the write path. Does anyone know what I'm doing wrong or what the problem might be? I've tried two different jQuery libraries and Im still getting the smae result.</p>
jquery asp.net
[5, 9]
2,979,801
2,979,802
How to add Dynamic Field in Dynamic Page in ASP.NET in C#
<p>I want to add one Dynamic Field as "ADD MORE SKILLS" which shows some Textbox and Label will come on clicking this link. You can see this kind of example on some Shine.com, TimesJob etc.....</p>
c# asp.net
[0, 9]
5,058,901
5,058,902
how to identify rootpath for application server?
<p>In my .net web application I create a blank solution and add website and class library into it. All the website pages are in UI folder, so when I use</p> <pre><code>'&lt;%=ResolveUrl("~") %&gt;' </code></pre> <p>in javascript, it returns '/UI/', but in application server I set website root at UI folder, so '&lt;%=ResolveUrl("~") %>' returns '/'. The problem here is, when I call AjaxPages under UI/AjaxPages/ folder it only works at local, it does not work at application server. The code I use is</p> <pre><code>var root='&lt;%=ResolveUrl("~") %&gt;'; $.post(root+"AjaxPages/UserStatus.aspx",....)... </code></pre> <p>Even I use </p> <pre><code>var path='&lt;%=ResolveClientUrl("~/AjaxPages/UserStatus.aspx") %&gt;'; $.post(path,....) </code></pre> <p>It still does not work in application server, but works local. I really have no idea what's wrong here. Thank you for any tips.</p>
c# jquery
[0, 5]
4,437,521
4,437,522
PHP script for creating calendar table or jquery complete solution required
<p>Ok so this is what I want to make:</p> <p><img src="http://i44.tinypic.com/eiwphl.jpg" alt="alt text"></p> <p>red = booked</p> <p>green = available</p> <p>I have data in mysql in the format of: <code>property_id, booked_from, booked_until</code> .</p> <p>Before I start trying to create the correct loops etc to create and style the table, i thought i best ask if there are already good jquery plugins / php classes create this visual interface and uncluttered enough to allow me to add a select date range method (like Google Analytics)?</p> <p>I'm looking for something to create a basic calendar table on a loop, which i can then style and add jquery features. Though worth asking if there's a complete package that already does what i plan on making?!!</p> <p>(jquery ui's date-picker doesn't look powerful enough / easy enough to modify)</p>
php jquery
[2, 5]
4,175,738
4,175,739
Why is PHP function breaking my Javascript
<p>I have this scipt call:</p> <pre><code>.... $objResponse-&gt;addScriptCall("my_script"); return $objResponse-&gt;sendResponse(); </code></pre> <p>This works ok but if I try to send a php mail just before, the script is not called:</p> <pre><code>... $send =&amp; $mailer-&gt;Send(); $objResponse-&gt;addScriptCall("my_script"); return $objResponse-&gt;sendResponse(); </code></pre> <p>Why is that happening? The problem persists even if I replace the email function with a plain:</p> <pre><code>... print 'hello'; $objResponse-&gt;addScriptCall("my_script"); return $objResponse-&gt;sendResponse(); </code></pre>
php javascript
[2, 3]
3,681,818
3,681,819
Reset all checkboxes on page without looping
<p>I was wondering if it was possible to reset all the checkboxes (mark them unchecked) on the page without looping using jQuery?</p>
javascript jquery
[3, 5]
438,330
438,331
Why will this code not work in my production environment?
<p>The code below works perfectly in Dev and Stage environment but not Production. Stage and Prod are both on IIS7. I've confirmed that litTest is being set and shows on the page but the class never appears on the html control in prod. Im baffled!</p> <pre><code> protected void lvQuestionList_ItemDataBound(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { ListViewDataItem dataItem = (ListViewDataItem)e.Item; TT.BusinessLogic.stQuestion question = (TT.BusinessLogic.stQuestion)dataItem.DataItem; HtmlControl tr = (HtmlControl)dataItem.FindControl("trRow"); if (tr != null &amp;&amp; question.stStatus.Status == "New") tr.Attributes.Add("class", "direct-row"); if (SortedAnimation != null &amp;&amp; question.QuestionId == new Guid(SortedAnimation)) { if (tr != null &amp;&amp; question.stStatus.Status == "New") tr.Attributes["class"] = "sortanim direct-row"; else { tr.Attributes["class"] = "sortanim"; litTest.Text = SortedAnimation + "test"; } SortedAnimation = null; } } } </code></pre> <p>Should also mention this listview is in an UpdatePanel.</p>
c# asp.net
[0, 9]
2,265,196
2,265,197
What is the working of web Crawler?
<p>Will web crawler crawl the web and create a database of the web or it will just create a searchable index of web? If suppose it creates an index, who will exactly will gather the data of web pages and store it in database?</p>
php python
[2, 7]
4,270,584
4,270,585
InnerText in Python
<p>Is there an equivalent to the c# <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlnode.innertext.aspx" rel="nofollow"><code>XmlNode.InnerText</code></a> Property in Python?</p> <p>If not, is there a straightforward way to implement it in Python? I thought I found something <a href="http://www.chaingang.org/bcc/2011/09/12/inner-text/" rel="nofollow">here</a>, but it seems to concatenate the values of the node and child nodes in the wrong order.</p>
c# python
[0, 7]
3,900,031
3,900,032
Most common or vicious mistakes in C# development for experienced C++ programmers
<p>What are the most common or vicious mistakes when experienced C++ programmers develop in C#?</p>
c# c++
[0, 6]
3,121,039
3,121,040
Get server time php and javascript
<p>I have this script 1- It gets the time of number of messages sent (time identified by client) 2- Compare it to now time (server time) 3- change the background of each message according to the time difference Now i have a problem in updating the clock, i update it each second (ajax request) but i think it is making the system heavier. Is there a way i can update the clock (server time) every minute? This is the script: javascript: function to get server time</p> <pre><code> function gettime() { $.post('gettimeofday.php', function(t){ document.getElementById('formatted_time').value = t; }); setTimeout("gettime()",1000); } </code></pre> <p>php:</p> <pre><code>$server_current_time = time(); echo(date("H:i",$server_current_time)); </code></pre> <p>javascript: function to calculate the time difference:</p> <pre><code>function checkTime(Time_to_send) { var time_from_db = Time_to_send.split(":",2); var time_hours = Number(time_from_db[0] * 60 ); var time_min = Number(time_from_db[1]); var time_of_msg = time_hours + time_min; var current_time = document.getElementById('formatted_time').value; var ct = current_time.split(":",10); var now_hours = Number(ct[0] * 60); var now_min = Number(ct[1]); var time_live = now_hours + now_min; var time_diff = time_of_msg - time_live; return (time_diff); } </code></pre> <p>And after that i check the time difference and change the background color. I hope you can help me find a solution and if you have any question concerning my question please tell me.</p>
php javascript
[2, 3]
2,047,757
2,047,758
javascript publish subscribe with callback
<p>Scenario :- a json with checked &amp; unchecked item count needs to be sent to a common function which in turn does some basic validation or shows error. There are different function each handle by different css/js team which call this function &amp; depending on the common function result (true/false) each team/module that provided the json with check/uncheck status does the relevant action. Thus both common function (say getcount) &amp; every independent team calling this function rely on the result of common function manipulate the dom/css independently &amp; the common function too manipulate dom independently.</p> <p>Instead of conventional way of calling function (say getCount({"chk" : 2 , "unchk" : 4})) i am looking for pusblish/subcribe method which is more cleaner as in Jquery &amp; easy to convey to all as only topic name &amp; contract/json needs to describe (also less if/else clause). Since common function is subscriber &amp; when every independent function publishes the resultant chk/unchek json the common function can easily do the manipulation using the publish/subscribe approach but the independent method has to do counter action as well which is only possible if subscribe function can send the result. I know javascript is asynchronous also i understand that common method can publish (say "resultOfGetCount") which every independent function/module can listen to &amp; do the action but is there any way in either in plain javascript or jquery where in on which subscriber can send the publisher the result in a way similar to $.ajax where in the callback function is called once server call is complete. </p> <p>Looking for the best approach for such scenario.</p>
javascript jquery
[3, 5]
2,360,148
2,360,149
On MultiThreading on the Android platform
<p><code>Multithreading on Android</code> is to some extent an easy task due to the various possibilities available for us.</p> <p>However it would be nice to understand the difference between the approaches.</p> <p><strong>What is the best way to multitask and based on what preferences is it the "best"?</strong></p> <ol> <li><p><strong><code>AsyncTask</code>?</strong></p> <pre><code>class MultiTasker extends AsyncTask&lt;, , &gt; </code></pre></li> <li><p><strong><code>Runnable</code>?</strong></p> <pre><code>Runnable myRun = new Runnable(){ public void run(){ } }; Thread T = new Thread(myRun); T.start(); </code></pre></li> <li><p><strong><code>Handler</code>?</strong></p> <pre><code>class MultiTasker extends Handler </code></pre></li> </ol>
java android
[1, 4]
739,807
739,808
How to make an android app from a website with php backend
<p>there is login for my website.</p> <p>3 pages which are used while logging into website are :-</p> <p>1) login_form.html ( this html page has form in which users can fill data when they click submit it sends to login_validate.php)</p> <p>2) login_validate.php ( this php page validates the input texts and if he is an authentic user it redirects them to home.php)</p> <p>3) home.php</p> <p>I want to make an android login page,when correct login username and password are entered instead of showing home.php it should show some other thing.</p> <p>I am able to make a POST http request to login_validate.php ,and i am getting home.php as reply,</p> <p>my problem is how can i know that login is successful as i am not getting any reply as success or failure.i am getting login_form.html when authentication is wrong and home.php when username and password are right....</p> <p>in my android app how can i know whether he entered right username and password or not correct credentials from the data i got from the server now???</p>
php android
[2, 4]
625,275
625,276
Boolean object in javascript returns true for "false" parameter
<p>I have a little problem.</p> <p>I have situations where my ajax calss returns a string.</p> <p>sometimes that string is "false" i want to always convert that string value into a boolean i tried : new Boolean(thatValue)</p> <p>but it returns true even for "false" as a paremter</p> <p>is there anyway to solve this? except me writing my own custom function that will return false if "flase" ?..</p> <p>thank you</p>
javascript jquery
[3, 5]
205,132
205,133
How to Insert Data from DataTable to Oracle Database Table :
<p>I've data in <code>DataTable</code> with 2 rows and 3 columns. I want to insert that data into <code>Oracle</code> table. </p> <p>How can I insert? please give me with some example.</p> <p>And also</p> <p>How can I pass datatable to storedprocedure in <strong>ORACLE</strong>...</p> <p>I pass datatable in below mensioned manner, but datatable type problem is comming. how can I solve this?</p> <pre><code>cmd.Parameters.Add("@Details",dtSupplier); (OR) cmd.Parameters.Add("Details", DbType.Single).Value = dtSupplier.ToString(); </code></pre>
c# asp.net
[0, 9]
3,619,793
3,619,794
JQuery Code not working in IE9 or lower versions
<p>EDIT*</p> <p>In one of the pages in our website there is a pirate with a speech bubble that tells jokes. When the bubble is clicked the joke changes to another one at random in the list. For some reason this will not work in IE9 or lower. Can anyone tell me why?</p> <p>I have checked the console and this error appears </p> <pre><code>"CE2.w.external.InPrivateFilteringEnabled is not a function" </code></pre> <p>Here is the script:</p> <pre><code>$(document).ready(function () { var list = $(".joke-list li").toArray(); var elemlength = list.length; // Encapsulate random value assignment within a function var setRandomValue = function(element) { var randomnum = Math.floor(Math.random() * elemlength); var randomitem = list[randomnum]; $(element).html($(randomitem).text()); } // Bind click button $('.speech').click(function () { setRandomValue(this); }); // Set random value for the first time setRandomValue($('.speech')); $('.speech').css("width: 1000px;"); }); </code></pre> <p>Here is a fiddle that I have thrown together to show the fault: <a href="http://jsfiddle.net/uRd6N/116/" rel="nofollow">http://jsfiddle.net/uRd6N/116/</a></p>
javascript jquery
[3, 5]
1,788,154
1,788,155
Response an xml file in modal popup
<p>This code is in control.ascx and control is put in ModalPopup.aspx page.</p> <p>First ai try with response.end() - this code throw exception. After ai try coment this line, but nothing is hapen.</p> <p>Browser is IE8</p> <pre><code>try { //export StringBuilder sb = ExportToExcelXml(); System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] byteText = encoding.GetBytes(sb.ToString()); Response.Clear(); Response.Charset = "utf-8"; Response.ContentType = "text/xls"; Response.AddHeader("content-disposition", "attachment; filename=export.xls"); Response.BinaryWrite(byteText); //Response.End(); } catch (Exception ex) { </code></pre>
c# asp.net
[0, 9]
1,124,747
1,124,748
How to remove a div in the parent structure?
<p>I am trying to remove some elements using a link. The elements that I am trying to remove are in a link's parent div, but i cannot seem to remove them.</p> <p>Here is the HTML:</p> <pre><code> &lt;div class="QR-answer-holder"&gt; &lt;label class="QR-answer-label"&gt;Enter an answer:&lt;/label&gt; &lt;input class="QR-answer-input textbox" type="text" name="answer" /&gt; &lt;/div&gt; &lt;a class="new-answer new-qr-answer-space" href="javascript:void(0)"&gt;New answer space&lt;/a&gt; | &lt;a class="remove-answer remove-qr-answer-space" href="javascript:void(0)"&gt;Remove Answer Space&lt;/a&gt; </code></pre> <p>Here is the JQuery:</p> <pre><code> $remove_qr_answer = $(".remove-qr-answer-space"); $remove_qr_answer.live("click", function() { $(this).parent.$(".QR-answer-holder").$(".QR-answer-label").remove(); $(this).parent.$(".QR-answer-holder").$(".QR-answer-input").remove(); }); </code></pre> <p>Is there anyway to make it so the remove button removes the label and input closest to the end of the div? (or does it do that automatically)?</p>
javascript jquery
[3, 5]
5,123,510
5,123,511
Confine validations to controls in gridview while updating(using command field edit,update,cancel)
<p>I am able to provide validations for the controls in grid view but those validations are also applied to the controls in the form.</p> <p>My question is how can those validations can be confined to controls in gridview only? </p> <p>i am using inbuilt commandfield (edit,update,cancel) as edit button. when i set property causevalidations to true for the commandfiled, it triggers validation not only to controls in gridview but also to the rest of the form. </p> <p>coudl you help..</p>
javascript jquery asp.net
[3, 5, 9]
4,418,806
4,418,807
How to make a jQuery popup to ask for logging in or creating profile
<p>I finally got a jQuery popup to work, and now trying to give the user the option to log in or create profile</p> <p>So far I have something very simple like this:</p> <pre><code>var $dialog = $('&lt;div&gt;Please log-in or create a profile&lt;/div&gt;') .dialog({ autoOpen: false, title: 'Login Dialog' }); </code></pre> <p>But what are some good and simple ways I can ask the person to log in? Should I just make a login form right in the div there? If so, in case the person needs to create a profile instead, how do I easily enable them to do that?</p> <p>Also, should the login and create-profile code live elsewhere? If so, how do I reference it from this setup?</p> <p>Thanks!!</p>
javascript jquery
[3, 5]
4,464,585
4,464,586
Android Java Drawing multiple lines
<p>I already got my DrawView, but can only draw 1 line at one time. If i try drawing again the last line deletes, how can I "save" them?</p>
java android
[1, 4]
3,761,191
3,761,192
Passing value to javascript from asp.net
<pre><code>&lt;script type="text/javascript"&gt; function abc() { var id = document.getElementById('123'); var caption= &lt;%=MyProperty %&gt;; } &lt;/script&gt; </code></pre> <p>code behind:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { Page.RegisterStartupScript(Guid.NewGuid().ToString(),"&lt;script language = 'javascript'&gt;abc();&lt;/script&gt;"); } protected int MyProperty { get { return 123; } } </code></pre> <p>i need to pass string value to javascript, with int this codes works fine.</p> <pre><code>protected string MyProperty { get { return "123"; } } </code></pre> <p>when i tried to pass string this code does't works.</p>
javascript asp.net
[3, 9]
1,321,831
1,321,832
stop event after first time
<p>i am firing an event when im at a special scrollposition with <a href="https://github.com/protonet/jquery.inview" rel="nofollow">jquery.inview</a>. it works by adding classes if an element is in the viewport. in my script im saying the following</p> <pre><code> var $BG = $('#BG') $('#BG').bind('inview', function (event, visible) { if (visible == true) { $(this).addClass("inview"); } else { $(this).removeClass("inview"); } }); if($BG.hasClass("inview")){ $('#diagonal').css('left',0) $('#diagonal').css('top',0) } </code></pre> <p>but it fires the .css events again and again, but i want them to fire only at the first time the #BG gets the "inview" class. thanks ted</p>
javascript jquery
[3, 5]
2,868,437
2,868,438
Problem with setInterval to call function
<p>I'm trying to get a simple script to work, but somewhere I must have done something wrong because it's not working! I just want to set an interval timing that call a function. Preciate some help. Perhaps not the best solution, but I'm new to this.</p> <pre><code>$(document).ready(function() { startInterval(); // activate timer function startInterval() { var t = setInterval("autoSave", 20000); } function autoSave() { alert("test"); } }); </code></pre>
javascript jquery
[3, 5]
2,343,920
2,343,921
Replacing "HTML tag with content" with "content"
<p>I need to replace</p> <pre><code>&lt;span class='foo'&gt;bar&lt;/span&gt; </code></pre> <p>with</p> <pre><code>bar </code></pre> <p>using JavaScript / jQuery.</p> <p>Note: tag content must be inserted exactly in the same place, where tag was.</p>
javascript jquery
[3, 5]
3,537,682
3,537,683
Fade in Words from a Word Cloud Randomly
<p>I have build the a word cloud (you can check it out at <a href="http://www.cybernetiksolutions.com/wordcloud" rel="nofollow">http://www.cybernetiksolutions.com/wordcloud</a> )</p> <p>Currently the cloud fades every word in all at one time. I would like to have the words fade in randomly from top to bottom. The idea was inspired by www.vudu.com and <a href="http://wonderwall.msn.com" rel="nofollow">http://wonderwall.msn.com</a> . I figure in the right direction on how I can make this happen would be greatly appreciated. </p>
javascript jquery
[3, 5]
2,996,822
2,996,823
jQuery prevent stop() from giving fixed height to element
<p>I have the following lines of code:</p> <pre><code>$(".product-list .product").hover(function() { $(this).find('.product-description').stop().slideDown("slow"); }, function() { $(this).find('.product-description').stop().slideUp("slow"); }) </code></pre> <p>Now the problem is, when I move fast enough, and then hover the element again, the .product-description get stuck to the height of the old event.</p> <p>For example:</p> <ol> <li>mouseover: element -> animates -> full height: 200px</li> <li>mouseleave: element -> animation stops -> animates -> height: 0 (default height now: 100px)</li> <li>mouseover: element -> animates -> full height: 100px (but should be 200px)</li> </ol> <p>And yes I already tried by getting the normal height - but the problem is, that I use clearfix what jQuery can't really handle.</p> <p>Thanks for any advice</p>
javascript jquery
[3, 5]
2,718,213
2,718,214
How can I find an element by its attribute value with jQuery?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/10882471/jquery-selector-with-specific-attribute">jQuery selector with specific attribute</a> </p> </blockquote> <p>I need to find an element with a specific data-field attribute value. Is it possible to do with jQuery?</p>
javascript jquery
[3, 5]
3,869,788
3,869,789
jQuery not replacing html button with text for more than 1 user
<p>I have this piece of code written in jQuery and PHP:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".vote&lt;?php echo $pid; ?&gt;").click(function(){ $("span.vote_box&lt;?php echo $pid; ?&gt;").html("you have voted"); }); }); &lt;/script&gt; </code></pre> <p>But it doesn't seem to work. What it is supposed to do is to print "you have voted" in the position of a button which users can use to vote some post with. It reacts ok in the beginning but when i log on as a different user the button stays intact and doesn't get replaced.</p> <p>Here is the PHP and HTML part:</p> <pre><code>&lt;?php echo '&lt;span class="vote_box'.$pid.'"&gt;'; echo '&lt;input type="button" class="vote'.$pid.'" name="vote" value="vote"/&gt;'; echo '&lt;/span&gt;'; ?&gt; </code></pre> <p>NOTE: I am using an AJAX request to insert the vote to the database so practically all I want jQuery to do is replace the button with text</p> <p>Any help? I am new to jQuery so I figure the "html" method I am using could be wrong. Thanks in advance!</p>
php jquery
[2, 5]
3,726,470
3,726,471
howto sort a asp:Table?
<p>is it possible to simply sort a asp:Table by columns?</p>
c# asp.net
[0, 9]
5,135,597
5,135,598
How to turn my working JS jQuery from showing loading image for every new div to a global one
<p>below is my working script that shows results on two divs, based on the selection of the drop down list. </p> <p>Every time that the user selects, appears one loading image, for each div. Is there a way to have 1 loading image instead of 2 ? And when the pages are loaded, the image is removed.</p> <pre><code> $(document).ready(function() { $('#termid').change(function() { var val = $(this).val(); $('#firstresult').empty().addClass('loading').load(val + '.php', function(){$('#firstresult').removeClass('loading') }); $('#secondresult').empty().addClass('loading').load(val + 'b.php', function(){$('#secondresult').removeClass('loading') }); }); }); </code></pre>
javascript jquery
[3, 5]
5,367,858
5,367,859
Change value of an element by Index
<p>I can't find a solution for the following problem: There's an element which should change when another element has been changed, when it has got the same index:</p> <pre><code> $("input[bez='sbd_texte']").eq(index).val() = "test"; </code></pre> <p>The "index" variable is ok, but I can't figure out how to change the value of this specfic element. </p> <p>So how can I change the value of a specfic element, which is recognized by an index?</p>
javascript jquery
[3, 5]
1,725,857
1,725,858
toggle effect in jquery not working
<p>Please, why is this not working:</p> <pre><code>$("#togglePanel").click(function(e){ $("#toolpanel").toggle(function(){ $("#orderMap").animate({marginLeft: 0, width: "100%"}, 500); }, function(){ $("#orderMap").animate({marginLeft: "341px", width: "576px"}, 500); }); }); </code></pre> <p>But when I do this, it works:</p> <pre><code>$("#togglePanel").click(function(e){ $("#toolpanel").toggle(function(){ $("#orderMap").animate({marginLeft: 0, width: "100%"}, 500); }); }); </code></pre> <p>Thanks...</p>
javascript jquery
[3, 5]
5,852,429
5,852,430
How to call javascript function of a web browser control of C#?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1437251/calling-a-javascript-function-in-the-c-sharp-webbrowser-control">Calling a Javascript function in the C# webBrowser control</a> </p> </blockquote> <p>I want to call a JavaScript function through C#, using a WinForm's WebBrowser control. I've attempted to search however could not find anything which answers my question, only solutions which involved ASP.NET.</p> <p>Thank you in advance.</p>
c# javascript
[0, 3]
1,787,936
1,787,937
How to addClass and/or animate an element inside an iframe
<p>I have created a widget that other people can load into their html via an iframe. Everything is working fine to load my custom js file (as the iframe src) into the iframe. I'm also loading jquery from ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js. My custom js then loads and parses some json at various intervals with $.get() from a server on the same domain as the js file. I use the json to create html elements that I add inside the iframe. Again, all of this is working as expected.</p> <p>The problem that I'm having is that I want to animate the html that I've added inside the iframe. I'm using the following functions to handle the animation:</p> <pre><code>function embeddedUnMarkAsNew($el) { $el.animate({color:"black"}, 500) } function embeddedMarkAsNew(timeToMark, $el){ alert("marking for this time: "+timeToMark) //start animation $el.animate({color:"red"}, 500); //end animation when duration runs setTimeout(function() { embeddedUnMarkAsNew($el); }, timeToMark) return false } </code></pre> <p>The alert inside of embeddedMarkAsNew() triggers with the proper timeToMark, but the element does not animate. I've changed the animation to an addClass() just to try it out, and although the class does show up in the inspector as being added, the element itself does not reflect this added class.</p> <p>I've used this technique on elements outside of iframes. What is it about doing this inside an iframe that is causing my problems???</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,711,904
4,711,905
remove eventhandler on ItemTemplate
<p>I want to remove the event handler of an ItemTemplate in asp .net. Here is the asp code </p> <pre><code> &lt;ItemTemplate&gt; &lt;asp:RadioButton runat="server" ID="rdbAnswer" GroupName="Group" AutoPostBack="True" OnCheckedChanged="rdbAnswer_CheckedChanged" /&gt; &lt;/ItemTemplate&gt; </code></pre> <p>I want to remove the checkedchanged event on code behind. How can i do this ? </p>
c# asp.net
[0, 9]
4,412,208
4,412,209
Developing native applications to run both on Android & iPhone?
<p>I'm new to mobile phones development, but I wonder whether there is any way to develop <strong>native</strong> apps (HTML-based apps is another story) that would run both on Android and iPhone? I know that there exist applications available for both OSs, so I wonder how are they ported/developed for both targets?</p>
iphone android
[8, 4]
2,106,037
2,106,038
Get culture based on language
<p>How can I get culture based on language ? For example if I will pass language = CHS it will retrieve zh-CN based on National Language Support (NLS) API Reference: <a href="http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx</a></p> <p>I belive .Net framework should provide us with method that support that .</p> <p>your responce will be highly appreciated !</p>
c# asp.net
[0, 9]
5,270,528
5,270,529
Problem loading remote script with jQuery multiple times in Firefox
<p>I have a script element in my webpage, something like this:</p> <pre><code>&lt;script id="myscript"&gt;&lt;/script&gt; </code></pre> <p>Now, from a javascript file, I'm doing something like the following:</p> <pre><code>$('#myscript').src('http://foo.bar?callback=somefunc') </code></pre> <p>Now this remote script 'returns javascript' of the following form:</p> <pre><code>somefunc(somearg); </code></pre> <p>When I run all of this, things work neatly, the script gets loaded dynamically, and the 'somefunc' callback is executed.</p> <p>The problem happens when I do the same thing again. Let's say I again call the same thing:</p> <pre><code>$('#myscript').src('http://foo.bar?callback=somefunc') </code></pre> <p>This, for some reason, DOESNT return the javascript call in Firefox only. (Works fine in IE - somefunc gets executed again as expected).</p> <p>I can think of ugly workarounds (such as doing a <code>$('head').append('&lt;script...'))</code> every time - but I'd like to know what's going on here.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]