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,663,972
3,663,973
Scroll on document after jQuery slide scroll
<p>I have a 300px height container in which I used a custom scroll made with jQuery slide. It all works perfect except when I reach the end of the scrolling area (which is 300px) the page doesn't scroll anymore until I move the mouse off that container.</p> <p>Is there a way to make the document scroll after jQuery slide scroll ends?</p>
javascript jquery
[3, 5]
2,010,975
2,010,976
use aspx page and web.config with a new domain
<p>I used a new domain. When I set only html pages than site running correct. But when I use web.config and aspx page then site give an error. </p> <p>Error is : HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid.</p>
c# asp.net
[0, 9]
360,074
360,075
How would I move code to a different class?
<p>In the <a href="http://code.google.com/p/libgdx/wiki/SimpleApp" rel="nofollow">SimpleApp</a> tutorial, the author puts all of his code inside one class file. Causing the rain and the bucket to be within it. </p> <p>I tried just taking the code and putting it into another class but then I would have duplicate methods in my code, and logically it would be incorrect. For example, I cannot have two create methods in a game.</p> <p><strong>How would I take the <em>rain</em> or the <em>bucket</em> from the <a href="http://code.google.com/p/libgdx/wiki/SimpleApp" rel="nofollow">tutorial</a> and put it into a different class?</strong></p>
java android
[1, 4]
5,682,034
5,682,035
Why do we love using i?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://programmers.stackexchange.com/questions/86904/why-do-most-of-us-use-i-as-a-loop-counter-variable">Why do most of us use &#39;i&#39; as a loop counter variable?</a> </p> </blockquote> <p>Maybe this questions seems to be extreamly stupid but I wonder why we use i as variable in most cases in for loops (and not other letter). This might be a historical cause.</p> <p>eg.</p> <pre><code>for(int i = 0; i &lt; 10; i++) </code></pre>
c# java c++
[0, 1, 6]
4,108,479
4,108,480
Html input value in server side code. Asp.Net
<pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server"&gt; &lt;script type="text/javascript"&gt; $(function () { $("#slider-range").slider({ range: true, min: 0, max: 100, values: [0, 75], slide: function (event, ui) { $("#value").val("" + ui.values[0] + " - " + ui.values[1]); } }); $("#value").val("" + $("#slider-range").slider("values", 0) + " - " + $("#slider-range").slider("values", 1)); }); &lt;/script&gt; &lt;/asp:content&gt; </code></pre> <p>I am using this code for a slider in my asp.net page. Now the value in displayed in the Html input. </p> <pre><code> &lt;input type="text" id="value" style="border: 0; font-weight: bold;" /&gt; </code></pre> <p>it is displayed as 0-75. How can I get both the values (0,75) separately in my server side so that i can write the values in database.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
1,016,578
1,016,579
jquery grid bind to sql server throuh page.aspx.vb
<p>I am trying to bind jquery grid to sqldata through .aspx page but i cant</p> <p>Iam having one jquery grid and one jquery chart so i have to bind the grid and chart to sql server using asp.net and vb</p> <p>Alredy im get the data in aspx.vb page and the data in datatable </p> <p>so frnds help me how to bind that aspx page to jquery grid </p>
jquery asp.net
[5, 9]
1,680,451
1,680,452
validation of fields in this situation
<pre><code>&lt;div id="default-box"&gt; &lt;span class="add"&gt;&lt;input type="text" class="name" /&gt;&lt;input type="text" class="email"/&gt;&lt;/span&gt; &lt;span class="add"&gt;&lt;input type="text" class="name" /&gt;&lt;input type="text" class="email"/&gt;&lt;/span&gt; &lt;span class="add"&gt;&lt;input type="text" class="name" /&gt;&lt;input type="text" class="email"/&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p>This code will arrange the name and email fields in rows and column. First row will contain name and email as a unit and same for the other rows. I want to validate each row as unit. Suppose name or email field are empty or email is not valid so when I enter the tab from email column of 1st row to move to second row it will show an error. I could not figure out the way to catch a row as unit. Thanks</p>
javascript jquery
[3, 5]
2,785,088
2,785,089
Invoking a pop-up 'confirm' message box in ASP.NET
<p>I know how to this when a button is clicked. For example:</p> <pre><code>imgBtnDelete.Attributes.Add("onclick", "return confirm('Please confirm you want to delete the letter')") </code></pre> <p>My question is:</p> <p>Say I have a piece of code-behind not related to clicking,calculating the value of a boolean, and if the boolean is true then I want the message box with ok/cancel to appear.</p> <p>f.e.:</p> <pre><code>bool hasMoney = ... if (hasMoney) { \\message box.. } </code></pre> <p>How do I do it?</p>
c# asp.net
[0, 9]
979,925
979,926
setting display property in the code behind
<p>How can i set the display property to block in the code behind?</p> <pre><code>&lt;asp:Panel ID="pnlHedgingTypeI" Style="display:none" runat="server"&gt; pnl.Attributes.Add("display", "block"); </code></pre> <p>is not helping me ..Could you please help me to resolve this?</p>
c# asp.net
[0, 9]
3,351,874
3,351,875
Visible window height instead of $(window).height;
<p>Is there any way to get the visible height of the whole page from inside an iframe , $(window).height() gives me iframes height ?</p> <p>Thank you in advance.</p>
javascript jquery
[3, 5]
3,134,747
3,134,748
Rounded corners AND shadow applied to one div?
<p>How? Any suggestions besides CSS? </p> <p>I have tried JQuery (dropCurves, shadow, shadedborder, corner osv).</p>
javascript jquery
[3, 5]
27,509
27,510
How can i have Response.Redirect() work from MasterPage?
<p>I have a problem: when i call a Response.Redirect() from the MasterPage it doesn't work. Well, debugging i can see that until the Pre_Render() method the target page is loaded, but then is rendered the previous page.</p> <p>Here's some code to better explain:</p> <p>(from MasterPageMain.master.cs)</p> <pre><code>protected void Page_Init(object sender, EventArgs e) { string m_QueryStringValue = Request.QueryString.Get("action"); if ((!string.IsNullOrEmpty(m_QueryStringValue)) &amp;&amp; (m_QueryStringValue.ToLower() == "send")) { if (Session["to"] != null &amp;&amp; Session["to"] is List&lt;string&gt;) this.SendPageByMail(); else { Session.Add("AddressToSend", Request.RawUrl); Response.Redirect("~/chooseRecipients.aspx"); } } } </code></pre> <p>I have a javascript that adds the querystring adding "action=send" when i click on the Send button.</p> <p>If i am on page "~/somethingInterestingToSend()" -for example- i want to get on the recipient selection page, but when i click the Send button i see always the same page.</p> <p>What coul be the mistake?</p>
c# asp.net
[0, 9]
2,209,732
2,209,733
Applying the DRY principle to this jQuery code
<p>I have this jQuery code:</p> <pre><code>var thumb = $($('#slider').children('.ui-slider-handle')); setLabelPosition(); $('#slider').bind('slide', function (event, ui) { $('#boksTimer').html((((ui.value) / 31) * 60).toFixed(0) + ' min pr. dag'); setLabelPosition(); }); function setLabelPosition() { var label = $('#boksTimer'); label.css('top', '10px'); label.css('left', thumb.position().left - (label.width() - thumb.width())/ 2); } var thumb2 = $($('#slider2').children('.ui-slider-handle')); setLabelPosition2(); $('#slider2').bind('slide', function (event, ui) { $('#boksTimer2').html((((ui.value) / 31) * 60).toFixed(0) + ' min pr. dag'); setLabelPosition2(); }); function setLabelPosition2() { var label2 = $('#boksTimer2'); label.css('top', '10px'); label.css('left', thumb2.position().left - (label2.width() - thumb2.width())/ 2); } var thumb3 = $($('#slider3').children('.ui-slider-handle')); setLabelPosition3(); $('#slider3').bind('slide', function (event, ui) { $('#boksTimer3').html((((ui.value) / 31) * 60).toFixed(0) + ' min pr. dag'); setLabelPosition3(); }); function setLabelPosition3() { var label3 = $('#boksTimer3'); label.css('top', '10px'); label.css('left', thumb3.position().left - (label3.width() - thumb3.width())/ 2); } </code></pre> <p>How can I make it more DRY? </p> <p>DRY = Don't repeat yourself</p>
javascript jquery
[3, 5]
2,498,467
2,498,468
How to change li position using Jquery
<pre><code>&lt;ul&gt; &lt;li id="1"&gt; &lt;li id="2"&gt; &lt;li id="3"&gt; &lt;li id="4"&gt; &lt;li id="5"&gt; &lt;li id="6"&gt; &lt;li id="7"&gt; &lt;/ul&gt; </code></pre> <p>i want to make a function that foreach time the function is called the first li at the top will be the last one so the first example will look like this </p> <pre><code>&lt;ul&gt; &lt;li id="2"&gt; &lt;li id="3"&gt; &lt;li id="4"&gt; &lt;li id="5"&gt; &lt;li id="6"&gt; &lt;li id="7"&gt; &lt;li id="1"&gt; &lt;/ul&gt; </code></pre> <p>Thanks </p>
javascript jquery
[3, 5]
5,857,243
5,857,244
Why does my dynamic form submit not use the jQuery-replaced button label value?
<pre><code>&lt;button class="gocrazy" label="1"/&gt; &lt;button class="gocrazy" label="2"/&gt; &lt;button class="gocrazy" label="3"/&gt; &lt;form id="crazyform" method="POST" action="/crazyform"&gt; &lt;input type="hidden" id="crazyreplace" value="REPLACE WITH BUTTON LABEL ON CLICK"&gt; &lt;/form&gt; $(".gocrazy").button(); $(".gocrazy").click( function(event) { var gocrazy = $(this).attr("label"); $("#crazyreplace").val(gocrazy); $("form#crazyform").submit(); return false; }); </code></pre> <p>I want to submit this form with a value replaced from the button label (1, 2 or 3) into the hidden <code>crazyreplace</code> field using jQuery.</p> <p>But the form is submitted with the original text message (<code>REPLACE WITH BUTTON LABEL ON CLICK</code>).</p> <p>What is wrong here?</p>
javascript jquery
[3, 5]
4,848,164
4,848,165
QueryString containing \ coming through with \\
<p>I'm have a page which I sent a parameter through the query string.</p> <p>If I'm retrieving it with Request.QueryString["Format"] I'm having troubles with the type 'CD\DVD'. It's being returned as 'CD\\DVD'. It's important I get this as the right string.</p> <p>How do I avoid the extra backslash? Or even get rid of it later?</p>
c# asp.net
[0, 9]
1,918,306
1,918,307
Create audio tag in html4 issue
<p>I am trying to create audio tag in html4.</p> <p>I have</p> <pre><code>var audioPlayer=document.createElement('audio'); var audioSource=document.createElement('source'); audioSource.src=audioFileName; audioSource.type="type='audio/mp3'"; audioPlayer.appendChild(audioSource); audioPlayer.width=320; audioPlayer.className='text_audio'; audioPlayer.id='audio_id'; audioPlayer.style.margin=0; audioPlayer.controls='controls'; $('div').append(audioPlayer); </code></pre> <p>I can see the control bar but it has trouble playing my mp3 file. Are there anyways to do this in Html4?</p> <p>Thanks a lot!</p>
javascript jquery
[3, 5]
778,153
778,154
Run jQuery after another jQuery script
<p>Im using <code>curl</code> to fetch the HTML from anothe web page and display on one of my pages:</p> <pre><code>$("document").ready(function() { $("#content").load("curl.php .auction_list_closed"); }); </code></pre> <p>Once the content is returned I want to have another script run. How can I run another line of jQuery once the content has been loaded?</p>
javascript jquery
[3, 5]
79,756
79,757
What is this pattern in javaScript and where can I read more about it
<p>I have codes similar to the following:</p> <pre><code> (function(MyHelper, $, undefined){ var selectedClass = "selected"; MyHelper.setImageSelector = function(selector) { var container = $(selector); setSelected(container, container.find("input:radio:checked")); container.find("input:radio").hide().click(function() { setSelected(container, $(this)); }); }; MyHelper.enableIeFix = function(selector) { var container = $(selector); container.find("img").click(function() { $("#" + $(this).parents("label").attr("for")).click(); }); }; function setSelected(container, selected) { container.find("label").removeClass(selectedClass); selected.siblings("label").addClass(selectedClass); } }( window.MyHelper = window.MyHelper || {}, $)) </code></pre> <p>I am new in JS and I am wondering if this is a specific pattern in javascript programming. I specfically wondering what is the meaning of last line:</p> <pre><code> }( window.MyHelper = window.MyHelper || {}, $)) </code></pre> <p>Is It Module pattern? </p>
javascript jquery
[3, 5]
774,337
774,338
cannot read all the lines from file in java
<p>The file looks like this:</p> <pre><code>14.809034;56.876646;Vaxjo; 15.809035;57.906646;Vaxjo2; 16.809035;58.906646;Vaxjo3; </code></pre> <p>and the code is here so far:</p> <pre><code>InputStream in = getResources().openRawResource(R.raw.cities); if (in != null) { InputStreamReader input = new InputStreamReader(in); BufferedReader buffreader = new BufferedReader(input); Pattern p = Pattern.compile(";"); Scanner del = new Scanner(buffreader); del.useDelimiter(p); while(del.hasNextLine()) { while (del.hasNext()) { city.add(new City(del.nextDouble(), del.nextDouble(), del.next())); } } in.close(); } else { } </code></pre> <p>And my output is just the first line 14.809034 56.876646 Vaxjo. What about the other lines?</p>
java android
[1, 4]
2,562,845
2,562,846
How to find the center of the div using jquery
<p>I have a div tag with id container. How can I find its center using either jquery or javascript?</p> <pre><code>&lt;div id="container"&gt;&lt;/div&gt; </code></pre> <p>here is css</p> <pre><code>#container { width: 300px; height: 300px; border: 1px solid red; } </code></pre>
javascript jquery
[3, 5]
4,786,591
4,786,592
jquery themeroller - out of the box example does not grey the modal dialog backgound
<p>I'm using the latest jquery themeroller - so far looks great.</p> <p>Except the modal dialog example and out of the box functionality of modal dialog boxes does not display the transparent curtain behind the current dialog box.</p> <p>Anyone know how to enable this?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
1,536,081
1,536,082
How to prevent javascript code in text area from executing
<p>How do I prevent user content which contains executable javascript from running when other users view my pages?</p> <p>For example, if someone added this to a textbox on a page and then saved the form, how would I stop this from being executed when this content is viewed again?:</p> <pre><code>&lt;script type="text/javascript"&gt; window.alert("hiiii!") &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
603,859
603,860
Android/Java Time difference ISO 8601 with Now
<p>I have an ISO 8601 time string and want to calculate the time difference to now in minutes without using joda time. How is this done?</p> <p>Thanks</p>
java android
[1, 4]
5,683,740
5,683,741
How to check whether a value is a number in javascript or jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric">Validate numbers in JavaScript - IsNumeric()</a> </p> </blockquote> <pre><code>var miscCharge = $("#miscCharge").val(); </code></pre> <p>I want to check misCharge is number or not? is there any method or easy way in jquery or javascript to do this?</p> <p>HTMl is </p> <pre><code> &lt;g:textField name="miscCharge" id ="miscCharge" value="" size="9" max="100000000000" min="0" /&gt; </code></pre>
javascript jquery
[3, 5]
3,460,097
3,460,098
Android /java Time Format?
<p>I have time as a "2011-12-03 12:00:19" how to convert it in "Fri 2 December 2011 " ,I know this <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html" rel="nofollow">http://docs.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html</a> ,But gives me Error:</p> <pre><code> Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given Object as a Date at java.text.DateFormat.format(Unknown Source) at java.text.Format.format(Unknown Source) at com.timestamp.NewTimeStamp.&lt;init&gt;(NewTimeStamp.java:21) at com.timestamp.NewTimeStamp.main(NewTimeStamp.java:35) </code></pre> <p>My code is ::</p> <pre><code>String mytime ="2011-12-03 12:00:19"; String pattern = "EEE d MMMMM yyyy"; SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); Date date = new Date(mytime); String time = dateFormat.format(date); System.out.println("=== &gt; " + time); </code></pre>
java android
[1, 4]
4,246,513
4,246,514
IF IE neglect/hide div
<p>I have page like this</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;div id="container"&gt; Hello, this is NON-IE content. &lt;/div&gt; &lt;/head&gt; &lt;/html&gt; </code></pre> <p>What I want is to <strong>Stop</strong> Internet Explorer <strong>[ IE ]</strong> from <strong>loading OR Neglecting</strong> <code>&lt;div id="container"&gt;</code> &amp; <strong>allow</strong> all <strong>other browsers</strong> to <strong>load</strong> It.</p> <p>Don't want to use <code>&lt;!--[if IE 7]&gt;</code>.</p> <p>Looking for <strong>Javascript</strong> to work with.</p> <p>How Can I achieve this ?</p> <p>Thanks</p> <ul> <li>Mandar</li> </ul>
javascript jquery
[3, 5]
5,808,753
5,808,754
URL accesses based on login
<p>Hello everyone I have a question that I will describe as good as I can. I have project that resides in the folder on my server the path for url is like</p> <p>www.domain.com\project now what I am trying to achieve is to have a \project directory be only accessible if user is login. scenario would be the user opens the url www.domain.com and he see the login screen if he logins path \project will be accessible if he does not and try's to go to any file in the direcoty or directory it should give him an error and redirect him back to login screen. I am using MVC3 in my project but I can write the login screen in asp.net web forms. I am also want to authorization be based in db a table with user logins so when the user logins it validates based on the information in the table. I am not looking for roles or privileges just a straight access to url based on login. If someone can show an example or a code sample on how to achieve this I will be greatly appreciated it.</p>
c# asp.net
[0, 9]
928,602
928,603
Android / Java Rewriting file makes it empty?
<p>I am writing to file every 10 second in my application, I need to save data regardless of user input. The file writing code goes as follows,</p> <pre><code>FileOutputStream fos = new FileOutputStream(new File(CurrentContext.getFilesDir() + File.separator + "myFile")); fos.write(s.toString().getBytes()); fos.flush(); fos.close(); </code></pre>
java android
[1, 4]
4,401,643
4,401,644
change inputType
<p>How can I change the <code>inputType</code> if is verified a particular situation?</p> <pre><code>if(currentMethod.equals(3)) { display.setText(""); if(nuovo.equals("")) /**se nell'EditText non ci sta scritto nulla,numero2 = 0**/ { Toast t = Toast.makeText(Convertitore.this, "Inserire un numero", Toast.LENGTH_SHORT); t.show(); return; } } </code></pre> <p>If <code>currentMethod</code> is equal with the element in the vector, I want that the <code>inputMethod</code> of the <code>EditText</code> changes.</p> <p>The <code>InputType</code> in the <code>main.xml</code> is set to <code>Number</code>, I want that when <code>currentMethod</code> equal with the element in the vector, the <code>inputType</code> is <code>Number|Text</code></p>
java android
[1, 4]
3,711,886
3,711,887
Specific values as argument for function
<p>I've got a function which has 1 parameter/argument of type String:</p> <pre><code> public void foo(String myParam) { //do something } </code></pre> <p>the possible values of the string are restricted (eg. "test","test2" and "test3"), any different value of myParam would cause an error.</p> <p>Is it possible to restrict the possible values of myParam without a switch case which would check the value of myParam? </p> <p>It would also be possible to pass a different object to my function which wraps the real value I need.</p> <p>Is there a standard/best way solution for that?</p>
c# asp.net
[0, 9]
1,946,596
1,946,597
$(this) not selecting element in callback function
<p>I have 2 different set of codes, the only difference is the location of <code>$(this).closest('.organizer_listing').slideUp('fast');</code>. In the first set of code, it works, but I prefer for that line of code to be as in the 2nd set of code inside the callback function, which no longer works - <code>slideUp</code> does not seem to be executed. </p> <p>Why is this so? How should I fix it?</p> <p><strong>Variation 1</strong></p> <pre><code>$("input[type=checkbox]:checked").each(function() { $(this).closest('.organizer_listing').slideUp('fast'); // Remove listings visually from list // Send AJAX request to delete from database var listing_id = $(this).closest('.organizer_listing').data('listing_id'); $.ajaxSetup({ cache: false }); $.getJSON(base_url + 'organizer/delete_favorite', {listing_id: listing_id}, function(json) { $.modal.close(); }); }); </code></pre> <p><strong>Variation 2</strong></p> <pre><code>$("input[type=checkbox]:checked").each(function() { // Send AJAX request to delete from database var listing_id = $(this).closest('.organizer_listing').data('listing_id'); $.ajaxSetup({ cache: false }); $.getJSON(base_url + 'organizer/delete_favorite', {listing_id: listing_id}, function(json) { $.modal.close(); $(this).closest('.organizer_listing').slideUp('fast'); // Remove listings visually from list }); }); </code></pre>
javascript jquery
[3, 5]
1,729,933
1,729,934
Get current element's classes in jQuery
<pre><code>​&lt;button id="test" class="example whatever"&gt;Show classes&lt;/button&gt;​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ $('button').click(function(){ var classes = $(this).attr('class'); alert(classes); });​ </code></pre> <p>The above code returns the content of the <code>class</code> attribute. How can I get it to return the classes formatted?</p> <p>For instance, in this case, I want the variable <code>classes</code> to have a value of <code>.example.whatever</code> instead of <code>example whatever</code>.</p> <p>I've searched and the only solution that seemed to be provided is the code I demonstrated above.</p>
javascript jquery
[3, 5]
1,170,335
1,170,336
toggle/vertical slider with multiple Divs
<p>I have 2 div section one div containing video &amp; other has tabular data. I would like to toggle them in horizontal direction i.e from right to left or vice verse. If video display table div is hide, and if table then video div will hide. </p> <p>This is working fine in vertical direction.</p> <pre><code>&lt;div class="option_list"&gt; &lt;p class="video_head"&gt;Video&lt;/p&gt; &lt;div class="divVideo"&gt; Video frame...&lt;/div&gt; &lt;p class="table_head"&gt;table&lt;/p&gt; &lt;div class="divtable"&gt; table frame...&lt;/div&gt; &lt;/div&gt; </code></pre> <p>script--</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function () { $(".table_head").click(function () { $(".divtable").slideToggle(); $(".divVideo").hide(); }); $(".video_head").click(function () { $(".divVideo").slideToggle(); $(".divtable").hide(); }); }); &lt;/script&gt; </code></pre> <p>How to toggle this horizontally? </p>
jquery asp.net
[5, 9]
1,598,574
1,598,575
C#: DataBase Null in RadioButtonList
<p>I would like to have a radiobuttollist were you can select value null.</p> <p>Something like this:</p> <pre><code>&lt;asp:RadioButtonList ID="rblCD" runat="server" SelectedValue='&lt;%# Bind("tblCD") %&gt;'&gt; &lt;asp:ListItem Value="RW"&gt;RW&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="R"&gt;R&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="DBNull"&gt;None&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList&gt; </code></pre> <p>Thanks a lot, Vincent</p>
c# asp.net
[0, 9]
981,193
981,194
How to cancel navigation when user clicks a link?
<p>I'm trying to load some stuff using AJAX when a user clicks a link, but I want the link to actually go somewhere so that the app still works when javascript is disabled. Is there any way to just do something with javascript and cancel navigation when a link is clicked?</p> <p>What's the best practice? Can that be done, or do I need to replace the link using javascript or what?</p>
javascript jquery
[3, 5]
4,936,383
4,936,384
Is $('.foo').eq(0) faster than $('.foo')?
<p>Suppose I have a huge list of elements with a structure like:</p> <pre><code>&lt;div class="item"&gt; &lt;div class="header"&gt;&lt;/div&gt; &lt;div class="body"&gt;&lt;/div&gt; &lt;div class="meta"&gt;&lt;/div&gt; &lt;div class="..."&gt;&lt;/div&gt; ... &lt;/div&gt;&lt;!-- .item --&gt; </code></pre> <p>I've already found an element and now I have to find, let's say, a '.body'. What code will work faster:</p> <pre><code>$(el).find('.body') </code></pre> <p>or</p> <pre><code>$(el).find('.body').eq(0) </code></pre> <p>In other words, will jQuery stop on the first found element or will it loop through all the elements first and only then it will return an element with a chosen index?</p>
javascript jquery
[3, 5]
266,026
266,027
adding php string to some javascript
<p>I'm trying to add a php string to some javascript:</p> <pre><code>document.getElementById("button").value = mygetrequest.responseText; </code></pre> <p>basically there are a load of buttons on one page. </p> <p>So i need to add a value at the end of button. <br>Basically the ID of each row so button<code>&lt;? echo $row['ID']; ?&gt;</code> but i'm not too sure how i would do this in javascript.</p> <p>Any help</p> <p>Thanks in advance</p>
php javascript
[2, 3]
1,018,995
1,018,996
How to set Progress bar for loading activity with data in android
<p>This is my first class doing Url loading .</p> <pre><code>public class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } </code></pre> <p>This is my Activity Class where data is displacing in web view.</p> <pre><code>public class detailedview extends Activity { WebView mWebView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detailedview); GetSet gs = new GetSet(); String title = gs.getTitle(); String desc = gs.getDesc(); mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setBuiltInZoomControls(true); mWebView.getSettings().setSupportZoom(true); mWebView.getSettings().setTextSize(TextSize.SMALLER); mWebView.loadDataWithBaseURL("", "&lt;p align=\"justify\"&gt;&lt;b&gt; " + title+"&lt;/p&gt;&lt;/b&gt;&lt;p align=\"justify\"&gt;&lt;br&gt;"+ desc + "&lt;/p&gt;&lt;/br&gt;", "text/html", "utf-8", ""); mWebView.setWebViewClient(new HelloWebViewClient()); } } </code></pre> <p>I want to put progress bar for loading data in my activity, I have tried a lot but I can't do it.</p> <p>Can you please write code or post code so that I can have a progress bar while loading data according to my code.</p>
java android
[1, 4]
1,681,312
1,681,313
a button that can only be clicked once, EVER
<p>as the title said i would like to create a button that says "available" and once any one clicks it it turns to "unavailable" for all future users any ideas ?</p> <p>note : its for a school project, nothing fancy or even secured, just trying to prove a point</p> <p>sorry for being vague for some, all i am trying to do is to create an article in my joomla website with a button that only the fastest user can access and click, thats it i am not worried with security or even cheating attempts joomla articles can have php js codes among others added to them</p>
php javascript
[2, 3]
3,804,777
3,804,778
GridView onItemClickListener never gets invoked
<p>I have a <code>GridView</code> with custom <code>View</code> in it, which is a <code>Button</code> and a <code>TextView</code>. I defined the <code>setOnItemClickListener</code> but it looks like it never invoked, please see peaces of code below.</p> <pre><code> gridview = (GridView) findViewById(R.id.main_gridview); gridview.setAdapter(new GridAdapter(this)); gridview.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { Toast.makeText(getApplicationContext(), "gadsfadsf", Toast.LENGTH_SHORT).show(); Log.d("Main", "onItemClick"); } }); </code></pre>
java android
[1, 4]
4,432,406
4,432,407
How to call multiple js functions on document.ready without putting them jQuery(document).ready(function(){});
<p>Is there a way to 'bind' multiple functions to jQuery's document.ready function without actually calling them in that method. Basically I don't know which functions I might be calling in document.ready until the page is generated.</p>
javascript jquery
[3, 5]
2,627,834
2,627,835
How to check uniq constraint on update/ insert in gridview?
<p>I have a simple gridview and sqldatasource to bind data to gridview , SqlDatabase I'm trying to set to a column a constraint for unique so If I add new row or update a row and the value already exists It won't update.</p> <p>For the column Name , I set ->Indexes/keys -> new -> choosed column Name -> Unique key .</p> <p>How can I get the error when it says already exists , in a label?</p> <p>thanks</p>
c# asp.net
[0, 9]
649,525
649,526
How to call a Javascript function having return value in c# codebehind
<p>I am having a page where i need to <strong>confirm</strong> whether to show updated grid or not</p> <p>I am calling a javascript function using </p> <pre><code>ScriptManager.RegisterStartupScript(this, typeof(string), "Error", "confirm('Are u sure');", true); </code></pre> <p>What I want to know is how to get the return value of confirm in C# code behind.</p>
c# javascript
[0, 3]
1,181,835
1,181,836
change DropdownList Datasource Dynamicly
<p>I have a <code>dropDownlist</code> that have tow <code>Datasource</code> with names <code>Datasource1</code>,<code>Datasource2</code>. when the page_Load accrued the datasource1 is assigned to <code>Dropdownlist</code>. I have a button on page that i want when i clicked on button, Datasource2 assign to <code>Dropdownlist</code> in <code>button click event</code> i wrote this:</p> <pre><code>Ddl_Num.DataSource = SqlDataSource8; Ddl_Num.DataBind(); </code></pre> <p>but it doesn't changed. how can i do that?</p>
c# asp.net
[0, 9]
4,858,894
4,858,895
Endless upcoming text using javascript
<p>My task is to create the page with text blocks upcoming endless inside the div block. Here is my solution:</p> <pre><code> &lt;script&gt; var startOffset = 0; var startOffsetPlus; var startOffsetMinus; $(document).ready(function () { startOffset = $(".carousel-item").last().offset().top; startOffsetPlus = "+="+ startOffset +"px"; startOffsetMinus = "-="+ startOffset +"px"; //endless loop call setInterval('beginEndlessLoop()', 1000/*Starting delay in ms*/); }); function beginEndlessLoop(){ setInterval('moveTextUp()', 0 /*ms*/); } function moveTextUp() { $(".carousel-block").animate( {"top": startOffsetMinus}, { duration: 10000/*ms*/, easing: "linear"} ); //move blocks to start position $(".carousel-block").animate({"top": startOffsetPlus}, 0/*ms*/); } &lt;/script&gt; </code></pre> <p>This solution works fine. But One problem is that this script takes processor and memory more and more. I'm not a javascript programmer. Could anyone please tell me how to call Garbage collector or something? =)</p>
javascript jquery
[3, 5]
1,256,919
1,256,920
Why does this code get a forceclose error?
<pre><code>public class main extends Activity { /** Called when the activity is first created. */ EditText username,password1; Button sub; String uname,pass; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); sub.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub username = (EditText) findViewById(R.id.uname); password1 = (EditText) findViewById(R.id.editText2); uname = username.getText().toString(); pass = password1.getText().toString(); if (uname == "Azhar") { if (pass == "azhar") Toast.makeText(main.this, "user is authenticated", Toast.LENGTH_SHORT); else Toast.makeText(main.this, "Password Invalid", Toast.LENGTH_SHORT); } else { Toast.makeText(main.this, "User or Password Invalid", Toast.LENGTH_SHORT); } } }); } } </code></pre>
java android
[1, 4]
1,832,967
1,832,968
Using a variable when traversing elements in JQuery
<p>Very quick and hopefully simple question.</p> <p>I am trying to select a hidden input by value with some predefined variable.</p> <pre><code>var id = $("#puid").val(); $('input[value=id]').closest('tr').css({'background-color':'red'}); </code></pre> <p>I thought the above code would have worked, however its not processing id as a variable. What is the right notation to do this? (I have tested the code by replacing id with the actual number and the rest of the code works fine).</p>
javascript jquery
[3, 5]
4,198,894
4,198,895
can jquery toggle the original css(style.css) value and the new value(set in the .animate{})?
<p>erm...can jquery toggle the original css(style.css) value and the new value(set in the .animation{})?</p> <pre><code>$(function() { $('a.maximize').click(function() { $($(this).attr('href')).animate({ position: "absolute", top: 0, left: 0, height: '99.5%', width: '99.5%', opacity: 1, },1000) }); }); </code></pre> <p>this is the jquery code i have now,but how to toggle the a href target to the new value(code above)</p> <p>or set the .animate{} change after click,and change back the previous .animate{} after click again.</p> <p>example: the same button, but first time click, change it to width height 100%,</p> <p>but the second time click on the same button, change them back to the width height 50%</p> <p>the third time change to width height 100% and so on..</p>
javascript jquery
[3, 5]
4,432,992
4,432,993
What are the most important optimizations in Java code on Android?
<p><br> I am just starting out programming on Android. </p> <p>What is the most computationally expensive Java constructs to avoid when programming an Android App? </p> <p>Of cause every algorithm costs instructions, but what about use of Method calls, Object references, Interfaces, Collections and such? What do I need to avoid, and what is "cheap" when I'm programming for speed?</p>
java android
[1, 4]
485,493
485,494
removing scripts from html data... using javascript
<p>So I have this function to strip out scripts from the page, but some scripts that are many lines long are still showing up. Is there a way to remove all scripts from the page that loads.</p> <pre><code> function filterData(data){ // filter all the nasties out // no body tags data = data.replace(/&lt;?\/body[^&gt;]*&gt;/g,''); // no linebreaks data = data.replace(/[\r|\n]+/g,''); // no comments data = data.replace(/&lt;--[\S\s]*?--&gt;/g,''); // no noscript blocks data = data.replace(/&lt;noscript[^&gt;]*&gt;[\S\s]*?&lt;\/noscript&gt;/g,''); // no script blocks data = data.replace(/&lt;script[^&gt;]*&gt;[\S\s]*?&lt;\/script&gt;/g,''); // no self closing scripts data = data.replace(/&lt;script.*\/&gt;/,''); // [... add as needed ...] return data; } </code></pre> <p>Here is an example of the script that comes through in the html</p> <pre><code>&lt;script type="text/javascript"&gt; var ccKeywords="keyword="; if (typeof(ccauds) != 'undefined') { for (var cci = 0; cci &lt; ccauds.Profile.Audiences.Audience.length; cci++) { if (cci &gt; 0) ccKeywords += "&amp;keyword="; ccKeywords += ccauds.Profile.Audiences.Audience[cci].abbr; } } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
5,638,916
5,638,917
How attach html-element to mouse using jQuery?
<p>How do I attach html-element to mouse cursor using jQuery. This should be something like 'draggable', but I want that element clung to the cursor after mouse double-click and to follow the cursor until the left mouse button is pressed.</p>
javascript jquery
[3, 5]
2,124,635
2,124,636
Change iframe text to other language
<p>i have an iframe : <a href="http://www.vantagewire.com/quotes_clients.php?ticker=THG:CA&amp;chscale=1m&amp;stylesheet=http://www.vantagewire.com/_resources/app/general/quotetab_chart_small_hosted.css" rel="nofollow">http://www.vantagewire.com/quotes_clients.php?ticker=THG:CA&amp;chscale=1m&amp;stylesheet=http://www.vantagewire.com/_resources/app/general/quotetab_chart_small_hosted.css</a></p> <p>i would like to embed this to a site but what i encounter is some users see it in french language other in english.</p> <p>i would like to make control of the iframe output in a code like this:</p> <pre><code> if(language==en){ iframe here which is english form } if(language==fr){ iframe here which is french form } </code></pre> <p>or any idea how to make the link above make to french and en that i can control ? </p> <p>Thanks</p>
php javascript
[2, 3]
1,932,298
1,932,299
Creating Java DataInputStream data in Python
<p>I have a Java program that uses a <code>DataInputStream</code> for storing object data. </p> <p>Example:</p> <pre><code> DataInputStream tInput = new DataInputStream(getClass().getResourceAsStream(aDirectory + "/ResultItemInfo.dat")); this._text = tInput.readUTF(); this._image = tInput.readUTF(); this._audio = tInput.readUTF(); this._random = false; if (tInput.read() == 1) { this._random = true; } this._hasMenu = false; if (tInput.read() == 1) { this._hasMenu = true; } </code></pre> <p>Nice, isn't it?</p> <p>There is an existing dataset, and now I have to add some records. If the tool that I am required to make was written in Java too, this would be pretty easy. Unfortunately, it is written in Python, so I have to discover a way how to create files that can be read from the Java application using Python.</p> <p>Is there any easy way to do this?</p> <p>As a last resort, I could:</p> <ul> <li>Modify the Java app and use XML. This would break compatibility with all existing data, so I really don't want to do it.</li> <li>Use Jython. Possible solution, but I want pure C-Python.</li> <li>Reverse-Engineer the data format. Not a good solution either.</li> </ul>
java python
[1, 7]
3,142,151
3,142,152
ASP.NET - Sending a PDF to the user
<p>I have a process that creates a PDF. I want these PDF's to be temporary and short lived. I want to be able to perform the following when the user clicks a button:</p> <pre><code>string CreatePDF()//returns fileName.pdf PromptUserToDownloadPDF() DeletePDF(fileName.pdf) </code></pre> <p>I want to avoid having to create a cleanup procedure and deal with any race conditions that arise from users concurrently creating PDF's while running cleanup. </p> <p>In winforms, I would synchronously prompt a user to download a file. How can I do a similar task in web?</p> <p><strong>UPDATE</strong><br /> Please note that I am using a 3rd party app to create the PDF's (<a href="http://xmlgraphics.apache.org/fop/" rel="nofollow">Apache FOP</a>). Basically I (will) have a function that invokes the command line:</p> <blockquote> <p>C:>fop "inputfile" "output.pdf"</p> </blockquote> <p>So, in memory is not an option...that is unless I could somehow do like....</p> <pre><code>string CreatePDF()//returns fileName.pdf string RecreatePDFInMemory() DeletePDF(fileName.pdf) PromptUserToDownloadPDF() </code></pre>
c# asp.net
[0, 9]
4,942,311
4,942,312
JavaScript: filter() for Objects
<p>ECMAScript 5 has the <code>filter()</code> prototype for <code>Array</code> types, but not <code>Object</code> types, if I understand correctly.</p> <p>How would I implement a <code>filter()</code> for <code>Object</code>s in JavaScript? </p> <p>Let's say I have this object:</p> <pre><code>var foo = { bar: "Yes" }; </code></pre> <p>And I want to write a <code>filter()</code> that works on <code>Object</code>s:</p> <pre><code>Object.prototype.filter = function(predicate) { var result = {}; for (key in this) { if (this.hasOwnProperty(key) &amp;&amp; !predicate(this[key])) { result[key] = this[key]; } } return result; }; </code></pre> <p>This works when I use it in jsfiddle (<a href="http://jsfiddle.net/MPUnL/4/" rel="nofollow">http://jsfiddle.net/MPUnL/4/</a>), but when I add it to my site that uses jQuery 1.5 and jQuery UI 1.8.9, I get JavaScript errors in FireBug.</p>
javascript jquery
[3, 5]
4,451,124
4,451,125
Best Practice: Relative URL
<p>What is the best way/best practice to get a url relative to the current page?</p> <p>string url = Request.ApplicationPath + "/MyFolder/MyFile.aspx";</p> <p>or</p> <p>string url = Page.ResolveURL("~/MyFolder/MyFile.aspx");</p> <p>I have been using the previous method, but there was a question posted earlier today <a href="http://stackoverflow.com/questions/1464907/relative-path-from-a-root-operator-address-in-code-behind">Relative path from a root operator (”~”) address in code behind</a> that made me wonder if what i was doing was the best way.</p>
c# asp.net
[0, 9]
2,227,696
2,227,697
Timer not running more than once
<p>For some reason when I run the below script for the first time, the timer doesn't activate again for a second time, any idea why?</p> <pre><code> var timer = 0; $(document).ready(function() { $('#search').keypress(function() { if(timer == 0) { $('#sel').html('&lt;iframe src="search.php?p=' + $('#search').val() + '"&gt;&lt;/iframe&gt;'); } timer = 1; setTimeout('timer = 0;', 2000); }); }); </code></pre> <p>Regards</p> <p>Matthew</p>
javascript jquery
[3, 5]
5,148,146
5,148,147
authenticate to a 3rd party site with jquery?
<p>I have a simple login form that lets users log into my website. Once logged in, there is a 3rd party site that I link which users can access and run searches on (its a database resource that we are partnered with). The problem is in order to access that 3rd party database they first have to log in to THAT site with a simple passphrase (which is the same for every user) and get a cookie. </p> <p>I'd like to simplify the whole process by running a jquery $get call to that 3rd party website when users sign in to my website so that they are authenticated with that 3rd party cookie and can seamlessly accesses the 3rd party database. Is that possible?</p>
javascript jquery
[3, 5]
2,919,199
2,919,200
Loading image from sources other that the gallery
<p>I am working on a slide puzzle and have a piece of code that get an image from the phones gallery, but I would like to use and image I provide that would be stored in either the assets folder or in a drawable folder that will resided in the res folder. Any help is appreciated. here is the method that I need to use that will make use of this. As you can see, it will currently get an image from the gallery. Thanks.</p> <pre><code>private void selectImageFromGallery() { Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI); startActivityForResult(galleryIntent, IMAGEREQUESTCODE); } </code></pre>
java android
[1, 4]
2,732,667
2,732,668
How can I databind to a string array?
<p>How can I databind a string array (<code>string[]</code>) to a <code>dropdownlist</code>?</p> <p>Does it implement <code>iEnumerable</code>?</p>
c# asp.net
[0, 9]
5,053,573
5,053,574
How to get "fixed" position of an element?
<p>I want to get an element's position relative to the window (fixed position).</p> <p>Here's what I've got so far:</p> <pre><code>(function ($) { $.fn.fixedPosition = function () { var offset = this.offset(); var $doc = $(document); return { 'x': offset.left - $doc.scrollLeft(), 'y': offset.top - $doc.scrollTop() }; }; })(jQuery); $('#thumbnails img').click(function () { var pos = $(this).fixedPosition(); console.log(pos); }); </code></pre> <p>But when I click a thumbnail, it appears to be off by about 10 pixels or so. i.e., it will give me negative values for <code>y</code> even when the top edge of the photo is about 5 pixels away from the top of my browser window.</p>
javascript jquery
[3, 5]
2,408,909
2,408,910
jquery get request returning document instead of XML
<p>I have a peice of code that i call inside of $("document).ready() in jquery that tries to open an xml file and parse it. </p> <pre><code>$.get('cal.xml', function(data){ alert(data); var xmlDoc = $.parseXML(data); var $xml = $(xmlDoc); }); </code></pre> <p>the alert that pops up is "[object Document]" rather than the actual text of the xml which then throws a problem with $.parseXML(data) saying that "Uncaught Invalid XML: undefined" (implying that data is undefined).</p> <p>here is the XML file </p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;cal&gt; &lt;today&gt; &lt;event&gt; &lt;time&gt; 6:30pm EST &lt;/time&gt; &lt;title&gt; nothing &lt;/title&gt; &lt;/event&gt; &lt;/today&gt; &lt;/cal&gt; </code></pre> <p>Could someone help me simply read in this XML file and set it up for parsing?</p>
javascript jquery
[3, 5]
2,187,149
2,187,150
JQUERY: Combining 2 function using OR operator
<p>How would I combine two function with an operator <code>OR ( || )</code> I would like to combine the 2 ifs statement in the script <a href="http://jsfiddle.net/andrewvmail/emeYT/7/" rel="nofollow">Here</a> is the fiddle</p> <p><strong>HTML</strong></p> <pre><code>&lt;form name="formName" method="post" action="#"&gt; &lt;input type="text" name="attendant[email]" size="13" value=""&gt; &lt;input type="text" name="attendant[email]" size="13" value=""&gt; &lt;input type="text" name="attendant[email2]" size="13" value=""&gt; &lt;input type="text" name="attendant[email2]" size="13" value=""&gt; &lt;input type="submit" name="submit"&gt; &lt;/form&gt; </code></pre> <p><strong>SCRIPT</strong></p> <pre><code>$("form").submit(function(event) { if ($("input:text[name='attendant\\[\email\]']", this).filter(function() { return $.trim(this.value) == ""; }).length) { window.alert("No member email1 should be empty."); event.preventDefault(); } if ($("input:text[name='attendant\\[\email2\]']", this).filter(function() { return $.trim(this.value) == ""; }).length) { window.alert("No member email2 should be empty."); event.preventDefault(); } }); </code></pre>
javascript jquery
[3, 5]
967,687
967,688
Calling Method in Android
<p>I am trying to call a method I have written. It compiles except for one line...</p> <pre><code>public class http extends Activity { httpMethod(); //will not compile public void httpMethod(){ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://site/api/"); try { // Add your data List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); // Execute HTTP Post Request HttpResponse response = httpclient.execute(httppost); String test = "hello"; TextView myTextView = (TextView) findViewById(R.id.myTextView); myTextView.setText(test); } catch (ClientProtocolException e) { // TODO Auto-generated catch block } catch (IOException e) { // TODO Auto-generated catch block } } } </code></pre> <p>I'm not the best java guy, but I would think calling the method like so would get a response. "Hello" is not displayed however... </p> <p>How do I properly call the method?</p>
java android
[1, 4]
1,158,951
1,158,952
Content slider like a slideshow
<p>I have almost identical content slider like <a href="http://www.webdeveloperjuice.com/2010/01/12/lightest-jquery-content-slider-ever-made-380-bytes/" rel="nofollow">this one</a>: </p> <p>How could I make it rotate automatically? I have tried different ways but I cant make it work. I have tried putting a click on the link but it doesn't work:</p> <pre><code>i=1; function autoplay(){ $('#navPoveznica'+i).click(); i++; if(i&gt;5){i=0}; setTimeout(autoplay, 2000); } </code></pre> <p>And I called the function when DOM was <code>.ready()</code><br> I'm really out of ideas, why doesn't this work? Can I select this way?<br> Should I use the class of the link and <code>.each()</code>?</p>
javascript jquery
[3, 5]
2,541,928
2,541,929
Saving file on disk
<p>In Java, while using Glassfish Server, we could only save files relative to our web application root. Thus you cannot directly save file on eg <code>c:\program files\abc.txt</code> whereas with php this is working. Is it valid? One should not be able to refer any location on hard disk outside web application root (unless you are using Virtual directory). Why are there so contradictory principles?</p>
java php
[1, 2]
1,204,845
1,204,846
how to show image proper format?
<p>I retrieve name and image from database that name and image are come in aspx as the requirement but problem is that image show one line only like "[image][image][image][image]"this format but i want 2x2 image </p> <p>aspx code :</p> <pre><code>&lt;asp:Repeater ID="reapterclient" runat="server" OnItemDataBound="repeaterclient_OnItemDataBound"&gt; &lt;ItemTemplate&gt; &lt;table width="645" align="left" cellpadding="8" cellspacing="01" border="0" bgcolor="#252525"&gt; &lt;tr bgcolor="#lclclc" height="40"&gt; &lt;td id="tdcollection" width="50%" align="center" valign="middle" class="general"&gt;&lt;asp:Image ID="imgClient" runat="server" ImageUrl='&lt;%#"~/clients_images/"+Eval("Client_Logo") %&gt;' Visible="true" Height="67" Width="380"/&gt;&lt;br /&gt; &lt;asp:Label ID="lblimgClient" runat="server" Text='&lt;%#Eval("Client_Name") %&gt;' Visible="true"&gt;&lt;/asp:Label&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td colspan="2"/&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; </code></pre> <p>cs code :</p> <pre><code>public void binddata() { SqlDataAdapter sda = new SqlDataAdapter("select Client_Name,Client_Logo from tp_Client_Master where (Project_Type like '%commercial%')",con); DataSet ds = new DataSet(); sda.Fill(ds); reapterclient.DataSource = ds; reapterclient.DataBind(); } </code></pre>
c# asp.net
[0, 9]
3,954,437
3,954,438
Difference in $_FILES structure when submitting and using XmlHttpRequest
<p>I'm building a file uploader using the javascript FileAPI and XmlHttpRequest with a fallback to uploading via a hidden iframe. Both uploads are processed with PHP.</p> <p>I however found an annoying difference in the way the $_FILES array is structured. </p> <p>When using the iframe fallback, the array will look like this: </p> <pre><code>$_FILES = array( 'files' =&gt; array( 'name' =&gt; array( 0 =&gt; 'name.jpg' ), 'type' =&gt; array( 0 =&gt; 'image/jpeg' ) ... ) ) </code></pre> <p>(I'm using multiple inputs called files[]) </p> <p>When I upload using an XmlHttpRequest, the array looks like this:</p> <pre><code>$_FILES = array( 'filename' =&gt; array( 'name' =&gt; 'name.jpg', 'type' =&gt; 'image/jpeg' ... ), ... ) </code></pre> <p>Is there any way to make this behave the same way? Below you find how I build my xhr request:</p> <pre><code>var data = new FormData(), xhr = new XMLHttpRequest(); data.append(file.name, file); xhr.open('POST', 'process.php', true); xhr.onload = function(e) { ... }; xhr.send(data); </code></pre> <p>At the moment I parse the two different arrays like this, which seems to work.</p> <pre><code> if(isset($_FILES['files']['name'])) { // old skool $_FILES array foreach($_FILES['files'] as $key =&gt; $values) { foreach($values as $index =&gt; $value) { $files[$index][$key] = $value; } } } else { // XMLHttpRequest $_FILES $files = $_FILES; } </code></pre>
php javascript
[2, 3]
5,112,651
5,112,652
android to long text for scrolable view
<p>I have a problem that seems to be very strange. Here is the code;</p> <pre class="lang-xml prettyprint-override"><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bghome" &gt; &lt;TableRow&gt; &lt;TextView android:id="@+id/TextTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:gravity="center" android:text="Wrocław" android:textColor="#FFFFFF" android:textSize="20dp" /&gt; &lt;/TableRow&gt; &lt;TableRow&gt; &lt;ScrollView android:layout_width="fill_parent" android:layout_height="400dp" android:layout_marginLeft="10dp" &gt; &lt;TextView android:id="@+id/TextMain" android:layout_width="300dp" android:layout_height="400dp" android:layout_gravity="center_vertical|right" android:text="Ładowanie danych..." &gt; &lt;/TextView&gt; &lt;/ScrollView&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; </code></pre> <p>Now. When I put quite long text in the TextView (inside scrolable view). I get disortion problem. Top of the text gets cut down. (Goal is to create a title and below it a scrolable container for html text from serwer - a html code).</p> <p>Id doesnt matter is I put html string on plain string, or I get data from serwer or hardcode it. I tried every combination, and I cant crack it.</p> <pre><code>MainText.setText(Html.fromHtml(Plain_str)); MainText.setText(Plain_str); MainText.setText(Plain_str.toString()); </code></pre> <p>Nothing helps.</p>
java android
[1, 4]
747,249
747,250
Add .00 to an int number using javascript
<p>Is it possible say a person enters an integer value 5 in a <code>Textbox</code> and automaticall a .00 is added in the end say <strong>5.00</strong></p> <pre><code>&lt;asp:TextBox ID="txtAmountTransfer" runat="server" Width="55%" CssClass="right"&gt;&lt;/asp:TextBox&gt; </code></pre>
c# javascript asp.net
[0, 3, 9]
2,866,294
2,866,295
Javascript regex replace if the matched string length is greater than limit specified
<p>I am using javascript regex to add a html markup for all the urls found like:</p> <pre><code> var exp = /(((|www\.|(http|https|ftp|news|file)+\:\/\/)[&amp;#95;.a-z0-9-]+\.[a-z0-9\/&amp;#95;:@=.+?,##%&amp;~-]*[^.|\'|\# |!|\(|?|,| |&gt;|&lt;|;|\)]))/ig; popupText = popupText.replace(exp , "&lt;font color='red'&gt;"+"&lt;b&gt;$&amp;&lt;/b&gt;"+"&lt;/font&gt;" ); </code></pre> <p>Now the problem is i want to make sure that it will word if the url found length is greater than 20 characters</p> <p>See <strong>$&amp;</strong> gets the match string i need to add a filter/check to gets its length.</p> <p>Any help is appreciated</p>
javascript jquery
[3, 5]
2,446,300
2,446,301
Maintaining application state in Android
<p>I'm trying to guess why, if I open my application, lock the device and some hours later resume the activity it crashes. I suppose thats why, after some time, Android destroy my app and then tries to resume and im not saving correctly the state of my activities.</p> <p>How can I force Android to destroy my app as it does usually without having to wait hours?</p> <p>Thanks in advance</p>
java android
[1, 4]
2,289,052
2,289,053
Loading content in a PHP file with JQuery
<p>I have the code below loading in the content I have in the test.php file. There's a lot of code in the php file so takes a bit of time to load. When it does load the "load content" text remains. I want to be able to: - display a loading symbol whilst the page is loading - hide the "load content" text once the content has appeared</p> <p>How would I do this?</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("a").click(function(){ $("#test").load('test.php'); }); }); &lt;/script&gt; &lt;div id="test"&gt;&lt;/div&gt; &lt;a&gt;Load content&lt;/a&gt; </code></pre> <p>UPDATE:</p> <p>Also I would like the it to be a link (as it currently doesn't work on a touch device) - any suggestions?</p>
php javascript jquery
[2, 3, 5]
4,159,618
4,159,619
timer schedule method exceeds the time
<p>I use the timer schedule method to send location information to the db every 5 min.</p> <p>Here is the code:</p> <pre><code>public void onStart(Intent intent, int startId) { this.timer.schedule(new Send(), new Date(), TEN_SECONDS*6*5); //ten_seconds = 10000 } class Send extends TimerTask { public void run() { String address = LocationService.this.address; new SendLocation(LocationService.this.id,address); // a thread that sends the info to the db LocationService.this.gpsLocation = null; LocationService.this.networkLocation = null; } } </code></pre> <p>But how come that my db has locations with 7/6 minute diffrence? The sendLocation checks if the location that i'm going to send to the db is the same as the last one, if true ignore the location else send it.</p> <p>Which means that the diffrence between each location in my db should be in jump of 5 minute.</p>
java android
[1, 4]
5,613,129
5,613,130
how to append anchor tag into parent of div?
<p>My html code is:</p> <pre><code>&lt;div title="test" class="xyz"&gt;Tesing&lt;/div&gt; </code></pre> <p>I want it to look like:</p> <pre><code> &lt;a href='#'&gt; &lt;div title="test" class="xyz"&gt;Tesing&lt;/div&gt;&lt;/a&gt; </code></pre> <p>How to do it using JavaScript?</p>
javascript jquery
[3, 5]
3,605,366
3,605,367
Is there any overhead to having multiple $(document).ready with jQuery 1.8.1
<p>I have code like this:</p> <pre><code>$(document).ready(function () { $('.accessLink') .bind('click', accessLinkClick); $('#logoutLink') .click(function (e) { window.location = $(this).attr('data-href') }); }); </code></pre> <p>Functionality for each part of my site is divided into a number of small files and when the site is deployed these are mimified and joined up. </p> <p>Each of these small files which number up to ten wait on $(document).ready. Can anyone tell me if there is much overhead in doing this. Splitting my code into functional areas has meant the code looks easy to maintain but I am just wondering about overhead now that I am using jQuery 1.8.1</p> <p>Update:</p> <p>Based on the answers I started to code like this:</p> <pre><code>$(document).ready(function () { accessButtons(); // login, register, logout layoutButtons(); themeButtons(); // theme switcher, sidebar, print page }); </code></pre> <p>with each function then coded as:</p> <pre><code>function accessButtons() { $('.accessLink') .bind('click', accessLinkClick); $('#logoutLink') .click(function (e) { window.location = $(this).attr('data-href') }); }; </code></pre>
javascript jquery
[3, 5]
1,318,328
1,318,329
Need a good JavaScript uploader
<p>I'm trying to upload files directly to Amazon S3. I have tried using <a href="http://www.uploadify.com/">Uploadify</a> and <a href="http://www.plupload.com/">Plupload</a>. Both have their merits. However, I've found both to be incompatible with older browser versions. Particularly IE 7, 8 and 9. I've also tested with Firefox 3.6. Really glitchy...</p> <p>I looked at <a href="http://digitarald.de/project/fancyupload/">FancyUpload</a>, which is fully compatible with all A-Grade Browsers (Internet Explorer 6+, Opera 9, Firefox 1.5+ and Safari 3+) with Adobe Flash 9 and 10 player.</p> <p>I've tried this uploader with Firefox 3.6 - 10, and IE 7, 8 and 9. NO PROBLEMS. The only thing, is that this is using MooTools, instead of jQuery. I know there are ways to integrate jQuery and MooTools. But before this approach, I would like to consider other options.</p> <p>Does anyone know a good uploader script that is reliable (paid or unpaid)? Either in pure JS or jQuery?</p>
javascript jquery
[3, 5]
3,319,641
3,319,642
Android - Text on Button
<p>I need to show the <strong>text on button's both left &amp; right side</strong>, whenever I touch the left side that should call an intent , and when I touch the right side that should call a separate intent . Is it possible to do like that? Please anyone suggest me.</p>
java android
[1, 4]
2,848,962
2,848,963
Execute a javascript function only if session["x"]="ok"; if it is not, not execute!
<p>Well i have 2 aspx page1 you are going to have amm two buttons or it dontmind but the goal is...</p> <p>when user press button1 in page1.aspx, session["x"] will be equals to "ok" if users press button2 in page1.aspx, session["x"] will be eauls to null;</p> <p>so after press any button user will be redirected to page2.aspx.</p> <p>i want to execute a javascript function if session is equals to "ok" and not to do it if session is null, someidea? when page2.aspx is open javascript function will be done automatically, if it is null, javascript function will not be nothing or it will not be executed. some idea? thanks guys!</p> <p>it worked so...</p> <p>the real code was it..</p> <pre><code>&lt;% if (Session[@"codigodiagrama"] != null){%&gt; &lt;script type="text/javascript"&gt; window.onload= function () { alert('with code'); } &lt;/script&gt; &lt;% } %&gt; &lt;% if (Session[@"codigodiagrama"] == null){%&gt; &lt;script type="text/javascript"&gt; window.onload= function () { alert('null'); } &lt;/script&gt; &lt;% } %&gt; </code></pre> <p>now i want to pass the session["codigodiagrama"] to the function if it has code to pass the String (codigodiagrama)</p> <p>i refer how to pass this session to this windows.onload =function(pass code here)</p>
javascript asp.net
[3, 9]
2,811,151
2,811,152
javascript/jquery convert utc to local time in short format
<p>So I'm trying to convert a UTC time to the clients local time in short format. I am using the following code:</p> <pre><code>var date = new Date(call.Timestamp); date.toLocaleString() </code></pre> <p>And I get the output like this on the screen:</p> <blockquote> <p>Thu Sep 13 2012 14:33:15 GMT+1000 (AUS Eastern Standard Time)</p> </blockquote> <p>What I would like to do is once I have converted it to the date object to display the short format: dd/mm/yyyy hh:mm:ss or mm/dd/yyyy hh:mm:ss depending on what timezone they are in. Is there a standard way I can do this in javascript? Does anyone know of a library package that can do this for me?</p> <p>I have also tried:</p> <pre><code>date.toLocaleDateString() + ' ' + date.toLocaleTimeString() </code></pre> <p>but the date string still outputs: "Thursday, September 13, 2012" rather than </p>
javascript jquery
[3, 5]
1,570,335
1,570,336
Moving from PHP to Python
<p>Currently I do all of my web-based programming in PHP, and each day I get more and more anxious to try Python.</p> <p>Not that I haven't played with it in an interpreter, but I mean really, write a web-based project in Python, and possibly move pretty much exclusively over to Python.</p> <p>But, I know that Python isn't strictly a web-based programming language (which is <strong>awesome</strong>) which makes me wonder if there are any hoops to jump through to use it on the web.</p> <p>A simple example would be, that I'm sure there's no <code>$_POST</code> like variables in Python by default. How does functionality like that find its way into Python?</p> <p>How do I move from PHP to Python smoothly? How do I use Python on the web?</p>
php python
[2, 7]
3,339,380
3,339,381
Search for immediate selector in jQuery?
<p>I have this function which accepts <code>obj</code> (Jq object) as a parameter </p> <p>However , in this function , I <strong>only need</strong> <code>obj</code> which is <code>:not(:disabled)</code> and <code>:not([readonly]</code></p> <p>currently I've managed to do it with : </p> <pre><code>function CheckRequiredSelection(obj) { obj.find(".requiredSelection:visible:not(:disabled):not([readonly])").andSelf().each(function () { ... }); } </code></pre> <p>But I really want to get rid of <code>find</code> and <code>addSelf</code> trick.</p> <p>Any help ?</p> <p>The document can contain : </p> <p>Edit #1 ... </p> <pre><code>&lt;select class="requiredSelection"&gt; ... &lt;/select&gt; &lt;select class="requiredSelection"&gt; ... &lt;/select&gt; </code></pre> <p>and before submit : I do something like : </p> <p><code>CheckRequiredSelection($(".requiredSelection"))</code></p> <p>Edit #2</p> <p>I could have check inside the .each loop but then it wont be efficient since it's after the selector. ( instead of getting 5 filtered elements from 100 , I will get 100 elements and THEN i'll have to filter. That's not nice).</p>
javascript jquery
[3, 5]
4,581,108
4,581,109
associative arrays as selectors and values in jquery
<p>Is it possible to implement associative arrays as Selectors and Values.</p> <p>I have an array</p> <pre><code> var obj = { surgeon:1, asstSurgeon:2, anesthe:3, nurse:4, scrub:5,....... }; </code></pre> <p>I am able to implement like this.</p> <pre><code>$("#surgeon").click(function(){ $("$hiddenvariable").val(1); }); $("#asstSurgeon").click(function(){ $("$hiddenvariable").val(2); }); ................, </code></pre> <p>Can anyone help me how can i reduce the code.</p> <p>Is there any other way to implement this.</p>
javascript jquery
[3, 5]
352,247
352,248
selecting textViews and getting their values
<p>I am trying to accomplish following things</p> <p>Suppose I have 5-6 <code>TextViews</code> with values <code>S N A K E</code> </p> <p>Now, I want to press <code>S</code> textView then slide my finger over <code>N</code> to select it too and then move my way to E. I want to do that so that i can get "<code>SNAKE</code>" in my string or char sequence etc</p> <p>If there is any idea do share me. I can't get it how to use <code>onTouch</code> here. Also, i am adding <code>textViews</code> dynamically so i am setting their ids dynamically too Best Regards</p>
java android
[1, 4]
2,593,875
2,593,876
Getting bottom scroll.y when scrolling to the bottom
<p>I'm using a nicescroll a plugin that I use to create scrollbars on divs. </p> <pre><code>$('#postscroller').niceScroll(); var nice = $("#postscroller").getNiceScroll()[0]; $('#postscroller').bind("scroll",function() { if(nice.scrollvaluemax==nice.scroll.y) { alert('bottom'); } alert(nice.scroll.y); }); </code></pre> <p>First I activate the div to be scrolled. Then I save the nicescroll instance to the nice variable. </p> <p>When I test the scroll event to see wether the scroll.y is being fired when I scroll to the bottom I get some numbers but not 134 which is nice.scrollvaluemax in the div I'm testing. </p> <p>I do get however 134 when I'm at the bottom and I scroll upwards. </p> <p>Any idea on how can I get 134 when scrolling to the bottom? </p> <p>Thanks</p>
javascript jquery
[3, 5]
4,213,143
4,213,144
How to set access to file for Un-authenticated user?
<p>I have attached my project's folder structure. I have marked Login.aspx page and Scripts folder with Red color border. I have written required JavaScripts inside Scripts folder.</p> <p>When the Login.aspx loads, Javascript error is coming. Error is shown below:</p> <pre><code>Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Steria Browser - MKG) Timestamp: Thu, 20 Oct 2011 08:46:42 UTC Message: Syntax error Line: 3 Char: 1 Code: 0 URI: http://localhost:1642/login.aspx?ReturnUrl=%2fScripts%2fCommonScriptFunctions.js Message: Syntax error Line: 3 Char: 1 Code: 0 URI: http://localhost:1642/login.aspx?ReturnUrl=%2fScripts%2fLoginScripts.js </code></pre> <p>After long analysis, I understood that the problem is due to un-authorised access since user is not completed authentication yet. But, I don't know how to override using web.config's location tag since both CommonScriptFunctions.js, and LoginScripts.js files are inside Scripts folder as shown in the attached screen-shot.</p> <p>Any idea please....</p> <p>Here is the screen-shot:</p> <p><img src="http://i.stack.imgur.com/NFBzh.jpg" alt="Login JavaScript Error"></p>
javascript asp.net
[3, 9]
1,972,294
1,972,295
Swapping input field placeholder text with jQuery
<p>I try as following jquery code, but it doesn't work true, how can fix it?</p> <p><strong>Demo:</strong> <a href="http://jsfiddle.net/pjqcf/" rel="nofollow">http://jsfiddle.net/pjqcf/</a></p> <pre><code>&lt;input type="text" value="Some descriptive text..."&gt;​ $('input[type=text]').focus(function () { if ($(this).val() == $(this).attr('defaultValue')) { $(this).val(''); } }); $('input[type=text]').blur(function () { if ($(this).val() == '') { $(this).val($(this).attr('defaultValue')); } });​ </code></pre>
javascript jquery
[3, 5]
696,445
696,446
Can jQuery ready() function be used twice for the same element?
<p>I want to use jQuery <code>ready()</code> function for the document element. Here are my scripts:</p> <p><em>1st page:</em></p> <pre><code>$(document).ready(function(){ $('form#haberekle').ajaxForm(options); }); </code></pre> <p><em>2nd page:</em></p> <pre><code> $(document).ready(function() { var options = { success:showResponse, beforeSubmit:showRequest, resetForm:true }; $('#haberresmiekleform').ajaxForm(options); }); </code></pre> <p>These two pages are included in the same main page with <code>&lt;!--#include file=""--&gt;</code></p> <p>Can these two functions work properly, or they block each other? According to my experience they seem work properly.</p> <p>For example: an <code>onclick</code> function of a button is only one.</p>
javascript jquery
[3, 5]
2,085,655
2,085,656
How do I pass parameters to javascript from each page dynamically
<p>The following code provides Remove capability on each of the list page (e.g. sample list page given below), of which only 3 variables (tableId, removeButtonId, headerCheckbox) vary in each page. How do I re-use this script across all pages, instead of defining this in each page. How do I pass parameters to this script from each page dynamically?</p> <pre><code> &lt;script type="text/javascript"&gt; var tableId = '#usersChildren\\:userList'; var removeButtonId = '#usersChildren\\:removeUsers'; var headerCheckbox = '#selectAll'; jQuery(document).ready(function() { if (jQuery(tableId).find("input[type='checkbox']").length == 1) { jQuery(headerCheckbox).hide(); jQuery(removeButtonId).hide(); } else if(jQuery(tableId).find("input[type=checkbox]:checked").length == 0) { jQuery(removeButtonId).hide(); jQuery(headerCheckbox).click(function() { jQuery(tableId).find("input[type='checkbox']").attr('checked', jQuery(headerCheckbox).is(':checked')); }); } jQuery(tableId).find("input[type='checkbox']").each(function() { if(jQuery(this).attr('id') != headerCheckbox) { jQuery(this).click(function() { if (jQuery(headerCheckbox).is(':checked')) { if(jQuery(tableId).find("input[type=checkbox]:checked").length != 1) { jQuery(removeButtonId).show(); } } else if(jQuery(tableId).find("input[type=checkbox]:checked").length &gt; 0) { jQuery(removeButtonId).show(); } else { jQuery(removeButtonId).hide(); } }); } }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,017,065
2,017,066
jQuery: hide() box when clicking on body but not() on element itself?
<p>I have a <code>&lt;a href="#" id="btn"&gt;Show Box&lt;/a&gt;</code> somwhere in my DOM. Additionally I have a <code>div#overlay</code> that is by default set to <code>display:none;</code>.</p> <pre><code>// Toggle Overlay $('#btn').click(function(e) { e.preventDefault(); $('#overlay').toggle(); }) $('body').not('#btn, #overlay').click(function() { if ( $('#overlay').is(':visible') ) $('#overlay').hide(); }); </code></pre> <p>Why is this not working? I want the <code>#btn</code> to toggle() the overlay when clicking it. However when the overlay is visible and I click anywhere on the document (except the <code>#btn</code> itself or the <code>#overlay</code>) I want the overlay also to be hidden.</p>
javascript jquery
[3, 5]
1,880,779
1,880,780
How to detect a MouseUp event outside the window?
<p>I am looking for jQuery solution to detect <code>mouseup</code> outside the window. That is, after the mouse has been <strong>downed</strong> inside the window, dragged outside while still down, and then released outside, is when the event should fire.</p> <p>I tried <code>document.mouseup = function() {}</code>, it didn't help. I tried to follow the example <a href="http://stackoverflow.com/questions/1685326/responding-to-the-onmousemove-event-outside-of-the-browser-window-in-ie/1745382#1745382">here</a>, but couldn't properly understand it (I even left a comment asking for help, but no help yet..:( )</p>
javascript jquery
[3, 5]
591,224
591,225
How to make jQuery functions run in order when a button is pressed?
<p>I have a <code>.click()</code> function that performs certain actions when a button is clicked. I want it to display a loading image, run some "stuff", then delete the loading image when the "stuff" is done. </p> <p>Example of Javascript code:</p> <pre><code>$("#button").click( function(){ shoeLoadingImage(); /************************************************************************** * * other actions to be performed after showLoadingImage() is finished * **************************************************************************/ //Whats below should only to be triggered after above actions above are finished hideLoadingImage(); } ); </code></pre> <p>By using a couple of suggestions here I came up with a solution. It works, but I'm sure there is a better way to do this since my loading.gif is frozen when it is loaded. FYI: the other actions listed under <code>success: function(){}</code> contains some actions that take some time to complete which is the whole purpose of this loading image. </p> <pre><code>$("#highlight").click( function(){ $.ajax({ beforeSend: function(){ showLoadingImage(); }, success: function(){ /************************************************************************** * * other actions to be performed after showLoadingImage() is finished * **************************************************************************/ }, complete: function (){ hideLoadingImage(); } }); }); </code></pre>
javascript jquery
[3, 5]
3,179,901
3,179,902
Submit fires twice if I have moved form in the DOM
<p>This works fine alone:</p> <pre><code> $('#signup').submit(function() { alert('submit event'); $.ajax({ url: url, data: data, success: function(msg) { $('#mc-response').html(msg); } }); return false; }); </code></pre> <p>but submit fires twice if the form is not in its original location—i.e., if I used any of these on document load:</p> <ul> <li><p><code>$('.formcontainer').prependTo('body').slideDown();</code></p></li> <li><p><code>$('.formcontainer').remove().prependTo('body').slideDown();</code></p></li> </ul> <p>Why would this happen? It works fine if I leave leave it in its original location.</p>
javascript jquery
[3, 5]
4,341,658
4,341,659
How do I run different versions of jQuery on the same page?
<p>My company has purchased a product that renders an ASP.NET control on the page. This control uses jQuery 1.2.3 and adds a script tag to the page to reference it. The developers of the control will not support use of the control if it modified in any way (including modification to reference a different version of jQuery).</p> <p>I'm about to start development of my own control and would like to use the features and speed improvements of jQuery 1.3. Both of these controls will need to exist on the same page.</p> <p>How can I allow the purchased control to use jQuery 1.2.3 and new custom development to use jQuery 1.3? Also out of curiosity, what if we were to use an additional control that needed to reference yet another version of jQuery?</p>
asp.net javascript jquery
[9, 3, 5]
3,015,933
3,015,934
How to compile Java from C#?
<p>I'm trying to use the following C# code to compile Java using javac:</p> <pre><code>Process p = new Process(); p.StartInfo.FileName = "javac"; Directory.CreateDirectory(Application.StartupPath + @"/TempJava"); p.StartInfo.Arguments = "-d "Application.StartupPath + @"/TempJava" + files; p.Start(); </code></pre> <p>"files" represents a string variable containing the name(s) of the <code>*.java</code> files. </p> <p>All in all, I want to create a new folder, and then take the Java files (from where ever they may be located) and compile it into a class file(s) in TempJava.</p> <p>For some reason, the code doesn't work, no errors, no warnings, but when I run it and check TempJava, there's no files in it.</p>
c# java
[0, 1]
1,008,363
1,008,364
How do you handle attaching JavaScript to UserControls in ASP.NET and keep multiple instance isolated?
<p>Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?</p>
asp.net javascript
[9, 3]
2,814,518
2,814,519
jQuery: Stopping a periodic ajax call?
<p>I am writing a small jQuery plugin to update a set of Divs with content obtained using Ajax calls. Initially, let's assume we have 4 divs. I am doing something like this:</p> <pre><code>(function($) { .... .... //main function $.fn.jDIV = { init: function() { ... ... for(var i = 0; i &lt; numDivs; i++) { this.query(i); } this.handlers(); }, query: function(divNum) { //Makes the relevant ajax call }, handlers: function() { for(var i = 0; i &lt; numDivs; i++) { setInterval("$.fn.jDIV.query(" + i + ")", 5000); } } }; })(jQuery); </code></pre> <p>I would like to be able to enable and disable a particular ajax query. I was thinking of adding a "start" and "stop" instead of the "handlers" function and subsequently storing the setInterval handler like this:</p> <pre><code>start: function(divNum) { divs[divNum] = setInterval("$.fn.jDIV.query(" + divNum + ")", 5000); }, stop: function(divNum) { clearInterval(divs[divNum]); } </code></pre> <p>I did not use jQuery to setup and destroy the event handlers. Is there a better approach (perhaps using more of jQuery) to achieve this?</p>
javascript jquery
[3, 5]
3,635,015
3,635,016
LinkedIn style tagging when adding skills
<p>I was looking online for good javascript tagging libraries. I was reading the following post: <a href="http://stackoverflow.com/questions/519107/jquery-autocomplete-tagging-plug-in-like-stackoverflows-input-tags">jQuery autocomplete tagging plug-in like StackOverflow&#39;s input tags?</a></p> <p>But I'm afraid mine is slightly different design constraint. I would like it to be more liked LinkedIn when adding skills to ones profile..so it's not inline. Is there anything that is available online for this?</p>
javascript jquery
[3, 5]
4,638,101
4,638,102
return folders from url
<p>I am looking to write a piece of javascript that will do the following:</p> <p>Look at current url and return any folders in the url ie:</p> <p><a href="http://localhost/folder1/page.aspx" rel="nofollow">http://localhost/folder1/page.aspx</a> returns -> /folder1/</p> <p><a href="http://localhost/page.aspx" rel="nofollow">http://localhost/page.aspx</a> returns -> /</p> <p>Any help?</p>
javascript jquery
[3, 5]