Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
1,817,857
1,817,858
Is there a Python or PHP library which can Tokenise and Convert Japanese text
<p>Given a string that can contain Japanse and English text, I would like to:</p> <ol> <li>Convert the Japanese parts from Hiragana to Katakana and half width to full width. </li> <li>Split the string by words (Japanse text does not use spaces to delimit words)</li> </ol> <p>I am currently using the excellent iOS / OS X string libraries (which cater for hundreds of complexities and edge cases).</p> <p><a href="https://developer.apple.com/library/mac/documentation/CoreFOundation/Reference/CFMutableStringRef/Reference/reference.html#//apple_ref/c/func/CFStringTransform" rel="nofollow"><code>CFStringTransform</code></a> with the <code>kCFStringTransformHiraganaKatakana</code> constant.</p> <p><a href="https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/instm/NSString/enumerateSubstringsInRange%3aoptions%3ausingBlock%3a" rel="nofollow"><code>enumerateSubstringsInRange:options:usingBlock:</code></a> with the <code>NSStringEnumerationByWords</code> constant.</p> <p>The search is moving from client to server so we need a PHP or Python version of these methods.</p>
php python
[2, 7]
3,667,171
3,667,172
Get the values of all checked check boxes and put them in a hidden field
<p>How do I modify this simple check all code to get all the values of the checkboxes after they are checked and then place them into hidden input, each value should be separated with a comma so I can then explode the values in php. The checkboxes are inside table rows</p> <pre><code>//checks all and unchecks all checkboxes based on checkbox in first row of the table. $('th input:checkbox').click(function(e) { var table = $(e.target).parents('table:first'); $('td input:checkbox', table).attr('checked', e.target.checked); }); </code></pre>
javascript jquery
[3, 5]
1,245,979
1,245,980
How to select same objects in two arrays using jQuery?
<p>I have a situation where I have two arrays of objects. I want select same objects from both arrays and show it. For instance I have following UL (<a href="http://jsfiddle.net/concypt/StPew/6/" rel="nofollow">You can see it at jsFiddle</a>):</p> <pre><code>&lt;ul&gt; &lt;li id="one" class="color pro"&gt;one&lt;/li&gt; &lt;li id="two" class="color pro"&gt;two&lt;/li&gt; &lt;li id="three" class="color"&gt;three&lt;/li&gt; &lt;li id="four" class="color"&gt;four&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I am using following script to show same objects. </p> <pre><code>var activeElementsColors = $("ul li.color"); var activeElementsPro = $("ul li.pro"); var activeElements = activeElementsPro.filter(function(el) { return $.inArray(el, activeElementsColors) &gt; -1; }); activeElements.show(); </code></pre> <p>I know I can use $("li.color.pro").show() but above one is just an example. real code is complex than this. </p>
javascript jquery
[3, 5]
2,264,811
2,264,812
How do I make a div element editable (like a textarea when I click it)?
<p>This is my code:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta name="viewport" content="width=device-width, user-scalable=no"&gt; &lt;/head&gt; &lt;body&gt; &lt;style type="text/css" media="screen"&gt; &lt;/style&gt; &lt;!--&lt;div id="map_canvas" style="width: 500px; height: 300px;background:blue;"&gt;&lt;/div&gt;--&gt; &lt;div class=b style="width: 200px; height: 200px;background:pink;position:absolute;left:500px;top:100px;"&gt;&lt;/div&gt; &lt;script src="jquery-1.4.2.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="jquery-ui-1.8rc3.custom.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
2,771,759
2,771,760
Is it possible to call an ASP.NET function inside a Javascript function?
<p>Is it possible to call an ASP.NET function inside a Javascript function?</p> <p>eg</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&gt; &lt;%@ Import Namespace="System.Xml" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;script runat="server"&gt; protected void btnSave_Click(object sender, EventArgs e) { } &lt;/script&gt; &lt;head&gt;..... &lt;/head&gt; &lt;script type="text/javascript" language="javascript"&gt; function abc() { . . . . btnSave_Click(sender,e); } </code></pre> <p>This code is just to give you an idea of what I want.</p>
javascript asp.net
[3, 9]
4,576,877
4,576,878
jquery selector for div with class
<p>I tried this below. I think the return Object of <strong>$("div.tab_select")[0]</strong> isn't a jQuery Object, but I can't even use pure javascript method.</p> <p>Is there any way to make it jQuery Object? for instance <strong>$($("div.tab_select")[0])</strong>..I know this's silly;</p> <p>Thank you for reading.</p> <pre><code>var tmp = $("div.tab_select")[0]; alert(tmp); //This gives me HTMLDivElement collectly. But I can't use any of javascript.. alert(tmp.nodeName); //But this give me error "Uncaught TypeError: Cannot read property 'nodeName' of undefined" tmp.hide(); //Neither, I can't use this. </code></pre>
javascript jquery
[3, 5]
5,546,624
5,546,625
Jquery slideDown on Button Click
<p>I'm looking to have a slide(down) toggle but would like the panel to line up neatly along the left edge of the button. I don't want to hard code margin, position, px, etc but want the slide down panel to always be "in relation" to (and relative) the (left bottom of) button. </p> <p>What am I missing?</p> <pre><code>&lt;!doctype html&gt; &lt;head&gt; &lt;script src='http://code.jquery.com/jquery-1.7.2.min.js'&gt;&lt;/script&gt; &lt;style type="text/css"&gt; .slideToggleBox{ float:left; padding:8px; margin:16px; border:1px solid red; width:200px; height:50px; background-color:blue; color:white; position:fixed; left:-10.5px; top:2.3%; } .clear{ clear:both; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="clear"&gt; &lt;button id=slideToggle&gt;slideToggle()&lt;/button&gt; &lt;br/&gt; &lt;div class="slideToggleBox"&gt; slideToggle() &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $("#slideToggle").click(function () { $('.slideToggleBox').slideToggle(); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
2,468,202
2,468,203
How to call javascript function and code behind using button
<p>How to call javascript function and code behind function using button?</p> <pre><code>&lt;asp:button id="btnSave" onclick="btnSave();" onclientclick ="return javascriptfunction();" runat="server"&gt; &lt;/asp:button&gt; </code></pre> <p>I tried like this too. but no response.</p> <pre><code>&lt;asp:button id="btnSave" onclick="btnSave();" onclientclick ="return true;" runat="server"&gt; &lt;/asp:button&gt; </code></pre> <p>even, javascript function return true, its not calling codebehind function. May i know reason?</p>
javascript asp.net
[3, 9]
4,025,528
4,025,529
Differentiate jquery and javascript
<p>How can we differentiate <code>jquery</code> and <code>javascript</code>.?<br> Where we can use <code>jquery</code> not <code>javascript</code> and vice-versa.?</p>
javascript jquery
[3, 5]
162,670
162,671
How to create a balance script based on the cursor position?
<p>I'm trying to do something very similar to this game. <a href="http://i301.photobucket.com/albums/nn42/playonlineflashgame/HomeRun.swf" rel="nofollow">http://i301.photobucket.com/albums/nn42/playonlineflashgame/HomeRun.swf</a></p> <p>Although it's not a game, it's just a simple "balance" thing i'm trying to apply according to the movement of the cursor.</p> <p>Same idea as the link i've provided up there where the guy starting swaying left and right according to where your cursor is. The think is that I've struggling to get the same smoothness like the effect you see in the game. Acceleration, innertia, gravity etc... not sure if it needs to be that complicated but the simpler the better.</p> <p>So if anyone ever built or done anything like that who can help me out, I would appreciate for life?</p>
javascript jquery
[3, 5]
3,551,835
3,551,836
Realod DataList on Client Side with XmlDataSource
<p>Hello i want to reload the Datalist on client side after regular interval of time by using jquery or javscript so as i can get the latest RSS news feed here is my code</p> <pre><code>&lt;asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="http://www.example.com/category/test/feed/" XPath="rss/channel/item"&gt;&lt;/asp:XmlDataSource&gt; &lt;asp:DataList ID="dlRss" runat="server" DataSourceID="XmlDataSource1"&gt; &lt;ItemTemplate&gt; &lt;label style="color: #222222; float: left; font-size: 16px; margin-top: 5px; width: 190px;"&gt; &lt;%# XPath("title")%&gt;&lt;/label&gt; &lt;label style="color: #444444; display: inline-block; font-size: 11px; margin-bottom: 5px; width: 190px;"&gt; &lt;%# Convert.ToDateTime(XPath("pubDate")).ToShortDateString() + " @" + Convert.ToDateTime(XPath("pubDate")).ToShortTimeString()%&gt;&lt;/label&gt; &lt;label style="color: #444444; display: inline-block; font-size: 13px; width: 190px;"&gt; &lt;%#XPath("description").ToString().Length &lt;= 200 ? XPath("description") : XPath("description").ToString().Substring(0,200) + "...&lt;a href='" + XPath("link").ToString() + "' target='_blank'&gt;more&lt;/a&gt;"%&gt;&lt;/label&gt; &lt;br /&gt; &lt;/ItemTemplate&gt; &lt;/asp:DataList&gt; </code></pre>
javascript jquery asp.net
[3, 5, 9]
5,727,849
5,727,850
Is a correct use of this in javascript?
<p>I used to have this call:</p> <pre><code>var link = $('&lt;a /&gt;', { 'class': 'prop' + index, title: elt, text: elt }); link.on('click', switchLabel); </code></pre> <p>with <code>switchLabel</code> as follow:</p> <pre><code>function switchLabel(e) { $('#' + this.className.replace('prop','corr')).text(this.title); } </code></pre> <p>I just realized that <code>this</code> is quite difficult to understand what it refers to in javascript, so I replaced with:</p> <pre><code>function switchLabel(e) { var source = e.currentTarget; $('#' + source.className.replace('prop','corr')).text(source.title); } </code></pre> <p>Am I correct? Please add some explanation to your answer and we (js noobs) can learn.</p>
javascript jquery
[3, 5]
378,407
378,408
Bind jQuery hover event to multiple DOM elements
<p>I've an unordered list of elements and I want to bind hover event to each of these elements. The HTML structure is as follows : </p> <pre><code>&lt;ul&gt; &lt;li id="url_1"&gt;item 1&lt;/li&gt; &lt;li id="url_2"&gt;item 2&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I figured using a for-loop would be the best way to do it. So my jQuery code is as follows:</p> <pre><code>for(i=1;i&lt;=2;i++){ $("li#url_"+i).hover(function () { /* do something on mouseenter */}, function () { /* do something on mouseleave */ }); } </code></pre> <p>This should bind the hover event to li#url_1 &amp; li#url_2. But it is not working!</p> <p>Can you please suggest the right (and more efficient) way to do this?</p> <p>Cheers, Kartik Rao</p>
javascript jquery
[3, 5]
3,707,602
3,707,603
why does this script not work in IE6?
<p>I've been working on and off on a horizontal accordion. It's not working perfectly at the moment but i've just got to change a few bits. The code is very rough and I intend to make it a bit more graceful once it works.</p> <p>It functions perfectly in every browser apart from ie6..initially when it loads in the page all you can see is the 6th panel (labelled df6)...then if you click on that the accordion seems to spring in to life....all the panels appear and it seems to work just fine. I can't think of any reason for this..</p> <p>Any ideas? I'm at a complete loss with this :(</p> <p><a href="http://boudaki.com/testing/carousel/test.html" rel="nofollow">http://boudaki.com/testing/carousel/test.html</a></p>
javascript jquery
[3, 5]
5,272,999
5,273,000
Use option value as a filename variable in a jquery function
<p>how can I pass the option value to the filename below? My purpose is to create files e.g. 1.php 2.php 3.php .... but I dont know how to pass it as a variable. Thanks.</p> <pre><code> &lt;form&gt; &lt;select id="termid"&gt; &lt;option value=""&gt;- select -&lt;/option&gt; &lt;option value="1"&gt;Option 1&lt;/option&gt; &lt;option value="2"&gt;Option 2&lt;/option&gt; &lt;option value="3"&gt;Option 3&lt;/option&gt; &lt;option value="4"&gt;Option 4&lt;/option&gt; &lt;option value="other"&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;/form&gt; </code></pre>
php jquery
[2, 5]
4,908,584
4,908,585
Jquery Is this the correct way?
<pre><code>&lt;script type="text/javascript"&gt; if (SOMECONDITION) { $("#scriptD").attr("src", "../../Scripts/A.js"); } else { $("#scriptD").attr("src", "../../Scripts/B.js"); } &lt;/script&gt; &lt;script id="scriptD" src="" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>I am trying to insert a <code>.js</code> file dynamically ( on the condition basis). But this is not working . Can anybody tell me whats the problem here? </p>
javascript jquery
[3, 5]
4,773,525
4,773,526
Is it safe to call jQuery's resize() function to execute my own resize handler?
<p>I am defining a resize handler that positions some elements on the screen, like this:</p> <pre><code>$(window).resize(function() { // Position elements } </code></pre> <p>I also want to execute this functionality when the page first loads, so I just add the following right after the above code:</p> <pre><code>$(window).resize(); </code></pre> <p>This works just fine. However, I'm wondering if I may trigger any side effects, harmful or not, by calling this function - I really just want to execute my own resize handler. Of course, I could do the following to make sure that I execute only my handler:</p> <pre><code>var positionElements = function() { // Position elements } $(window).resize(positionElements); positionElements(); </code></pre> <p>However, I'm new to JavaScript and I want to keep my code as concise as possible - this adds some boiler plate code to the mix.</p> <p><strong>Edit:</strong> In fact, my code can be shortened even more by using chaining. Like this:</p> <pre><code>$(window).resize(function() { // Position elements }).resize(); </code></pre>
javascript jquery
[3, 5]
1,689,321
1,689,322
how to use goto statement in android
<p>How can I use <code>goto</code> in Android?</p>
java android
[1, 4]
457,334
457,335
check the string having full number or the combinbation of number and string
<p>I want to check whether a string is only numeric, or is alphanumeric.</p> <p>For example :</p> <pre><code>string test = "2323212343243423333"; string test1 = "34323df23233232323e"; </code></pre> <p>I want to check test having number only or not. If the whole string having number means it returns true. Otherwise it returns false.</p> <p>How can i do this?</p>
c# asp.net
[0, 9]
1,031,580
1,031,581
before remove object want to do some functionality over its siblings in jquery
<p>below specified working fine for me but i want to know is there any other best way to do it </p> <pre><code>$(this).parents('form:first') .siblings('.div-action,.single-field').show() .siblings('form:first').remove() </code></pre> <p>Like i tried below specified one not helpful</p> <pre><code>$(this).parents('form:first') .remove(function(){ $('this') .siblings('.div-action,.single-field').show()}); </code></pre> <p>I know below specified way too but i want to know the best way to do this</p> <pre><code> var temp = $(this).parents('form:first') temp.siblings('.div-action,.single-field').show() temp.remove() </code></pre> <p>I want to do it in one line only</p>
javascript jquery
[3, 5]
2,876,649
2,876,650
How do I get text/html between consecutive <input>s?
<p>Since input tags aren't supposed to have closing tags, is there a simple way to extract the text/HTML in between a series of input tags? For example, for the below I want to retrieve <code>&lt;b&gt;Bob and Tim&lt;/b&gt;&lt;br&gt;Tim &lt;i&gt;after&lt;/i&gt; Bob&lt;br&gt;</code>.</p> <pre><code>&lt;div id="inputs"&gt; &lt;input type="text" value="bob" size="4" /&gt; &lt;b&gt;Bob and Tim&lt;/b&gt;&lt;br&gt; &lt;input type="text" value="tim" size="4" /&gt; Tim &lt;i&gt;after&lt;/i&gt; Bob&lt;br&gt; &lt;input type="button" value="get textbox values" id="mybutton" /&gt; &lt;/div&gt;​ </code></pre> <p><a href="http://jsfiddle.net/gLEZd/5/" rel="nofollow">http://jsfiddle.net/gLEZd/5/</a></p> <p>I can get the textbox's values, but how do I accomplish the above?</p>
javascript jquery
[3, 5]
1,834,760
1,834,761
dynamically convert string to HTMLControl in javascript
<p>I am having one id of textbox in form of string &amp; I want to set some value from js. How could I set it</p> <pre><code>document.formid.getElementByTag("input").getelementId("strTextId").value = dynamicVal </code></pre> <p>Other cases its HTMLInputObject ref. But here I am having string id only</p> <p>Please guide me. I wanted to do it in javascript only</p>
javascript asp.net
[3, 9]
5,824,480
5,824,481
Creating custom/intutive layout for controls
<p>I have an address control which display the contact info of the person. </p> <p>so it displays something like </p> <p>1234, street City, CA 12345</p> <p>Now i want to give user flexibility to create format out of it. For ex someone might want to display address as,</p> <p>street, City, Country</p> <p>OR </p> <p>Just display their emails: [email protected] [email protected] </p> <p>Any good ideas on how to it or similar examples? thanks</p>
c# asp.net jquery
[0, 9, 5]
1,856,267
1,856,268
How to swap fadeIn/fadeOut of dynamically created selectors
<p>I am swapping out divs generated with a php foreach loop like this...</p> <pre><code>&lt;img class="trigger" name="showme-&lt;?php echo $stuff ?&gt; ... &gt; &lt;div id="showme-&lt;?php echo $stuff ?&gt;" style="display:none"&gt;&lt;/div&gt; $('.trigger').click(function(){ var num=$(this).attr("name"); $('#'+num).fadeIn(); </code></pre> <p>This works fine.. but my question is how do I not just fade in these elements but also fade out the ones that are currently sitting there so I am only showing one showme-var div at a time? Because I do not know which one is currently showing I can not use the selector to identify who needs to be faded out. Can I add a wildcard "*" to the selector or maybe use .children of a parent div?</p>
javascript jquery
[3, 5]
929,946
929,947
Getting the name or id of an input, not the input value
<p>Simple question.</p> <pre><code>&lt;input type="text" value="Some text" name="thisname" id="thisid" /&gt; </code></pre> <p>How can I get the name of the id or name that is being used, instead of value. It is clear that value of this text-box is "Some text". But what I want is name of id and name being used now.</p> <p>To be more clear ... I want "thisid" or "thisname".</p> <p>See my code</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $("p").parent(".selected").css("background", "#FF8877"); }); function add(name) { $("#" + name).parent().clone().insertAfter($("#" + name).parent()); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt; &lt;div class="selected"&gt;&lt;p name="name" id="name" onclick="add(this.name)"&gt;Hello Again&lt;/p&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Any idea ?</p>
javascript jquery
[3, 5]
2,049,390
2,049,391
Can't get jQuery to return data
<p>I have a very simple jQuery script.. all I want it to do is return the data on the PHP/HTML page but it's not working. The code is below:</p> <pre><code>function sendData() { $.post("validation.php", $("#c_form").serialize(), function(data){}, "html"); </code></pre> <p>}</p> <p>The function is called by an onclick event in the form. I don't get why it is isn't working, very stumped. Any ideas? There are no errors that pop up in the firefox console window.</p>
javascript jquery
[3, 5]
5,602,527
5,602,528
how to valid only digit in textbox in firefox?
<p>i have problem to valid digit in textbox in IE 9 and firefox 4 &amp; 5, is any one know ? i try all previous question's answer but still face problem, i just want use to enter only digit in textbox, i am use asp.net too for code language.</p>
javascript jquery asp.net
[3, 5, 9]
4,812,427
4,812,428
is there an equivalent to C# indexer in java
<p>I want to do this in java. is it possible?</p> <pre><code>public string this[int pos] { get { return myData[pos]; } set { myData[pos] = value; } } </code></pre>
c# java
[0, 1]
2,515,765
2,515,766
Jquery / Javascript find first visible element after scroll
<p>I have code like below:</p> <pre><code>&lt;div id="container"&gt; &lt;div class="item" id="1"&gt;blah blah&lt;/div&gt; &lt;div class="item" id="2"&gt;blah blah 2&lt;/div&gt; &lt;/div&gt; </code></pre> <p>But actually there are lots and lots of with class='item'. </p> <p>Basically as the user scrolls this great long list of items I want to change the style of the current top visible one (like google reader!). Have looked around for solution in jquery or plain javascript but can't seem to find one. Anyone have any ideas?</p> <p>Thanks</p> <p>Mark</p>
javascript jquery
[3, 5]
967,026
967,027
Text box value doesn't get post after selecting a date from Jquery datepicker
<p>I create a textbox and add a Jquery UI datepicker.But when I select and click the button.the textbox doesnt get post and show an error message like(Notice: Undefined index: date_text in C:....................\file.php on line 57 ).But when I enter a date using keyboard without having a datepicker it will submit well.Please help me.How can I do this having datepicker</p> <p>this is my jquery code</p> <pre><code>&lt;script&gt; $(function() { $( "#datepicker" ).datepicker(); $( "#datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" ); }); &lt;/script&gt; </code></pre> <p>this is my textfield</p> <pre><code>&lt;div id="datetobe"&gt;Date to be dispose &lt;label for="date_to_dispose"&gt; &lt;input name="datepicker" type="text" id="datepicker" class="textfield" /&gt;&lt;/label&gt; &lt;/div&gt; </code></pre>
php javascript jquery
[2, 3, 5]
3,413,533
3,413,534
Passing "return false" between functions in jQuery
<p>I know the title is a bad title, I don't know any way to explain this other than with an example:</p> <pre><code>$('form').submit(function(){ $(this).find('input').each(function(){ if($(this).hasClass('error')) return false; }); }); </code></pre> <p>However, the "return false" is returning the ".each()" with false. How can I "pass" it onto the ".submit()"?</p>
javascript jquery
[3, 5]
4,338,643
4,338,644
php include unterminated string literal message
<p>The following works just fine:</p> <pre><code>var sFirstText=&lt;?php include("first2.html"); ?&gt;; </code></pre> <p>when first2.html looks like this INCLUDING the double quotes:</p> <pre><code>"&lt;p&gt;sentence one&lt;/p&gt;&lt;p&gt;sentence two&lt;/p&gt;" </code></pre> <p>However, if first2.html looks like:</p> <pre><code>"&lt;p&gt;sentence one&lt;/p&gt; &lt;p&gt;sentence two&lt;/p&gt;" </code></pre> <p>I get an unterminated string literal message. I hope to figure out how I can include the html without first having to remove the carriage return/line feed sequences.</p> <p>Also, if I remove the double quotes and do:</p> <pre><code>var sFirstText="&lt;?php include("first2.html"); ?&gt;"; </code></pre> <p>that won't work, returning a message I haven't yet been able to comprehend.</p> <p>Basically I want to get simple html formatting into a field without having to remove the cr/lf sequences.</p>
php javascript
[2, 3]
3,454,969
3,454,970
how to go to application's stack in android?
<p>I have an applicaton, which need a pop up to be shown from a service for which I have started an activity with flag Intent.FLAG_ACTIVITY_NEW_TASK. It has two buttons A and B. After clik of both buttons I am finishing the activity.</p> <p>But even after I finish this activity (pop up), when I select my activity from recent activities (If i long press home button), I am directed to the pop up activity. How do I go my application's main stack?</p>
java android
[1, 4]
3,320,340
3,320,341
Graphics spoilt by intermittent jumps
<p>I have written a game app with bitmaps moving around the screen. It employs a separate thread which writes directly to a canvas. On my Samsung Galaxy Y the animations seems smooth throughout the game, however on a "Tabtech m7" tablet the smooth graphics appear to be interrupted by intermittent freezes of about half a second duration, and spaced about three or four seconds apart. Is it possible that it is just a feature of the (cheap) tablet hardware, or is it more likely that it's some aspect of my programming? And if it's me, how could I go about diagnosing the cause?</p>
java android
[1, 4]
5,213,895
5,213,896
Read JavaScript variables from a file with Python
<p>I use some Python scripts on server-side to compile JavaScript files to one file and also add information about these files into database. For adding the information about the scripts I now have yaml file for each js file with some info inside it looking like this:</p> <pre><code>title: Script title alias: script_alias </code></pre> <p>I would like to throw away yaml that looks redundant here to me if I can read these variables directly from JavaScript that I could place in the very beginning of the file like this:</p> <pre><code>var title = "Script title"; var alias = "script_alias"; </code></pre> <p>Is it possible to read these variables with Python easily?</p>
javascript python
[3, 7]
297,584
297,585
jquery detecting when we are at the end of text in textarea
<p>I am just trying to learn jquery, and I was wondering how can you figure out when, given a bunch of text in a textarea, is the user at the end of textarea and tries to click down. For example, the last line of the text is asdf, and when the user is at that line, and presses down on the arrow key, i would like to get an event of some sort, or at least be able to figure out whether we are at the last line, and do an action (for example, wrap around and go to the first line)</p> <p>If anyone has some idea of how to do this, it would be greatly appreciated!</p> <p>Jason</p>
javascript jquery
[3, 5]
4,528,575
4,528,576
Instantiating a class - No overload for method 'Subjects' takes '0' arguments
<p>I have referenced a dll in a asp.net 2.0 web site developed in Visual Studio. The person who supplied the dll said to reference it and instantiate a class called Subjects.</p> <p>I have referenced it and if I type:</p> <pre><code>Subjects mySubjects = new Subjects(); </code></pre> <p>it appears to be 'found' as 'Subjects' appears in light blue text.</p> <p>If I then try to access a method by writing this:</p> <pre><code>string ProjectSubject = mySubjects.GetSubject(ProjectID); </code></pre> <p>again, it seems to be 'found' in that intellisense, as soon as you type the full stop after mySubjects shows the methods available to be called.</p> <p>So far, so good. But, when I try to run the page, I get a compile error which is:</p> <p>No overload for method 'Subjects' takes 0 arguments.</p> <p>I don't understand. I thought you always had to reference a class with</p> <pre><code>someClass myClass = new someClass(); </code></pre>
c# asp.net
[0, 9]
593,013
593,014
How to do this box in Javascript?
<p>I'm trying to do the following sort of thing in Javascript, where you click on the down arrow and it expands downward and displays options (I'll have some input fields and checkboxes and text and stuff in there).</p> <p>Can anyone please help me out or point me in the right direction, I've tried google searching but I have no idea what they're even called in the Javascript world. "Javascript expanding box", "javascript drop down box", "javascript expanding modal dialog", etc. Nothing seems to hit. </p> <p>Here's the example:</p> <p><a href="http://imageshack.us/f/810/examplebe.jpg/" rel="nofollow">http://imageshack.us/f/810/examplebe.jpg/</a></p> <p>There will be a submit button in the top section (not in the expand section), which will submit the options in the drop down menu as well as the options in the section near the submit button.</p> <p>Thanks!</p>
javascript jquery
[3, 5]
4,521,595
4,521,596
run one javascript function for different element
<p>how run one javascript function for diffrent element with one ASP.Net button click ?</p>
javascript asp.net
[3, 9]
414,545
414,546
what the meaning of plus operator in this JQUERY scripts
<p>I want to ask mean of plus operator in this script +i+ in the follow:</p> <pre><code>i=0; // next line in scripts write this code : $('.container[data-id='+i+']').hide(); // +i+ what the meaning of it </code></pre> <p>Need Help thanks a TON</p>
javascript jquery
[3, 5]
3,270,914
3,270,915
Get dimension of element on another site using JQuery?
<p>I have a set of urls which all have an div in them with an id of 'section_container'. On a completely seperate url I would like to access this page, detect the width of the container and return that value back, hopefully all through a post call or something.</p> <p>Can this be done? I own all the domains by the way.</p>
javascript jquery
[3, 5]
4,376,190
4,376,191
Using one javascript code on multiple sections
<p>I don't know much about jQuery but I've been using the following javascript code to make a table keep the scroll bar location upon pageback:</p> <pre><code>&lt;script type="text/javascript"&gt; window.onload = function () { var strCook = document.cookie; if (strCook.indexOf("!~") != 0) { var intS = strCook.indexOf("!~"); var intE = strCook.indexOf("~!"); var strPos = strCook.substring(intS + 2, intE); document.getElementById("grdWithScroll").scrollTop = strPos; } } function SetDivPosition() { var intY = document.getElementById("grdWithScroll").scrollTop; document.cookie = "yPos=!~" + intY + "~!"; } &lt;/script&gt; </code></pre> <p>and</p> <pre><code>&lt;div id="grdWithScroll" onscroll="SetDivPosition()"&gt; </code></pre> <p>It works great for a single div. But how could I extend this for use with a second div section?</p>
javascript jquery
[3, 5]
5,048,090
5,048,091
window.print() is not printing the whole page
<p>I have a page <img src="http://i.stack.imgur.com/BqNg8.png" alt="screenShot"></p> <p>I want to print this page. On print button i am using something like this</p> <pre><code>&lt;input id="print" type="submit" onclick="window.print();" /&gt; </code></pre> <p>But the problem is it is not printing the whole page. Like it only print that is currently in the view. When i click on the print button then till <code>Email:[email protected]</code> page print. It does not print the text below the scrollbar. </p> <p><img src="http://i.stack.imgur.com/CwK2J.png" alt="textBelowScrollbar"></p> <p>How can i print the whole text. Like suppose i have a very big page and i am using tabs to accommodate my page. And when click on print button, then i want to include the whole page including tabs. How can i do it? </p> <p>Thanks</p>
javascript jquery
[3, 5]
4,921,607
4,921,608
overwrite the preventDefault() in another method
<p>I have a this call</p> <pre><code>&lt;a onclick="facebookLogin();" class="facebook_btn_homepage" href="/signup"&gt; &lt;img src="/images/facebook_btn2.png?1280194712" alt="Facebook_btn2"&gt;&lt;/a&gt; $('.facebook_btn_homepage').click(function(event){ event.preventDefault(); }); </code></pre> <p>but in the function facebookLogin() i want to overwrite the </p> <pre><code> function facebookLogin() { FB.login(function(response) { //i want to overwrite the preventDefault and go to another //page because its trying to go to another url and the preventDefault //is stopping the page from going to another url </code></pre>
javascript jquery
[3, 5]
1,699,977
1,699,978
.animate() and going back to original state
<p>I am a bit new to jQuery, and trying to learn it. I am animating an element after its parent is clicked, but I also want the element to go back to its original state after a set time period. I did try <code>setTimeout</code> but I may be using it wrong, so it didn't work. Can someone explain how to do this? </p> <pre><code>var span = $('span'); $('button').click(function(){ span.animate({ left: '200' }, 500, 'linear', function() { }); }); </code></pre>
javascript jquery
[3, 5]
1,422,363
1,422,364
Java packages not importing
<p>I am trying to import a bunch of java related API's into my android project but when I import them it says it cannot find the package</p> <p>here is an example of what I an trying to import</p> <pre><code>import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; </code></pre> <p>all the <code>javax.swing</code> classes show an error. When I go into where the java JDK was installed and look at the <code>src.zip</code> file I see all those classes in there so what do I do to get them to work?</p>
java android
[1, 4]
4,018,565
4,018,566
Can't set property to object
<pre><code>var data = {}; .... data[someprop][someotherprop] = 'bla bla' </code></pre> <p>I get</p> <p><code>Uncaught TypeError: Cannot read property ... of undefined</code> and <code>Cannot set property of...</code></p> <p>Yes, the object doesn't have these properties ..yet, but I'm setting them in that line where I get the error lol. So what's up with that?</p>
javascript jquery
[3, 5]
4,928,709
4,928,710
Android Format calendar to output time
<p>I am using the below code to set an alarm. I would like to output what the time for this would be. I don't know if I going about this the wrong way. If I output the variable cal it has a long string of information. How do I extract only the hour and minutes?</p> <pre><code> Calendar cal = Calendar.getInstance(); // add 5 minutes to the calendar object cal.add(Calendar.MINUTE, 464); </code></pre>
java android
[1, 4]
2,313,242
2,313,243
How to open an aspx page using jquery
<p>I want to know how to display an aspx page in a popup using jquery</p>
asp.net jquery
[9, 5]
5,307,986
5,307,987
Unable to set GridView row widths on RowDataBound
<p>My current code to attempt to set widths for the rows on a gridview is:</p> <pre><code>protected void RowDataBound(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Header) { foreach (DataControlFieldHeaderCell dcfhc in e.Row.Cells) { dcfhc.Width = 100; } } else { foreach (DataControlFieldCell dcfc in e.Row.Cells) { dcfc.Width = 100; } } } </code></pre> <p>But that just keep all of the widths default! What am I doing wrong?</p> <p>EDIT: I have already tried thise code as well!</p> <pre><code>PoolToDBHeaders.DataSource = new DataView(headerTable); PoolToDBHeaders.DataBind(); foreach (DataControlField dcf in PoolToDBHeaders.Columns) { dcf.ItemStyle.Width = 100; } PoolToDBHeaders.DataBind(); </code></pre>
c# asp.net
[0, 9]
5,483,694
5,483,695
make new year animation on my web page with santa.gif :)
<p><a href="http://www.fatihtoprak.com" rel="nofollow">Here</a> is my personal web page. </p> <p>I used this html tag for moving PozSanta.gif </p> <pre><code>&lt;div id="animatedImage" style="position:fixed;padding-top:550px;z-index:99;left:1px;bottom:1px;"&gt; &lt;img src="http://www.fatihtoprak.com/wp-content/themes/PozWhite/assets/img/Poz_Santa.gif" alt="animatedImage" /&gt; &lt;/div&gt; &lt;script type="text/javascript" src="http://www.fatihtoprak.com/wp-content/themes/PozWhite/assets/js/PozSanta.js"&gt;&lt;/script&gt; </code></pre> <p>I want to change something for this, for example when Pozsanta.gif come to end of the Screens right should be come back (walk to right to left ) ? Is that possible if it is how ?</p> <p>Js file :</p> <p><a href="http://www.fatihtoprak.com/wp-content/themes/PozWhite/assets/js/PozSanta.js" rel="nofollow">http://www.fatihtoprak.com/wp-content/themes/PozWhite/assets/js/PozSanta.js</a></p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,284,145
4,284,146
programmatically edit images for puzzle usage
<p>I'm making a sliding puzzle ( 3x3/4x4/5x5 with the lower-right corner cut out ). However I can't figure out where to start with programmatically cutting images ( which will be loaded from own gallery in sdcard or database from app ) in the puzzle pieces. I've been looking over the internet and nothing really helped me.</p> <p>What is the best way to cut up this image and store it in a new database (and still will be able to slide them)? Just a push in the right direction would be appreciated.</p>
java android
[1, 4]
751,980
751,981
asp.net c# browse to folder instead of file
<p>can i by using input ==file browse to <strong>folder only</strong> not folder plus file or by any other means.</p> <p>I have to give path in textbox for some Website package to unzip(that contains all the folders and files need to initialize a website). By giving that many checks have to be implemented like path exists. </p> <p>It would be nice if the user just selects the folder he created for the website package to be unzipped. </p>
c# asp.net
[0, 9]
253,064
253,065
Return array in Java
<p>I have my primary class running, and I wanted to run a separate class to shuffle numbers, then return the shuffled numbers into my primary class. In my shuffle class I have the return statement... but now what do I do? How do I use the random order of my int array in my primary class?</p> <p>Here is my shuffle class:</p> <pre><code>public class Shuffle { public static int[] getShuffle() { int[] cards = new int[52]; ArrayList&lt;Integer&gt; cards_objs = new ArrayList&lt;Integer&gt;(); for (int i = 0; i &lt; cards.length; i++) { cards_objs.add(i); } Collections.shuffle(cards_objs); for (int i = 0; i &lt; cards.length; i++) { cards[i] = cards_objs.get(i); } return cards; } </code></pre> <p>}</p> <p>I am making a card game(if you cant tell);</p> <p>I wanted to use this shuffle class so that the cards are shuffled... but no card appears more than once.</p> <p>when I return cards, how do I use them in my game class? for example if the first number in the array is 1, then the card is Ace of clubs, if the number is 2, then the card is Ace of diamonds. and so on... I apologize for not posting enough information... I am new to java (as you can tell)</p> <p>all help will be greatly appreciated,</p> <p>-Steve</p> <p>EDIT: I found out what my problem was, I don't think I made it clear enough what my question was. Nonetheless thank you all for your help, it gave me ideas on different ways to approach this project. </p>
java android
[1, 4]
4,267,972
4,267,973
How to use jQuery to FIND & REPLACE given text with a matching URL instead
<p>Hey there, in short I'm looking to parse a web page and find the text "class abc" and create a url like this: <a href="http://www.site.com/code/documentation/classes/classabc/index.html" rel="nofollow">http://www.site.com/code/documentation/classes/classabc/index.html</a></p> <p>I'm basically gonna create links from my hosted svn code website to documentation I've generated via doxygen from the same codebase. </p>
javascript jquery
[3, 5]
1,920,761
1,920,762
Interpret Dynamic value of javascrript Variable to textbox id
<pre><code> t += '&lt;td &gt;&lt;input type="text" maxlength="5" size="5" id ="text"." + i +" name="tx"/&gt;&lt;/td&gt;'; </code></pre> <p>Iam building dynamic Table with the Text boxes in each row iam looking to have the textbox id genrated with the variable <code>i</code> dynamically. Iam not able to get the value of variable <code>i</code> appended dynamically . when i try to view source <code>+?="" +="" .?=""</code> in the input tag.How to append the value of <code>i</code> to the textbox id generated dynamically</p>
javascript jquery
[3, 5]
1,398,057
1,398,058
How to access main window element from iframe
<p>I hope someone can help with this issue. I have a popup iframe using lytebox. I would like it that when i click a link in my iframe with the class "mylink" that it executes the ajax call and update a div in my main window with the id "mydiv". I know how to do the onclick events and the ajax call but i do not know how to access the "mydiv" from the main window and update it with the content. Any help on this would be greatly appreciated. Thanks.</p>
javascript jquery
[3, 5]
140,360
140,361
difference between this and $(this)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1051782/jquery-this-vs-this">jQuery $(this) vs this</a> </p> </blockquote> <p>When using jQuery, whats the difference between this and $(this)?</p>
javascript jquery
[3, 5]
2,009,599
2,009,600
Android - center justified email body from Intent
<p>I am attempting to email the results of the app with an intent. I am using a StringBuilder and appending a few lines of text with "\n" within each line and then invoking toString() on it and storing it in the 'result' variable. </p> <p>The problem I am having is the text is automatically center justified in the email message body. What can I do to change this and make it left justified?</p> <p>Here is the code for passing the intent:</p> <pre><code> Intent i = new Intent(Intent.ACTION_SEND); i.setType("message/rfc822"); i.putExtra(Intent.EXTRA_EMAIL , new String[]{""}); i.putExtra(Intent.EXTRA_SUBJECT, "xxx"); i.putExtra(Intent.EXTRA_TEXT, results); try { startActivity(Intent.createChooser(i, "Send Results...")); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show(); } </code></pre>
java android
[1, 4]
2,451,224
2,451,225
How to removing a set of first 3 characters in input field when after you done typing with jQuery
<p>Is there anyway I can remove a match of a set first characters in the input field once a use is done typing, with jQuery.</p> <p>Regards</p>
javascript jquery
[3, 5]
3,106,475
3,106,476
Create "namespace" in $(document).ready(function() {..});
<pre><code>// first.js $(document).ready(function() { var MyNamespace = {}; }); // second.js $(document).ready(function() { console.log(MyNamespace); }); </code></pre> <p>Running this script I'm getting error <code>Uncaught ReferenceError: MyNamespace is not defined</code>. I suppose, I'm getting this error because definition of <code>MyNamespace</code> and <code>MyNamespace</code> calling are in different scopes. How do I solve this problem?</p> <p>I need to create namespace inside $(document).ready() wrapper because functions in this namespace will use jQuery methods etc.</p> <p>What is the best practice?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
3,089,547
3,089,548
IE automation and SQL reporting services c#
<p>I'm working on a project for work that has me running a SQL reporting services report all day long. I would like to automate this process and have gotten pretty far in the process. I can navigate to the page, search for what I want, select the output of the file and click export. The problem I run into is the File Download dialog box that pops regardless of file type or mime settings. I am able to get around it now by using an AutoIt function but its flaky at best. I really want to just download the file to a specific location. My question.. Is there a way to intercept whatever clicking the export button does and get some sort of link to the file? Or is there a way to run the function that link does in asp programmaticly and grabbing the file that way? (Sorry if terminology is off not real familiar with ASP).</p> <p>Edit... I know there are better ways of doing this with reporting services such as subscriptions etc (thanks for the responses btw :)... But this is what I'm stuck with until I can get the admin to fix a few things. In the company I'm at that involves getting about 20 different departments involved and it will most likely not get fixed. But ultimately my question is whether it is possible to do what im asking in C#. Can I intercept where the code is sending me when I click export and grab the file? Is that even possible? </p>
c# asp.net
[0, 9]
3,251,669
3,251,670
extracting value from url using jquery
<p>I'm intercepting user clicks on pagination links and I need to extract only page number from that link which is always set inside page variable. </p> <p>so inside my js I have ....</p> <pre><code>var a = $a.attr("href"); </code></pre> <p>.. which ouputs this</p> <pre><code>/Home/GetTabData?page=2&amp;activeTab=House </code></pre> <p>so how can I extract only this number from after <strong>page=</strong></p> <p>If it's matter keep in mind that this number can be two or three digit long and activeTab is dynamic value.</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,951,665
5,951,666
ScrollView problem in Motorola Milestone
<p>I have multiple listviews, all of them with scrollbars. Everything works great, tested in alot of emulators and a couple of phones... except in Motorola Milestone with 2.1. As i said, i tried it with the emulator in 2.1 and newer (i'm using 1.6 SDK) and i had no problem whatsoever, except when i try it with a physical Milestone. There, the scrollbar doesn't shows and, more important, i can't even scroll on the ListView.</p> <p>Anyone has a clue on why is this happening?</p>
java android
[1, 4]
4,081,595
4,081,596
Check the gridview column check box
<p>I am developing an app in C# in which I am using the datagridview and gridview first column contains the checkboxes and I want to chech the checkbox is true or not but it is giving me the exception of 'Object referernce is not set to an instance of an object'. The code is following</p> <pre><code> private void btnDelete_Click(object sender, EventArgs e) { StudentDAL s = new StudentDAL(); try { for (int i = 0; i &lt; this.dataGridView1.RowCount; i++) { if (!DBNull.Value.Equals(this.dataGridView1.Rows[i].Cells[0]) &amp;&amp; (bool)this.dataGridView1.Rows[i].Cells[0].Value == true) { s.delete(Convert.ToInt32(this.dataGridView1.Rows[i].Cells[1].Value)); i--; } } this.dataGridView1.DataSource = s.getAll(); } catch (Exception nn) { } } </code></pre> <p>Please help me.</p>
c# asp.net
[0, 9]
5,858,025
5,858,026
Focus is not coming in javascript
<p>I have a button in <code>aspx</code>. In its <code>onclientclick</code> I called a javascript function which is written in <code>JScript.js</code>. Following is my javascript:</p> <pre><code>function ChangeBG() { alert("hi"); } </code></pre> <p>I called this above function in button click. I had put breakpoint in javascript. But onclicking on button, alert is coming, but control is not going to breakpoint. What may be the reason for this? I am running in Internet browser. What change i can make to bring the focus to breakpoint. Can anybody help?</p>
asp.net javascript
[9, 3]
2,424,653
2,424,654
passing more than one variable to another page in asp.net
<p>I want to pass more than one variable to other web pages.</p> <p>I try this code</p> <p><code>string adi = TaskGridView.SelectedRow.Cells[3].Text;</code></p> <p><code>string soyadi = TaskGridView.SelectedRow.Cells[3].Text;</code></p> <p><code>Response.Redirect("Default2.aspx?adi=" + adi);</code></p> <p><code>Response.Redirect("Default2.aspx?soyadi=" + adi);</code></p> <p>but it doesnt work how can I do?</p>
c# asp.net
[0, 9]
2,228,306
2,228,307
jquery exception
<p>I have this navmenu with anchors associated with a jquery snippet that loads in and animates content. (See demo: <a href="http://d2o0t5hpnwv4c1.cloudfront.net/011_jQuerySite/sample/index.html" rel="nofollow">http://d2o0t5hpnwv4c1.cloudfront.net/011_jQuerySite/sample/index.html</a>)</p> <p>Now, on some of the nav's anchors, I'd like for this plugin to NOT fire off (as I want to be able to associate some of the navmenu's anchors strictly with the ScrollTo plugin instead). </p> <p>My question is, what can I add to this:</p> <pre><code>$(document).ready(function() { var hash = window.location.hash.substr(1); var href = $('#nav li a').each(function(){ var href = $(this).attr('href'); if(hash==href.substr(0,href.length-4)){ var toLoad = hash+'.php #content'; $('#content').load(toLoad) } }); $('#nav li a').click(function(){ var toLoad = $(this).attr('href')+' #content'; $('#content').hide(888,loadContent); $('#load').remove(); $('#wrapper').append('&lt;span id="load"&gt;LOADING...&lt;/span&gt;'); $('#load').fadeIn(888); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-4); function loadContent() { $('#content').load(toLoad,'',showNewContent()) } function showNewContent() { $('#content').show(888,hideLoader()); } function hideLoader() { $('#load').fadeOut(888); } return false; }); }); </code></pre> <p>...so that it doesn't fire off all the above whenever the anchor has the class="scroll" associated with it? </p>
javascript jquery
[3, 5]
5,833,848
5,833,849
JavaScript Error: Microsoft JScript runtime error: Object expected
<p>Below is the "truncated" code for an Ajax TabContainer I'm using for my web page. I need to find the tab index for the container in a JavaScript function, however I continue to get the error message "Microsoft JScript runtime error: Object expected" when this line of code is called in the JavaScript:</p> <pre><code> function doValidate() { var tabIndex = $('#tabs_header span.ajax_tab_active').index() </code></pre> <p>If I comment out the "var tabIndex..." part I do not get the error, so I'm wondering if someone can tell me what is going on here. Below is the code for the tabContainer. I've "truncated" because it is a very large form with over 12 text box inputs. Both tabs represent two different methods of doing a search. By clicking on the "Search" button, the doValidate() method is the first action called, before the site even goes into the code behind. Also, I receive the same error message on the same line of code no matter which tab is active. </p> <pre><code> &lt;asp:TabContainer ID="AdvOrBasicSearch" runat="server" ActiveTabIndex="0"&gt; &lt;div id="tabs_header"&gt; &lt;span id="tab1" class="ajax_tab_active"&gt; &lt;asp:TabPanel ID="basicSearch" runat="server" HeaderText="Basic Search"&gt;.../asp:TabPanel&gt; &lt;/span&gt; &lt;span id="tab2" class="ajax_tab_active"&gt; &lt;asp:TabPanel ID="advSearch" runat="server" HeaderText="Advanced Search"&gt;...&lt;/asp:TabPanel&gt; &lt;/span&gt; &lt;/div&gt; &lt;/asp:TabContainer&gt; </code></pre>
javascript asp.net
[3, 9]
1,552,223
1,552,224
How to find input element id by value?
<p>How do I get the id of an input element based on its value? The values will always be unique and there are only 7 of them. I have tried this:</p> <pre><code>$('#wrapper').find("input[value='"+value+"']").each(function(){ return this.id; }); </code></pre> <p>But nothing is returned!</p> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
608,363
608,364
Just a part of .attr()
<p>I have an img html block <code>&lt;img src="folder1/folder2/folder3/logo1.png"&gt;</code> positioned inside a big div like this </p> <pre><code>&lt;div id="editorial"&gt; &lt;div id="img_editorial"&gt;&lt;img src="folder1/folder2/folder3/logo1.png" /&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>When user hovers the <code>&lt;div id="editorial"&gt;</code> (mouseover) i want to read the attribute of <code>&lt;img&gt;</code> which is <code>folder1/folder2/folder3/logo1.png</code> extract the <code>logo1.png</code> from this and add <code>on_</code> to the logo ( <code>on_logo1.png</code> ) and then output it with <code>jquery .html() function</code> to overwritte <code>&lt;div id="img_editorial"&gt;</code> </p> <p>On mouseout i want to return to <code>logo1.png</code> ... because i have multiple background changes in that parent div ... so the basic functionality is to grayout a logo when mouse is over a big div (also div`s background changes ... etc) ...</p> <p>So .. how can i read the <code>&lt;img&gt;</code> attribute and then extract logo1.png and not the whole <code>folder1/folder2/folder3/logo1.png</code> ...</p>
javascript jquery
[3, 5]
2,761,954
2,761,955
Jquery validation does not work
<p>For eg:I have two fields here. If I fill input type="second" and post it and If I do not fill input type = first, it is not validating first field,it should tell me to fill first field but vice versa if I fill input type = first and if I do not input type = second, it is showing error.</p> <pre><code>&lt;form name="test" onsubmit="return te()" method="post"&gt; &lt;input type="text" id="first"&gt; &lt;span id=""&gt; &lt;input type="text" id="second"&gt; &lt;span id=""&gt; &lt;input type="submit" value="submit"&gt; </code></pre>
javascript jquery
[3, 5]
4,655,501
4,655,502
Pass an ID on button click
<p>I have this code below that create rows and cells for a list of products. There is a button that I want to use to get additional product information. Basically the user will search for something and it will display limited results. When the user clicks on the button it will call a method that will do something else. </p> <p>How do I get that button to pass and ID or something to a method? </p> <p>I tried the <code>.Click</code> but did not work to call the method. Currently the method only displays a messagebox.</p> <pre><code>for (rowCtr = 1; rowCtr &lt;= rowCnt; rowCtr++) { // Create new row and add it to the table. TableRow tRow = new TableRow(); Table1.Rows.Add(tRow); for (cellCtr = 1; cellCtr &lt;= cellCnt; cellCtr++) { // Create a new cell and add it to the row. TableCell tCell = new TableCell(); if (rowCtr == 1 &amp;&amp; cellCtr == 1) { Image ProductImage = new Image(); ProductImage.Height = 75; ProductImage.Width = 75; tCell.RowSpan = 5; tCell.Controls.Add(ProductImage); tRow.Cells.Add(tCell); } if (rowCtr == 1 &amp;&amp; cellCtr == 2) { tCell.Text = "Title: Title of Product"; tRow.Cells.Add(tCell); } if (rowCtr == 2 &amp;&amp; cellCtr == 2) { tCell.Text = "Weight (lbs): 54"; tRow.Cells.Add(tCell); } if (rowCtr == 4 &amp;&amp; cellCtr == 2) { Button getOfferButton = new Button(); getOfferButton.Width = 100; getOfferButton.Text = "Get Offer"; getOfferButton.Click += new EventHandler(getOffer); tCell.Controls.Add(getOfferButton); tRow.Cells.Add(tCell); } } } </code></pre>
c# asp.net
[0, 9]
4,765,889
4,765,890
dropdown menu using JavaScript in asp.net
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/101536/best-javascript-drop-down-menu">Best Javascript drop-down menu?</a> </p> </blockquote> <p>I want to have a dropdown menu bar in which onmouseover effect, the child of the parent elements of the menu`s come from database. Can any body help me how to do this. well, my thoughts are guiding me that this will possibly be done by a javascript and i am struggling doing so. Am i wrong with my approach of using javascript ? is there any other way of doing this? Well, can you people guide me how to do this? thank you.</p>
javascript jquery asp.net
[3, 5, 9]
5,772,576
5,772,577
jQuery slideUp() content when clicked for a second time
<p>How would I slideUp() the content only when '.areaCodeList' is clicked a second time?</p> <pre><code>$(".areaCodeList").on('click', function() { $(this).next('.churchList').slideDown(); ($this.die()); $('.churchList').slideUp(); }); </code></pre>
javascript jquery
[3, 5]
3,795,302
3,795,303
jQuery scrolling DIV is jumpy and positioned incorrectly
<p>Not too long ago I asked about setting up a DIV which scrolls with the rest of the page. Post can be found <a href="http://stackoverflow.com/questions/8647840/div-container-following-scroll-of-screen">here</a>.</p> <p>I've set this up, using the following code:</p> <p>JS..</p> <pre><code>jQuery(function ($) { var el = $('#sidebar'), pos = el.position().top; alert(pos); $(window).scroll(function() { el.toggleClass('fixed', $(this).scrollTop() &gt;= pos); }); }); </code></pre> <p>CSS..</p> <pre><code>/* profile sidebar */ #sidebar&gt;div{ width: 300px; margin-top: 10px; } #sidebar.fixed&gt;div{position:fixed;top:0} </code></pre> <p>A copy of the page can be found <a href="http://dunc.seriouslyfish.com/test.htm" rel="nofollow">here</a>. The alert was just some debugging.</p> <p>The problem is, when you scroll a small amount, <code>#sidebar</code> suddenly appears at the very top of the page. In addition, sometimes as you scroll further down, the sidebar appears - and sometimes it doesn't.</p> <p>Any idea what might be causing such seemingly random functionality?</p>
javascript jquery
[3, 5]
4,114,762
4,114,763
How to create C++ executables for flashing ROMs?
<p>I want to create C++ executables to flash ROMs over ADB on android phones, can anyone help me on this? I have a basic knowledge of C++ but cannot understand from where I should start The logic is Initialize header files-->Initialize ADB service-->Start ADB shell-->Flash the .img files using flash_image binary--> ADB reboot</p> <p>Can anyone give me a simple example for flashing boot image? I m unaware what header files should I include, which compiler should I use. created a new thread as I didn't find anything regarding this</p> <p>Thank you</p>
android c++
[4, 6]
2,293,057
2,293,058
Detecting when a div's height changes using jQuery
<p>I've got a div that contains some content that's being added and removed dynamically, so its height is changing often. I also have a div that is absolutely positioned directly underneath with javascript, so unless I can detect when the height of the div changes, I can't reposition the div below it.</p> <p>So, how can I detect when the height of that div changes? I assume there's some jQuery event I need to use, but I'm not sure which one to hook into.</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,568,873
4,568,874
How to disable the maximize button of browser in C# asp.net
<p>I have a problem that I want to disable the maximize button of the browser when we run our web application, means user can not maximize the same browser screen in which site is running. I don't know how it will be achieved? Please suggest me the right solution regarding the same.</p> <p>Thanks in advance.</p>
javascript asp.net
[3, 9]
4,000,994
4,000,995
Preloader for dynamic content
<p>I have dynamic page which takes about <strong>8 seconds</strong> to load searched data.</p> <p>Problem is, all <strong>browsers remain on old page</strong> for those 8 secs &amp; <strong>show dynamic page</strong> only after it</p> <p><strong>loads completely.</strong></p> <p>What I want is <strong>preloder image</strong> to be shown to the customers until second page gets load.</p> <p>How can I achieve this?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,756,787
5,756,788
Debugging on the device with multiple Libraries Android
<p>I want to debug my application on my Android phone. However the app itself contains JRE, Maven, and Android Libraries. When I try to run in it does not give me the option to choose my device, but launches the emulator. The device chooser for "normal apps" works fine. Is it because of multiple libraries I have?</p> <p>Could anyone please help</p> <p>Tnx</p>
java android
[1, 4]
1,087,373
1,087,374
Webcontrol as a property of another webcontrol
<p>In asp.net sometimes a webcontrol needs to reference another webcontrol such as the gridview needs the id of the datasource object that it will bind to.</p> <p>I have a property of my webcontrol that is a string (the id of the webcontrol I want to reference). How do I access the actual webcontrol based on this id?</p>
c# asp.net
[0, 9]
3,199,241
3,199,242
Using java to communicate with a PHP script on my server
<p>I need to be able to access my database, which in it's own isn't hard as java can directly access it. I want to, however, use a php script to access it, as I need to insert stuff into the database as well, and I don't want to have the username and password of a read-write accoutn for my database in my java code. If someone decompiles it, he can just access my database and do stuff with it...</p> <p>So basicly, I want to use a PHP script and send $_POST request info from my java code to my php script</p> <p>(yes, java, not javascript ;-) )</p>
java php
[1, 2]
481,747
481,748
C# equivalent for PHP file_put_contents
<p>I am converting a PHP file to C#,completed 75%,stuck with these lines </p> <pre><code>if(file_put_contents($uploaddir.$randomName, $decodedData)) { //echo $randomName.":uploaded successfully"; //NO NEED TO CONVERT ECHO PART } </code></pre> <p>PHP Brothers please help</p> <p><strong>MORE INFO</strong></p> <p>I converted <strong><em>this</em></strong></p> <pre><code>// Encode it correctly $encodedData = str_replace(' ','+',$data[1]); $decodedData = base64_decode($encodedData); </code></pre> <p><em><strong>to this</em></strong></p> <pre><code>// Encode it correctly string encodedData = data[1].Replace(' ', '+'); string decodedData = base64Decode(encodedData); </code></pre> <p>where base64Decode <strong><em>is</em></strong> </p> <pre><code>public static string base64Decode(string data) { byte[] binary = Convert.FromBase64String(data); return Encoding.Default.GetString(binary); } </code></pre>
c# php
[0, 2]
1,065,091
1,065,092
Function in function cycle
<p>i need to load PHP file with random image to <code>&lt;div&gt;</code> every 2 seconds with fade effect so i use javascript and jQuery. I write function to hide div, load file in, than show it and wait 2 seconds, then it should call function again, but it happend just once then it stop.</p> <p>Here is the function:</p> <pre><code>function random(){ $("#randomImage1").animate({opacity: '0.0'}).load("../images/randomImage.php").animate({opacity: '1.0'}).delay(2000, function(){ random(); }); random(); </code></pre>
javascript jquery
[3, 5]
797,309
797,310
Redirecting on a single search result?
<p>When a user does a search on my website, and there is only one entry, then I want to redirect the user to the search result. The current way that I am doing this is poor. Here is how I am currently doing this:</p> <p>If there is only one search result on the search result page, then I render a hidden input with an ID of "redirect" and a value of the link to redirect to. In the javascript, if the hidden input with ID "redirect" exists, then the user is redirected to the value of the element.</p> <p>It's a poor way to do this because the single search result is loaded first, so the user actually sees that there is one search result. Then, it loads after, say, 3 seconds.</p> <p>Is there a better way to do this?</p>
php javascript jquery
[2, 3, 5]
1,926,209
1,926,210
create file on localhost (Web server physical path)
<p>Currently I am working on <strong>asp.net</strong> website and I am not very much familiar with asp.net. I have a <code>WebForm</code> and when user clicks on <strong>Submit</strong> button a <code>.txt</code> file should be get created on server(Text File name is ID entered by user which is unique.)<br> I used following to create the file. </p> <pre><code>File.Create( Server.MapPath("~") + id + @".txt"); </code></pre> <p>But this gives me error when the site is running on the localhost of my pc.<br> <strong>Access to the path 'C:\inetpub\wwwroot\XXX\YYY.txt' is denied.</strong> </p> <p>This is something related with access permission. What should I do to fix this. Please advice me.</p>
c# asp.net
[0, 9]
5,111,387
5,111,388
jQuery onunload do action if button was pressed
<p>I have a small website who's client side framework is <em>jQuery</em>.</p> <p>I have a page where I need to do some <em>AJAX</em> action before the page unloads but that action may not fire if a certain button was clicked.</p> <p>I was trying this with:</p> <pre><code>&lt;body onbeforeunload="myaction();"&gt; </code></pre> <p>But how do I know that certain button was clicked or not?</p>
javascript jquery
[3, 5]
2,839,868
2,839,869
asp.net authentication for any third party
<p>I would like to make the user to be able of logging to my website using any accounts: facebook, yahoo, windows live, ...</p> <p>It is something like stackoverflow account authentication.</p> <p>I need to do it with asp.net (.NET). how can I do that?</p> <p>Thanks in advance. </p>
c# asp.net
[0, 9]
3,959,360
3,959,361
Get URL of ASP.Net Page in code-behind from another page
<p>I am trying to find away to determine a pages url from the page object. It seems you can only get the path of the current context.</p>
c# asp.net
[0, 9]
3,572,010
3,572,011
Reinstall application apk programmatically without downloading
<p>Due to <a href="http://code.google.com/p/android/issues/detail?id=25906&amp;q=reporter%3aLee.Wilmot&amp;colspec=ID%20Type%20Status%20Owner%20Summary%20Stars">this annoying Android limitation</a> I need users to reinstall my application so the manifest permissions are detected by other applications. </p> <p>This is already going to be frustrating for the user, but in addition, I cannot see a way to reinstall my application from the apk stored in /data/app and I would therefore have to download the same version to the storage card before firing the usual install intent.</p> <p>I eagerly await someone telling me that I'm missing something obvious! I've drawn a blank...</p> <p>Thanks in advance.</p> <p>Edit: Please do star the issue if you'd like to see it resolved! Cheers.</p>
java android
[1, 4]
4,996,098
4,996,099
msrdpclient.connect failed to connect when accessign with IP on win7
<p>I am using msrdpClient ActiveX control in my web app to connect to other system on network remotly. My app simply get username, passwrod , domain and resolution and call connect function. But problem is when i use "http://localhost:8080/CMSServer/ie.html" to connect it works fine but if i use my system IP instead of localhost as "http://192.168.3.39:8080/CMSServer/ie.html", it got failed to connect throwing no exception just do nothing on connect button."http://localhost:8080/CMSServer/ie.html" is my web app address" is my web app address. Problem is only with windows 7.Its working fine on windowsXp. Can anybody tell me its solution. My connect code is</p> <pre><code> MsRdpClient.server = machineName; MsRdpClient.UserName = machineUsername; MsRdpClient.AdvancedSettings.ClearTextPassword = password; MsRdpClient.DesktopWidth = desktopWidth; MsRdpClient.DesktopHeight = desktopHeight; MsRdpClient.ColorDepth = colorquality; MsRdpClient.FullScreen = true; MsRdpClient.Advancedsettings3.ConnectionBarShowRestoreButton = false; MsRdpClient.Connect(); </code></pre> <p>Thanks in advance</p>
java javascript
[1, 3]
5,304,949
5,304,950
Is there a way to check if a user is logged in using JQuery?
<p>I want to be able to display a message if a user is not logged in if they try rating a user by clicking a rating. Is there a way to add it to my JQuery code below or can I pass it to my PHP script?</p> <p>I'm using PHP</p> <p>Here is the JQuery code.</p> <pre><code>$('#rate li a').click(function(){ $.ajax({ type: "GET", url: "http://localhost/update.php", data: "rating="+$(this).text()+"&amp;do=rate", cache: false, async: false, success: function(result) { // remove #ratelinks element to prevent another rate $("#rate").remove(); // get rating after click getRating(); getRatingAvg(); getRatingText2(); getRatingText(); }, error: function(result) { alert("some error occured, please try again later"); } }); </code></pre>
php jquery
[2, 5]
4,514,626
4,514,627
Applying a class from an array to a repeated item with JQuery
<p>I know I'm close here but it only adds a class from the colors array to the 1st 3 postbox divs:</p> <pre><code>$(document).ready(function($) { var toCopy = $('.postbox'); var colors = ['box1','box2','box3']; for (var i = 1;i &lt; 7;i++) { $('.rightCol').append(toCopy.clone()); } $('.postbox').each(function(i, val) { $(this).addClass(colors[i]); }); }); </code></pre> <p>Here's the end result using the above:</p> <pre><code>&lt;div class="rightCol"&gt; &lt;div class="postbox box1"&gt;&lt;/div&gt; &lt;div class="postbox box2"&gt;&lt;/div&gt; &lt;div class="postbox box3"&gt;&lt;/div&gt; &lt;div class="postbox"&gt;&lt;/div&gt; &lt;div class="postbox"&gt;&lt;/div&gt; &lt;div class="postbox"&gt;&lt;/div&gt; &lt;div class="postbox"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>How do I get it to keep repeating? </p>
javascript jquery
[3, 5]
1,718,091
1,718,092
Asp.net buttonclick server event firing when textbox is entered
<p>I have a textbox and a button.</p> <p>The button has a <code>btn_click(obj, eventargs)</code> on codebehind.</p> <p>This is on <code>master</code> page.</p> <p>What I want is when the textbox is focused and click <code>enter</code>,</p> <p>I want to run that function, in other words, click the button.</p> <p>So, I wrote...</p> <pre><code>$("#" + "&lt;%= txtSearch.ClientID %&gt;").keypress(function (e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { $("#" + "&lt;%= imgBtnSearch.ClientID %&gt;").click(); } </code></pre> <p>On server side function, I am redirecting to another page.</p> <p>Since it is not redirecting, can i assume that it is not working?</p> <p>Is there anything I can make it work?</p> <p>});</p>
c# asp.net
[0, 9]
3,379,813
3,379,814
Possible echo javascript function syntax error?
<p>This has been stressing me out. I'm calling a php function that saves an image from a user input url, then echos a javascript function to set it as the background image. Everythings working fine except setting the image as the background. Its saved on the server and everything. Im not getting any js or php syntax errors, the browser just says 404 not found even though the file with the correct name is there in the directory. It works completely fine when i dont include the session variable as part of the image name. </p> <p>Thanks in advance, this is probably just me being stupid as its been a while since ive used php.</p> <pre><code>&lt;?php session_start(); $src = $_GET['image']; $contents= file_get_contents($src); $file = fopen( pic.$_SESSION['id'].'.jpg','w+'); fwrite($file, $contents); fclose($file); echo '&lt;script&gt;'; echo 'var body = document.getElementsByTagName("body")[0];'; echo 'var source = "pic'.$_SESSION['id'].'.jpg";'; echo '$(body).css("background-image", "url(source)");'; echo 'alert(source);'; //just to test to make sure it returns the correct name echo '&lt;/script&gt;'; ?&gt; </code></pre>
php javascript
[2, 3]
1,244,063
1,244,064
Javascript Phone number auto convert is not working
<p>I have some javascript code like below</p> <pre><code>function mask(eventVal,val){ var len = val.value.length; var key = whichKey(eventVal); if(key&gt;47 &amp;&amp; key&lt;58) { if( len==0 )val.value=val.value+'(' else if( len==4 )val.value=val.value+') ' else if(len==9 )val.value=val.value+'-' else val.value=val.value; } else{ val.value = val.value.replace(/[^0-9-]/,'') val.value = val.value.replace('--','-') } } function whichKey(eventVal) { var code; if (!eventVal) var eventVal = window.event; if (eventVal.keyCode) code = eventVal.keyCode; else if (eventVal.which) code = eventVal.which; return code; } </code></pre> <p>HTML</p> <pre><code>&lt;input type="text" name="PhoneNumber" id="PhoneNumber" value="" onkeydown="mask(event,this)"/&gt; </code></pre> <p>It is working fine when I am typing phone number like 1234567890 is automatically converting into (123) 456-7890 when I am trying to remove value like remove 0 from the end then formatting is getting ruined completely. like 123) 456-789 and even it is getting ruined when I am click any other place. Can Any one help me to fix it? </p>
javascript jquery
[3, 5]
2,459,136
2,459,137
Access genereated INPUT Fields
<p>Hi I'm currently generating a couple of input boxes via c# and I would like to access them later to save the entered data back to the database. However I am not sure on how to access the generated input boxes.</p> <p>I generate them like this:</p> <pre><code>sb.Append("&lt;input name=\"txtThekeUpdate[" + thekenRow["ID"] + "]\" type=\"text\" id=\"MainContent_txtBetreiber\" class=\"textEntry\" value=\" " + thekenRow["Name"] + "\"/&gt;&lt;br /&gt;"); </code></pre> <p>txtThekeUpdate is an Array since I am planning on entering multiple updated datasets at once.</p> <p>Do you know how I could access them with the corresponding ID?</p>
c# asp.net
[0, 9]
2,984,681
2,984,682
How to add header files in cdroid application?
<p>I have installed a c++ compiler on my nexus one; but when I compile a simple program it gives me error that .h file not found. Tell me how can I add these header files? </p>
android c++
[4, 6]
1,447,666
1,447,667
get right position of Element? jQuery or javascript
<p>I wish to get the right position of an element in jquery, i have tried <code>attr('right')</code>, and i have read the API document regarding <code>.position().right</code> which is non existent <em>(i believe)</em>.</p> <p><a href="http://jsfiddle.net/xavi3r/vcuq7/" rel="nofollow">http://jsfiddle.net/xavi3r/vcuq7/</a></p> <p>Is an example i wish to alert the right value for.</p>
javascript jquery
[3, 5]