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 |
---|---|---|---|---|---|
290,729 | 290,730 | How to interpolate two values with .animate | <p>How-to, </p>
<p>Interpolate the following table in jQuery, </p>
<pre><code><tr data-value='2.000'>
</code></pre>
<p>I need to get the data-value, that is 2.000 and then interpolate it until 10.0</p>
<pre><code>var from = {property: 0};
var to = {property: 100};
jQuery(from).animate(to, {
duration: 100,
step: function() {
console.log( 'Currently @ ' + this.property );
}
});
</code></pre>
<p>What I am trying to do is I have a table value that gets updated via xml, and while I wait I want to play an animation increasing the value until the target value is reached or a new value is provided via an aml update.</p>
| javascript jquery | [3, 5] |
5,272,991 | 5,272,992 | Update information as needed | <p>On the page I have a list of HTML-elements, each element has its status: </p>
<pre><code><ul>
<li>
<span class='status'>ok</span>
<span class='content'>content1</span>
</li>
<li>
<span class='status'>not ok</span>
<span class='content'>content2</span>
</li>
<li>
<span class='status'>ok</span>
<span class='content'>content3</span>
</li>
</ul>
</code></pre>
<p>This list is very big.</p>
<p>I need to update the status (without reloading the page).</p>
<p>What are the ways to do this?</p>
<p>I wanted to use AJAX. And periodically poll the database and get out status, etc.
What could be more options?</p>
<p><strong>Update1:</strong></p>
<p>I think that the use of Ajax in this way is not very good: the status change very rarely, and a list of objects is large.</p>
| php javascript | [2, 3] |
3,222,180 | 3,222,181 | php website to aspx .net website | <p>I was working on a rewards website in php and mysql. I have almost finished everything but the client now wants the website to be in .net and not php. Most of the php coding is completed and it is not possible to start from scratch in .net and finish the whole website in 2 weeks. </p>
<p>I am good with php but not much knowledge about c# or aspx. is there any chance that i can just modify the php pages into aspx pages or create new aspx pages and re-direct? I am basically clue-less here so i need some suggestions.</p>
<p>Appreciate any help provided. </p>
| php asp.net | [2, 9] |
2,941,624 | 2,941,625 | why in firefox it is ok, but in ie8 it print 'undefined undefined'? | <pre><code><div>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
<span onmouseover="tip(event,this);">程序错误<div class="content">good</div></span><br>
</div>
<p id="vtip" style="position:absolute"><img id="vtipArrow" src="vtip_arrow.png" />testtest<span class="content"></span></p>
<script>
function tip(evt,s){
$('p#vtip').show();
xOffset = -10; // x distance from mouse
yOffset = 10; // y distance from mouse
alert(evt.pageY+' '+evt.pageX)
}
</script>
</code></pre>
<p>in firefox it is ok,
but in ie8 it print 'undefined undefined'</p>
| javascript jquery | [3, 5] |
2,754,615 | 2,754,616 | Loop through 2 arrays in jquery and combine | <p>I have 2 arrays, one with cities, and another array with ID's...
I would like to loop both, and then output some HTML</p>
<p>Right now im only looping cities, and then appending some HTML to a as following:</p>
<pre><code>if ($jq(".area").length > 0) {
var region = $jq(".hiddenFieldRegion").val();
var cityIDs = $jq(".hiddenFieldChosenAreas").val();
var strcities = $jq(".hiddenFieldChosenCities").val();
//var cities = strcities.split('|');
//Set region to be marked
if (region) {
$jq(".mapdk").attr("class", region);
}
//Appending to searchform
if (strcities) {
$jq.each(strcities.toString().split("|"), function (k, v) {
var v = v.split("|");
$jq("<option selected />").text(v[0]).appendTo("select.chosen-cities");
});
}
}
</code></pre>
<p>I would like the place where im appending to the searchform, add an attribute value, with an ID from the cityIDs array...</p>
<p>So i get some HTML like:</p>
<pre><code><option value="XXX">CityName</option>
</code></pre>
<p>Is that possible?</p>
| javascript jquery | [3, 5] |
258,927 | 258,928 | how to get property from code behind jquery variable? | <p>I want to retrieve property value in jquery function and want to set it in variable. I am trying with below code but its not working.</p>
<p>.cs file</p>
<pre><code>private string _Heading;
public string Heading { get { return _Heading; } set { _Heading = value; } }
</code></pre>
<p>.aspx</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$("#btnShowSimple").click(function (e) {
ShowDialog(false);
e.preventDefault();
var someProp = "<%= this._Heading; %>";
alert(someProp);
});
</script>
</code></pre>
<p>What should i do to retrieve property value?? Anyone have solution than please help me in this.</p>
| c# jquery asp.net | [0, 5, 9] |
1,919,209 | 1,919,210 | How to send an value from .aspx page to JavaScript file? | <p>I have these functions:</p>
<pre><code>function clear(txtvalue)
{
}
function EnableValue (txtvalue, rfvValue)
{
}
<asp:Button ID="btn1" runat="server" OnClick="btn1_Click" onclientClick =" return clear('"+txtValue.ClientID+'"); Text="Button" />
<asp:Button ID="btn2" runat="server" OnClick="Button1_Click" onclientClick ="return EnableValue ('"+txtValue.ClientID+'",'"+rfvValue.ClientID+'")"; Text="Button" />
</code></pre>
<p>I have two functions where I am trying to send an value from my .aspx page (button)
to a JavaScript file.</p>
<p>I get an error telling server tag is not well formed.</p>
<p>What is the issue here?</p>
| asp.net javascript | [9, 3] |
1,219,113 | 1,219,114 | How to get feedback to a page from a running thread in ASP.NET? | <p>So I have this interface that is just one big GO button that syncs a bunch of data from one tool to another. The problem is it takes a really long freaking time and some users are left wondering whats the deal. So I am wondering if there is a way that I can put something in my loop so that every so many entries it sends something back to the page to update them on the progress.</p>
<p>Currently it is just an .aspx page with an aspx.cs behind it. The Go button fires off the whole process and it calls Response.Write a ton of times (as well as writing the same thing to a log file I made) but the Responses don't show until the entire thing is done.</p>
<p>Please advise.</p>
| c# asp.net | [0, 9] |
4,555,106 | 4,555,107 | Error: No class definition found | <p>I have added jars with the below procedure:</p>
<ol>
<li>Right-click on the project in Eclipse and select “Build Path -> Add Libraries…”.</li>
<li>Select User Library from the list and click Next.</li>
<li>Click the “User Libraries…” button.</li>
<li>Click “New…” in the User Libraries dialog.</li>
<li>Give the user library a name and select the System library checkbox and click OK.</li>
<li>Highlight the newly added user library in the list and click the “Add JARs…” button and add the desired jar files.</li>
<li>Click OK on the User Libraries dialog.</li>
<li>Make sure the new user library is checked in the Add Library dialog.</li>
</ol>
<p>After running the application it is saying that "<code>No class definition found</code>" and "<code>could not find the class</code>" errors.</p>
| java android | [1, 4] |
2,954,903 | 2,954,904 | form jquery prevent default | <p>I want to prevent the form from submitting, but execute other form handlers, preventDefault stops all.</p>
<p>here's an example:</p>
<pre><code><form id="example">
<input type="text" name="name" />
</form>
<form id="example2">
<input type="text" name="name2" />
</form>
/* generic form handling */
$('form').submit(function(e) {
alert('hello');
});
/*
specific example
i want this handler to prevent the form from submitting normally, but at the same time, i want it to execute the above code with the alert "hello"
*/
$('form#example').submit(function(e) {
e.preventDefault(); // this stops the generic form handling (above) and standard form submission
});
</code></pre>
| javascript jquery | [3, 5] |
5,768,323 | 5,768,324 | Python and Android apps | <p>I've been using Python for about a year now and would love to start writing some Android apps using Python.</p>
<p>I've been researching both Kivy and SL4A and I'm a little confused about something.</p>
<p>When you develop an Android app using Python and one of the above, does the user of the Android device need to download anything special in order to run? Or is it all transparent to the user?</p>
<p>Thanks</p>
| android python | [4, 7] |
4,436,964 | 4,436,965 | Trying to remove characters at the end of a string in three p elements using the same class | <p>Looking to be able to use a class instead of an ID as I have three p elements that I need to remove 1- characters from. Any thoughts would be much appreciated. Initial reply thanks to Tim Down (and due to my very ropey explanation of what my problem was - shown below) I'm sure this is much easier than I know! Thanks.</p>
<pre><code><p id="test"> Nice text in here </p>
var textNode = document.getElementById("test").firstChild;
textNode.data = textNode.data.slice(0, -10);
</code></pre>
| javascript jquery | [3, 5] |
5,490,377 | 5,490,378 | getting intellisense to show properties in markup for a custom server control | <p>I have a custom control that inherits from <strong>UserControl</strong>, and I can't get it's properties to show in intellisense. For example, I have a property:</p>
<pre><code>public string Title;
</code></pre>
<p>but if I start typing:</p>
<pre><code>ff:myControl Tit...
</code></pre>
<p>Nothing shows up (like I think it should). I have tried adding attributes like <strong>Browsable</strong>, <strong>EditorBrowsable</strong>, etc, but nothing is seeming to work - what am I forgetting?</p>
| c# asp.net | [0, 9] |
553,020 | 553,021 | UserControl pass Value to MasterPage Content | <p>I am coding in a userControl, </p>
<p>how can I pass text to a control I placed in one of the contents?</p>
<p>It's a literal by the way</p>
<p>Thank you</p>
| c# asp.net | [0, 9] |
3,689,130 | 3,689,131 | What is the most cheap way to mix `this` and other selectors in JQuery | <p>what is the best way to mix <code>this</code> with other selectors in JQuery <code>:filter</code>,<code>[id=""]</code> and stuff like this, lets assume we wanna read <code>.val()</code> of an input with <code>name="input"</code> in form with that function is bind to it. </p>
<p>and if possible do they cost different ? if so why ?</p>
<p>here is the form </p>
<pre><code><form>
<input type="text" name="input">
</form>
</code></pre>
<p>like we have this </p>
<pre><code> $("form").submit(function(){
if($(this).valid() == true){ //here i wanna read the value of input with name test}
</code></pre>
| javascript jquery | [3, 5] |
4,168,134 | 4,168,135 | Simple JQuery click-and-show doesn't work | <p>I'm using this simple bit of JQuery to show/hide a div by clicking on the link, I've used the same code a few times before and it worked perfectly but now all of a sudden it refuses to work.</p>
<p>JQuery is properly included and the page doesn't give a Javascript error (or any other error for that matter).</p>
<p>JQuery:</p>
<pre><code><script type="text/javascript">
$(function() {
$('#addnew').css('display', 'none');
$('#shownew').click(function() {
$('#addnew').toggle();
return false;
});
});
</script>
</code></pre>
<p>HTML (link):</p>
<pre><code><a href='#' id='shownew'>Add News Item</a>
</code></pre>
<p>HTML (div):</p>
<pre><code><div id="addnew">
<form id="new_news" enctype="multipart/form-data" action="news.php" method="post">
Title:
<br/><input type="text" name="title" id="title" />
<p>Image (optional, will be shown after first paragraph)
<br/><input type="hidden" name="size" value="2000000"><input type="file" name="photo">
<p>Article body:
<br/><textarea cols='40' rows='5' maxlength='5000' name='body' id='body'></textarea>
<p><input type="submit" name="submit" id="submit" value="Submit" />
</form>
</div>
</code></pre>
<p>What could I possibly be missing here? As you see from the JQuery, the div is hidden to begin with. When I remove the line that says <code>$('#addnew').css('display', 'none');</code> the div is displayed correctly, but the link still doesn't toggle it on and off.</p>
| javascript jquery | [3, 5] |
4,515,196 | 4,515,197 | Android compatibility, how to use view attributes that only work on newer versions? | <p>I'm sure this is an "easy" question, but I'm totally new to android and java.
Basically there are certain attributes that have been changed on later versions eg:</p>
<pre><code> android:configChanges="keyboardHidden|orientation"
</code></pre>
<p>(older)</p>
<pre><code> android:configChanges="keyboardHidden|orientation|screenSize"
</code></pre>
<p>(newer)</p>
<p>What happens to older versions if I use the second option? Would they work correctly or not?</p>
| java android | [1, 4] |
1,808,925 | 1,808,926 | clearly length is important - javascript length issue | <p>I am trying to show a div if the length of a string from a db call is not 0</p>
<p>So, to test, I'm trying:</p>
<pre><code>html += '<div class="item_image"> price '+image.item_price;
</code></pre>
<p>Which will print within div item_image something like:</p>
<pre><code>price $10
</code></pre>
<p>So, to show a div I want to because the price field is not empty I'm trying:</p>
<pre><code>if(image.item_price.length>0){ // price
html += '<div class="price_holder">'+image.item_price+'</div>';
} // price
</code></pre>
<p>But it does not show the div, it's as if it's is not reading the length correctly, is there a better way to do this?</p>
| javascript jquery | [3, 5] |
5,583,524 | 5,583,525 | jQuery: I have a class, I'm iterating it with each. The result is different each turn. How to use the this and access the value? | <p>I'm a beginner and this is my first time encountering problem like this.</p>
<p>I'm iterating a class using the each method provided by jQuery. The page have many class with the same name. So we can expect that it may be 15 iterations.</p>
<p>Each iteration have different value.</p>
<pre><code>$(".book").each(function(n) {
var result = $(this
</code></pre>
<p>I have to get the last TD with the value List. So my option is to use </p>
<pre><code>$(".book tbody tr:last")
</code></pre>
<p>But I think this thing wouldn't work in the each environment because it won't know which context it is currently processing.</p>
<p>The $(this tbody tr:last) wouldn't work also. How can I devised a selector that will work?</p>
<pre><code><div class = "book">
<p class = "chapter">
<table>
<tbody>
<tr>
<td>General</td>
<td>
<b>Buck</b>
</td>
</tr>
<tr>
<td>General</td>
<td>List</td>
</tr>
</tbody>
</table>
</p>
</div>
</code></pre>
| javascript jquery | [3, 5] |
4,946,213 | 4,946,214 | Select elements whose children don't contain specific elements in jQuery | <p>I want to select all divs on a page whose children <strong>don't</strong> contain an element with a specific class. </p>
<p>I can select elements whose descendants <strong>do</strong> contain the class with: </p>
<pre>
$('div').has('.myClass');
</pre>
<p>So I just want the inverse of this. </p>
| javascript jquery | [3, 5] |
2,387,252 | 2,387,253 | checking whether data is null | <p>Is it best practice to check whether a value is null coming from a database even though there are constraints on the column which disallow nulls.</p>
<p>Thanks in advance</p>
| c# asp.net | [0, 9] |
915,288 | 915,289 | looping through elements in jquery | <p>I've got a page with bunch of drop downs and each drop down has a button next to it. When the page initially loads I want all the buttons to be disabled and if there is a change to a specific drop down then its corresponding button shall be enabled. </p>
<p>I've got the following code down for this but I need to know how to loop through all the drop downs and buttons so I can generalize it. </p>
<pre><code>$(document).ready(function () {
//disable all buttons
function disableAllButtons () {
$(':input[type=button]').attr("disabled", "true");
}
disableAllButtons();
//enable button when drop down changes
$(':input[name=sNewPKvalue1]').focus(function() {
disableAllButtons();
$(':input[name=Update0]').removeAttr("disabled");
})
//enable button when drop down changes
$(':input[name=sNewPKvalue2]').focus(function() {
disableAllButtons();
$(':input[name=Update1]').removeAttr("disabled");
})
////.....question?
});
</code></pre>
<p><strong>Question</strong></p>
<p>If I have 12 dropdowns and 12 buttons</p>
<p>How do I loop through all the drop downs with name <code>sNewPKvalue[1-12]</code> and all the buttons with name <code>Update[0-11]</code></p>
| javascript jquery | [3, 5] |
4,209,454 | 4,209,455 | ASP Query String From DropDown | <p>I have a webpage: <strong>Menu.aspx</strong>, where I have the following controls of relevance: </p>
<ul>
<li>a DropDownList with some values</li>
<li>a hyperlink, which redirects me to a page called Edit.aspx.</li>
</ul>
<p>In my <strong>Edit.aspx</strong> page, I have a cancel button, which redirects the user back to the Menu page</p>
<p>What I would like to do is when my user clicks on the hyperlink to go to the Edit page,index of the DropDownList is preserved in a query string In my <strong><em>Menu.aspx</em></strong> page I have the following aspx code, but I am not sure how to proceed</p>
<pre><code><asp:HyperLink
ID="lnkEdit"
NavigateUrl='<%# "Edit.aspx?" + Eval("UserID") + ...not sure... %>'
</asp:HyperLink>
<asp:DropDownList
ID="myDropDown"
...some <asp:ListItems/>
</asp:DropDownList>
</code></pre>
<p>EDIT: Clarified why Im using NavigateURL. Because my query string already does an Eval to determine the user ID.</p>
| c# asp.net | [0, 9] |
2,140,209 | 2,140,210 | I want to go the previous MENU whenever I press the physical back button on my droid, could someone guide me through that ? | <p>This is my Function that dynamically create menu from a parsed XML, now I want that when I press the physical back button it should move to the previous menu.
I have read a lot of articles on this but still haven't find a single for going back in Menus.</p>
<pre><code>public int create_menu(int level_n){
int lv=level_n;
if(flag){
base=0;
}
else{
base=lv-1;
}
ctr=true;
if(e[lv].getType().equals("menu")){
flag=false;
subm[lv]=subm[base].addSubMenu(0, lv, 0, e[lv].getName());
lv++;
for(int i=0;i<noChild[lv-1];i++){
if(e[lv+i].getType().equals("menu")){
create_menu(lv+i);
Log.i(TAG,"number= "+i);
flag=false;
}
else if (e[lv+i].getType().equals("action")){
if(ctr){
Log.i(TAG,"going to else"+e[lv].getName()+" " +i);
subm[lv]=subm[lv-1+i].addSubMenu(0, lv+i, 0, e[lv+i].getName());
//Log.i(TAG,"element = "+e[lv+1].getType() );
lv++;
create_menu(lv);
ctr=false;
}
flag=false;
}
}
flag=true;
}
else if(e[lv].getType().equals("action")){
if(flag==true && ctr==true)
{
subm[lv]=subm[base].addSubMenu(0, lv,0, e[lv].getName());
lv++;
}
else if(flag==false && ctr==false){
subm[lv]=subm[base-1].addSubMenu(0, lv, 0, e[lv].getName());
lv++;
}
}
return lv;
}
</code></pre>
| java android | [1, 4] |
448,407 | 448,408 | Stoping a link from executing it's href path | <p>Hi I am trying to stop a link from executing it's default action , but I seem to have no luck.Here is my code:</p>
<pre><code> $("a.delete").on("click", function (e) {
var container = $("#lightbox-background");
var lightbox = $("#lightbox");
lightbox.init("Are you sure you want to delete this book?")
e.preventDefault();
});
var lightbox = {
init : function(actionString){
$("<div id='lightbox-background'></div>").appendTo("body");
$("<div id='lightbox'></div>").appendTo("body");
$("<p></p>").appendTo("#lightbox");
$("<a href='#' id='ok'>OK</a>").appendTo("#lightbox");
$("<a href='#' id='cancel'>Cancel</a>").appendTo("#lightbox");
}
}
</code></pre>
<p>I hoped that if I used e.preventDefault it would stop the link from from going to it's href path but it did not work.Am I doing something wrong?</p>
<p><strong>EDIT:</strong> I just noticed that if I remove the call for the lightbox object from the click event handler the e.preventDefault() works.</p>
| javascript jquery | [3, 5] |
644,340 | 644,341 | Targetting dynamic text inside paragraph | <p>I have some contact information, in which I wish to wrap the telephone number in a <code><a></code>, with the number in the href, for smartphone support.</p>
<p>The initial markup:</p>
<pre><code><p class="myClass">
<a href="mailto:[email protected]">[email protected]</a><br />
Phone: 88 88 88 88<br />
Fax: 88 88 88 87<br />
</p>
</code></pre>
<p>Now, the markup will remain the same, however the numbers and addresses will change. Therefore, my first idea was to start an anchor after "Phone", and close it before the second break tag, then get that value and stick it in the href. Sadly, it doesn't work that way, as the tag is closed immediately.</p>
<pre><code>$("p.myClass:contains('Phone')").each(function(){
var org = "Phone: ";
var rep = "Phone: <a>";
$(this).html( $(this).html().replace(org, rep) );
$("</a>").insertBefore("p.myClass:contains('Phone') br:nth-child(3)");
});
</code></pre>
<p>So what I really want to end up with, is to have the phone number wrapped, like so:</p>
<p><code>Phone: <a href="tel:{number}">{number}</a></code></p>
<p>,where {number} is a dynamic value, and the rest of the markup remains the same. I'm looking for a solution that actually works, and which preferably cleaner than the mess I made above. :) Any ideas?</p>
| javascript jquery | [3, 5] |
4,079,306 | 4,079,307 | jquery strange flickering on mouseover/out | <p>The HTML:</p>
<pre><code><div id="timerList">
...
<li rel="project" class="open">
<a class="" style="" href=""><ins>&nbsp;</ins>Project C</a>
</li>
...
</div>
</code></pre>
<p>The javascript/jquery:</p>
<pre><code>$('#timerList li[rel="project"]').mouseover(function(){
$('a:first',this).after('<span class="addNew"><a href="#">Add Timer</a></span>');
}).mouseout(function(){
$('.addNew',this).remove();
});
</code></pre>
<p>When I hover my mouse over an li element, a span.addNew element is created within</p>
<p>THE PROBLEM:
When I put my mouse ofer the span.addNew, it flickers on and off. Perhaps the mouseout event is firing, but I don't understand why it would or how to prevent it.</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
2,177,600 | 2,177,601 | Change HyperLink Url using js or JQuery? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/179713/how-to-change-the-href-for-a-hyperlink-using-jquery">How To change the HREF for a Hyperlink using jQuery</a> </p>
</blockquote>
<p>I have to change to Class="zz1_TopNavigationMenu_1 ms-topnav zz1_TopNavigationMenu_3 ms-topnavselected zz1_TopNavigationMenu_9" href ? </p>
<pre><code><td onmouseover="Menu_HoverRoot(this)" onmouseout="Menu_Unhover(this)" onkeyup="Menu_Key(this)" id="zz1_TopNavigationMenun0"><table class="ms-topnav zz1_TopNavigationMenu_4 ms-topnavselected zz1_TopNavigationMenu_10" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="white-space:nowrap;"><a class="zz1_TopNavigationMenu_1 ms-topnav zz1_TopNavigationMenu_3 ms-topnavselected zz1_TopNavigationMenu_9" href="/personal/3319994/Blog/default.aspx" accesskey="1" style="border-style:none;font-size:1em;">Home</a></td>
</tr>
</table>
</code></pre>
<p>Thanks in advance</p>
| asp.net javascript jquery | [9, 3, 5] |
5,771,178 | 5,771,179 | How to check if image is loaded? | <p>Is it possible somehow to check is image loaded without function .load() or onLoad? Problem is that the webkit-like browsers doesn't work properly with this function.</p>
<p><strong>UPDATE:</strong>
Problem is in <a href="http://en.wikipedia.org/wiki/Motion_JPEG" rel="nofollow">http://en.wikipedia.org/wiki/Motion_JPEG</a> - load fires only once otherwise stream is going and loading new images. </p>
| javascript jquery | [3, 5] |
4,049,986 | 4,049,987 | How can i solve the error of 'var' in ASP.Net C#? | <pre><code>protected void Button1_Click(object sender, EventArgs e)
{
var query2 = from cm in DC.custMasts where cm.custCity == TextBox1.Text.Trim()_ select cm.custName, custCity, custCompany;
GridView1.DataSource = query2 ;
}
</code></pre>
<p>I'm getting error </p>
<blockquote>
<p>CS0819: Implicitly-typed local variables cannot have multiple declarators</p>
</blockquote>
<p>How can i solve this error?</p>
<p>EDIT :: Thank you guys, it worked and error disappeared.</p>
| c# asp.net | [0, 9] |
5,778,014 | 5,778,015 | Get substring from a string | <p>I want to get the substring from a string when i ll give the part of the string ...</p>
<p>For example : I have the string "Casual Leave:12-Medical Leave :13-Annual Leave :03".</p>
<p>Partial code is here: </p>
<pre><code> Label label1 = new Label();
label1.Text = (Label)item.FindControl(Label1); //label1.Text may be casual Leave or medical leave or others...
if (label1.Text == substring(the given string ))
{
//suppose label1.Text ="Casual Leave" means i put 12 into the textbox
TextBox textbox = new TextBox();
textbox.Text= //corresponding casual leave value //
}
</code></pre>
<p>what i do?</p>
| c# asp.net | [0, 9] |
2,690,715 | 2,690,716 | how to pass database values in jquery? | <p>Am having several boxes(more than 100) that will create dynamically with</p>
<p>Now on each clicking of the box i should slide in one pop up box without page refresh.I downloaded jquery UI(http://jqueryui.com/demos/dialog/#option-position) and used in my project.Now I want to pass the company id on each click of the box to get the details from database.if I click window 5 the company id 5 should pass the get all the other details of the company inside the dialog.</p>
<p>jquery code:</p>
<pre><code><script type="text/javascript">
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function () {
$("#dialog").dialog({
autoOpen: false,
show: "slide",
hide: "explode"
});
$("div[id *= 'window']").live('click', function (e) {
$("#dialog").dialog("open");
return false;
});
});
</script>
</code></pre>
<p>Asp.net code</p>
<pre><code><div id="dialog" title="Basic dialog">
<div><%#Eval("comp_name")%> </div>
<div><%#Eval("comp_city")%> </div>
</div>
</code></pre>
| jquery asp.net | [5, 9] |
3,802,878 | 3,802,879 | Closing lightbox permanently for a user on close button click | <p>I am using a jquery plugin ( lightbox) on my asp.net page(http://www.ericmmartin.com/projects/simplemodal/#demo). This lightbox loads a page using Iframe in this lightbox. this lightbox has an image for closing popup.</p>
<p></p>
<p>I want that when user clicks this image and loads page again then this pop up doesn't appear. Right now popup appears on each time user hits F5. I guess I need to use cookies with JS/Jquery but not exactly sure.</p>
| javascript jquery asp.net | [3, 5, 9] |
3,209,098 | 3,209,099 | Check between a tag for empty with jQuery | <p>I want check between a tag if empty was between it append a text, How is it?</p>
<p>Example: if empty was between tag <code><span></span></code> append phrase <code>There is not</code> between <code>.exist</code>.</p>
<p></p>
| javascript jquery | [3, 5] |
5,369,231 | 5,369,232 | Comparing dates Java Script | <p>I have the following scenario that I am strugling to code.</p>
<p>I have a valuation date that is a string that is chosen by a user from a calander popup. What I need to do is take that date and pass it into a function that works outs a second date depending on the value of that date. If the first date is more than 7 days from the first day of the month use the first day of the month else use the last day of the month. This needs to happen in client side as this date need to be displayed after they have chosen the first date.</p>
<p>SO far I have the below:</p>
<pre><code>Function CompareDate()
{ var date1 = document.getElementById("textbox1");
var x = new date();
var year = x.getYear();
var day = x.getDay();
var thisMonthFirstDay = new Date(year, month,1)
var thisMonthLastDate = ....
var 1day = 1000*60*60*24
var date1_ms = recdate
var date2ms = thisMonthFirstDay.gettime()
if(Math.round(difference_ms/1day) > 7
{var textbox = document,getelementbyid("textbox2");
textbox.value = texbox.value + thisMonthLastDate
}
else
{
textbox.value = texbox.value + thisMonthFirstDay }
}
</code></pre>
<p>Any examples of how this can be done would be greatly appeciated.
Cheers</p>
| javascript asp.net | [3, 9] |
1,364,883 | 1,364,884 | EditItem in ListView - doesn't load edit template | <p>Howdy,
I don't know if it is a known issue - but when I click on the Edit button once - the server reloads the listview - when I click on the edit button once again I receive the EditTemplate and I'm able to edit the list view ... is this is a known behaviour?</p>
<p>Furthermore: The c# behind is working through the full editing cycle ( loads the special editing data ) - but I still only see the usual "view".</p>
<p>//Added some meat to the question</p>
<pre><code>public void test_ItemEditing(Object sender, ListViewEditEventArgs e)
{
// returns the current key
DataKey currentDataKey = speiseplanListView.DataKeys[e.NewEditIndex];
// fetches the information - for the whole plane
DataTable speiseplan = getSpeiseplan(0);
DataTable preisgruppen = getPreisgruppen();
extractTags(speiseplan);
extractPreise(speiseplan, preisgruppen);
speiseplanListView.DataSource = speiseplan;
speiseplanListView.DataBind();
}
</code></pre>
<p>This is the edit function - which gets called once the user presses the "edit" button --- it's completed on both tries .. however only the second try returns the "EditItemTemplate".</p>
<p>The page_load function is rather unnecessary for the edit event - since the edit event is a postback event - so the page load gets skipped in both cases.</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] == null)
{
FormsAuthentication.SignOut();
FormsAuthentication.RedirectToLoginPage();
Session.Abandon();
}
else
{
this.kantinenID = Convert.ToInt32(Request["id"]);
this.userID = Convert.ToInt16(Session["USERID"]);
if (IsPostBack == false)
{
try
{
switch (Request["action"])
{
...
}
}
catch (System.FormatException ex)
{
...
}
}
}
}
</code></pre>
| c# asp.net | [0, 9] |
5,818,725 | 5,818,726 | AJAX function $(div).html not replacing content | <h2>problem</h2>
<p>My div <code>#project_log_ajax</code> should tell me the number of ajax request taken at current time.</p>
<p>For debugging reasons I change that <code>projekt_ajax_counter</code> in the html each time.
I use <code>'start'</code> at the beginning of the request and <code>'end'</code> at the end.</p>
<p>The only thing it writes in my div is <code>'start'</code>. It won't show me the content that I replace it with the first time.</p>
<p>If I copy it into my debug console, the div gets the correct content. As you can see in my console output it only shows me the logs no warnings/errors.</p>
<h2>counter.js</h2>
<pre><code>var project_ajax_counter = 0;
function project_ajax()
{
...code...
console.log(project_ajax_counter);
project_ajax_counter++;
console.log($('#project_log_ajax'));
console.log('wait');
$('#project_log_ajax').html('start');
//ajax
var data = $.ajax({
type: "POST",
url: url,
data:DataString ,
async: false
});
//counter -1
console.log(project_ajax_counter);
project_ajax_counter--;
$('#project_log_ajax').html('end');
console.log($('#project_log_ajax'));
...code...
}
</code></pre>
<h2>Javascript function same code twice - console output ##0</h2>
<pre><code>0 counter.js:22
[<div>, context: #document, selector: "#project_log_ajax"]
counter.js:24
wait counter.js:25
1 counter.js:38
[<div>, context: #document, selector: "#project_log_ajax"]
counter.js:41
0 counter.js:22
[<div>, context: #document, selector: "#project_log_ajax"]
counter.js:24
wait
and so on
</code></pre>
| javascript jquery | [3, 5] |
5,928,316 | 5,928,317 | Is there a work around to cast an object from a DataKeyArray to a String in ASP.Net? | <p>I'm trying to cast an object from a DataKeyArray to a String and I get the following error: </p>
<p><code>Cannot convert type 'System.Web.UI.WebControls.DataKey' to 'string'</code></p>
<p>Is there someone to work around this problem. Here is my code that is producing the error:</p>
<pre><code>int index = (int)GridView1.SelectedIndex;
HttpContext.Current.Session["Order"] = (String)GridView1.DataKeys[index];
Response.Redirect("Test.aspx");
</code></pre>
| c# asp.net | [0, 9] |
4,282,224 | 4,282,225 | change Width Gridview While containing 100 words; | <p>change Width Gridview While containing 100 words;</p>
<pre><code>gridInbox.Rows[i].Cells[4].Wrap = false;
gridInbox.Rows[i].Cells[4].Width = 10;
</code></pre>
<p>does not work;</p>
| c# asp.net | [0, 9] |
1,409,253 | 1,409,254 | How to solve this simple jQuery issue? | <p>I'm new to jQuery and JavaScript in general. I noticed that if you insert an element via jQuery into the DOM and try to perform an action on that element later, it fails. For example:</p>
<p>I am adding a class of "listenToField" to all the input elements on the page:</p>
<pre><code>$(function() {
$('input').addClass('listenToField');
});
</code></pre>
<p>Then when I add the second function:</p>
<pre><code>$(function() {
$('input').addClass('listenToField');
// second function
$('.listenToField').keydown(function() {
alert('Hi There')
});
});
</code></pre>
<p>It does not alert 'Hi There'.</p>
<p>However if I hardcode the class "listenToField" into the HTML inputs, the alert works. How can I still have it work when jQuery inserts the class dynamically without resorting to hard coding?</p>
| javascript jquery | [3, 5] |
3,501,971 | 3,501,972 | Delete a line in file (Android/java) | <p>In my app (Android) I create a file. To this file I add a line by line after some situation. Then I send a data to the server line by line. When all transmission is OK I erase the file, like this:</p>
<pre><code>fos_kasowanie_pliku = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos_kasowanie_pliku.write("".getBytes());
fos_kasowanie_pliku.close();
</code></pre>
<p>Can I delete only 1 line (first one) after sending this to the server?
I read that I should rewrite the file without this line. Is there a better solution?</p>
| java android | [1, 4] |
267,349 | 267,350 | jquery dynamic id | <p>i use such code to access item </p>
<pre><code>function f(id){
$("#"+id).val(); // with analogy $("#id item")
}
</code></pre>
<p>is it correct? is any other methods?</p>
| javascript jquery | [3, 5] |
5,511,731 | 5,511,732 | How to get "this" form content by name? | <p>In the following example I get <code>title</code> from <code>this</code> form using html <code>id=title</code>.</p>
<p>How do I do the same, but instead of using ID then using name?</p>
<pre><code>$(document).ready(function(){
$('form').live('submit', function(){
var aform = $('form[name="create_form"]');
// get the entire form
var form = $(this);
// get form title field by ID
var title = this.elements.title.value;
// get selected radio button using name instead if ID
var type = $(this).find('input:radio[name="ctype"]:checked').val() || '';
alert(title);
</code></pre>
<p>In the case of the radio button, is it gotten by name, but I can't figure out how to translate that syntax to a normal form field of</p>
<pre><code><input name="title" id="55544_title" type="text" />
</code></pre>
| javascript jquery | [3, 5] |
139,621 | 139,622 | Converting a string to a class name | <p>I have a string variable that represents the name of a custom class.</p>
<p>Ex: string s = "Customer";</p>
<p>I will need to create an arraylist of customers. So, the syntax needed is:</p>
<pre><code>ArrayList<Customer> cust = new ..
</code></pre>
<p>How do I convert the string s to be able to create this arraylist on runtime?</p>
| c# asp.net | [0, 9] |
2,007,514 | 2,007,515 | jquery fadeout not a solution | <p>With code below I'm fading some divs, but when I reload the page, the divs are visible again. I don't want that to happen; what I need is that if user clicks a back button or the home link, it should go back to the original format, otherwise the divs must be kept hidden when the page is reloaded.</p>
<pre><code>$(document).ready(function () {
$("#prodoneid").click(function () {
$("#sliderid, .prodcls").fadeOut(250);
});
});
</code></pre>
<p>below is my html code
</p>
<pre><code> <div id="prodoneid" class="prodcls"> <img src="images/zara/thumbnails/1.png" alt="ZARA"/> </div>
<div id="prodtwoid" class="prodcls">
<img src="images/zara/thumbnails/2.png" alt="ZARA"/>
</div>
<div id="prodthreeid" class="prodcls">
<img src="images/puma/thumbnails/1.png" alt="PUMA"/>
</div>
<div id="prodfourid" class="prodcls">
<img src="images/hermes/thumbnails/1.png" alt="HERMES"/>
</div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
5,826,638 | 5,826,639 | computer name of user along with ip address | <p>hi i am trying to get the ip address and computer name of my users . i am able to get ip address but computer name i am not getting , i tried these codes. </p>
<pre><code>$ip=$_SERVER['REMOTE_ADDR'];
gethostbyaddr($_SERVER['REMOTE_ADDR']);
$_ENV['COMPUTERNAME'];
</code></pre>
<p>except ip address nothing worked for me. i want to get the client computer name</p>
<p>i want to submit these ip address and computer name in my server.or is there any better way to identify the returning visitor as ip address keep on changing every hour for most of the users . i want to count how many times a user from a particular pc is coming to my website</p>
| php javascript | [2, 3] |
4,684,746 | 4,684,747 | trigger an event when an element reaches a position on the screen | <p>I would like to trigger some functions according to a position of an element. This element's position changes every tenth second. There is two dozens functions to trigger.</p>
<p>I thought about this pseudo-code :</p>
<pre><code>When element position changes{
Loop through all the coordinates to see if a function can be triggered{
if the current element position matches the function's triggering position
execute the function
}
}
</code></pre>
<p>But looping through all possible position each split seconds burdens the browser. So if there is a way to have events to do that.</p>
<p>Is it possible ?</p>
<p>Edit:
After Beetroot-Beetroot comment, I must say that the element that moves only moves on an X abscissa : so just one dimension.</p>
<p>It's much like a horizontal timeline moving from left to right, where some animation happen when a certain year is reached.
However the moving speed can be increased by the user, so fixed time to trigger animation is not an option.</p>
| javascript jquery | [3, 5] |
4,014,384 | 4,014,385 | jquery getting index of selected checkbox | <p>I have some HTML like this:</p>
<pre><code><div id="Myclass">
<div class="Wrapper">
<input type="checkbox" class="SomeCheckboxClass">
<input type="checkbox" class="SomeCheckboxClass">
<input type="checkbox" class="SomeCheckboxClass">
</div>
<div class="Wrapper">
<input type="checkbox" class="SomeCheckboxClass">
<input type="checkbox" class="SomeCheckboxClass">
<input type="checkbox" class="SomeCheckboxClass">
</div>
</div>
</code></pre>
<p>I want to find the index of a the selected textbox, if any.</p>
<p>For now, I wrote this:</p>
<pre><code>$('#MyClass .Wrapper').each(function () {
Index = 0;
$(this).find('.SomeCheckboxClass').each(function () {
if ($(this).attr('checked')) {
Index = $(this).index();
}
});
SomeFunction(Index);
});
</code></pre>
<p>Is there a better way to do this?</p>
<p>Thanks.</p>
| javascript jquery | [3, 5] |
1,530,289 | 1,530,290 | jquery Show and Hide the picture by number of question? | <p>Hey I have 10 ten image in a div(name is background).. and display properties is none..</p>
<p>I want to show by questions number.. I mean Question=1 img1.hide(),img2.show() Question=2 img2.hide(); img3.show ............ question 10 img9.hide() img10.show</p>
<p>my function name is resim() and it callback from Button click</p>
<p>function resim(question) This is wrong right :) Actually this is wrong.. it doesn't work :))</p>
<pre><code>var i=0;
while (i<3)
{
if (question==i)
{
$("#background img").eq(i-1).hide();
$("#background img").eq(i).show();
i++;
}
else
{
return;
}
}
</code></pre>
<p>but I cant do the function... How must it be? Sorry about my english</p>
| javascript jquery | [3, 5] |
5,580,143 | 5,580,144 | jquery - Block specific links before a page fully loads and binds click events | <p>I have a modal dialog plugin written in jquery, that binds to the click event of all of the <a> elements with a specific class.</p>
<p>The modal dialog 'fetches' a page via AJAX, which is declared under the 'href' parameter of the <a> element.</p>
<p>Everything works fine, but - when a user clicks the <a> link before the page was fully loaded and ready (before the click event is binded to the element) - the browser navigates to the page declared in the 'href' parameter.</p>
<p>Any ideas of how to prevent this behavior? An ideal situation would be to ignore clicks on these elements before the page has fully loaded. Client-side performance is crucial.</p>
| javascript jquery | [3, 5] |
4,984,072 | 4,984,073 | How to execute FB client on different Android devices? | <p>I have a naive problem, but I confused: I have made application which uses Facebook SDK, and it works good on my device and emulator, and it doesn't work on customer's device. He doesn't get any error or exceptions - when he press button for authorize he will see "loading" message, but progress bar will be closed, and authorization will be canceled. What problem is it? Thank you for anything hints</p>
<pre><code> private void submitExec() {
/* if (SQLiteDbWrapper.getInstance().getBookCount()==0) {
Toast.makeText(this, "A list of books is empty", Toast.LENGTH_LONG).show();
return;
}*/
SQLiteDbWrapper.getInstance().makeFacebook(this, this.getApplicationContext());
if (SQLiteDbWrapper.getInstance().getConnector().getFacebook().isSessionValid()) {
//new SubmitClass().execute();
}
else {
SessionEvents.AuthListener listener = new SessionEvents.AuthListener() {
@Override
public void onAuthSucceed() {
//MyBookDroidActivity.this.executeSubmitClass();
}
@Override
public void onAuthFail(String error) {
}
};
SessionEvents.addAuthListener(listener);
SQLiteDbWrapper.getInstance().getConnector().login();
}
}
</code></pre>
<p>It is function for authorizating. </p>
<pre><code>public void makeFacebook(Activity activity, Context context) {
if (mConnector==null||!mConnector.getFacebook().isSessionValid()) {
mConnector=new FacebookConnector(FACEBOOK_APPID, activity, context,
new String[] {"publish_stream", "read_stream", "email"});
}
}
</code></pre>
<p>It is function for making FacebookConnector. </p>
| java android | [1, 4] |
1,699,255 | 1,699,256 | jQuery attr command | <p>I want to add a value to the onchange event, but the JS code has errors</p>
<pre><code>$(args).attr('onChange', 'setTimeout('__doPostBack(\'ctl00$cpBody$txtDate\',\'\')', 0)');
</code></pre>
<p>anyone see error?</p>
| javascript jquery | [3, 5] |
3,699,547 | 3,699,548 | DIV with background image | <p>We have applied the backgroud image(round corner image from web site) for DIV control. and then dynamically added more statement in DIV control. </p>
<p>How we will increase the height and width for the image?</p>
<p>Please give us some suggestions.</p>
| javascript asp.net | [3, 9] |
2,399,254 | 2,399,255 | Why doesn't combining has() and gt() work in some cases? | <p>I wanted to select any ul which contains more than 3 lis. </p>
<p>This code worked with the 1.2.6 jQuery library:</p>
<pre><code>$("ul:has(li:gt(2))")
.each( function() {
$(this).css("border", "solid red 1px");
});
</code></pre>
<p>But not 1.3.2 or 1.4.2. </p>
<p>This code worked with the 1.4.2 jQuery library:</p>
<pre><code>$('ul').has('li:nth-child(3)').css('border', 'solid red 1px');
</code></pre>
<p>But not v1.2.6. </p>
<p>It's my understanding that jQuery version changes should (generally) not necessitate code changes. Any help understanding this, or differences to be aware of between different versions of the jQuery libraries, would be much appreciated. Thanks!</p>
<p>Clarification:<br>
Why does each version work with one library version, but not the other? Is this a known bug (if so, which one?), or am I doing something wrong? Do documented bugs exist describing these issues on the jQuery site? Should I report the 1.4.2 behavior as a bug?</p>
| javascript jquery | [3, 5] |
4,707,034 | 4,707,035 | javamail-android or JavaMail 1.4.7 | <p>Simple question, for a mail API to send and receive emails as part of an Android app should I use the <a href="http://www.oracle.com/technetwork/java/javamail/index-138643.html" rel="nofollow">JavaMail 1.4.7</a> api from Oracle or the open source <a href="https://code.google.com/p/javamail-android/" rel="nofollow">javamail-android</a> API ported specifically for Android. I ask because I see that the android port is now almost 4 years old, and the Javamail is less than a month old.</p>
| java android | [1, 4] |
186,805 | 186,806 | Update Interface | <pre><code>public void parti(View view) {
float sp = 0;
long currentTime = 0, diffTime = 0;
ImageView img = (ImageView) findViewById(R.id.i1);
float a = 0;
EditText et1 = (EditText) findViewById(R.id.editText1);
et1.setText(Float.toString(a));
currentTime = System.currentTimeMillis();
do {
a = img.getX();
if (diffTime > 150) {
for (int i = 0; i < 10; i++) {
sp += (float) Math.random() * 5;
img.setX(sp);
diffTime = 0;
currentTime = System.currentTimeMillis();
}
} else {
diffTime = System.currentTimeMillis() - currentTime;
}
} while (a < 600);
}
</code></pre>
<p>This is a fragment of code... I want to show every single step and not only the arrival one... how can I refresh every time I do a <code>SetX()</code>? </p>
<p>For understand I want to create an app which step by step it moves an image straight on the screen until it reach the margin of the screen... I need to show step by step because I'm going to create a game using this code.</p>
| java android | [1, 4] |
5,746,266 | 5,746,267 | How to load Jquery.js if not already loaded ? | <p>I need to check if I need to load JQuery OR it is already loaded by another page !? </p>
<p>How can I check this on client side ?
I want to have something like this:</p>
<pre><code><script >
if jquery-1.6.2.js isExist then
{return}
else // somehow
load (<script src="../js/jq/jquery-1.6.2.js"></script> )
</script>
</code></pre>
| javascript jquery | [3, 5] |
3,009,901 | 3,009,902 | Message / confirm dialog | <p>I have a need for a confirm message box from a button click, but only on some conditions. I am cheking two values on the aspx.page, and if one is higher than another, I need a confirmation from the user. Are there any ( simple) way of doing this ? I have been reading about javascript and alert messages, but I cant seem to figure out this one....
I am using RadStudio 2007, .net application.</p>
<p>Any help are appriciated.
Anja</p>
| asp.net javascript | [9, 3] |
641,480 | 641,481 | How to check a live mms:// stream....? | <p>I have a live stream like this</p>
<p>"mms://streaming.exsample.com:8080/exsample"</p>
<p>i need to make a function to check the link status before showing the stream link in my site.
If the stream is down need to show an error to inform to the guest.. Is there a simple jquery solution for this? or php? I have googled for this for hours but couldn't come up with a working solution. Please help.</p>
| php javascript jquery | [2, 3, 5] |
1,759,375 | 1,759,376 | Unable to display image using javascript | <p>net code as follows</p>
<pre><code><asp:Image runat="server" ID="img1" ImageUrl="~/Images/important.gif" />
<asp:Button ID="btn" runat="server" Text="print" />
</code></pre>
<p>and my javascript is as follows</p>
<pre><code><script type="text/javascript">
function printIt() {
var win = window.open('', 'Image', 'resizable=yes,...');
if (win) {
//var imgID = '<%= img1.ClientID %>';
var imageControl = document.getElementById('<%=img1.ClientID%>').src;
win.document.write(imageControl);
win.document.close();
win.focus();
win.print();
}
return false;
}
</script>
</code></pre>
<p>// updated code as per <code>vitoshabg</code> answer</p>
<pre><code><script type="text/javascript">
function printIt() {
var win = window.open('', 'Image', 'resizable=yes,...');
if (win) {
//var imgID = '<%= img1.ClientID %>';
var imageControl = document.getElementById('<%=img1.ClientID%>').src;
win.write('<img src="' + imageControl + '">');
//win.write(imgParent);
win.document.close();
win.focus();
win.print();
}
return false;
}
</script>
</code></pre>
<p>But instead of the image I am getting the url can some one help me to get the image here</p>
| javascript asp.net | [3, 9] |
5,554,188 | 5,554,189 | Convert Instream to String Faster (Android)? | <p>How do I convert an Instream to a string fast right now im using..</p>
<pre><code>private static String convertStreamToString(InputStream is) {
/*
* To convert the InputStream to String we use the BufferedReader.readLine()
* method. We iterate until the BufferedReader return null which means
* there's no more data to read. Each line will appended to a StringBuilder
* and returned as String.
*/
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}
</code></pre>
<p>But this takes atleast 2-3 minutes on the emulator. I found out it would be faster if I converted the instream to a Byte Array then to a String?. Does anybody have any knowledge of this?</p>
| java javascript android | [1, 3, 4] |
2,469,625 | 2,469,626 | Android C2DM AUTHENTICATION_FAILED error while registeration | <p>Please help me in this. I am getting authentication_failed error while registering for c2dm service. I have logged in developer account in my emulator.</p>
<pre><code> Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.setPackage("com.google.android.gsf");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
registrationIntent.putExtra("sender", "[email protected]");
startService(registrationIntent);
</code></pre>
<p>In the BroadcastReceiver class, I am getting authentication_failed error. Please guide me where I am wrong..</p>
| java android | [1, 4] |
3,555,636 | 3,555,637 | Why is this code's execution speed so different? | <p>In <strong>Internet Explorer 7</strong>, this code executes consistently in <strong>47</strong> ms:</p>
<pre><code>function updateObjectValues() {
$('.objects').html(12345678); // ~500 DIVs
}
</code></pre>
<p>however, this code executes consistently in <strong>157</strong> ms:</p>
<pre><code>function updateObjectValues() {
$('.objects').html('12345678'); // ~500 DIVs
}
</code></pre>
<p>Passing a number is over 3x faster than a string. Why are these results so dramatically different? And, is there any way to help the performance of the string?</p>
| javascript jquery | [3, 5] |
39,493 | 39,494 | Show different color strings(text) in textbox asp.net | <p>In my asp.net website i have a textbox which provides the log information. I am using this log to display the error,success and other information. What i want to do is i want to show the result text in textbox in color according to the type of log. For eg; i want to display error as red text, success as green and so on.</p>
<p>I tried the following code but using this code changes the color of entire content of textbox.</p>
<pre><code> /// <summary>
/// colorIndex (0 = default, 1 = red, 2 = green)
/// </summary>
/// <param name="logValue"></param>
/// <param name="colorIndex"></param>
private void writeToLog(string logValue, int colorIndex)
{
if (colorIndex == 0)
{
TextBox2.ForeColor = Color.Black;
}
else if(colorIndex == 1)
{
TextBox2.ForeColor = Color.Red;
}
else if(colorIndex == 2)
{
TextBox2.ForeColor = Color.Green;
}
TextBox2.Text = "[ " + DateTime.Now + "] " + logValue + Environment.NewLine + TextBox2.Text;
}
</code></pre>
<p>Actually i want the output as follows:</p>
<p><img src="http://i.stack.imgur.com/exEAO.png" alt="enter image description here"></p>
<p>You can see in above output there are three different colors of text in same texbox.
This output is actually from the desktop application. And i want to show same type of output in asp.net web page? How can i do it? Please help. Thanks in advance!!</p>
| c# asp.net | [0, 9] |
3,389,894 | 3,389,895 | Display a text field with single quotes | <p>I'm working on an application that requires a text field to fade in with the value being loaded by AJAX. (I'm doing this all with jQuery), here's the code:</p>
<pre><code>$("div#p"+eId+"_content").html("<input class='editPost' type='text' value='"
+ oldCont
+ "' id='p"
+ eId
+ "_editBox' />");
</code></pre>
<p>Unfortunatly, <code>oldCont</code> can contain single quotes, which means the textbox will only contain <code>oldPost</code> up until that single quote. How could I display <code>oldCont</code> without having that problem, but still retaining that single quote (without the \ from escaping it)?</p>
| javascript jquery | [3, 5] |
3,075,397 | 3,075,398 | jQuery generated <a> not clickable? | <p>To save data flow I use these lines to wrap text in a pattern with anchors, the code executed successfully, but why it seems that the generated anchors are not clickable?</p>
<pre><code>$(function(){
$(".block span").each(function(){
$(this).wrapInner("<a></a>")
$(this).find("a").attr("herf","/tag/"+encodeURIComponent($(this).html()));
})
})
</code></pre>
<p><b>And you could also see jsfiddle here:<a href="http://jsfiddle.net/vftMe/" rel="nofollow">http://jsfiddle.net/vftMe/</a></b><br>
Is there any error in my code? Or it's just the browser's limit? What's the alternative way to do this?</p>
| javascript jquery | [3, 5] |
4,714,100 | 4,714,101 | ReferenceError: show_agent_stats not defined | <p>I am trying to show a MySQL table query in a script that gets shown on a button click. When the button is clicked it calls a function that outputs to a DIV tag. The function is in another script page called functions.php and is included at the top of the current page vicidial.php. When the button is clicked i get the above error message, im sure its something simple but om not seeing it, here is the calling button and the DIV tag i want the results to print to;</p>
<pre><code> (vividial.php)
<button onclick="show_agent_stats();">Hey there</button>
<div id="agent_stats"></div>
(functions.php)
function show_agent_stats(){
?>
<script type="text/javascript">
var oldHTML = document.getElementById("agent_stats").innerHTML;
var newHTML = "<?php include("dbtable.php");?>";
return document.getElementById("agent_stats").innerHTML= newHTML;
<?php
}
</code></pre>
<p>any help finding the source of this error is greatly appreciated. Thanks in advance</p>
| php javascript | [2, 3] |
450,617 | 450,618 | Android: Pipe channels | <p>How can i use a pipe channel to open and read a file on android? Can anyone give me an example?</p>
| java android | [1, 4] |
4,029,019 | 4,029,020 | jQuery - how to register a callback for an asynchronous function? | <p>I am a jQuery newbie. I have a core js file which will not be visible to my user. I have the following function inside it that makes a server request -</p>
<pre><code>function checkMsgs(t1,t2) {
// poll the url
// return the results
$.get("http://www.mySite.com/web/test.php", {
"t1" : t1,
"t2" : t2
}, function(data) {
return data;
});
}
</code></pre>
<p>Now, I want to call this function, without blocking the thread i.e., asynchronously. How do I make a function call after it returns from this method, but without blocking anything?</p>
| javascript jquery | [3, 5] |
1,206,856 | 1,206,857 | javascript variable existence on page | <p>I'm creating javascript Variable using c#.net inside code behind page and putting that variable on page using Page.ClientScript.RegisterClientScriptBlock(). So that variable is available on page and I can read(get) that variable value on client side using jquery.</p>
<p>I'm doing following:</p>
<pre><code>C# :
category_columnNames += "var vertical_" + catItem.VerticalID + "_columnNames=['Tools','PersonID','Topic','Category','Cost','Company']";
Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "LoadColumnNames", category_columnNames, true);
</code></pre>
<p>By doing this let's say :<code>var vertical_1_columnNames=['Tools','PersonID','Topic','Category','Cost','Company'];</code> is on page. Now I want to first check if that <code>variable(vertical_1_columnNames)</code> exists on page or not. If yes then I need to get value of it (<code>['Tools','PersonID','Topic','Category','Cost','Company']</code>) on client side.I'm doing following on client side:</p>
<p>Client Side :</p>
<pre><code>function ViewCartDirectLeadsGridInit(gridID) {
alert(gridID);//vertical_1_CategoryGrid
var vertical = gridID.toString().split('_')[1];
var columnNames = "vertical_" + vertical + "_columnNames";
alert(columnNames); // vertical_1_columnNames
alert(typeof(columnNames));// string
alert(eval(columnNames)); // ['Tools','PersonID','Topic','Category','Cost','Company']
if (!window.columnNames) // This is not working.I want to check for existence of var vertical_1_columnNames
{
alert("success");
return false;
}
else{
// do something;
}
}
</code></pre>
<p>Any suggestion?</p>
<p>Thanks,</p>
<p>A</p>
| c# javascript | [0, 3] |
88,634 | 88,635 | Email anti spam PHP | <p>I have a contact form with no sort of spam protection on my site and im receiving lots of spam, I'm going to add anti spam protection, I know i can do this with PHP, but if I stopped the form from validation if an anti spam question was wrong using jQuery, would this be sufficient? or do spam bots bypass javascript security measures? </p>
| php javascript jquery | [2, 3, 5] |
449,629 | 449,630 | How to limit the width of a column and make its text wrap | <p>I have a RadGrid in my application and whats happening is that if the text in the column of the grid is to long it will not wrap so the grid container will expand and get out of the frame so I would like to make it so that when the text in the column is too long that it wraps, how can I do this? Here is an example of one of those columns. </p>
<pre><code> <telerik:GridBoundColumn DataField="clientnum"
HeaderText="Client Number" HeaderStyle-HorizontalAlign="Left"
AllowSorting="false" />
</code></pre>
<p>Thank you for your help</p>
| c# asp.net | [0, 9] |
5,893,255 | 5,893,256 | Pass PHP array into Javascript array | <p>Referring to the title. I have an array which I coded like this:-</p>
<pre><code>$query = "SELECT * FROM server";
$result = mysql_query($query);
$dServer = array();
while($row = mysql_fetch_assoc($result))
{
$dServer[] = $row['model'];
}
</code></pre>
<p>Now, how do I pass the $dServer array into a Javascript array?</p>
<p>For example, this array:</p>
<pre><code>var a = new Array();
</code></pre>
| php javascript | [2, 3] |
5,222,085 | 5,222,086 | Which database in Java Android? | <p>I am developing an app in Android. I would like to attach a database (created in C++) to my app Android that my Android app could read. In which format should I create this database with my C++ program?</p>
| java android | [1, 4] |
5,697,014 | 5,697,015 | On click event of image button | <p>I have a problem that when I click on the image button instead of redirect me to the corresponding page, it will just redirect back to the same page. </p>
<p>This is the code in asp;</p>
<pre><code> <asp:ImageButton ID="header1" src="Resources/Icons/Header1.jpg" runat="server" />
</code></pre>
<p>And this is in my page load in the code behind;</p>
<pre><code> header1.Attributes.Add("onclick", "~/ChildSelection.aspx");
</code></pre>
<p>Any ideas why this is happening?</p>
| c# asp.net | [0, 9] |
942,771 | 942,772 | Sorting an object list | <p>I am keeping a list of objects in a <code>List()</code>. I want to sort this list by a property of the object.</p>
<p>For example, say the object is a Messsage and message has: content, date, header, ...</p>
<p>I want to sort the list by the message's date. </p>
<p>Is there any <code>List</code> method or any other method that makes this sort easy?</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
33,121 | 33,122 | How can I run code right before the jQuery submit() executes? | <p>Basically, I have a form and a validation function that executes when a form is submitted. However, I want some other codes to run before the validation runs. I tried this: <a href="http://stackoverflow.com/questions/290254/how-to-order-events-bound-with-jquery">How to order events bound with jquery</a>, but it does not work.</p>
<p>Here's what I have:</p>
<pre><code> $('form').submit(function(){
$('form').trigger('before-submit');
if($(this).find('error').exists(event))
event.preventDefault();
});
$('form').bind('before-submit', function(e) {
if($('#url').val=='http://')
$('#url').val('');
alert('test');
});
</code></pre>
| javascript jquery | [3, 5] |
5,297,479 | 5,297,480 | make use of the enter key | <p>I have a list of urls(div) underneath an input field(div). I need the ability to come down in the list and than by hitting enter this will trigger some function designated to the url. This is the fidle: <a href="http://jsfiddle.net/yomoore/sjKgF/24/" rel="nofollow">the script</a></p>
<p>Over the last days I have tried to much things to explain, but in conclusion none of it worked. Help would be appreciated. </p>
| javascript jquery | [3, 5] |
574,798 | 574,799 | Radio Button, Text Area and Input check | <p>I have a form with all the input fields as class <code>item</code>. When I click submit, it checks, with the following function if all values are filled in.</p>
<pre><code>$.each($(".items"),function(i,e){
// loop through all the items
if(e.value == "" || !$("input[name='"+e.name+"']:radio:checked").length)
if(error.indexOf(e.title) === -1)
error += e.title + "<br/>";
});
</code></pre>
<p>This form comprises of text areas, radio boxes and normal text input fields. It returns all the radio boxes not filled in, as well as all the text inputs not filled in. But then it also returns ALL the text areas, regardless of whether it's filled in or not.</p>
<p>I first thought it was because I specified it to check the value, but it seems the value check does in fact check text areas, so it can't be that.</p>
<p>Could anyone assist me in making it return only empty elements?</p>
| javascript jquery | [3, 5] |
853,708 | 853,709 | Stopping a media player | <p>I am implementing a media player on android phone.<br>
This player starts based on some conditions, but I am unable to stop it (back button pressing doesn't work). Once the streamer who is sending the data stops, player stops too and crashes. </p>
<p>I want to stop the media player whenever I want by pressing the BACK button. can somebody tell me how to do so?</p>
<p>I have tried using methods like these, but they don't work!!</p>
<pre><code>@Override
public void onBackPressed()
{
MediaPlayer.stop();
MediaPlayer.release();
finish();
}
@Override
protected void onStop()
{
finish();
}
</code></pre>
| java android | [1, 4] |
4,513,733 | 4,513,734 | How to use JavaScript variable from popup window in code behind? | <p>I have ASP.NET web application that contains master page. Master page contains content page. Content page contains user control. User control contains Telerik grid with its context menu.</p>
<p>I'd like to click the item in grid's context menu and open new popup modal window. In that window there's drop down list. I pick up some option from drop down list and click OK. I'd like to get the value selected from drop down list and use it in my ASP.NET code to proceed further.</p>
<p>I've tried to use hidden field to store the value from drop down list but it doesn't work because I'm not sure where hidden field should be placed.</p>
<p>Could someone help me to make it work?</p>
| javascript asp.net | [3, 9] |
4,551,126 | 4,551,127 | Getting nth child value of element using Jquery | <p>I wish to add '1' to the id conCol to make it conCol1. Please can someone tell me how I go about this because my statement below doesn't work. Also, is it possible to get the value of "first-column" i.e Condition #0 to make it Condition #1?</p>
<pre><code>newElem.children('select :nth-child(2)').attr('id', 'conCol' + newNum).attr('name', 'name' + newNum);
<tr id="condition1" class="clonedInput">
<td class="first-column">Condition #0</td>
<td><span style="float:left; padding-right: 10px;">
<select id="conCol" name="conCol" class="standard_select" style="width:147px; background:#fff;">
</code></pre>
| javascript jquery | [3, 5] |
2,882,398 | 2,882,399 | how to run this script when scroller is 2500px? | <p>I tried here but I think I did something wrong, can help?
I saw a similar code right here and just adapted.
Thank you.</p>
<pre><code>$(document).ready(function(){
$(document).scrollTop() >= 2500) {
var bar = $('.bar');
var p = $('.percents');
var interval;
var start = 0; // start animation at 0%
var end = parseInt(92); // stop progress bar on 78% just for demo
var current = start;
var countUp = function() {
// increment by one during each function call
current++;
bar.css('width', current+'%');
// update percents in html
p.html(current + "%");
// stop interval if we reached our goal (78%)
if (current === end) {
clearInterval(interval);
}
};
// change progress bar every 1000 / (78+1) milliseconds
interval = setInterval(countUp, (2500 / (end + 1)));
};
});
</code></pre>
| javascript jquery | [3, 5] |
1,603,360 | 1,603,361 | hide text between <label>abc</label> - remove ' abc ' | <p>i have a label tag and i want to remove text between <code><label> </label></code></p>
<p><strong>my string (html code) is</strong></p>
<pre><code><label style="cursor: pointer; " for="31">
<img src="/joomla_1.7/images/stories/virtuemart/product/resized/black4_90x90.png" alt="the"/>
<span class="vm-img-desc" style="display: none; ">the</span>
$12.93
</label>
</code></pre>
<p>i want to remove <code>$12.93</code> and i just want to image and the span in to <code><label> </label></code> tag</p>
<p>i am using <code>php</code> and <code>jQuery</code> </p>
| php javascript jquery | [2, 3, 5] |
102,515 | 102,516 | Change parameter of the URL requested on a button click | <p>I apologize in advance for not being able to supply more information, if this is not possible with the limited info, I will delete the question.</p>
<p>So, I have a script that generates kind of a search engine that depends on the script (also dinamically generated) which is quite complicated and I don't have any impact on it.</p>
<p>When you click on the apply (search) button, the search process is triggered and you can see the results on the new URL that has a few parameters.</p>
<pre><code>E. g.: http://www..example.com/...&ThisParameter=XYZ&SecondParameter=foo&ThirdParameter=bar
</code></pre>
<p>My question is - is it possible to change <code>"ThisParameter=XYZ"</code> to something else, e. g. <code>"ThisParameter=Something"</code>. </p>
<p>The problem is that I don't know how the URL is constructed and can'i impact it, so I would need a code that would just take any URL generated and change this part mentioned.</p>
<p>Thank you for your opinions in advance!</p>
<p>EDIT</p>
<p>I have found the part of the script that impacts the URL generated. When I change it in DOM, it does redirect me to the desired page.</p>
<pre><code>var options = {"FOO":123,"BAR":"ABC","ThisParameter":"STH","EXAMPLE":123, ...}
</code></pre>
<p>And this is the output when you choose "copy path":</p>
<pre><code>_options[0].ThisParameter
</code></pre>
| javascript jquery | [3, 5] |
1,991,544 | 1,991,545 | How can I refer other objects in php? | <p>I'm very new to Php and I'm from Java. I have a class in Java like this:</p>
<pre><code>class A {
}
class B{
}
</code></pre>
<p>in same package. Inside class <code>A</code> I have defined a datatype of type <code>B</code> like :</p>
<pre><code> B bType;
</code></pre>
<p>I want the same behavior in php. Is that possible to do so? </p>
<p>And are there any way to "package" my classes in php?</p>
<p>Thanks in advance.</p>
| java php | [1, 2] |
5,918,199 | 5,918,200 | Is it possible for my Activity to send generated touch/motion events to its child views? | <p>I have an <code>Activity</code> that generates some <code>MotionEvent</code>s (via <code>MotionEvent.obtain()</code>). I'd like to pass these generated touch/motion events to the <code>Activity</code>'s children views. From the docs, <code>Activity.onTouchEvent()</code> is only called when one of the child views doesn't handle the event, which means I can't call that to pass the generated touch event to the children.</p>
<p>Is there a way to send a generated touch event <em>from the parent <code>MainActivity</code></em> to its children views, in such a way that they normally respond (for example, if a child view has an <code>OnClickListener</code> set, and I send a generated down/up touch event to the child view, I'd like the <code>OnClickListener</code> to be called)?</p>
<p>Note that I'm not trying to send touch events from one activity to another, and that this is all in my own application. Also, my devices aren't rooted, so solutions requiring root don't help me.</p>
| java android | [1, 4] |
3,861,985 | 3,861,986 | jquery toggle between forms | <p>I have ran out of ideas for this assignment for a class. I had to create two PHP forms using PHP_SELF and I am suppose to use javascript or jquery to toggle between the forms. I tried using</p>
<pre><code><a href="#" onclick="document.getElementById('form1').style.display = 'block'; document.getElementById('form2').style.display = 'hidden';">Form 1</a>
<a href="#" onclick="document.getElementById('form1').style.display = 'hidden'; document.getElementById('form2').style.display = 'block';">Form 2</a>
</code></pre>
<p>This does work on changing the forms, however when I hit the submit button the form it goes back to form 1 and doesn't display the results. The thing I have to figure out is after the form has been submitted using PHP_SELF, how to get it to stay on that form to show the results generated by the server.</p>
| php javascript jquery | [2, 3, 5] |
1,151,185 | 1,151,186 | Calling a function when neither of two elements is being hovered? | <p>My idea is to have two variables, insideLink that marks if I'm currently hovering over my menu and insideBox that checks if I'm hovering over Div container.</p>
<p>And if I leave I check if I'm also out of the other element, if I'm out of both I call the closeboth function that closes them both.</p>
<p>I tried doing it like this, but it doesn't work. Box closes right away after I move away from the menu link.</p>
<p>I suppose setTimeout would help but, but my attempts with that didn't work quite well. Any ideas? </p>
<pre class="lang-js prettyprint-override"><code>$(linkID).hover(function() {
insideLink=1;
console.log("Its over Link");
},function() {
insideLink=0;
if (insideBox==0) {
console.log("Its outside both elements, closebox");
closebox();
}
});
$(open).hover(function() {
insideBox=1;
console.log("Its inside box");
},function() {
insideBox=0;
if (insideLink==0) {
console.log("Its outside both elements, closebox");
closebox();
}
});
</code></pre>
| javascript jquery | [3, 5] |
3,960,709 | 3,960,710 | How can I use html styles in strings with format arguments? | <p>In my app, I'd like to define a format string in strings.xml that looks like this (note the <code><b>...</b></code> tags):</p>
<pre><code><string name="location"><b>Location:</b> %1$s</string>
</code></pre>
<p>And then use <a href="http://developer.android.com/reference/java/lang/String.html#format%28java.lang.String,%20java.lang.Object...%29" rel="nofollow">getString(int, Object...)</a> to substitute in a format argument:</p>
<pre><code>String formattedString = getString(R.string.location, "Edmonton, AB");
</code></pre>
<p>This produces a value of <code>"Location: Edmonton, AB"</code>. I'd like to get a value of <code>"<b>Location:</b> Edmonton, AB"</code>.</p>
<p>Is there some way of doing this using string formats in strings.xml without splitting it up into two strings?</p>
| java android | [1, 4] |
5,317,374 | 5,317,375 | Multiple divs problem when working with Jquery | <p>I am facing a wired problem when using Jquery Dialog. </p>
<pre><code> <div id="divSupplierGrid" style="display: none">
<uc2:SupplierGrid ID="Tab1UCSupplierGrid" runat="server" />
</div>
<div id="divCreateInqGeneral" style="display: none">
<uc1:CreateInqGeneral ID="Tab1UCCreateInqGeneral" runat="server" />
</div>
function DisableBackGrd() {
$("#divCreateInqGeneral").dialog({ bgiframe: true,
modal: true,
open: function () { hideScrollBars(); },
beforeClose: function () { showScrollBars(); }
});
}
</code></pre>
<p>When i keep only 'divSupplierGrid' on my page .Jquery dialog works fine but as soon as i add 'divCreateInqGeneral' i get 'Microsoft JScript runtime error: Object doesn't support this property or method' Exception. Whats going wrong?</p>
| javascript jquery asp.net | [3, 5, 9] |
5,144,985 | 5,144,986 | enter qty and update total order | <p>Just making a very very simple order form.</p>
<p>Want a input box ( only accept numbers )</p>
<p>User enters a quantity , lets say 50</p>
<p>We have a multiplier value which is lets say 10</p>
<p>Want a disabled form field, showing the result of 50 x 10 </p>
<p>So form field would show 500</p>
<p>so now we have variable <strong>orderTotal</strong> we can pass to our code like:</p>
<pre>$txtAmount = "orderTotal";</pre>
<p>Any ideas ?</p>
| javascript jquery | [3, 5] |
5,270,785 | 5,270,786 | How to access Parent from child in JS | <p>I want to access an object's own function from a jQuery method which fails.</p>
<pre><code>function obj(){
this.send = function(){
$.get("send.php",null,function(data){
this.success();
}).error(function(){ this.fail(); });
}
this.fail = function(){
alert("fail");
}
}
var o = new obj();
o.send();
</code></pre>
<p>Gives this error: <code>TypeError: this.fail is not a function</code></p>
<p>How to access function <code>fail</code> inside jQuery?</p>
| javascript jquery | [3, 5] |
5,829,086 | 5,829,087 | Convert this PHP code to C# Rijndael Algorithm | <p>I've got this php code and I'd like to get the exact equivalent C#</p>
<pre><code>$ivSize = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_CBC);
$iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
$encryptedData = mcrypt_encrypt(MCRYPT_RIJNDAEL_192, $key, $salt . $message . $nonce, MCRYPT_MODE_CBC, $iv);
$base64Data = base64_encode($salt . $iv . $encryptedData);
$urlEncodedData = rawurlencode($base64Data);
</code></pre>
<p>all contributions gratefully received!</p>
| c# php | [0, 2] |
370,267 | 370,268 | How to add child node in treeview at runtime in asp.net? | <p>I have treeView control in my web page which has three parent nodes <code>Parent1</code>, <code>Parent2</code>, <code>Parent3</code>. Then how i will add the child at runtime.</p>
<p>Thanks.</p>
| c# asp.net | [0, 9] |
194,961 | 194,962 | Save dialog box through javascript | <p>I am using javascript to open save dialog box</p>
<p>the java script is </p>
<p>function openDialog(path)
{</p>
<pre><code> document.execCommand("SaveAs",true,path);
</code></pre>
<p>}</p>
<p>In my project, i am creating linkButtons dynamically and attaching this function with linkButton's OnClient Click event at run time.</p>
<pre><code> LinkButton linkButton = new LinkButton();
linkButton.OnClientClick = "openDialog("+file.ToString()+")";
</code></pre>
<p>where "file" contains the path of the file which has to be saved.</p>
<p>But i am getting a javascript error as</p>
<p>"Expected ")" "</p>
<p>can anyone help me in what i am doing wrong in this.</p>
<p>I have N number of dynamically created linkButtons and i am associating each linkButton with different file.</p>
| c# javascript asp.net | [0, 3, 9] |
4,954,292 | 4,954,293 | How to check whether a value is a number in javascript or jquery | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric">Validate numbers in JavaScript - IsNumeric()</a> </p>
</blockquote>
<pre><code>var miscCharge = $("#miscCharge").val();
</code></pre>
<p>I want to check misCharge is number or not? is there any method or easy way in jquery or javascript to do this?</p>
<p>HTMl is </p>
<pre><code> <g:textField name="miscCharge" id ="miscCharge" value="" size="9" max="100000000000" min="0" />
</code></pre>
| javascript jquery | [3, 5] |
1,198,049 | 1,198,050 | How handle 'null' values in a json search | <p>still new to JavaScript, I am searching for numbers in my JSON, but the JSON has a lot of null values. How can I ignore the null values in my search?</p>
<pre><code>$.each(geojson.features, function (i, v) {
if (v.properties.code.toString().search((/2/i)) != -1) {
Count++;
}
});
</code></pre>
<p>Thanks for the help in advance. </p>
| javascript jquery | [3, 5] |
140,271 | 140,272 | Remove a specifc inline style with Javascript|jQuery | <p>I have the folowing code in my html:</p>
<pre><code><p id='foo' style='text-align:center; font-size:14pt; font-family:verdana; color:red'>hello world</p>
</code></pre>
<p>and that in my external css:</p>
<pre><code>#foo{ font-size:11pt; font-family:arial; color:#000; }
</code></pre>
<p>I want to remove all "font-size" and "font-family" in the "style" atribute, but not the "color" and others setted in external css.</p>
<p><strong>Result expected:</strong></p>
<pre><code><p id='foo' style='text-align:center; color:red'>hello world</p>
</code></pre>
<p><em><strong>Already tried:</em></strong></p>
<pre><code>$('#foo').removeAttr('style'); // That removes all inline
$('#foo').css('font-family',''); // That remove the css setted too
</code></pre>
<p>thanks</p>
| javascript jquery | [3, 5] |
588,692 | 588,693 | How to display the selected date from a popup to the selected id | <p>In my project i have a requirement like Date should be displayed with previous and next links and adjacent to next link there is popup jquery calendar to select the particular date. This i have implemented as follows</p>
<pre><code><script>
function ShowSchedule() {
document.getElementById("today").innerHTML = date;
}
function ShowDay(isNextDay) {
if (isNextDay) {
currentTime = new Date(currentTime.getFullYear(), month, currentTime.getDate() + 1);
date = month_name[currentTime.getMonth()] + " " + currentTime.getDate() + ", " + currentTime.getFullYear();
ShowSchedule();
}
else {
currentTime = new Date(currentTime.getFullYear(), month, currentTime.getDate() - 1);
date = month_name[currentTime.getMonth()] + " " + currentTime.getDate() + ", " + currentTime.getFullYear();
ShowSchedule();
}
}
$(function() {
$('#tday').datepick({
changeMonth: false,
dateFormat: 'M dd, yyyy',
showTrigger: '#calImg'
});
});
</script>
<body>
<form>
<div>
<a id="prev" href="#" onClick="ShowDay(false)">Prev</a>
<span id="today">
</span>
<a id="next" href="#" onClick="ShowDay(true)">Next</a>
<input id="tday" />
</div>
<script>
ShowSchedule();
</script>
</form>
</body>
</code></pre>
<p>By using the above code am able to display the current system date with previous and next links along with the calendar popup. But the problem is after selecting the date from the popup calendar i need to display selected date current date position. i.e. For example today date is May 25, 2012, If the user selects date as May 20, 2012 then the selected date should displayed in the place of May 25, 2012 along with previous and next links</p>
<p>Any help would be appreciated</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.