Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
2,231,952 | 2,231,953 | Notify when GPS activated | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/11446428/broadcast-reciever-for-gps-state">Broadcast reciever for GPS state?</a> </p>
</blockquote>
<p>Is there a listener that can notify me when GPS is activated?
(When user enabled "GPS" button from the notification bar)<br>
I tried using <code>addGpsStatusListener</code> but it is not what I was looking for.</p>
| java android | [1, 4] |
1,939,584 | 1,939,585 | jquery ajax encoding problem! | <p>i send ajax requests with jquery, and i have a function:</p>
<pre><code>$('input').ajaxSuccess(function(e, xhr, settings) {
console.log(xhr.responseText);
});
</code></pre>
<p>Ajax response ara russian letters in utf-8, all server (apache, php) and files are in utf-8 but response text is something like this:</p>
<pre><code>\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u0430\u043b\u043e \u0431\u0443\u043a\u0432!
</code></pre>
<p>how could i decode this characters to normal words? Thanks for help!</p>
| javascript jquery | [3, 5] |
1,110,099 | 1,110,100 | Passing a string to a javascript and retrieving it further | <p>I am passing a string to a javascript through call by reference. The string is a text retrieved from a textarea field. The problem is that a single word is retrieved properly, but when I send multiple text it shows a problem. The sample code is like this in a php file,
The txt is the name of textarea field. If I type hello in the field and send it works properly but whenever I type string like "hello india", it gives a problem and nothing is retrieved</p>
<p>Sample code for post.php is like this :</p>
<pre><code><?php
$msg=$_GET['msg'];
$v1=$_GET['v1'];
$v2=$_GET['v2'];
<textarea name="txt" id="txt">
<input type=button onclick="send(txt.value,123,456)">
?>
</code></pre>
<p>The send() method is not a standard method. Its a custom method which passes variables to a file through GET method. The txt is the name of the textarea column. The send method works like this:</p>
<pre><code>function send(str,var1,var2)
{
$('#loader').html('loading');
$('#postarea').load('post.php?msg='+str+'&v1='+var1+'&v2='+var2);
}
</code></pre>
| php javascript | [2, 3] |
5,334,673 | 5,334,674 | how to bypass mozilla confirm alert box | <p>When i try to go to last visited page on my website in mozilla i get this message "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier". Can anyone tell me how to bypass this. This is so frustrating. i have used php on my website</p>
| php javascript | [2, 3] |
2,136,247 | 2,136,248 | how to get apache log like debugging in Android logcat | <p>I am currently using a webview to load a webpage which contains lots of javascript and having lots of trouble debugging what exactly gets loaded and when in the webview .</p>
<p>Then I saw this post where the op seems to be using apache log to monitor webpage load events in his webview.
<a href="http://stackoverflow.com/questions/3652583/enhance-webview-performance-should-be-the-same-performance-as-native-web-browse/4799448#4799448">Enhance webView performance (should be the same performance as native Web Browser)</a></p>
<p>Can I get a similar utility plugin or anything so that I can use it with logcat in ddms view.</p>
<p>If possible please provide some resource as to how to configure it for android. </p>
| java android | [1, 4] |
4,644,785 | 4,644,786 | Is parentsUntil() the best function to use? Jquery | <p>Given the html:</p>
<pre><code> <div class="a">
<div class="b">
<div class="c">
<div class="d">
</div>
</div>
<div class="d">
</div>
</div>
</div>
</code></pre>
<p>Im interested in the selecting the parent element with class <code>a</code> applied to it when any element with the class 'd' is clicked.</p>
<p>I have the following javascript / jQuery, but it seems very messy. Is there a neater way?</p>
<pre><code><script>
$('.d').click(function(){
var elementA = $(this).parentsUntil('.a').last().parent();
})
</script>
</code></pre>
| javascript jquery | [3, 5] |
4,750,108 | 4,750,109 | Correct use of OnDOMReady function | <p>The following on DOM ready function, if I have 2 functions that use this declaration:</p>
<pre><code>$(document).ready(function(){my Function here});
</code></pre>
<p>Now should I use two tags, one for each function or should I declare both functions in one of these tags, both inside the: <code>$(document).ready(function(){my two Functions here});</code>?</p>
<pre><code><script>
$(document).ready(function(){my Function here});
</script>
</code></pre>
<p>Thank You</p>
| javascript jquery | [3, 5] |
3,612,724 | 3,612,725 | media conversion library/plugin preferably php | <p>I am looking for an media conversion library that can convert and compress various media i.e both audio and video files to various formats.</p>
| java php | [1, 2] |
4,623,159 | 4,623,160 | add "readonly" to <input > (jQuery) | <p>How can i add "readonly" to a specific <code><input ></code>? .attr('readonly') does not work.</p>
| javascript jquery | [3, 5] |
4,172,930 | 4,172,931 | Change a javascript function to a jquery | <p>I am using Jquery to load a page into a div. The page the gets loaded is using a javascript. How can i change the javascript shown below into a jquery</p>
<pre><code>window.onload = function(){
new JsDatePick({
useMode:2,
target:"AdddueBy",
dateFormat:"%d-%m-%Y"
});
new JsDatePick({
useMode:2,
target:"bDob",
dateFormat:"%d-%m-%Y"
});
new JsDatePick({
useMode:2,
target:"gDob",
dateFormat:"%d-%m-%Y"
});
};
</code></pre>
| php javascript jquery | [2, 3, 5] |
3,965,333 | 3,965,334 | Recursively replaced element with editor (and back) breaks event listeners | <p>Background: There are some values on my website which shall be editable via JavaScript and Ajax. The Ajax is working fine and I can edit values but after I saved the value I cannot edit it again without reloading the page.</p>
<p>I reduced the problem to this: The original element gets replaced with a HTML form. When the form is submitted the form itself is replaced by the new version of the display element, but the event listener is broken.</p>
<p>I put together some sample JS code (<a href="http://jsfiddle.net/J8Sa7/" rel="nofollow">JSfiddle</a>) which doesn't work as I expect.</p>
<pre><code>var text = $('<em/>').text('click me!');
text.click(function() {
var button = $('<input type="button" value="Click me, too" />');
button.click(function() {
$('#container').html(text);
});
$('#container').html(button);
})
$('#container').html(text);
</code></pre>
<p>What shall happen:</p>
<ol>
<li>current value displayed</li>
<li>after text <code>click</code>ed text replaced with form (text element saved for simplicity)</li>
<li>after button <code>click</code> text displayed again</li>
<li><code>click</code> on text works again as in step 2 (doesn't work now)</li>
</ol>
<p>Why is the <code>click</code> event lost when using the <code>text</code> object again?</p>
| javascript jquery | [3, 5] |
3,183,327 | 3,183,328 | Allocating and deallocating event on a button | <p>I am busy having a problem with allocating a new event to an existing button that was created in the designer.</p>
<p>Now here is the button that was created prior to runtime which is inside the modalpopupexteder5 -</p>
<pre><code><asp:Button runat="server" ID="btnClose" Text="Close" OnClick="btnClose_Click" />
</code></pre>
<p>Here is the codebehind - </p>
<pre><code> protected void btnAddAccount_Click(object sender, EventArgs e)
{
btnClose.Click -= new EventHandler(btnClose_Click);
btnClose.Click += new EventHandler(btnCancel_Click);
ModalPopupExtender5.Show();
}
protected void btnCancel_Click(object sender, EventArgs e)
{
ModalPopupExtender11.Hide();
}
protected void btnClose_Click(object sender, EventArgs e)
{
ModalPopupExtender5.Hide();
}
</code></pre>
<p>So the button in the beginning has the event btnClose_Click hooked up to it. But I want to change it to the btnCancel_Click</p>
<p>But it wont execute the btnCancel_Click. It executes the original btnClose_Click</p>
<p>Any Ideas what could of caused this?</p>
<p>Does this relate to the page life cycle?</p>
<p><strong>--EDIT--</strong>
I should let you know that the btnAddAccount_Click does get executed.</p>
<p>Basically I don't to create the same modalpopupextender, I want to use the existing one but depending on user selection will determine which eventhandler should be called and in this case the btnAccount_Click has selected the btnCancel_Click to be assigned to the button.</p>
| c# asp.net | [0, 9] |
1,127,367 | 1,127,368 | regular expression text merge | <p>Is this possible in reg-ex?<br><br></p>
<blockquote>
<p>subject='fox';<br>
adjective='quick brown';<br>
verb='jumps';<br>
text='The <<adjective>> <<subject>> <<verb>> over the lazy dog.'<br></p>
</blockquote>
<p><i>reg-ex would return:</i><br></p>
<blockquote>
<p>'The quick brown fox jumps over the lazy dog.'</p>
</blockquote>
| php javascript | [2, 3] |
3,574,382 | 3,574,383 | Best practices in using Javascript in ASP.NET in a pre-AJAX and pre-jQuery era | <p>I would like to know what are the best practices in using Javascript in ASP.NET in a pre-AJAX and pre-jQuery era. What I meant by pre-era is not the time before AJAX/jQuery was created, but rather the time before it is popularized and widely adopted (by a significantly large number of programmers).</p>
<p>i.e. Is it good thing to store the script in a string variable and register it on demand (RegisterClientScriptBlock) or on startup (RegisterStartUpScript)?</p>
<p>Although I would be happy to see answers in using Javascript in ASP.NET, its usage in PHP and JSP are also welcome.</p>
<p>Thanks in advance for your time and expertise.</p>
| asp.net javascript jquery | [9, 3, 5] |
478,503 | 478,504 | calling single javascript function for each php variable fetched from database, multiple countdown program | <p>I am trying to get a multiple countdown system, event day and minutes being fetched from database. There can be many such events. After getting the event date, i pass this values to a javascript function which on client side runs for every 1 sec using the setTimout function. This works fine for one event. However for many events how do i achieve the same functionality. i.e i want to run the javascript function for each event.</p>
<p>I am getting some php variables from database. eg</p>
<pre><code>while($row = mysql_fetch_array($query)){
$a = $row['day'];
$b = $row['minutes'];
</code></pre>
<p>}</p>
<p>Now i need to pass all this values inside a javascript function.
If there were only one event, i could directly pass the php values. But for multiple events i am confused as to what to do. I tried using a javascript function inside the while loop, but i get function not defined error, and that is obvious because php is run before javascrip. Any logic, or help appreciated.</p>
<p>Thanks</p>
| php javascript | [2, 3] |
1,551,388 | 1,551,389 | Problem while switching between activities in Android | <p>0
down vote
I having the same problem, I got a runtime error when I press the button that should change the activity</p>
<pre><code>package com.example.LocationTracker;
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button;
public class LocationTracker extends Activity{ /** Called when the activity is first created. */
Button btn_Tracker;
Button btn_Display_Map;
Context context;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
context = getApplicationContext();
btn_Tracker = (Button)findViewById(R.id.btn_Tracker);
btn_Tracker.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//setContentView(R.layout.trackeractivity);
Intent myIntent1 = new Intent(view.getContext(), TrackerActivity.class);
context.startActivity(myIntent1);
}});
}
class TrackerActivity extends Activity {
//Your member variable declaration here
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.trackeractivity);
}
}
</code></pre>
<p>I added everything right in the maniefest file</p>
<pre><code><activity android:name=".TrackerActivity" android:label="@string/app_name"/>
<activity android:name=".DisplayMapActivity" android:label="@string/app_name"/>
</application>
</code></pre>
<p>please help me.</p>
<p>Thanks</p>
| java android | [1, 4] |
5,734,353 | 5,734,354 | How to fetch serialized jquery array to a php page? | <p>heres my code ive serialized checboxes and i want it to be pass to a php page through ajax. NOTE that i am not using forms. and i cant use forms. i am using click event on a button to pass the value.</p>
<pre><code>$('#res-button').click(function (){
var pid = $('#pid');
var name_res= $('#name_res');
var email_res= $('#email_res');
var contact_res= $('#contact_res');
var room_id=$('[name=rescheck[]]:checked').serialize().replace(/%5B%5D/g,'[]');
alert(room_id);
$.ajax({
type: "POST",
url: "reservation-valid.php",
data: {name_r:name_r, email_r:email_r,contact_r:contact_r,prop_id:p_id,cvalue:room_id},
success: function(data) {
//some codes here
});
}
});
});
</code></pre>
<p>THE RESULT OF MY ALERT TO room_id is this- "rescheck[]=1&rescheck[]=2&....." so i know my serialize is working, but i cant get it to php to insert my ids in database.</p>
<p>this is my php code:</p>
<pre><code>$c_array=$_POST['cvalue'];
foreach($c_array as $ch)
{
$sql=mysql_query("INSERT INTO reservation VALUES('','$prop_id','$ch','$name_r','$contact_r','$email_r','')");
}
</code></pre>
| php jquery | [2, 5] |
1,188,217 | 1,188,218 | Is it uploading individual files or all files at once? | <p>I am using an AJAX fIle upload feature and what happens is that in this jsfiddle <a href="http://jsfiddle.net/NujcX/2/" rel="nofollow">here</a>
, every time a user appends a question by typing in a question in the textarea and clicking "Add Question", it adds a table row of the question number, the question and more importantly the file input.</p>
<p>But what I want happening is lets say for example the user adds 3 questions (so 3 rows are appended) and in 2 of those rows contains a file location in the file input (lets say first and second row), then when I click on the upload button for the first row, will it only upload the file in the first row and then when that is done when I click on the upload for second row it will upload the file in the second row?</p>
<p>In other words does it upload files individually by the row it is in and also is it using the form code in the html (an input hidden field) to upload the files using the form's <code>action="upload.php"</code>?</p>
| php javascript | [2, 3] |
4,237,183 | 4,237,184 | Export Grid view to excel and save excel file to folder | <p>I want to save excel file which export data of grid view.I have written code to export gridview data to excel but i dont know, how to save exported file.</p>
<p>Following is my code to export gridview into excel :</p>
<pre><code> Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("content-disposition", "attachment;filename=MyFiles.xls");
Response.Charset = "";
this.EnableViewState = false;
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gvFiles.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
</code></pre>
<p>Please help
and thanks in advance.</p>
| c# asp.net | [0, 9] |
3,361,172 | 3,361,173 | Dynamically generated textfield not showing the value set by javascript | <p>I have a dynamically generated textfield (using the following code):</p>
<pre><code>echo "<div><table width='100%'><tr>
<td>
Date: <input type='text' class='span2' id='currDate'>
</td><td rowspan='2'></td></tr></table>";
</code></pre>
<p>This field is generated once a user presses a button, this button links to a javascript:</p>
<pre><code>$('#receipts button').live('click', function(){
var id = this.id;
$.ajax({
type: "post", url: "receipt-stock.php", data: "production_detail_id="+id,
success: function(data) {
$('.modal-body').html(data);
$('#new_receipt').modal('show');
var myDate = new Date();
var prettyDate = myDate.getDate()+'-' +(myDate.getMonth()+1)+'-'+myDate.getFullYear();
$("#currDate").val(prettyDate);
$('#currDate').datepicker({ dateFormat: 'dd-mm-yy' });
}
});
});
</code></pre>
<p>As it can be seen from the javascript i am displaying a modal which contains the textfield from the code above. Everything works fine except the part where i am setting the value of <code>#currDate</code> to the current date, the textfield does not show anything nether it shows the date-picker when in focus.</p>
<p><strong>However upon using alert i found that the textfield has the value i want, it just doesn't display it.</strong></p>
| php javascript jquery | [2, 3, 5] |
626,902 | 626,903 | Move li elements with certain class into and div | <p>I am trying to use the .append function in jquery.
I have a div with li elements in it. They have different classes, lets say odds and evens.
I would like the li's with the class "odd" moved into another div with li's in it.
How can I do this?
Here is my setup:
<strong>Edit</strong>. This was in valid markup, I just didn't put all in. Fixed now for others. </p>
<pre><code><div id="col1">
<ul>
<li class="odd"></li>
<li class="even"></li>
<li class="odd"></li>
<li class="even"></li></ul>
</div>
<div id="col2">
<ul>
<li></li>
</ul>
</div>
</code></pre>
<p><strong>So then the output is:</strong> </p>
<pre><code><div id="col1">
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
</div>
<div id="col2">
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
</div>
</code></pre>
| javascript jquery | [3, 5] |
1,792,203 | 1,792,204 | Trying to do some Obfuscation, How should I approach this particular case? | <p>I currently have an assignment that is really pushing my limits so I need some help on how to approach this. </p>
<ol>
<li>We have a set of 25 results</li>
<li>We are using a jquery plugin to vertically scroll through these 25 results, the container displays five results at a time. </li>
<li>When viewing the source code of the page, you can see the html for all 25 results. Obviously the jquery plugin is what is making them visible or not.</li>
<li>The task is to make it so that only five of the result set are displaying at any time during a source code viewing. All the rest of the results must come from javascript or some other technique.</li>
</ol>
<p>So I somehow have to either:</p>
<ol>
<li>Send a pool of 25 results to JS and have it generate the div info on the fly
OR</li>
<li>Some type of timed script that grabs five results at a time and displays them. But this all has to continuously scroll vertically so that is a consideration also.</li>
</ol>
<p>So I am trying to get my head around how I should approach this: One idea I had was to run an ajax call every five or ten seconds that has a php script generate five new results, then display them in the appropriate div. This is slow and would basically mean a page that is constantly sending out ajax calls. the random results are coming from a php script that is parsing an xml feed.</p>
<p>I am really just looking for a roadmap or some conceptual directions on how this could be approached.</p>
| php javascript jquery | [2, 3, 5] |
1,961,962 | 1,961,963 | Check which element has been clicked with jQuery | <p>I am trying to use an 'if' statement to determine which element was clicked.</p>
<p>Basically I am trying to code something along the lines of:</p>
<pre><code>if (the element clicked is '#news_gallery li .over') {
var article = $('#news-article .news-article');
} else if (the element clicked is '#work_gallery li .over') {
var article = $('#work-article .work-article');
} else if (the element clicked is '#search-item li') {
var article = $('#search-item .search-article');
};
</code></pre>
<p>What is the proper jQuery syntax for this? Many thanks in advance.</p>
| javascript jquery | [3, 5] |
4,246,018 | 4,246,019 | alerting user on other user login with jquery ajax | <p>how can i alert the user already logged in for the new user logged in........suppose....</p>
<p>user1 one is currently logged in and user2 is offline.
i want to alert user1</p>
<p>when user2 logged in............</p>
<p>how can i achieve this</p>
| php jquery | [2, 5] |
4,762,523 | 4,762,524 | How to make a sign light up | <p>Apologies if this doesn't qualify as a StackOverflow question.</p>
<p>I have a jpg of a sign that's made up of 100 light bulbs. I'd like to use jQuery to animate the bulbs so that they flicker on after a moment's hesitation.</p>
<p>I'm thinking that it would require two images and that I would animate hiding/showing them back and forth to produce the flicker, but I wanted to ask if there was a more elegant solution first.</p>
| javascript jquery | [3, 5] |
915,515 | 915,516 | Nested jquery selectors triggering both parent and child specific events | <p>I've got a table with the following structure</p>
<blockquote>
<ul>
<li>table#Main</li>
<li><ul>
<li>tbody</li>
</ul></li>
<li><ul>
<li><ul>
<li>tr.Row</li>
</ul></li>
</ul></li>
<li><ul>
<li><ul>
<li><ul>
<li>td </li>
</ul></li>
</ul></li>
</ul></li>
<li><ul>
<li><ul>
<li><ul>
<li><ul>
<li>input.EditRow</li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
</ul>
</blockquote>
<p>My jquery looks like this:</p>
<pre><code> $("table#Main > tbody > tr.Row").live("click", function (e) {
RowClick($(this));
});
$(".EditRow").live("click", function (e) {
EditRow($(this));
});
</code></pre>
<p>My problem is that if I click the .EditRow button and call the EditRow function, the RowClick function is called immediately after.</p>
<p>After doing some research on the site, I saw that others got around this problem by using either one of the other of the following commands. </p>
<pre><code>e.preventDefault();
e.stopPropagation();
</code></pre>
<p>I tried them on both functions, in different combinations but couldn't figure it out. Can someone tell me what I'm doing wrong?</p>
<p>Thank you! <3</p>
| javascript jquery | [3, 5] |
4,350,463 | 4,350,464 | If URL contains anything, then fire a Javascript function | <p>Basically, if the URL/<code>window.location</code> contains absolutely any variable whatsoever (past domain.com/, of course), I'd like javascript to execute something. </p>
<p>Currently, I have the following jQuery code which only executes when <code>window.location</code> contains the exact wording "#hash", but as stated before I'd like to expand the functionality for all variables.</p>
<p><strong>Edit:</strong> Sorry, to clarify, by variable I mean any one of the following examples:</p>
<ul>
<li>domain.com/<strong>#hash</strong></li>
<li>domain.com/<strong>#hash2</strong></li>
<li>domain.com/<strong>sub/folder</strong></li>
<li>domain.com/<strong>textwithoutahash</strong></li>
</ul>
<p><em>Also, if someone knows how to do this in basic Javascript and without the need for the jQuery library, that would be an added bonus!</em></p>
<pre><code>$(function() {
if ( window.location.href.indexOf('#hash') > -1 ) {
myfunctionhere;
}
});
</code></pre>
| javascript jquery | [3, 5] |
3,263,598 | 3,263,599 | how to send table value to printer? | <p>I want to send table values to printer.That table contails more than 50 records.so there is scrollbar or pagination on that table.Below the printer there print button, if click the button those all values should go to printer.</p>
<pre><code>function print(){
window.print();
window.opener.document.location = window.opener.document.location.href;
window.close();
}
</code></pre>
<p>I used to code for print value.but it shows only the page, not in all table values .I ma using jsp,javascript.</p>
<p>I am looking for directdownload without css and open popup window, i need to do this work.</p>
<p>Any idea????</p>
| javascript jquery | [3, 5] |
3,573,279 | 3,573,280 | issue with insertBefore() | <p>I got a small object which has to append new rows to a table.. It works fine in most cases, but if there is a table inside some of the rows (in the "root" table) the object doesn't append to the proper table!?</p>
<p>I have been doing a bit of debugging and found the line where it all goes wrong.. If DEBUG is set and the line with insertBefore() is omitted the object appends to the proper table</p>
<pre><code>var List = new function(){
this.append_row = function(row, tbl, index){
if(DEBUG){
index = -1;
}
if(index == 0){
row.prependTo(tbl);
}
else if(index > 0){
var elm = $('tr', tbl);
if(elm.length > index){
row.insertBefore(elm.eq(index)); // the issue is in this line
}
else{
row.appendTo(tbl);
}
}
else{
row.appendTo(tbl);
}
};
}
</code></pre>
| javascript jquery | [3, 5] |
5,689,629 | 5,689,630 | My function calls are not working? | <p>I wrote code first without using functions to prototype, and of course, it worked fine: </p>
<pre><code>$(function() {
$(".PortfolioFade img")
.mouseover(function() {
popup('PORTFOLIO');
var src = $(this).attr("src").replace("images/paperclip.png", "images/paperclip-black.png");
/*var src = $(this).attr("src").match(/[^\.]+/) + "-black.png";*/
$(this).attr("src", src);
})
.mouseout(function() {
;
/*var src = $(this).attr("src").replace("images/paperclip-black.png", "images/paperclip.png");
$(this).attr("src", src); Look at popup.js mouseover events*/
});
});
</code></pre>
<p>However, when I expressed the same in function form, the function call didn't seem to work. </p>
<pre><code>$(document).ready(function() {
// put all your jQuery goodness in here.
$('body').hide().fadeIn(1000);
function ImageRollover(image_element, popup_name, original, replacement)
{
$(element)
.mouseover(function(){
popup(popup_name);
var src = $(this).attr("src").replace(original,replacement);
$(this).attr("src",src);
})
.mouseout(function(){
;
});
}
ImageRollover(".Portfolio img",'PORTFOLIO',"images/paperclip.png","images/paperclip-black.png");
});
</code></pre>
<p>Defining the function elsewhere didn't seem to have any effect either. </p>
| javascript jquery | [3, 5] |
3,112,732 | 3,112,733 | Creating modal window through jquery | <p>I am trying to create a mask (modal) on my whole website and for this i tried :</p>
<p><strong>css</strong></p>
<pre><code> #mask
{
position:absolute;
z-index:9000;
background-color:#000;
display:none;
}
</code></pre>
<p><strong>js</strong></p>
<pre><code> $('body').append(' <div id="mask"></div> ');
var maskHeight = $(document).height();
var maskWidth = $(window).width();
$('#mask').css({ 'width': maskWidth, 'height': maskHeight, top: 0, opacity: 1 });
</code></pre>
<p>it works fine, but the mask is only on the visible part of my website, when i <code>scrolls down</code> there is no mask.Can anybody tell me the solution for this?</p>
| javascript jquery | [3, 5] |
2,349,776 | 2,349,777 | jQuery get DOM element as string | <p>Say I have</p>
<pre><code>$(":input[type=text]:first")
</code></pre>
<p>How do I get</p>
<pre><code><input type="text" value="" size="28" maxlength="140" tabindex="1" placeholder="search" class="textbox" name="q" autocomplete="off">
</code></pre>
<p>Assuming I run this on SO?</p>
<p><strong>Update</strong> I don't want to call <code>.parent()</code> since I have lots of other stuff in the parent element.</p>
| javascript jquery | [3, 5] |
5,183,750 | 5,183,751 | Generate code to an html interface | <p>Am new to html, so I've created an html page but i want to generate code to this page like creating queries, links to other pages...<br/><br/>
what should i do to generate code to my html pages? </p>
| c# asp.net | [0, 9] |
3,071,846 | 3,071,847 | Javascript Match on parentheses inside the string | <p><em>How do I do a .match on a string that has parentheses in the string?
String1.match("How do I match this (MATCH ME)");</em></p>
<hr>
<p>None of the answers are getting me what I want. I'm probably just doing it wrong. I tried to make my question basic and I think doing that asked my question wrong. This is the statement I am tring to fix:</p>
<pre><code>$('[id$=txtEntry3]').focus(function () {
if (!DropdownList.toString().match($('[id$=txtEntry2]').val()) || $('[id$=txtEntry2]').val().length < 5) {
$('[id$=txtEntry2]').select();
ErrorMessageIn("The Ingredient number you entered is not valid.");
return;
}
ErrorMessageOut();
});
</code></pre>
<p>This works correctly the problem I am running into is when it tries to match a entry from "txtEntry2" that has "()" in it.</p>
<hr>
<hr>
<p>Well it's kinda broken but it works for what I need it to do. This is what I did to fix my problem:</p>
<pre><code>$('[id$=txtEntry3]').focus(function () {
if (!StripParentheses(DropdownList).match(StripParentheses($('[id$=txtEntry2]').val())) || $('[id$=txtEntry2]').val().length < 5) {
$('[id$=txtEntry2]').select();
if (!$('[id$=txtEntry2]').val() == "") {
ErrorMessageIn("The Ingredient number you entered is not valid.");
}
return;
}
ErrorMessageOut();
});
function StripParentheses(String){
x = String.toString().replace(/\(/g, '');
x = x.toString().replace(/\)/g, '');
return x;
}
</code></pre>
| javascript jquery | [3, 5] |
5,219,546 | 5,219,547 | Can I get the frequency of a raw sound in real time in Android? | <p>I would like to build an app that can tell the frequency of a musical note played through a androids mic as quickly as possible.</p>
<p>Disclaimer: I am not building a another tuner app, I promise ;)</p>
<p>I am aware of the difficulty of getting the frequency, I will probably use FFT.</p>
<p>But how quickly can i realisticly get whether the sound being played is an expected note?</p>
<p>i.e. is the recorded half a second of a sound an A, or B etc.</p>
<p>Thanks in advance :)</p>
<p>Ben</p>
| java android | [1, 4] |
2,020,986 | 2,020,987 | How to unescape Javascript in PHP | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-char">How to decode Unicode escape sequences like “\u00ed” to proper UTF-8 encoded characters?</a> </p>
</blockquote>
<p>I have some javascript text that contains values like '\u003c' (less than sign <).</p>
<p>Is there a php functions that allows me to unescape javascript ?</p>
<p>(I did not expect urldecode to work, though i tried it. It does not indeed.)</p>
| php javascript | [2, 3] |
421,448 | 421,449 | Get the value of a twitter bootstrap radio button. JQuery | <p>I'm using the Radio-button from twitter bootstrap: <a href="http://twitter.github.com/bootstrap/javascript.html#buttons" rel="nofollow">http://twitter.github.com/bootstrap/javascript.html#buttons</a>.</p>
<p>In my html in looks like this:</p>
<pre><code> <div class="btn-group" data-toggle="buttons-checkbox">
<button type="button" class="btn">Left</button>
<button type="button" class="btn">Middle</button>
<button type="button" class="btn">Right</button>
</div>
<input type="submit" onclick="get_the_value_and_do_something_with_it"
</code></pre>
<p>I would like to know how to get the value of the button the user checked thanks to Jquery or Javascript.</p>
<p>I saw several question on this topic, but I think it is different with this kind of button, because it looks like they do not accept a "checked" attribute.</p>
<p>Any help would be very welcome</p>
<p>PS: if someone knows how to check by default one of the button, it would also help me a lot. Thank you.</p>
| javascript jquery | [3, 5] |
1,210,720 | 1,210,721 | jquery find element at a particular position | <p>Is there a method in jquery to select an element located at a particular position
for example select the element that is located at left:100 and top:300 ? in absolute position</p>
<p>It would be nice if I could select and element located in a range of positions, </p>
<p>for example select the element that is located left: 100 - 150 px top 200 - 280px</p>
<p>Thank you guys</p>
| javascript jquery | [3, 5] |
2,968,468 | 2,968,469 | javascript pass table data to php script | <p>I have a table (that can be fairly large....say 200x200 px) where each cell has a background color, and a small image in it. The user will be able to click the cell and change the color/symbol (the symbol represents the color), via jQuery/Javascript. How can I pass the table data to a PHP script so it can be assembled into an image or pdf?</p>
| php jquery | [2, 5] |
3,937,070 | 3,937,071 | save keydown in array and executes | <p>im creating a simple 2d game, and I want save the keydown keys into array, and execute them inisde a loop, so the user can hold a key and make it look like the chartater is moving non stop.</p>
<p>i got a setInterval function that act like a game Timer, and it just loop it self all the time. i added a listener and an array to hold the key.</p>
<p>I checked the keys inside the array and it look fine but, the functions moveRight and moveLeft are not working for some reson.</p>
<p>here is the code:</p>
<pre><code> this.keysPressed = new Array();
InitGameLoop: function () {
var that = this;
setInterval(function () {
$(document).keydown(function (e) {
var key = e.which;
that.keysPressed.push(key);
for (var i = 0; i < that.keysPressed.length; i++) {
if (that.keysPressed[i] == 38) {
that.moveRight(worldWidth, 10);
}
else if (that.keysPressed[i] == 37) {
that.moveLeft(10);
}
log(that.keysPressed, that.yPos);
that.keysPressed.pop();
}
});
}, 60);
</code></pre>
<p>my questions are:</p>
<ol>
<li>what am i doing worng?</li>
<li>is this a good idea? (if not, please feel free to recommend me about another :) )</li>
</ol>
<p>(sorry for my english)</p>
| javascript jquery | [3, 5] |
2,031,002 | 2,031,003 | How to set width of a html tablerow in C# | <p>this is a follow up question to the following question link:</p>
<p><a href="http://stackoverflow.com/questions/11112112/how-to-hide-columns-in-asp-net-webform">how to hide columns in ASP.NET webform</a></p>
<p>following the answer that i got from the above link, i am using </p>
<pre><code> System.Web.UI.HtmlControls.HtmlTableRow
</code></pre>
<p>i want to set the width of the entire row. How can i do this in C#? any other idea/way you can suggest, please let me know.</p>
<p>if you have any more questions, please do not hesitate to ask.</p>
| c# asp.net | [0, 9] |
3,648,774 | 3,648,775 | How does jQuery invoke methods of objects when an Array of jQuery objects is returned? | <p>After passing a string "selector" into the jQuery function:</p>
<pre><code>$('#onenode')
</code></pre>
<p>An array of jQuery object's is returned.</p>
<p>One of the methods of these object's is "html", which is why:</p>
<pre><code>$('#onenode').html('hello!');
</code></pre>
<p>Works.</p>
<p>However...</p>
<p>This:</p>
<pre><code>$('.somenodes')
</code></pre>
<p>Returns an array of jQuery objects, each of the objects in this array has the method "html".</p>
<p>So how does:</p>
<pre><code>$('.somenodes').html('hello');
</code></pre>
<p>Work? The "html" method must be a method of the Array Object that is returned.</p>
<p>I assume therefore that the "html" method of the Array Object looks similar to this:</p>
<pre><code>html: function(value) {
for(var i=0; i<this.length; i+=1) {
this[i].html(value);
}
}
</code></pre>
<p>These are all assumptions, I'm pretty much guessing.</p>
<p><strong>I am attempting to create my own small library that uses "selectors", but I am struggling with this part. I know that this is probably incorrect -- could someone explain how jQuery really does it?</strong></p>
| javascript jquery | [3, 5] |
2,142,990 | 2,142,991 | Function won't execute | <p>I'm trying to create a function that will execute on a click, on the condition that a variable is set to 0;</p>
<p>However, the function will not execute, even if the variable is set to 0.
(I am using jquery)</p>
<pre><code>var menuVisible = 0 ;
$('#links').click(function(){
if (menuVisible = 0)
{
$('#subMenu').show("slow") ;
menuVisible = 1 ;
}
});
</code></pre>
<p>I'm testing the value of the variable 'MenuVisible' with alert, and it is indeed '0'. So, why won't the function execute ?</p>
| javascript jquery | [3, 5] |
195,219 | 195,220 | How to get sibling td value? | <pre><code><table>
<tr>
<td>
<asp:Label ID="lblUnitPrice" runat="server" Text='<%#Eval("UNIT_PRICE") %>' />
<input type="text" id="txtUnitPrice" style="display: none" />
</td>
<td>
<asp:LinkButton ID="linkBtnUnitPrice" runat="server" Text="Edit" OnClientClick="SetEditMode(this); return false;" />
</td>
</tr>
</table>
</code></pre>
<p>I want to get lblUnitPrice id when user clicks on linkBtnUnitPrice i.e in SetEditMode(this) function using JQuery or Javascript</p>
| javascript jquery asp.net | [3, 5, 9] |
5,031,222 | 5,031,223 | how to do new lines? [ textarea -> jquery -> p tag ] | <p>I'm doing something very similar to the stackoverflow question preview only much more basic.</p>
<p>user types in text area -> keyup shows what they've typed in preview</p>
<p>new lines aren't working</p>
<pre><code> $('input, textarea').keyup(function(){
var value = $(this).attr('value').replace('\n', '<br />').replace('\r', '<br />');
$('p.preview').html(value);
})
</code></pre>
| javascript jquery | [3, 5] |
547,207 | 547,208 | jQuery Extension accepting a String not just an Object | <p>This might be a silly question, but I can't seem to find a solution...</p>
<p>I just wanted to make a <strong>isNullOrWhiteSpace</strong> extension (same name as the .NET one), to determine if a string is <code>'', '0', 0, undefined, null</code>. Nothing crazy.</p>
<p>Now doing it with a typical jQuery extension, it seems it is always looking for a jQuery <strong>Object</strong> to be passed in. But for in my extension, I need it to work with a simple <strong>string</strong>, but it doesn't work at all when I do.</p>
<pre><code>$.fn.isNullOrWhiteSpace = function () {
if (['', '0', 0, undefined, null].indexOf($.trim(this)) > -1) {
return false;
}
return true;
};
'testing'.isNullOrWhiteSpace(); // doesn't work
// Uncaught TypeError: Object has no method 'isNullOrWhiteSpace'
</code></pre>
<p><strong>What am I missing here??</strong></p>
<p>-- from answers below, turns out it should be simply:</p>
<p><strong><code>$.isNullOrWhiteSpace</code></strong>, the <code>$.fn.</code> part makes it a jQuery-Object extension as opposed to just a regular extension (like <code>$.isArray()</code>, <code>$.trim()</code> (which I use in my own question... sigh))</p>
| javascript jquery | [3, 5] |
4,905,570 | 4,905,571 | Communication model: C++ and Java | <p>Pals,</p>
<p>I have a requirement to establish a communication channel between C++ and Java layer of my application for the exchange of objects and their properties.</p>
<p>I have got the following options:</p>
<ol>
<li>XML / SOAP</li>
<li>Postgre SQL</li>
</ol>
<p>Can you please advice me the Pros & Cons on these. Please share your experiences on the implementation complexities.</p>
<p>Thanks,
Gtk</p>
| java c++ | [1, 6] |
2,046,067 | 2,046,068 | How can I prevent a user from middle clicking a link with javascript or jquery | <p>I want to prevent the user from being able to middle click a certain link to open a new tab. I have tried the following:</p>
<pre><code>$(window).on('mouseup', '.sptDetails', function(e){
e.preventDefault();
if(e.button == 1){
return false;
}
});
</code></pre>
<p>This doesn't seem to work.</p>
| javascript jquery | [3, 5] |
612,125 | 612,126 | how to show message box in asp.net | <p>I'm using C# to create a website and I'm trying to show a message box. I'm trying to use JavaScript for this situation and it runs if I do the following:</p>
<pre><code>Response.Write("<script LANGUAGE='JavaScript' >alert('Login Successful')</script>");
</code></pre>
<p>However if instead I do this:</p>
<pre><code>Response.Write("<script LANGUAGE='JavaScript' >alert('Login Successful')</script>");
Response.Redirect("~/admin.aspx");
</code></pre>
<p>The message box doesn't get shown.</p>
<p>Why is this and how can I fix it?</p>
| c# javascript asp.net | [0, 3, 9] |
4,500,133 | 4,500,134 | How to call another method inside BroadcastReceiver onReceive method in android? | <p>Hi i am using BroadcastReciever to track the incoming messages and send the messages to the database for storage through webservices. But whenever i called a method inside the onReceive method it is saying error message <code>unable to start receiver</code>.</p>
<pre><code>package com.android.message.alert;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.telephony.SmsMessage;
import android.util.Log;
import android.view.View.OnClickListener;
import android.widget.Toast;
import com.webservice.call.SendWebservice;
public class MessageListener extends BroadcastReceiver
{
TextToSpeech tts;
public static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
@Override
public void onReceive(Context context, Intent intent)
{
if(intent!=null && intent.getAction()!=null && ACTION.compareToIgnoreCase(intent.getAction())==0)
{
Bundle bundle = intent.getExtras();
Object[] pdus = (Object[]) bundle.get("pdus");
final SmsMessage[] message = new SmsMessage[pdus.length];
for (int i = 0; i < pdus.length; i++)
{
message[i] = SmsMessage.createFromPdu((byte[])pdus[i]);
}
SendWebservice.sendToWebservice(message[0].getMessageBody());
}
}
}
</code></pre>
<p>Any help regarding how to call another method inside the onReceive method would be helpful. Please Help me Regarding this issue.</p>
| java android | [1, 4] |
5,024,803 | 5,024,804 | Find the Jquery version using normal Javascript | <p>Is there any way to find the version of Jquery using normal plain javascript.
I know to do this using JQuery itself by using the following code.</p>
<pre><code>jQuery.fn.jquery;
</code></pre>
<p>or</p>
<pre><code>$().jquery;
</code></pre>
<p>But this wont works for me beacuse I am not allowed to use Jquery code. Please suggest any alternative methods using only plain javascript.</p>
<p>Thanks in advance.</p>
| javascript jquery | [3, 5] |
1,876,688 | 1,876,689 | Why declare inside of $(function () { ... })? | <p>The application I am looking at loads an external javascript file which looks like this:</p>
<pre><code>$(function () {
// Don't allow browser caching of forms
$.ajaxSetup({ cache: false });
var dialogs = {};
var getValidationSummaryErrors = function ($form) {
// We verify if we created it beforehand
...
...
}
return errorSummary;
};
</code></pre>
<p>I understand that the file setups up some variables and also declares a function called getValidationSummaryErrors.</p>
<p>What I don't understand is why is this all within </p>
<pre><code>$(function () { ... }
</code></pre>
<p>What's the purpose of this? Can I not just declare the variable and things inside the flat file without the "$(function () { }" ?</p>
| javascript jquery | [3, 5] |
2,574,001 | 2,574,002 | How to use Global.asax file to redirect the user? | <p>What should be done if I want to redirect a user based on their ISO Codes?</p>
<p>And how should I detect a website user's IS Code in the first place? Like I know there are these server variables that we use to detect Client IP and all (HTTP_FORWARDED_FOR, REMOTE_ADDRESS, etc) but information
about them on the many sites that I have read has got me confused about what to use. Like some say there can be comma separated IPs returned by HTTP_FORWARDED_X and out of those IPs , one is not sure which is the real IP and which are the proxy addresses. Also, that all the IP addresses in returned can be fake.</p>
<p>So my questions are:-</p>
<ol>
<li><p>How to I fetch the REAL IP Address of a person? Like I only want to know what country a particular person is sitting so I can redirect the user accordingly. </p></li>
<li><p>Secondly lets say a person is sitting in US then I want the user to be redirected to www.mysite.us.
If a person is visiting my site from Germany, www.mysite.de is the address that I want the person to be redirected to.</p></li>
<li><p>Also if DE is the ISO Code then I want my GermanMaster.master page to load and if its US then I want that the USMaster.master should load.</p></li>
</ol>
<p>So how do I fetch a user's not fake IP address, redirect a user based on that ISO code and then load a master page according to the ISO Code.</p>
<p>How do I go about it? I haven't ever worked with Global.asax before so clueless how to go about it all. Any help will be greatly appreciated. Thanks.</p>
| c# asp.net | [0, 9] |
821,364 | 821,365 | How to convert data | <p>I want to convert 2014-04-26T19:22:28.000+05:30 into dd-mm-yyyy.</p>
<p>I use :</p>
<pre><code>SimpleDateFormat formatter, FORMATTER;
formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.000hh:mm");
String oldDate = BeginDate.getProperty("BeginDate").toString(); // "2011-03-10T11:54:30.207Z";`enter code here`
Date date = formatter.parse(oldDate.substring(0, 25));
FORMATTER = new SimpleDateFormat("dd-MMM-yyyy");
lstTemp.add("Start Date : " +FORMATTER.format(date) );
</code></pre>
<p>I get following error :</p>
<p>Unpraseable date : "2014-04-26T19:22:28.000+05:30"</p>
| java android | [1, 4] |
972,351 | 972,352 | An else if statement for unwanted characters and too short a length of characters for edittext | <p>I have an <code>edittext</code> variable named <code>getusername</code> I wish to use in an if statement.</p>
<p>I wish to check for unwanted characters like !,@,#,$,%,^,&,*,(,),etc. I also want to make sure the text from edittext will not be less than 3 characters.</p>
<p>Right now i'm using <code>getusername.getText().toString()</code> to get the values in edittext but I want to use an if statement that toasts "success" if the characters in the edittext match my exceptions. and if not toasts what the problem is.</p>
<p>Is there anyway to do this?</p>
<p>My current code asterisks mark where i need help on with my comments.</p>
<pre><code>if (getusername.getText().toString() *does not have any spaces or invalid characters*)
and (getusername.getText().toString() *has more than 3 characters*) {
Toast.makeText(this, "Success.",Toast.LENGTH_SHORT).show();
} else if (getusername.getText().toString() *has spaces or invalid characters*) {
Toast.makeText(this, "Invalid Characters",Toast.LENGTH_SHORT).show();
} else if (getusername.getText().toString() *does not have more than 3 characters*) {
Toast.makeText(this, "Not enough characters",Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Unknown Error",Toast.LENGTH_SHORT).show();
}
</code></pre>
<p>This shows a general idea of what i'm trying to accomplish. </p>
<p>Thank you in advance.</p>
| java android | [1, 4] |
2,187,786 | 2,187,787 | Rebuild ASP.NET Web Application via code | <p>Currently I force ASP.NET to rebuild a web application by changing the web.config. However, I would prefer to do it via C# code (including clearing cache etc). How could I go about doing this.</p>
| c# asp.net | [0, 9] |
2,160,195 | 2,160,196 | display div based on dropdown selection | <p>This is my code. I want display a div tag based on dropdown list. But I got the error is no css rule found.</p>
<pre><code><html>
<head>
<script>
$(document).ready(function ()
{
$('.group').hide();
$('#option1').show();
$('#selectMe').change(function ()
{
$('.group').hide();
$('#'+$(this).val()).show();
})
});
</script>
</head>
<body>
<div id="option1" class="group">asdf</div>
<div id="option2" class="group">kljh</div>
<div id="option3" class="group">zxcv</div>
<div id="option4" class="group">qwerty</div>
<select id="selectMe">
<option value="option1">option1</option>
<option value="option2">option2</option>
<option value="option3">option3</option>
<option value="option4">option4</option>
</select>
</body>
</html>
</code></pre>
| javascript jquery | [3, 5] |
5,723,778 | 5,723,779 | Play Sound Javascript/Jquery | <p>I would like to request help from experts here but I would like to explain my requirements first.
I am building an Ajax Based application that will run on our local intranet network.</p>
<ol>
<li>Now upon every return of request from my Ajax, I need to play a sound in my client browser.</li>
<li>I want to put a sound file (mp3/wav) in my web server (Tomcat) directory where the application will download
and play at the client browser. (I dont want to embed this and will just automatically play)</li>
</ol>
<p>But I basically have this limitation.</p>
<ol>
<li>Our target users intranet computers has no access to the outside internet since this is being block by our network team.</li>
<li>Most of the client runs on Windows XP and Flash might not be updated or not being installed.</li>
</ol>
<p>I know a little jquery but I dont know if what I am thinking is possible and what possible plugin can I use that is
basically cross browser. My target browse runs on IE6/IE7/IE8/FF3. Please advise.</p>
| javascript jquery | [3, 5] |
4,902,597 | 4,902,598 | auto page scroll when page reached 70% of page height using jquery | <p>I have a page that displays users feeds. I've setup 20 feeds per page and after that users can click on "see more" and it will again display 10 more feeds.</p>
<p>But I want to make it like facebook and twitter where pages are automatically scrolled when we go to the bottom. I have modified my javascript to do the same but it's not working. Any help will be highly appreciated</p>
<p>My javascript code for see more with modified autoscroll is:</p>
<pre><code>$(document).ready(function(){
$(document).scroll(function(e){
if (processing)
return false;
if ($(window).scrollTop() >= ($(document).height() - $(window).height())*0.7){
processing = true;
$("#morestream_button").click(function() {
$(this).hide();
$("#morestream_box").html("<img src=\"'.uhome().'/files/loading.gif\" /> Loading");
$.post("'.uhome().'/index.php?p=jquery/moreactivities",
{offset:$("#stream_offset").val(),uid:"'.$uid.'",target_id:'.$target_id.'},
processing = false;
function(data){
var currentVal = parseInt( $("#stream_offset").val() );
$("#stream_offset").val(currentVal + 30);
$("#morestream_box").before(data);
if (data) {
$("#morestream_button").show();
}
$("#morestream_box").html("");
},"html"
);
return false;
});
}}}});
</code></pre>
<p>My website is way2enjoy.com and you can see the link see more at bottom but I dont want to click on that link, I want that as users go down it should automatically scroll.</p>
<p>Use 'demo' as username and password.</p>
| javascript jquery | [3, 5] |
5,190,941 | 5,190,942 | Clean way of using polymorphism at the presentation layer - ASP.NET | <p>A lot of times, I find myself doing UI control manipulation in the code behind and wanted to find a clean way of doing this.</p>
<p>Use Case:
A drop down has CSS1 style, editable in Edit mode but
has CSS2 style, view only in View mode</p>
<p>I can achieve this by simply have a set of switch case statements. I can use polymorphism and create a EditMode and ViewMode class but that requires me to have a reference to the UI control to be passed to these classes. This tightly couples the UI and the logic layer which I want to avoid.</p>
<p>Any ideas?</p>
<p><strong>EDIT:
Can anyone give an example of externalizing the UI logic from the code behind?</strong></p>
| c# asp.net | [0, 9] |
5,941,357 | 5,941,358 | Date format in javascript | <p>How do i convert date to month day year format in java script and access year,month,day from the converted format.</p>
<p>we have converted the date by using our custom date formate Date.Format(obj, "mm-dd-yyyy").once the date is converted we need to get year from the formated date.obj indicate current date with dd-mm-yyyy.</p>
| javascript jquery | [3, 5] |
2,130,369 | 2,130,370 | Get textfield values from JavaScript driven form and append those values to a div | <p>I need to grab two textfield values on button submit and then insert them into some HTML and append that HTML to a div.</p>
<p>The test page is at <a href="http://seafoammedia.com/dealer/quote/form.php" rel="nofollow">http://seafoammedia.com/dealer/quote/form.php</a> with the main javascript file being jtracker.js</p>
<p>The code I've inserted into jtracker.js to try and do this is:</p>
<pre><code>$('.jtWidgetGetQuote').click(function(){
$("#map").append("<img src='http://maps.google.com/maps/api/staticmap?maptype=roadmap&amp;markers=size:mid|color:red|"+ fieldNames['origZip'] +"|"+ fieldNames['destZip'] +"&amp;size=270x170&amp;sensor=true' alt='' />")
})
</code></pre>
| javascript jquery | [3, 5] |
135,306 | 135,307 | KeyDown event is not firing second time | <p>In my masterpage, i'm having one textbox for searching purpose. if we press enterkey it is redirecting to some otherpage. But it is happening only one time. next time when i enter some text and press enter key, it is not going to the Keydown event handler.</p>
<p>Code: </p>
<p>javascript Code:</p>
<pre><code> function SearchQuestionsAndDisplay(txt, event) {
if (event.keyCode == 13) {
document.location = "BrowserAddOn.aspx?SearchString=" + escape(txt.value);
}
return false;
}
</code></pre>
<p>Text Box:</p>
<pre><code> <asp:TextBox ID="SearchTextBox" runat="server" Text="Search" AutoPostBack="true"
onkeyup = "return SearchQuestionsAndDisplay(this,event)" CssClass="searchtxtbox" />
</code></pre>
<p>Please suggest me what i need to do. pl let me know if there is anything missing in my code.</p>
| asp.net javascript | [9, 3] |
3,570,754 | 3,570,755 | How to find the Vertical size of a window displaying a web page | <p>I have an ASP.NET Site that has a single Master Page. On one of my pages in this site I display a PDF file as the content of the page.</p>
<p>I need a way to know the size that I can make the PDF control so that I do not create a scroll bar for the webpage (the PDF control has it's own scroll bar).</p>
<p>I was able to solve this horizontally by setting the width of the control to 100%. Sadly this does not work for the Vertical size.</p>
<p>Any help is appreciated.</p>
<p>Vaccano</p>
| asp.net javascript | [9, 3] |
4,962,401 | 4,962,402 | How use C# methods in JavaScript? | <p>I have C# library with some logic for my app.</p>
<p>How I can call C# methods from my web project(HTML/JavaScript/PHP/Apache)?
Maybe exists some method like using Java Applet or <code>WebView.addJavascriptInterface()</code> in Android?</p>
| c# java php javascript android | [0, 1, 2, 3, 4] |
4,547,051 | 4,547,052 | Need to get the clients machine name or his Mac address using asp.net c# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1342738/get-the-mac-of-asp-net-website-user">Get the MAC of ASP.NET website user</a> </p>
</blockquote>
<p>i am developing a local web application. I need to get the Mac id of the client PC that access the web site. The site is local so i can install some dll or library but still i need the mac address. I searched it but didn't got any solutions. Please help.</p>
| c# asp.net | [0, 9] |
3,598,657 | 3,598,658 | Make element absolute, but do not change its position on the screen | <p>I have an element that is relative positioned on the page, relative to its parent element.</p>
<p>How can I make this element absolute with jQuery.css, but without changing the actual position on the screen? It should stay in the same place, and it should be absolute relative to the document body</p>
<p>$.css('position', 'absolute') will re-position the element </p>
<p>If it can't be done, how can I change the x,y position of this element on the screen, relative to the document body (or the browser screen)?</p>
| javascript jquery | [3, 5] |
789,172 | 789,173 | Print multiple files using PHP or javascript | <p>I am working on a Job Portal Web Application. AM creating functions for Admin. That he should see three checkboxes for employee like:
1.) Html Form
2.) CV (in .doc)
3.) Certificates (could be many)</p>
<p>Admin will check the boxes, he/she want to print then click on one "Print" button. And it should print all files one after another. Please help me in this case.</p>
| php javascript | [2, 3] |
5,816,576 | 5,816,577 | How to get four following text inputs after each checkbox? | <p>I am traversing checkboxes like this:</p>
<pre><code>$('.day').each(function() {
// here I need to get the following 4 text inputs in the HTML
// and set some attributes on them
});
</code></pre>
<p>After every checkbox there are four text input fields (there are also some div, span tags for CSS around them). So inside the loop above I need to get four text input fields that follow the checkbox in the HTML source so I can set some attributes on them.</p>
<p>How would I go about that?</p>
| javascript jquery | [3, 5] |
2,282,233 | 2,282,234 | Is there a way to return a list of all the image file names from a folder using only Javascript? | <p>I want to display all images from folder located in server in image gallery.</p>
<p>Is there a way to return a list of all the image file names from a folder using only JavaScript or jquery?</p>
<p>Also I want to count no. of image files in similar folder using only JavaScript.</p>
<p>Is there any want to count no. of image files from a folder using only JavaScript?</p>
| javascript jquery | [3, 5] |
5,064,136 | 5,064,137 | Session variables vs local variables | <p>Whenever I have to store anything in the session, I have picked up the habit of minimizing the number of times I have to access the session by doing something like this:</p>
<pre><code>private List<SearchResult> searchResults;
private List<JobSearchResult> SearchResults
{
get
{
return searchResults ?? (searchResults = Session["SearchResults"] as List<SearchResult>);
}
set
{
searchResults = value;
Session["SearchResults"] = value;
}
}
</code></pre>
<p>My reasoning being that if the object is used several times throughout a postback, the object has to be retrieved from the Session less often. However, I have absolutely no idea if this actually helps in terms of performance at all, or is in fact just a waste of time, or perhaps even a bad idea. Does anyone know how computationally expensive constantly pulling an object out of the session would be compared to the above approach? Or if there are any best practices surrounding this?</p>
| c# asp.net | [0, 9] |
4,044,470 | 4,044,471 | Pop-Up with ASP.Net Button Click that is not blocked with popup blocker | <p>I currently have an ASP.Net button click event that does a few things (including change session variables) prior to registering a new startup script As is, when a user clicks the button, their pop-up blocker blocks the popup even though it was technically triggered by a user event; I imagine the browser doesn't see it that way.</p>
<pre><code>protected void ContinueButton_Click(object sender, EventArgs e)
{
if (agreement.Checked)
{
string eid = Request.QueryString["eid"];
Session["TestAgreement"] = "Agreed";
openNewWindow("Exams/exam.aspx?id=" + courseCode, "height=760, width=1000, status=yes, toolbar=no, menubar=no, location=no, scrollbars=1");
}
}
private void openNewWindow(string url, string parameters)
{
ClientScript.RegisterStartupScript(this.GetType(), "Exam", String.Format("<script>window.open('" + url + "', '', '" + parameters + "');</script>"));
}
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
5,526,277 | 5,526,278 | I'd like to detect the value chosen from a drop down, and then pass that to the page url and reload | <p>I have some javascript sorting my ul, alphabetically a-z or z-a. It works fine on page one, but if there is more than one page it ignores the list on page 2 etc.</p>
<p>So, instead of using javascript to sort the li's, I want to pass the selection back to the page's query and reload</p>
<p>here's my script, most of which is redundant now. </p>
<pre><code>var select = document.getElementById('organise');
$('#organise').change(function() {
if(select.value === 'A') {
$('.recipeTable li').sortElements(function(a,b){
var aText = $.text([a]);
var bText = $.text([b]);
return aText.toLowerCase() > bText.toLowerCase() ? 1 : -1;
});
} else {
$('.recipeTable li').sortElements(function(a,b){
var aText = $.text([a]);
var bText = $.text([b]);
return aText.toLowerCase() > bText.toLowerCase() ? -1 : 1;
});
}
});
</code></pre>
<p>So I want to detect the selected dropdown value (either A or Z) and pass that into the url and reload. I'm stuck ;-?</p>
<p>Rich :)</p>
| php javascript | [2, 3] |
4,347,910 | 4,347,911 | android If else statements | <p>So my issue is, I get a wierd sound problem (it repeats the hit sound really fast) when I use an if statement to determine if I hit the monster and lived or if I hit the monster and died. Using classic mario logic, if I land on top I live, if not then I die. I didn't have a problem until I added two different if statements. If you need more info let me know. I think my problem is how I am using the if statement.</p>
<pre><code>private void checkGhostCollisions() {
int len = ghosts.size();
for (int i = 0; i < len; i++) {
Ghost ghost = ghosts.get(i);
if (hero.position.y < ghost.position.y) {
if (OverlapTester.overlapRectangles(ghost.bounds, hero.bounds))
hero.hitGhost();
listener.hit();
} else {
if(hero.position.y > ghost.position.y)
if (OverlapTester.overlapRectangles(hero.bounds, ghost.bounds)) {
hero.hitGhostJump();
listener.jump();
break;
}
}
}
}
</code></pre>
| java android | [1, 4] |
4,332,664 | 4,332,665 | Converting between image file types in c# | <p>On my website, I'm receiving image files for upload. I accept files of type jpg, png, bmp or gif. If the user uploads a jpg, png or gif I want to save the file keeping the file type, but if the user uploads a bmp I want to convert it to a png.</p>
<p>I have a method stub like this:</p>
<pre><code>private void profileImgUpload(HttpPostedFile profileImg)
</code></pre>
<p><code>HttpPostedFile</code> has a method <code>saveAs</code>, to save the file, or else a property <code>InputStream</code> to get a stream to work with.</p>
<p>In the previous implementation, someone had written this:</p>
<pre><code>String[] allowedExtensions = { ".png", ".jpeg", ".jpg", ".gif" };
for (int i = 0; i < allowedExtensions.Length; i++)
{
if (FileExtension == allowedExtensions[i])
FileOK = true;
}
}
if (FileOK)
profileImg.SaveAs(physicalPath + "newAvatarTemp.png");
</code></pre>
<p>I have assumed that this just results in the file being saved with the name <code>newAvatarTemp.png</code>, but the actual encoding type is not changed.</p>
| c# asp.net | [0, 9] |
1,283,761 | 1,283,762 | UniqueID optimized for android device | <p>I am trying to generate a unique id for android phones and tablets. I found an interesting function but with my brand new galaxy tab 2 it does not work. Here is my function :</p>
<pre><code>public String generateId(TelephonyManager tm, ContentResolver resolver) {
final String tmDevice, tmSerial, androidId;
tmDevice = "" + tm.getDeviceId();
tmSerial = "" + tm.getSimSerialNumber();
androidId = "" + Secure.getString(resolver, Secure.ANDROID_ID);
UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
return deviceUuid.toString();
}
</code></pre>
| java android | [1, 4] |
46,407 | 46,408 | How to write the javascript function calling the asp.net button click() event in asp.net? | <p>i am writting the javascript function like this</p>
<pre><code> function PreviewImg(imgFile, labelid,frameid) {
labelid.innerHTML = imgFile.value;
document.getElementById('btnupload').click();
}
</code></pre>
<p>Above code <strong>document.getElementById('btnupload').click();</strong> is the error but firfox browser is supported but i have support IE8 , pls give me suggestion
error is <code>htmlfile: Access is denied.</code></p>
| javascript asp.net | [3, 9] |
3,726,092 | 3,726,093 | Find height of rendered/visible text | <p>I know how to get this height of a font:
<img src="http://i.stack.imgur.com/U3fL1.png" alt="enter image description here"></p>
<p>By placing the text in a div and getting offset height of the div.</p>
<p>But I would like to get this actual height (Which will depend on font family):
<img src="http://i.stack.imgur.com/yNu12.png" alt="enter image description here"></p>
<p>Is that in any way possible using web based programming?</p>
| javascript jquery | [3, 5] |
1,883,753 | 1,883,754 | ajax call with jquery | <p>I want to make an ajax call after every 1 min but the succeeding call should be made only after the preceding ajax call was completed. For example ajax call 2 should be made only after ajax call 1 is completed.
I know how to make a function execute every 1 min with setInterval.
thanks in advance</p>
| javascript jquery | [3, 5] |
1,923,769 | 1,923,770 | how to add list item through jquery in ul? | <pre><code> <ul id="content">
<li>
<label class="desc">Album Title:</label>
<div>
<input type="text" class="field text full required" name="album[title]" id="album_title" />
<?php echo form_error('album[title]', '<label class="error">', '</label>'); ?>
</div>
</li>
<li>
<label class="desc">Image</label>
<div>
<input type="file">&nbsp;&nbsp;
<a href="" id="add_row"><img src="<?php echo base_url(); ?>skin/images/add.png" /></a>
</div>
</li>
<li class="buttons">
<button id="saveForm" class="ui-state-default ui-corner-all" value="Submit" type="submit">Add</button>
</li>
</ul>
</code></pre>
<p>i want to add new <code><li></code> before last <code><li></code> for add dynamic image field(through jquery).</p>
<p>Thanks in advance
Loganphp</p>
| javascript jquery | [3, 5] |
1,428,581 | 1,428,582 | Print RTF file to default printer on client side using Jquery or javascript | <p>I am creating an <code>.rtf</code> file based on user submitted form for php web application. Until here it's fine.</p>
<p>Now I need to print this <code>.rtf</code> file on client side default printer silently without any <code>rtf</code> tags in it(print rtf file directly as it is as we have, when we open <code>.rtf</code> in MS-Word).</p>
<p>So is there any script, using javascript or jQuery to do this? Showing the printer dialog also works for me.</p>
<p>Can anyone please suggest me with examples. Thanks in advance.</p>
| php javascript jquery | [2, 3, 5] |
5,612,622 | 5,612,623 | How to upload & crop image using jquery/javascript? | <p>Friends,</p>
<p>I know how to post a form to webserivce or php page using jquery.
But can somebody tell me how to upload the image using jquery to webservice.
also i want to crop image with fixed height & width JCROP is plugin
Please can somebody suggest me guideline about how to do these things in proper manner.</p>
| javascript jquery | [3, 5] |
3,999,181 | 3,999,182 | Learn Java or C++ | <p>I am a C programmer , have no experience in JAVA. I will be taking an online course of algorithms from tomorrow but it is in JAVA . In December second week I have regionals of ACM
ICPC and for that I require to learn C++ or JAVA , and I have some experience in C++ before
as it is quite similar to C. </p>
<p>Now I am very confused, Should I learn JAVA or C++ as I can not do both. My aim is ACM ICPC but then the course would have helped me a lot. I have to learn C++ or Java as otherwise we have to program every little bit in C , so we don't have so much time in competition. Please consider my time constraint while giving your advice. I have only 3 months</p>
| java c++ | [1, 6] |
2,592,724 | 2,592,725 | Problem while inserting html control in my database in Asp.Net | <p>My problem is that I'm inserting HTML control using Server.HtmlEncode() method <code><a href=''>Apply now!</a></code> in my database through text box but whenever I'm inserting it throws an exception. </p>
<p>My Code is Here</p>
<pre><code>textbox1.text=Server.Server.HtmlEncode("`<a href=''>Apply now!</a>`");
//Database entry
obj.html=textbox1.text;
</code></pre>
| c# asp.net | [0, 9] |
2,341,840 | 2,341,841 | Show Alert Message When Input Is Too Short using jQuery | <p>I am trying to display an alert message when the input is shorter than given limit, using jQuery. Unfortunately, my code isn't working, therefore, seeking your help. </p>
<p>Here are the codes I am using.</p>
<p>HTML</p>
<pre><code><input type="textarea" name="message" id="message" row="20" col="50" />
<input type="submit" name="submit" id="submit" value="Send Message" />
</code></pre>
<p>JavaScript</p>
<pre><code><script type="text/javascript">
jQuery(document).ready(function($) {
$("input:submit[name='submit']").on("click",function() {
var msgwords = $("input:textarea[name='message']").val().replace( /[^\w ]/g, "" ).split( /\s+/ ).length;
var minwords = 10;
if (comwords < minwords) {
alert("Your Comment is too short.");
}
});
});
</script>
</code></pre>
| javascript jquery | [3, 5] |
3,248,164 | 3,248,165 | How can I overload abstract constructor in derived class | <p>I have an abstract constructor and a derived class like follows:</p>
<pre><code>abstract ab {
ab();
}
class dc {
dc();
}
</code></pre>
<p>I want to execute first the constructor of the derived class and then execute the constructor of the abstract class</p>
<p>Please give me an example.</p>
| java php | [1, 2] |
4,722,245 | 4,722,246 | How to update tuples in Javascript? | <p>(Not sure if I am using the correct terminology, in Python that is called a tuple. Hope it makes sense.)</p>
<p>I would like to refactor the following method. The only difference is the <code>enddate/startdate</code> respectively, therefore there is no need to repeat the code.</p>
<pre><code>function datepicker_reload(source, isPast){
if(isPast){
$(source).find('.date_picker').datepicker({
endDate: new Date(),
format: $('#locale').text(),
weekStart:1,
calendarWeeks:'True',
autoclose: 'True',
todayHighlight: 'True'
});
}
else{
$(source).find('.date_picker').datepicker({
startDate: new Date(),
format: $('#locale').text(),
weekStart:1,
calendarWeeks:'True',
autoclose: 'True',
todayHighlight: 'True'
});
}
}
</code></pre>
<p>I was wondering if I could put the common values as a tuple together:</p>
<pre><code>var options = { format: $('#locale').text(),
weekStart:1,
calendarWeeks:'True',
autoclose: 'True',
todayHighlight: 'True' };
</code></pre>
<p>Then add the one additional keypair in there: (However this step seems to be completely off, how do i achieve it?)</p>
<pre><code>if(isPast)
options += {endDate: new Date()}
else
options += {startDate: new Date()}
</code></pre>
<p>and then pass the whole tuple to the function:</p>
<pre><code>$(source).find('.date_picker').datepicker(options);
</code></pre>
<p>is this possible?</p>
| javascript jquery | [3, 5] |
4,970,599 | 4,970,600 | What advantages can I get from learning C++ if I'm mainly a C# Programmer? | <p>Recently I've started to notice a lot of smirks and generally rude comments whenever I mention C#. Everyone I talk to either says learn Python or learn C++. </p>
<p>Python is a nice language, I get it. But I don't find much use for it right now (<strong>for my use cases</strong>), and C++ I heard is a faster language (<em>not sure</em>). </p>
<p>So my question is this, what advantage can I get from learning C++ (<em>besides the knowledge and expansion of my horizons</em>), when I mainly program in C#.</p>
<p>If anyone can make a legitimate claim, I'll for sure look into learning the language because let's face it, I trust you guys.</p>
<p>Thanks so much for all the help.</p>
| c# c++ | [0, 6] |
1,240,345 | 1,240,346 | "Tag" (like keyword tag) multiply e-mails in input with validation | <p>I am looking for a simple jQuery script that I can call on a input field.</p>
<p><strong>When user input e-mails in the field and then presses SPACE or ENTER it should tag the e-mail.</strong></p>
<p>Very simple, but haven't been able to find such a script. Does it exist?</p>
<p>NOTE: NOT this one: <a href="http://stackoverflow.com/questions/519107/jquery-autocomplete-tagging-plug-in-like-stackoverflows-input-tags">jQuery autocomplete tagging plug-in like StackOverflow's input tags?</a> - it doesn't really suit my needs. As you can enter other values than an e-mail (no validation) and also complicated integration. I was woundering for a: onKeyUp="function()" solution, or something similar.</p>
| javascript jquery | [3, 5] |
27,599 | 27,600 | How to keep a value in JavaScript | <p>After doing an async $.ajax call, I need to highlight the table cell that was updated.<br>
Right now I'm using $td in the global name space, which of course is a wrong idea.</p>
<p>Q: How do I keep the value of $td when the jqXHR is called back? I think the answer has to do with closure, but I don't know.</p>
<pre><code>var UpdateSort = function(ID,Sort){
var jqXHR = $.ajax('Remote/Ajax.cfc', {
data: {
method:'UpdateSort'
,returnformat:'json'
,paramID:ID
,paramSort:Sort
}
});
jqXHR.success(function(result){
if (result.MSG == '') {
$td.addClass('success');
} else {
$td.addClass('err');
};
});
</code></pre>
| javascript jquery | [3, 5] |
1,446,219 | 1,446,220 | Can we make dropdownlist in asp.net automatically post back the first item in the list | <p>Here's the simple code:</p>
<pre><code>protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
{
string word = DropDownList1.SelectedItem.Text;
generateSynomyn(word);
}
</code></pre>
<p>This code is not executed when I select the first item on the index. In order to execute the code for the first item I have to select any other item first, then only the first item in the <code>dropdownlist</code>.</p>
<p>Also, can we automatically post back or at least make the <code>selectItem</code> the first item on the <code>dropdownlist</code>?</p>
| c# asp.net | [0, 9] |
5,392,459 | 5,392,460 | return a php associative array to javascript array | <p>I am trying to return a php associative array to javascript array through ajaxRequest.responseText</p>
<p>Here's what I do.</p>
<p>First in php, I do this: </p>
<pre><code>$encoded = json_encode($thisarray);
echo $encoded;
</code></pre>
<p>If I echo $encoded, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"}</p>
<p>Then in js script, </p>
<pre><code>thisarray = new Array();
thisarray = ajaxRequest.responseText;
</code></pre>
<p>If I alert thisarray, I get {"a":"apple,arrow","b":"boy,bank","c":"cat,camp"}</p>
<p>That's wrong since alerting an array should give error. But in this case, when I alert thisarray, I get the full array!!</p>
<p>Needless to say, I can't call my value out of thisarray, since it is yet defined as an array.</p>
<p>Anyone can tell me what am I missing here?</p>
| php javascript | [2, 3] |
465,790 | 465,791 | Android Activities and sub-Activities | <p><br>
I am new in Java and Android and now I have a follow problem.
I want to pass String[] str variabe from one activity to another and show list of my string.<br>
I have read <a href="http://developer.android.com/resources/tutorials/views/hello-listview.html" rel="nofollow">http://developer.android.com/resources/tutorials/views/hello-listview.html</a> tutorial .
I have DataTest extends Activity class.</p>
<pre><code>Intent myIntent = new Intent(DataTest.this, MyListAdapter.class);
myIntent.putExtra("response", str);
startActivity(myIntent);
</code></pre>
<p>When I want to open MyListAdapter extends ListActivity activity,I get an exception. </p>
<p>Therefore I create MyListAdapter extends Activity activity class and declare there </p>
<pre><code>ListActivity l = new ListActivity();
object.
if(extras !=null)
{
String[] str = extras.getStringArray("response");
}
</code></pre>
<p>But here I get error. </p>
<pre><code>l.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, str));
</code></pre>
<p>Where do I mistake ???</p>
| java android | [1, 4] |
742,677 | 742,678 | Get elements in jQuery where "x" attribute = "y" | <p>How can I change the attribute of an element, depending on another attribute?</p>
<p>For example, I have 2 <code><a></code> elements. They both have the class <code>myClass</code>. One of the elements has <code>rel="1"</code> and the other has <code>rel="2"</code>. I wish to only change the <code>z-index</code> on the one which has <code>rel=1</code>. How do I do this?</p>
<p>I've tried:</p>
<pre><code>$(".myClass[rel='1']").css("z-index", 10);
</code></pre>
<p>But it doesn't work. Cheers.</p>
| javascript jquery | [3, 5] |
973,757 | 973,758 | how we can covert a string to boolean? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/263965/how-can-i-convert-a-string-to-boolean-in-javascript">How can I convert a string to boolean in JavaScript?</a> </p>
</blockquote>
<p>I have a select list with 2 options in it, <code>yes</code> or <code>no</code>, something like:</p>
<pre><code> <select size="1">
<option value="true">yes</option>
<option value="false">no</option>
</select>
</code></pre>
<p>Now i want to use the selected value in the jquery-UI button disabled property , means :</p>
<pre><code> $("button").button({ disabled : $("select").val() });
</code></pre>
<p>Now my problem is that the value which we will get by <code>$("select").val()</code> is <code>string</code> and for</p>
<p><code>disabled</code> property we need boolean. So i want to know that is there any method just like </p>
<p><code>pareInt</code> or <code>parseFloat</code> by which we can convert a string to boolean ?</p>
| javascript jquery | [3, 5] |
332,864 | 332,865 | Errors attempting to publish a project from Visual Studio Express 2008 | <p>I am attempting to publish an application to a local intranet site, and am getting the following errors:-</p>
<pre><code>Unable to add 'ControlPanel.aspx' to the Web site. 550 ControlPanel.aspx: Access is denied.
Unable to add 'Default.aspx' to the Web site. 550 Default.aspx: Access is denied.
.
.
.
Unable to add folder 'bin' to the Web site. Cannot create folder "bin".
</code></pre>
<p>but I can connect to the location using ftp and do anything I like, using the same username and password. Does anyone know why this might be?</p>
<p>(Although I have copied the files and the new application runs I suspect doing this has wrecked the licensing of one of the components, so I'd like to be able to try the 'official' way.)</p>
| c# asp.net | [0, 9] |
3,118,641 | 3,118,642 | how to make auto Resize | <p>let say there are three column in a container, if i minimize the width of any element then adjacent element should cover the area by maximize it's width. <a href="http://jsfiddle.net/sadrana/SrJfu/6/" rel="nofollow">my live example on jsfiddle</a>
What i want :<br>
<strong><em>1. if any element resize (minimize or maximize) then adjacent element should auto adjust the width<br>
2.container has fix size and should not be change the dimension<br>
3. element must be auto fit inside the container</em></strong><br>
is there any way to use handler e.g. jQuery uses in it's layout <a href="http://layout.jquery-dev.net/demos/layout_inside_dialog.html" rel="nofollow">ui-resizable-handle</a></p>
<pre><code> <div id = "container">
<div id = "element1"> </div>
<div id = "element2"> </div>
<div id = "element3"> </div>
</div>
#element1 {width:30%; height:100;}
#element2 {width:40%; height:100;}
#element3 {width:30%; height:100;}
</code></pre>
| javascript jquery | [3, 5] |
3,876,707 | 3,876,708 | how to set a default dropdownlist selecteditem | <p>I have a login page where user enters Username(textbox), Password(textbox), and location(dropdownlist) then login. </p>
<p>On the server page, for the location dropdonwlist I have a connection string to access SQL server database to get all locations from location table and bound the data to the dropdownlist. </p>
<p>For the dropdownlist.SelectedItem, What I want to do is that once user enters Username, onChange, the default location for the particular user should be the selected location before the user clicks Login. This default location is defined by locationID(FK) in the Login table which has loginId, username, password, and locationID as its columns. I want the process of retrieving locationID (accessing a DB table) to happen on the server side, then pass the locationID to the client side where I can call a function to select a default dropdownlist item according to the locationID. What's the way to accomplish this?? Thanks</p>
<p>Programming Language C#
Database SQL Server 2005</p>
| c# javascript | [0, 3] |
2,934,650 | 2,934,651 | Read folder in website in asp.net | <p>I want a website and read all the elephants and folders.</p>
<p>A site in the taxbox when I got all the files and folders to the list of my site</p>
<p>In Asp.net</p>
| c# asp.net | [0, 9] |
2,683,496 | 2,683,497 | How to format date to match specific pattern? | <p>I need to format <strong>DateTime.Now</strong> to match this pattern <strong>Example:</strong> 10-March-2011.</p>
<p>How can I accomplish it?</p>
| c# asp.net | [0, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.