Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
|---|---|---|---|---|---|
3,562,734
| 3,562,735
|
cursor movement through eye
|
<p>I was thinking whether it could be possible to track cursor movement through eye.
Depending on which part of screen , the eye looks the curson will move.
Can this be achieved?
Thansks everyone for replying!.I am just looking for some new idea that can be implemented and which have not been implemented.Any ideas/suggetions are welcomed.</p>
|
c# java
|
[0, 1]
|
4,354,087
| 4,354,088
|
jQuery - How to check for available javascript on a page?
|
<p>On a html page that uses $.getScript to dynamically load .js files.</p>
<p>Later at some point if I wish to check whether a particular .js file is loaded. How to do this?</p>
<p>Can I check using filename.js? or do I have to check for an object/function/variable in that file?</p>
<p>Thanks for the answers folks. You guys suggested callback function, global variable etc. But the thing is, I work in corporate environment where one corporate .js loads other .js(the one I'm trying to detect). Not only I can't modify corporate .js, I can't control when it'll change. I was hoping may be there was a way to know which .js file is loaded on page.</p>
|
javascript jquery
|
[3, 5]
|
17,667
| 17,668
|
How Do I Add jQuery To Head With JavaScript?
|
<p>I am trying to include jQuery to an HTML page conditionally. It only needs to be added if it doesn't exist yet.</p>
<p>I am using the following code near the top of my body tag to inject a script tag that includes the jQuery library in the head.</p>
<pre><code><script type="text/javascript">
if (typeof jQuery === 'undefined') {
alert('now adding jquery');
var head = document.getElementsByTagName("head")[0];
script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js';
head.appendChild(script);
if (typeof jQuery === 'undefined') {
alert('jquery still not present :(');
}
} else {
alert('jquery already present');
}
</script>
</code></pre>
<p>When I execute it, I get the message that jQuery is still not present after adding it. The script tag <strong>does</strong> correctly show up in the loaded page's source.</p>
<p>Trying to make use of jQuery a little further down below in my page, confirms that jQuery is indeed not working. As expected, Chrome's JavaScript console says '$ not defined'.</p>
<p>How can I get this to work?</p>
|
javascript jquery
|
[3, 5]
|
2,093,223
| 2,093,224
|
asp.net masterpage jQuery function
|
<p>I'm creating a new web project and i trying to get jQuery working with masterpages</p>
<p>I want to have a link that if it is pressed will do an expansion of a div.</p>
<p>Problem: jQuery isn't fired and the page do a postback</p>
<p><img src="http://i.stack.imgur.com/e2OoY.png" alt="enter image description here"></p>
|
jquery asp.net
|
[5, 9]
|
4,935,967
| 4,935,968
|
Mouseleave only when mouseenter ends
|
<p>with the follow code:</p>
<pre><code>$('someelement').hover(
function() {
console.log('mouseenter begin');
setTimeout(function() {
console.log('mouseenter ends');
}, 2000);
},
function() {
console.log('mouseleave begin');
setTimeout(function() {
console.log('mouseleave ends');
}, 2000);
}
)
</code></pre>
<p>If I enter and leave div at some times (or one time less then 2 seconds) my console get:</p>
<pre><code>mouseenter begin
mouseleave begin
mouseenter ends
mouseleave ends
</code></pre>
<p>I want mouseleave only executed when <code>mouseenter</code> ends, but don't know how.</p>
<pre><code>mouseenter begin
mouseenter ends
mouseleave begin
mouseleave ends
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,552,088
| 3,552,089
|
how to read javascript array in php
|
<p>I'm trying post a javascript array using jquery $.post method to php and use array values in mysql query.</p>
<pre><code>$.post("test.php", { 'celvalues[]': celValues }});
</code></pre>
<p>where values for array celvalues is assigned.
So how to read this array in php?</p>
|
php jquery
|
[2, 5]
|
79,566
| 79,567
|
How to direct call webservice in android?
|
<p>I have to write a simple application that calls a web-service from android. So please give me a sample code to call it. And please it will be better if the code does not use any special libraries which I have to download and include in project. Also that code should not use the word "Soap" because I have searched a lot on net and every where there is example given "how to call Soap web service". I don't have to call a Soap or anything else, just a simple web service. So please give a reference code or at-least some useful links. Now I tried a code, </p>
|
java android
|
[1, 4]
|
1,530,821
| 1,530,822
|
Error: uncaught exception: [Exception... "An invalid or illegal string was specified"
|
<p>This two errors I get in the Firefox error console:</p>
<pre><code>Error: Incorrect document format
Source file:
Row 1, column 45
Source code:
<div xmlns="http://www.w3.org/1999/xhtml"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Error: uncaught exception: [Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)" location: "http://127.0.0.1/WebLibThirdParty/JavaScript//jquery.js Line: 112"]
</code></pre>
<p>My jquery code is simple:</p>
<pre><code>$(document).ready(function() {
// when the #guest_details is clicked
$('#guest_details').click(function() {
var postedData = $('#guest-details-dialog-contents form').serialize();
var uri = '/';
$.ajax({
type: 'POST',
data: postedData,
url: uri,
success: function(data) {
// this works
alert(data);
// this doesn't work
alert($(data).html());
}
});
return false;
});
});
</code></pre>
<p>As you can see, the problematic line is:</p>
<pre><code>alert($(data).html());
</code></pre>
<p>In the ajax callback. The PHP script returns valid XHTML (served as XML) so I am buffled by this issue.</p>
<p>EDIT:</p>
<p>Ok. The problem is that AJAX returns messed up XHTML. It changes tags to HTML:</p>
<pre><code><br /> becomes <br>
<input type="text" name="someInput" /> becomes <input type="text" name="someInput">
and so on
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,609,307
| 5,609,308
|
Script to enable/disable input elements?
|
<p>I'm wondering if it's possible for a script to enable/disable all input elements on the page with some sort of toggle button.</p>
<p>I googled it but didn't find anything too useful except for this:</p>
<p><a href="http://www.codetoad.com/javascript/enable_disable_form_element.asp" rel="nofollow">http://www.codetoad.com/javascript/enable_disable_form_element.asp</a>
but I'm not sure how to edit it for the toggle.</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,614,911
| 3,614,912
|
jQueryUI accordion not working
|
<p>With jQuery UI, I am using the accordion and it looks pretty cool.
Default the 1st tab or whatever its called is open, I want it so that they are all
closed and only open when clicked. Any way of doing this?</p>
<p>Also, can you make the area the opens only big enough for what is actually in it?
What I think is happening is the default size when opened is equal to the biggest thing in ANY of them.</p>
<p>Here is my example online, click the play tab and you will see what I mean.
When the user first sees it he can not see the other tabs as they are off screen down below because of the big empty space.
<a href="http://www.taffatech.com/Demo.html" rel="nofollow">http://www.taffatech.com/Demo.html</a></p>
<pre><code><div id="accordion2">
<h3>Welcome</h3>
<div>Choose a game!</div>
<h3>Play Game 1</h3>
<div>
<p>Game 1 is in development
<div align="center">
<canvas id="myCanvas" width="600" height="400" align="center" style="border:1px solid #ffffff;"></canvas>
</div>
</p>
</div>
<h3>Play Game 2</h3>
<div>
<p>Game 2 is in development</p>
</div>
<h3>Play Game 3</h3>
<div>
<p>Game 3 is in development</p>
</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,973,462
| 5,973,463
|
why my code that write by me is upper,when keyup
|
<pre><code>$('#a').keyup(
function(event){
alert(event.keyValue)
}
)
</code></pre>
<p>but error,coz 'keyValue' is not undefined,</p>
<p>how do i get the keyValue when the event keyup???</p>
<p>i use jquery.</p>
<p>thanks</p>
<hr>
<p>i do this:</p>
<pre><code>$('#a').keyup(
function(event){
alert(String.fromCharCode(event.which))
}
</code></pre>
<p>but it alert the value of upper</p>
<p>ex: </p>
<p>i alert I</p>
<p>l alert L</p>
<p>why???
)</p>
|
javascript jquery
|
[3, 5]
|
894,114
| 894,115
|
Getting text from <td> element using jQuery
|
<pre><code>if (document.getElementById("td1").innerHTML == "word"){
$("td:first").html("another word");
}
</code></pre>
<p>I just want to check if this have this text .</p>
|
javascript jquery
|
[3, 5]
|
540,514
| 540,515
|
insert html content inside a class in jquery
|
<p>I am using jquery to insert html content like,</p>
<pre><code>$.get("_html/saveme.html", function(data){
$(".saveWin .modalCSS").html(data); //Error here
});
</code></pre>
<p>In Firefox it is giving me error as,</p>
<pre><code>Node cannot be inserted at the specified point in the hierarchy
</code></pre>
<p>In IE it is working fine.
Please suggest me, are there any other ways to call class inside a class and insert html content.</p>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
4,876,690
| 4,876,691
|
removing one property of an object
|
<p>I have an object that looks like this. </p>
<pre><code>{
par1: 'par1value',
par2: 'par2value',
par3: 'par3value'
};
</code></pre>
<p>I want to remove the property called <code>par1</code> and save it separately so it looks like this </p>
<pre><code>var par1 = 'par1value';
{
par2: 'par2value',
par3: 'par3value'
};
</code></pre>
<p>Can someone suggest a nice way to do this</p>
|
javascript jquery
|
[3, 5]
|
1,444,559
| 1,444,560
|
How remove function from this code after first usage this field?
|
<pre><code>$(document).ready(function(){
$('#id_laufzeit_bis').datepicker().on('changeDate', recalculate_deadline);
$('#id_kuendigungsfrist').change(recalculate_deadline);
$('#id_kuendigungsfrist_type').change(recalculate_deadline);
$('#id_kuendigung_moeglichbis').change(check_reminder_date);
$('#id_erinnerung_am').datepicker().one('hide', check_reminder_date);
});
</code></pre>
<p>How remove <code>check_reminder_date</code> function from this code after first usage this field? (<code>#id_erinnerung_am</code>)</p>
<pre><code>$('#id_erinnerung_am').datepicker().one('hide', check_reminder_date);
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,705,901
| 4,705,902
|
How to force function execution after input with javascript
|
<p>I am making a small calculator (just for javascript learning)
and I have two input fields for fraction calculation
1.Field: numerator
2.Field: denominator</p>
<p>And a button "Calculate fraction"</p>
<p>which executes the function myFraction(numerator,denominator) when user clicks on it.</p>
<p>Is it possible do do the same without the Button?
I mean javascript should recognize that someone is making input and then calculate the fraction automatically.</p>
|
javascript jquery
|
[3, 5]
|
5,758,284
| 5,758,285
|
only input check boxes that are checked in the first td in a tr
|
<p>How do I get the the number of matches/length of: only input check boxes that are checked in the first td in a tr?</p>
<p>this works:</p>
<pre><code>$('#myTable').find('tr td input[type=checkbox]:checked').parents('tr').length;
</code></pre>
<p>this wont work</p>
<pre><code>$('#myTable').find('tr td:eq(0) input[type=checkbox]:checked').parents('tr').length;
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,580,701
| 2,580,702
|
script reference causes conflict
|
<p>I have code 1 which executes with this in the head:</p>
<pre><code><link class="jsbin" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
<script class="jsbin" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
</code></pre>
<p>Then I have code 2 which goes by:</p>
<pre><code><script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script src="livesearch.js" type="text/javascript"></script>
</code></pre>
<p>The problem is that when I put the last reference (code 2) the first doesn't work anymore..
What am I doing wrong?</p>
<p>( for some reason code 2 doesnt react on jquery 1.7 )</p>
|
javascript jquery
|
[3, 5]
|
1,718,985
| 1,718,986
|
Microsoft JScript runtime error: Could not complete the operation due to error c00ce514
|
<p>I wrote a file download code but i get this error when i start it in my projects. Only this code works perfectly fine. But in complex project this error occurred. Can you help about it ?
Here is download code</p>
<pre><code>string fileUrl = @filePath + "\\" + _DownloadableProductFileName;
string newFileName = _DownloadableProductFileName;
FileStream fs = new FileStream(fileUrl, FileMode.Open, FileAccess.Read);
byte[] buffer = new byte[(int)fs.Length];
fs.Read(buffer, 0, (int)fs.Length);
fs.Close();
Response.Clear();
Response.AddHeader("Content-Length", buffer.Length.ToString());
Response.AddHeader("Content-Disposition", "attachment; filename=" + newFileName);
Response.BinaryWrite(buffer);
Response.End();
</code></pre>
<p>And the error code is </p>
<blockquote>
<p>Microsoft JScript runtime error: Could not complete the operation due to error c00ce514.</p>
</blockquote>
<p>Here error occurs.</p>
<pre><code>get_responseData: function XMLHttpExecutor$get_responseData() {
/// <value type="String" locid="P:J#Sys.Net.XMLHttpExecutor.responseData">The text of the response.</value>
if (arguments.length !== 0) throw Error.parameterCount();
if (!this._responseAvailable) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData'));
}
if (!this._xmlHttpRequest) {
throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData'));
}
return this._xmlHttpRequest.responseText; //here throw error
},
</code></pre>
|
c# asp.net
|
[0, 9]
|
659,801
| 659,802
|
Move div rather than Remove()
|
<pre><code> $(settings.widgetSelector, $(settings.columns)).each(function () {
var thisWidgetSettings = iNettuts.getWidgetSettings(this.id);
if (thisWidgetSettings.removable) {
$('<a href="#" class="remove">CLOSE</a>').mousedown(function (e) {
/* STOP event bubbling */
e.stopPropagation();
}).click(function () {
if(confirm('This widget will be removed, ok?')) {
$(this).parents(settings.widgetSelector).animate({
opacity: 0
},function () {
$(this).wrap('<div/>').parent().slideUp(function () {
$(this).remove();
iNettuts.savePreferences();
});
});
}
return false;
}).appendTo($(settings.handleSelector, this));
}
</code></pre>
<p>Basically right now this code when 'close' is clicked it removes the content completely. What i would rather do is move it to a different div. I was reading about prependTo. I thought this would be as simple as changing:</p>
<pre><code>$(this).remove();
</code></pre>
<p>To:</p>
<pre><code>$(this).prependTo('.dock');
</code></pre>
<p>But doesn't seem to be that simple. This just removes it still. <a href="http://pastebin.com/u64XXAQ5" rel="nofollow">Full Code</a></p>
|
javascript jquery
|
[3, 5]
|
4,184,915
| 4,184,916
|
select specific elements in parent div
|
<p>im trying to get an article from a div, and the problem is it gets everything when i use <code>$('#article').html()</code> is there a way for just getting a spesific html inside the parent div without other elements?</p>
<pre><code><div id="article">
This is an article
blabla
<br/>
<b>something bold here</b>
<div id="unknown">{some javscript}</div>
<link type="anything" url="somewhere">
<style>
.something
</style>
the end of the article
</div>
</code></pre>
<p>should return</p>
<pre><code>this is an article
blabla
<br/>
<b>something bold here</b>
the end of the article
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,449,153
| 5,449,154
|
Where is the best place to store user related data in asp.net?
|
<p>When a customer logs in to my site, I need to know their account id and their menu id. This lets me know what data they can see on a page and what menu they get. I don't want to have to read this data over and over. Should I store this in a session variable or customize the membership user and membership provider to contain this information?</p>
|
c# asp.net
|
[0, 9]
|
4,150,271
| 4,150,272
|
Fix jquery page change flash before slide
|
<p>Here's the link: <a href="http://www.sandbox.brightboxstudios.com/swings/test4.html" rel="nofollow">http://www.sandbox.brightboxstudios.com/swings/test4.html</a></p>
<p>The issue is when clicking a link, it seems to flash the next pages content for a split second before sliding to it..</p>
<p>This started happening after I made sure the back button started working.</p>
<p>I don't know much of anything about javascript so please be specific in your answers, it would be greatly appreciated! We are not profit, so this is a HUGE help.</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
678,604
| 678,605
|
On button Click in the Grid I can't get in to the function
|
<p>Using CSharp, I'm not getting into the (GridView1_RowDeleting) function on the button click.. I don't know whats the problem is but wasted alot of time on it.</p>
<p>Default.aspx</p>
<pre><code>asp:GridView ID="GridView1" runat="server" OnRowDeleting="GridView1_RowDeleting"
AllowPaging="True">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="img1" runat="server" CommandName="GridView1_RowDeleting" ImageUrl="~/Images/cross.png" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</code></pre>
<p>Default.aspx.cs</p>
<pre><code> protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
10,017
| 10,018
|
GridView DataKeyName for a DropDownList Select Statement
|
<p>When the user selects a row to edit I have a dropdownlist as one of the controls. In order for me to populate that ddl I need one of the datakeyname values (there are three). I was guessing that I could retrieve this value when the OnEditing event fired and pass it to the select statement for the ddl. Just not sure how to do this. I am using a stored procedure to query the Database.</p>
<p>This is my sqldatasource for the ddl -</p>
<pre><code><asp:SqlDataSource ID="SqlDataSourceDebtor" runat="server"
ConnectionString="<%$ ConnectionStrings:AuditDevConnectionString2 %>"
SelectCommand="sp_fc_vm_getDebtorList" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="GridView1" DefaultValue="0" Name="ClientKey"
PropertyName="SelectedValue" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</code></pre>
<p>The "ClientKey" is the datakeyname value I need.</p>
|
c# asp.net
|
[0, 9]
|
1,592,830
| 1,592,831
|
Is there an Cocoa or Objective C api for Java?
|
<p>I'm a Java programmer and i wanted to get into writing so apps for the Iphone. I started to research and found myself looking at xmlvm..that all good, but then xmlvm has a HelloWorld.java with some UIWindow classes that i can't find and can't compile. Short of it is where is the api for Java so i can compile xmlvm's HelloWorld.java for the Iphone. Here's the code: and i've already compiled xmlvm with ant and have xmlvm.jar in my classpath so??</p>
<pre><code>import org.xmlvm.iphone.*;
public class HelloWorld extends UIApplication {
public void applicationDidFinishLaunching(UIApplication app) {
UIScreen screen = UIScreen.mainScreen();
CGRect rect = screen.applicationFrame();
UIWindow window = new UIWindow(rect);
rect.origin.x = rect.origin.y = 0;
UIView mainView = new UIView(rect);
window.addSubview(mainView);
UILabel title = new UILabel(rect);
title.setText("Hello World!");
title.setTextAlignment(UITextAlignment.UITextAlignmentCenter);
mainView.addSubview(title);
window.makeKeyAndVisible();
}
public static void main(String[] args) {
UIApplication.main(args, HelloWorld.class);
}
}
</code></pre>
|
java iphone
|
[1, 8]
|
4,007,849
| 4,007,850
|
javascript not working after php include
|
<p>I am trying to apply javascript twice to a simple html textarea. I have onfocus and autogrow (which is actually jquery). It seems i can only get one or the other to work but never both at once. </p>
<p>My script has an: </p>
<pre><code><?php
include 'header.php';
?>
</code></pre>
<p>This seems to be the problem. In both the header.php and the index.php (where the header is included) I have loaded jquery.js. when I remove this file from the header, autogrow works but not my onfocus event (which clears the default text). Is there a way to include another file without the two effecting each other. I cant provide the code because it too long.</p>
<p>This is my onfocus code:</p>
<pre><code><script type='text/javascript'>
function addEvents(id) {
var field = document.getElementById(id);
field.onfocus = function () {
if (this.value == "Answer this problem...") {
this.value = "";
}
};
field.onblur = function () {
if (this.value == "") {
this.value = "Answer this problem...";
}
};
</code></pre>
<p>}
addEvents("answerbox");
</p>
|
php jquery
|
[2, 5]
|
3,858,475
| 3,858,476
|
How I would call a C# function from javascript?
|
<p>I'm trying to figure out how I would call a C# function from a javascript confirm box. i.e. If user selects 'OK' a function is called, and if user selects 'Cancel' another function is called.
All the code is located in the back page, and looks as follows:</p>
<pre><code>Response.Write(@"
<script language='javascript'>
var msg=confirm('Your new document has been created.\nPress OK to go there now, or Cancle to create another document.');
if (msg==true) {<%=redirect()%>;}
else {<%=clearForm()%>;}
</script>
");
protected void redirect(object sender, EventArgs e)
{
Response.Redirect("myPage.aspx");
}
protected void clearForm(object sender, EventArgs e)
{
//More code here//
}
</code></pre>
<p>Note that all the code within the Response.Redirect is all on one line, I just split it up here for simplicity!
Anyways, this does not work, and I cant find a solution. I've tried various different things within the <code>if</code> statement</p>
<p>My first idea was not to give the user an option, and to simply use:</p>
<pre><code>Response.Write(@"<script language='javascript'>alert('Your new document has been created.');</script>");
Response.Redirect("TaskPanel.aspx");
</code></pre>
<p>But when I tried this, the page did not wait for the user to click OK before redirecting, and hence made it pointless.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,269,317
| 5,269,318
|
Elegant way to combine ASP.NET validation with JQuery
|
<p>How can I best combine JQuery with ASP.NET client side validation model?</p>
<p>I've generally avoided implementing ASP.NET validation model because it always seems overkill for what I was doing. For the site I'm working on now I'm just collecting non critical user data and only need somewhat basic validation. I dont want messages appearing in the DOM or anything like that. I've always found it hard to get that to look right anyway.</p>
<p>But I need now to implement something a little more elegant. What I want to take advantage of in JQuery is clever search expressions like 'tell me if at least one of these checkboxes is checked'. I'm new to JQuery, but I think this is about 1 line of JQuery and a lot more complicated in the traditional ASP.NET model.</p>
<p>So I want to take full advantage of JQuery's abilities but not completely undemine ASP.NET's validation model.</p>
<p>My best approach so far is this (which pretty much goes behind the back of ASP.NET):</p>
<pre><code>$('#<%=btnJoinMailingList.ClientID %>').bind('click', function(event) {
if (...) {
alert("You must enter a name");
return false;
}
return true;
});
</code></pre>
<p>What's a better approach here? Are there any recommended plugins for JQuery ?</p>
<p>PS. I don't want to use MVC model. I'm trying to create a very 'RAD' site and dont have time to delve into that fun new stuff yet.</p>
|
asp.net jquery
|
[9, 5]
|
5,291,628
| 5,291,629
|
jquery for hide repeating clicking image values
|
<p>I am doing a project in bus seat selection.I am in middle of the project.
Now i showing the bus seating arrangement to the customer.When the user click the unselected seat it shows the seat in colored(ie., selected) and also show the selected seat values to the user.This works fine.
when the user deselect the selected seat,the seat deselect and come back to previous stage but the values not removing of that selected seat.
Please have a look at the code.</p>
<pre><code><?php
echo "<table>";
for($i=0;$i<5;$i++)
{
echo "<tr>";
for($j=0;$j<12;$j++)
{
echo "<td>";
$k=$i.$j;
?>
<img src="Seat.jpg" id="<?php echo $k; ?>" class="off">
<?php
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
?>
<div class="seatno"></div>
<script type="text/javascript">
$(document).ready(function(){
$("img").click(function(){
var imageid = $(this).attr("id");
if(imageid)
{
if ($(this).hasClass('off'))
{
$(this).attr("src","Seat-availed.jpg").addClass('on').removeClass('off');
$(".seatno").append(imageid+",");
}
else
{
$(this).attr("src","Seat.jpg").removeClass('on').addClass('off');
// $(".seatno").css("color","red");
var editid;
var rmv = $(".seatno").html();
var editid = $(this).attr("id");
var finder = rmv.find(editid);
alert(finder);
}
}
});
});
</script>
</code></pre>
<p>please find the solution
This code is just like the redbus.in</p>
|
php jquery
|
[2, 5]
|
3,187,895
| 3,187,896
|
Possible to write i-phone app in python
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/43315/can-i-write-native-iphone-apps-using-python">Can I write native iPhone apps using Python</a> </p>
</blockquote>
<p>I just googled whether it is possible to write an i-phone app in Python and
got very confusing, and not super good results.</p>
<p>Is it possible? And if so, what module(s) do I need to install?</p>
|
iphone python
|
[8, 7]
|
4,833,762
| 4,833,763
|
LINQ Except query with an XElement
|
<p>I have a data set that I receive from a service. The data comes in XML format. We are given an XElement object with all the data. The structure of the XML document is very simple. Looks like this:</p>
<pre><code><root>
<dataPoint>
<id>1</id>
<param1>somedata</param1>
<param2>somedata</param2>
</dataPoint>
<dataPoint>
<id>2</id>
<param1>somedata</param1>
<param2>somedata</param2>
</dataPoint>
</root>
</code></pre>
<p>Of course, I have a large number of dataPoints. I also have a list (List) with the id's of dataPoints being displayed in a GUI. What I'd like to have is the dataPoints that ARE NOT displayed on the GUI so I can manipulate only those and not the whole data set.
Thanks</p>
|
c# asp.net
|
[0, 9]
|
1,960,232
| 1,960,233
|
Explanation needed on boolean methods return
|
<p>I've been looking through some code from a decompiled APK file and ran across this syntax for returning a boolean condition that I haven't seen before. Anyone have an explanation on how this works?</p>
<pre><code>public static boolean is2G(NetworkType paramNetworkType)
{
if ((EDGE.equals(paramNetworkType)) || (IDEN.equals(paramNetworkType)) || (CDMA.equals(paramNetworkType)) || (GPRS.equals(paramNetworkType)));
for (int i = 1; ; i = 0)
return i;
}
</code></pre>
|
java android
|
[1, 4]
|
3,149,881
| 3,149,882
|
How do you find all divs by class and delete them all?
|
<p>I have many divs with a specific class and I want to delete all those divs. How do you do this using jQuery or javascript? But, how do you delete <b>all divs</b> with a specific class? Thanks!</p>
<p>code:</p>
<pre><code><div>
<div class='testa'>test a</div>
<div class='testb'>test b</div>
<div class='testc'>test c</div>
<div class='testa'>test a</div>
<div class='testb'>test b</div>
<div class='testc'>test c</div>
<div class='testa'>test a</div>
</div>
</code></pre>
<p>How would you delete all div's with the <code>testa</code> class?</p>
|
javascript jquery
|
[3, 5]
|
5,845,259
| 5,845,260
|
Javascript/Jquery call function every 5 minutes for an 8 hour period
|
<p>I need to call a function every 5 minutes for an 8 hour period. The catch is it must be the on the same day. For example if the user logs onto the system at 11:59pm on 3/29 and it's now 12:01am on 3/30 the function should no longer be called.</p>
<p>I know how to call it ever 5 minutes and have the jquery ajax call coded. That part is fine. My problem is figuring out the date. Will someone please assist me? I can provide more detail if needed.</p>
<p>Thank you kindly in advance,</p>
<p>Nathan</p>
<p>Sorry I forgot the code:</p>
<pre><code>var startDay;
function keepAlive(currDay) {
var today = new Date().getDate();
if (currDay == today) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
data: "{ alive: 'true' }",
url: "../ses/imsi_ses_edit.aspx/KeepSessionAlive",
dataType: "json",
success: function(data) {
},
error: function(response) {
alert(response.responseText);
}
});
}
}
window.onload = function() {
startDay = new Date().getDate();
keepAlive(startDay); //Make sure the function fires as soon as the page is loaded
setTimeout(keepAlive, 300000); //Then set it to run again after five minutes
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,101,460
| 1,101,461
|
Child repeater's item count
|
<p>I am trying to get the child repeater's item count but for some reason it keeps coming up as zero. Here is my code: Parent repeater is rptDays. Child repeater is rptEditInfo.</p>
<pre><code>protected void rptDays_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Repeater rptEditInfo = (Repeater)e.Item.FindControl("rptEditInfo");
...
DateTime thisDay = (DateTime)e.Item.DataItem;
DataSet ds = new DataSet();
...
ds = **bind valid dataset to this variable**
rptEditInfo.DataSource = MRSTable;
rptEditInfo.DataBind();
}
</code></pre>
<p>}</p>
<pre><code>protected void rptEditInfo_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header)
{
Repeater rpt2 = (Repeater)((Repeater)e.Item.Parent);
Repeater rpt1 = (Repeater)((Repeater)sender).Parent.FindControl("rptEditInfo");
int countTest1 = rpt2.Items.Count //always zero
int countTest2 = rpt1.Items.Count //always zero
}
}
</code></pre>
<p>What am I doing wrong? The data is valid and populated. Only thing I can think of is that I am not accessing the child repeater properly. </p>
|
c# asp.net
|
[0, 9]
|
3,098,957
| 3,098,958
|
What does Jquery.Recup mean?
|
<p>well i'm confuse about the line witch says "$.Recup ..." I don't know why it is named the same as the plugin name and what it's for. </p>
<pre><code>(function ($) {
$.fn.Recup = function () {
var parametros = {
};
var tsic = true;
$.Recup = function (opciones) {
var Metodos = {
};
return Metodos;
};
$.Recup.anterior = function () {
};
$.Recup.siguiente = function () {
}
})(jQuery);
</code></pre>
<p>I'm refering to this code, What does <code>$.Recup</code> exactly do?it would be perfect if someone gives me an example please</p>
<pre><code> $.Recup = function (opciones) {
var Metodos = {
};
return Metodos;
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,504,966
| 1,504,967
|
Is there really no way to programmatically click a link using PHP?
|
<p>I have been trying for a while now trying to figure out how to programmatically click a link using PHP and/or javascript. I have it setup so if the user clicks a link it will refresh a table. You don't really need to know why I want to do this b/c then it will go down a whole long road of confusion. Just know that there is a link to be clicked and I really really want to programmatically click that link using PHP and/or javascript. </p>
<p>Is there really no way to do this?</p>
<p>Edit: The code where I need to put the auto-click is in PHP, which would have to create and trigger some javascript or jquery or whatever.</p>
<p>Edit 2: Ok, now that you're all confused ... the real problem is that I have a Drupal form that has a property set to use AJAX when submitting. So the submission is done using the jquery plugin that is a module for Drupal. The AJAX setting is just an attribute setting and I do not have access to the underlying code that goes along with the submission of the form. Which forces me to have to refresh the table after the button is clicked. I really wish I could just attach the refreshing to the button click event for the submit of the form. But since I don't have access to that code I don't believe it's possible.</p>
|
php javascript
|
[2, 3]
|
1,486,482
| 1,486,483
|
Asp.net Permanent redirection Body,Path,QueryString,Method
|
<p>in My Scenario. </p>
<p>I want to redirect all request to another domain that includes Path,QueryStrings,Method,Content </p>
<p>Example
Some user send request to my domain. </p>
<pre><code>POST www.mydomain.com/service?id=5
HEADER {
token:securityToken
UserAgent: Chrome
Accept: application/json
}
BODY
{
Content lorem ipsum
}
</code></pre>
<p>I 'll Check some parameters and change token in the header.</p>
<p>Then </p>
<p>I want to send this request to another domain.</p>
<pre><code>POST www.anotherdomain.com/service?id=5
HEADER {
token:newsecurityToken
UserAgent: Chrome
Accept: application/json
}
BODY
{
Content lorem ipsum
}
</code></pre>
<p>Finally </p>
<p>User will get anotherdomain's response. Is it Possible ?</p>
<p>Server : Windows server 2008
.Net Framework : 4.0</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
38,334
| 38,335
|
Visual Studio Asp.net error
|
<p>Recently, I've created a new web application in Visual Studio 2010. </p>
<p>Now, when I run application, I'm getting error message related with <code>System.EnterpriseServices.Wrapper.dll</code></p>
<p><img src="http://i.stack.imgur.com/kuk9P.png" alt="enter image description here"></p>
<p>Any suggestions?</p>
|
c# asp.net
|
[0, 9]
|
1,243,407
| 1,243,408
|
lightbox dynamic image retrieval
|
<p>I am constructing a lighbox gallery, currently experimenting with FancyBox (http://fancybox.net) and ColorBox (http://colorpowered.com/colorbox).</p>
<p>By default you have to include a link to the large version of the image so that the Lightbox can display it. However, I am wanting to have the image link URLs pointing to a script rather than directly to the image file. So for example, instead of:</p>
<pre><code><a href="mysite/images/myimage.jpg">
</code></pre>
<p>I want to do:</p>
<pre><code><a href="mysite/photos/view/abc123">
</code></pre>
<p>The above URL points to a function:</p>
<pre><code>public function actionPhotos($view)
{
$photo=Photo::model()->find('name=:name', array(':name'=>$view));
if(!empty($photo))
{
$user=$photo->user;
$this->renderPartial('_photo', array('user'=>$user, 'photo'=>$photo, true));
}
}
</code></pre>
<p>At some point in the future the function will also update the view count of the image.</p>
<p>Now this approach is working to an extent - most images load up but some do not load up (the lightbox gets displayed in a malformed state). I think the reason for this is because it is not processing the function quick enough. For example when I click the "next" button it needs to go to the URL, process the function and retreive/output the response.</p>
<p>Does anybody know how I can get this working properly?</p>
|
php jquery
|
[2, 5]
|
4,111,260
| 4,111,261
|
multiplication error
|
<p>If I multiply 12 x 25.4 i get 304.7 whereas I expect 304.8. I see that using odd numbers x 25.4 I get the correct answers but using even numbers always seem to be off by 0.1. I am writing a scientific app that is heavily based on formulas so any insight would be helpful. </p>
<pre><code>if (((m1_sqs1_spinner.getSelectedItem().toString().equals("in"))))
{ // start square in inches
double m1_sqs1_eng = new Double(m1_sqs1.getText().toString());
double square_effective_dia_inch = m1_sqs1_eng;
double square_effective_dia_mm = square_effective_dia_inch * 25.4;
m1_ed_mm.setText(Double.toString(square_effective_dia_mm));
} // end square in inches
</code></pre>
|
java android
|
[1, 4]
|
3,581,954
| 3,581,955
|
re-fetch request in php and javascript
|
<p>here it goes;</p>
<pre><code>echo "<a href='#' class='thumb'><img class='thumb-img' value = ".$row->aid." onclick='getVote(".$row->aid.", \"".$row->atitle."\")' src='images/roadies/th".$row->aid.".jpg' /> </a>";
</code></pre>
<p>the above function sends the "$row->aid" value to a javascript function through ajax.</p>
<p>in the javascript however, i want to make a function that needs the ++value of the $row->aid variable. i want the php to get the new value and then pass it again to javascript.</p>
<p>how do i do it without a page reload?</p>
<p>to make things more clear, i just need to get the next incremented value of the php variable. i want php to get the next ++ value from the DB and pass it back to JS.</p>
<p>please help me do this. ;))</p>
|
php javascript
|
[2, 3]
|
3,802,050
| 3,802,051
|
What do you call it when you pass a parameter to the next parameter
|
<p>I notice a lot of code where people do something like:</p>
<pre><code>myClass.someMethod(something here, $1);
</code></pre>
<p>The $1 is picking up a value from "something here"?</p>
<p>What is this known as? I can't seem to find it anywhere? But this step, process is used in cases with regex quite a bit..</p>
|
c# javascript
|
[0, 3]
|
2,110,272
| 2,110,273
|
Disable and Enable Arrowkeys by javascript
|
<p>I have a scenario where first I need to disable keyboard arrow keys and after some processing again Enable it,for this I write this jquery function</p>
<pre><code>function DisableArrowKeys() {
var ar = new Array(37, 38, 39, 40);
$(document).keydown(function(e) {
var key = e.which;
if ($.inArray(key, ar) > -1) {
e.preventDefault();
return false;
}
return true;
});
}
</code></pre>
<p>this function can disable arrow keys,after some processing I need to enable arrow key for this I made changes in the function like below</p>
<pre><code>function EnableArrowKeys() {
var ar = new Array(37, 38, 39, 40);
$(document).keydown(function(e) {
var key = e.which;
if ($.inArray(key, ar) > -1) {
return true;
}
});
}
</code></pre>
<p>But when we call that function it does not enable arrowkeys.</p>
|
javascript jquery
|
[3, 5]
|
3,047,343
| 3,047,344
|
How to post a HttpWebRequest(include of custom headers) in a new browser window
|
<p>How can i open a httpwebrequest in new window and at the same time have to pass the custom headers with the request in c#.net?</p>
<p>This is my sample code,</p>
<pre><code>HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(url);
WebReq.AddHeader("name","value");
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
</code></pre>
<p>It will work fine, but it will give the response in the same page. I don't want like that. I have to show the response in new window otherwise i have to open the http web request in new window for to show the response in new window.</p>
<p>How can i do this?</p>
|
c# asp.net
|
[0, 9]
|
4,349,367
| 4,349,368
|
convert time_t to ticks
|
<p>I have a function that convert ticks to time_t format</p>
<pre><code> long ticks = DateTime.Now.Ticks;
long tt = GetTimeTSecondsFrom(ticks);
long GetTimeTSecondsFrom(long ticks)
{
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
return (long) (new DateTime(ticks) - epoch).TotalSeconds;
}
</code></pre>
<p>Now i am confused how to convert it back to ticks with some mathematical formula and not with a function.</p>
<p>Any suggestions...??</p>
<p>thanks</p>
<p>Let me take a general case and explain.
DateTime.Now.Ticks give me a value 633921719670980000 which is in tics</p>
<p>then i convert this in time_t with the above function and get tt = 1256575167</p>
<p>now i want to convert this back to 633921719670980000. for this i need a formula</p>
|
c# asp.net
|
[0, 9]
|
2,455,795
| 2,455,796
|
error with jquery offset
|
<p>I'm trying to get a div to appear underneath another div so that I can slide the top div down to reveal the appended second.</p>
<p>I'm pretty far off, but I keep getting an error that jquery's <code>[offset][1]</code> (which I'd like to use to get the position of the top div) is returning undefined. </p>
<p>Maybe this is just the wrong approach for this. Any help is appreciated.</p>
<pre><code>$(document).ready(function() {
$('.obscure').on('click', function() {
var blueDiv = $('.blue').clone();
// blueDiv.css('display', 'none');
$('#wrapper').append(blueDiv);
var obscure = $('#obscure');
var offset = obscure.offset();
console.log(offset);
/*Uncaught TypeError: Cannot read property 'top' of undefined */
var y = offset.top;
var x = offset.left;
console.log(y);
//blueDiv.css('top', y);
$('.obscure').css('z-index', 10000);
});
});
</code></pre>
<p><a href="http://jsfiddle.net/loren_hibbard/U7tAV/" rel="nofollow">http://jsfiddle.net/loren_hibbard/U7tAV/</a></p>
|
javascript jquery
|
[3, 5]
|
937,833
| 937,834
|
jQuery hide and show element and remember using cookie
|
<p>I have the following fiddle here: <a href="http://jsfiddle.net/9jN8L/" rel="nofollow">http://jsfiddle.net/9jN8L/</a></p>
<p>The idea is that sidebar will be shown and if the user clicks the link then it will hide and a cookie will be created and remember that they have hidden it. Should they click it again it will show the sidebar again and delete the cookie (this is why the code is duplicated inside the toggle method functions)</p>
<p>However the sidebar is hidden by default and it doesn't show when the link is clicked after it has been hidden... Can anyone help? Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,924,353
| 2,924,354
|
Setting active class for navigation using javascript
|
<p>I am using PHP to echo my list of navigation options, this is being done due to different privileges for each user. The list is divided into groups which has a few more list items, one a user clicks on the heading of the group expands, listing the sub-menu. I have been able to set the active class for the menu which is currently open using this piece of javascript:</p>
<pre><code>function initMenu() {
$('#menu ul').hide();
$('#menu li a').click(function() {
var checkElement = $(this).next();
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
//slide up if visible (works fine).
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
//otherwise slideDown (works fine too).
}
});
}
$(document).ready(function() {markActiveLink();initMenu();});
function markActiveLink() {
$("#menu li ul li a").filter(function() {
return $(this).prop("href").toUpperCase() == window.location.href.toUpperCase();
}).addClass("active")
.closest('ul') //some markup problem
.slideDown('normal');
}
</code></pre>
<p>And this is my markup for list that are being displayed: </p>
<pre><code>echo "<ul id='menu'>";
echo "<li><a href='#'>Adminstration</a>
<ul><li>";
echo "<a href='path_to_page/usermanagement.php'>User Management</a>";
echo "</li><li>";
// and some more items
</code></pre>
<p><strong>Here administration is my group heading and User Management is my sub-group.
Now using the above piece of code i am still not able to expand my menu on different pages, so that the user knows which page he is on?</strong></p>
|
php javascript jquery
|
[2, 3, 5]
|
5,138,107
| 5,138,108
|
DataReader is reading only even rows
|
<p>I was Binding Data from DB in Grid view.But in the datasource 'CountryList' only even rows is added from data reader. whats wrong with this code?</p>
<pre><code>using (cmd)
{
cmd.CommandType = CommandType.StoredProcedure;
cn.Open();
using (SqlDataReader dr = cmd.ExecuteReader())
{
if (dr.HasRows)
{
while (dr.Read())
{
CountryList.Add(ParseDataReader(dr));
}
cn.Close();
return CountryList;
}
}
}
</code></pre>
<p>and the Parse method is: </p>
<pre><code>public static Countries ParseDataReader(SqlDataReader dr)
{
Countries MyCountries = new Countries();
dr.Read();
if (dr["CountryID"]!=DBNull.Value )
{
MyCountries.CountryID = (int)dr["CountryID"];
}
if (dr["Code"]!=DBNull.Value)
{
MyCountries.Code = dr["Code"].ToString();
}
if (dr["Name"]!=DBNull.Value)
{
MyCountries.Name = dr["Name"].ToString();
}
if (dr["RequiresState"]!= DBNull.Value)
{
MyCountries.RequiresState = (bool)dr["RequiresState"];
}
if (dr["Order"]!=DBNull.Value)
{
MyCountries.Order = (decimal)dr["Order"];
}
return MyCountries;
}
</code></pre>
<p>FYI: My stored procedure is returning correct number of rows.But datareader reading only the even rows from the result.</p>
|
c# asp.net
|
[0, 9]
|
4,002,520
| 4,002,521
|
how to avoid button click event from firing when page refresh occurs in asp.net?
|
<p>I want the code to avoid button click event from firing when page refresh occurs, i can not give response.redirect as i have some labels to be displayed after the button click event occurs.
Is there any chance that i can find out weather the page is page refresh from code behind in .cs ?</p>
<p>Thanks in advance</p>
|
c# asp.net
|
[0, 9]
|
3,976,406
| 3,976,407
|
Loop through all IDs that begin with XXX
|
<p>Would anyone know how to loop through all ID's that being with name_</p>
<p>So, for example, within the markup I may have 50 id's that all start with "name_", the full ID would be like name_2, name_55, name_25, etc.</p>
<p>I'd like to loop through all of these getting the number.</p>
<p>Not really sure where to begin....... thank you!</p>
|
javascript jquery
|
[3, 5]
|
2,890,130
| 2,890,131
|
Time Counter using php and jquery
|
<pre><code>function next_second(){
var target = '1350840000';
var now = <?php echo time();?>;
alert(now);
}
$(function() {
setInterval(next_second, 1000);
});
</code></pre>
<p>the above alert function always returns same value. Am i doing something wrong?</p>
|
php jquery
|
[2, 5]
|
5,721,977
| 5,721,978
|
Value Of Control Assigned With Javascript
|
<p>Why when I assign new value of HiddenField control with javascript, the value of HiddenField control in this case remains the same state (5) when I call it with "<%= this.HiddenField.Value %>" ? But when I call it with "console.log(document.getElementById('<%= this.HiddenField.ClientID %>').value);" this return the chagned state in this case "active", why? How I can get the changed value in code behind (I want "<%= this.HiddenField.Value %>" to return "active"(the changed value)) ?</p>
<pre><code><script>
$(function () {
document.getElementById('<%= this.HiddenField.ClientID %>').value = "active";
console.log(document.getElementById('<%= this.HiddenField.ClientID %>').value); // this return te changed value "active"
console.log('<%= this.HiddenField.Value %>') //this again is 5 not "active"
});
</script>
<asp:HiddenField ID="HiddenField" runat="server" Value="5" />
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,213,408
| 3,213,409
|
jQuery event binding with accessibility in mind - click and keypress
|
<p>Just a quick question, I seem to do this a lot:</p>
<pre><code>$saveBtn.bind("click keypress", function(e)
{
if (e.type != "keypress" || e.keyCode == 13)
{
// Do something...
return false;
}
});
</code></pre>
<p>Is there a quicker way to bind an 'action' listener to a button? I want to always ensure my buttons with event listeners fire on both clicks and the enter key...this seems like it'd be a fairly common thing to want to do but found nothing on google. Any thoughts?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,533,578
| 1,533,579
|
Emptying keyboard buffer in javascript
|
<p>If I have an element that responses on </p>
<pre><code>$('#div').keydown(function(event) { ....
</code></pre>
<p>and if user presses a key like a crazy rabbit on heat thousand times within a really short period, browser responses on most of those calls. </p>
<p>Can I somehow prevent that by flushing keyboard buffer?</p>
|
javascript jquery
|
[3, 5]
|
3,696,656
| 3,696,657
|
How to ensure that a function is executed completely, before navigating to another page?
|
<p>I'm removing certain records using a webservice. The jquery ajax request is written in the onclick of a hyperlink. When im executing the script, line by line using firebug, it's getting removed otherwise it's not. Does any one meet any situation like this before? Please help</p>
<p>Code sample:</p>
<pre><code> $(".target").click(function() {
func(); //This function should be executed completely before navigating to another page
});
var func = function() {
var items = $("#flag").find('td input.itemClass');
id = items[0].value;
var status = items[1].value;
var type = items[2].value;
var params = '{' +
'ID:"' + id + '" ,Type:"' + type + '" ,Status:"' + status + '"}';
$.ajax({
type: "POST",
url: "WebMethodService.asmx/DeleteItem",
data: params,
//contentType: "plain/text",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
$("#deleteNotificationMessage").val("Item has been removed"); // keep a separate label to display this message
}
//Event that'll be fired on Success
});
}
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,495,024
| 2,495,025
|
Stop your code injecting javascript twice?
|
<p>I have a method that does something, and it puts a javascript method into the page that it uses. I need to make sure that it only puts the javascript method in once regardless of how many times it is called.</p>
<p>What's the best way to do this? Can I search the section of page that has rendered so far and see if the method was already created?</p>
|
asp.net javascript
|
[9, 3]
|
2,067,882
| 2,067,883
|
Get div id using javascript
|
<p>Here's some HTML:</p>
<pre><code><div class="results">
<div id="1">something</div>
<div id="2">something else</div>
<div id="3">blah blah blah</div>
<div id="4">etc</div>
</div>
</code></pre>
<p>Now if I can call this using jQuery:</p>
<pre><code>var div = $(".results > div");
div.click(function()
{
alert(this.childNodes[0].nodeValue);
});
</code></pre>
<p>When clicking on a div, it will call an alert box saying whats in the div (from the list above: one of 'something', 'something else', 'blah blah blah' or 'etc'). Does anyone know how I can get it to alert the id (in this example, 1, 2, 3 or 4) of the div rather than the information within the node?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,834,226
| 2,834,227
|
asp.net error: Parser Error
|
<p>I'm suddenly getting below message in browser when debugging application out of Visual Studio 2008 target .net fw 3.5</p>
<p>Research online lead me to confirm the following:
The "Inherits" in markup page matches code-behind namespace class reference: "USFBugTracker.UpdateContracts". I also checked that the target CPU (x86) is correct.</p>
<p>I'll gladly post some code but when debugging not even getting to the point of running anything. I'm getting this debugging. I've not yet published this anywhere.</p>
<p>Any ideas? Thanks.</p>
<h2>Server Error in '/' Application.</h2>
<p>Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. </p>
<p>Parser Error Message: Could not load type 'USFBugTracker.UpdateContracts'.</p>
<p>Source Error: </p>
<pre><code>Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdateContracts.aspx.cs"
Line 2: Inherits="USFBugTracker.UpdateContracts" %>
Line 3:
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,800,762
| 2,800,763
|
Difference between $('selector')[0] ,$('selector').eq(index) in jquery.
|
<p>What is the difference between <code>$('#div1 a')[0]</code> and <code>$('#div1 a').eq(0)</code> for the following markup</p>
<pre><code><div id="div1">
<a href="#">click</a>
</div>.
</code></pre>
<p>Please Help.</p>
|
javascript jquery
|
[3, 5]
|
2,469,272
| 2,469,273
|
Jquery convert object to string and slice
|
<p>Via ajax-based script i get object:</p>
<p>for example:</p>
<pre><code>item.TYP_PCON_START
</code></pre>
<p>which value is, for example 201212...
When i try to slice him, i get oject error...</p>
<p>How could i slice this object so, that for example i get 2012, or better set two last numbers on furst place and add dot, like:</p>
<pre><code>12.2012
</code></pre>
<p>How could i do this? (i append this text as value of select list)</p>
|
javascript jquery
|
[3, 5]
|
1,732,209
| 1,732,210
|
Joining functions together - cleaner code
|
<p>Is there a way to shorten my code. I need to add about 15 more functions which all do the same thing.</p>
<pre><code>$(document).ready(function() {
$('.map-highligh').maphilight({
});
//north roll over
$('#hilightlink').mouseover(function(e) {
$('#north').mouseover();
}).mouseout(function(e) {
$('#north').mouseout();
}).click(function(e) { e.preventDefault(); });
//Wellington roll over
$('#hilightlink-wel').mouseover(function(e) {
$('#wellington').mouseover();
}).mouseout(function(e) {
$('#wellington').mouseout();
}).click(function(e) { e.preventDefault(); });
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,530,656
| 3,530,657
|
Jquery onchange alternative that works with auto fill form plugins
|
<p>How can I get the JavaScript onChange to work with a <a href="http://autofillforms.mozdev.org/drupal/content/main-page" rel="nofollow">autofill</a> form extension. The problem is that when you click the button to autofill the form it doesn't call the onChange. Is thre a work around for this?</p>
<p>Example HTML:</p>
<pre><code><select onchange="$('select[name=\'zone_id\']').load('index.php?country_id=' + this.value + '&amp;zone_id=');" name="country_id">
<option value="false"> --- Please Select --- </option>
<option value="1">Afghanistan</option>
<option value="2">Albania</option>
<option value="3">Algeria</option>
</select>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,033,603
| 3,033,604
|
jQuery, how to preload images and be notified when images are loaded?
|
<p>i am still new to all the Javascript stuffs and i have to be honest that i have not yet experimented anything concerning my question.</p>
<p>I would like to know if there is a way or a plugin with jQuery to preloaded multiples images and call a function when the images are loaded?</p>
|
javascript jquery
|
[3, 5]
|
2,784,136
| 2,784,137
|
how to Put add in our android application
|
<p>I have created an application for admob, but I am getting an error. I found an example from Google and I have tried it, but there is a problem when I'm launching the application .</p>
<p>I'm using Android 2.2 API 8.
I am able to launch the application, but this block is causing an error.</p>
<pre><code>android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</code></pre>
<p>If I change this to</p>
<pre><code>android:configChanges="keyboard|keyboardHidden"
</code></pre>
<p>then I am able to launch the application, but there is an error coming on our add field.</p>
<pre><code>you must have adactivity declare in Android Manfiest.xml with config change
</code></pre>
<p>Due to this I am not able to show google adds in our application.</p>
<p>Please help me to fix this.</p>
|
java android
|
[1, 4]
|
317,992
| 317,993
|
Jquery slider javascript help required, thumbnails not in correct order
|
<p>I am using wow slider and there is some issue, which causes the bullets, which onhover show thumbs of images and point to that image in sequence onClick. Howeverver at no. 13 and afterwards images are not in sync (as shown on bullet hover/onMouseover), but click on bullet in slideshow points to correct image.</p>
<p>I tweaked some css but in vain..is it possible to do it by editing Script.js or style.css, Please somebody help to resolve this.</p>
<p><a href="http://kapilind.sitesled.com/wow/index.htm" rel="nofollow">Please see the code in action here</a>.</p>
<p>Thanks in Adv,</p>
<p>Anita</p>
<p>[PS: I am using IE7.0 as browser.]</p>
|
javascript jquery
|
[3, 5]
|
228,356
| 228,357
|
How can I set a table cell's background color to red when none of the radio buttons in it are selected?
|
<p>I am new to JavaScript in general and jQuery in particular and need some help.</p>
<p>I need to write a script to validate that a radio button is selected. If none of the radio buttons are selected I want the table cell they are in to be highlighted in red to alert the user about it.</p>
<pre><code><table>
<tr><td><input type="radio"/></td><td>value 1</td></tr>
<tr><td><input type="radio"/></td><td>value 2</td></tr>
<tr><td><input type="radio"/></td><td>value 3</td></tr>
</table>
<input type="submit"/>
</code></pre>
<p><strong>Edit</strong></p>
<p>I only want the cells containing the radio buttons to be highlighted </p>
|
javascript jquery
|
[3, 5]
|
2,138,811
| 2,138,812
|
How can I simplify this Javascript function?
|
<p>I'm trying to scale this but I'm a little green when it comes to creating JS functions. I managed to get this far on my own, but alas...</p>
<p>When a span gets a value of whatever (in this case, a city name), I want the select box to automatically match it. And I want to scale this by getting rid of all these else if's.</p>
<pre><code>$(document).ready(function() {
$('select#field1 option').removeAttr('selected');
var whereEvent = $('span#field2').html();
if (whereEvent == 'New York') {
$('select#field1 option[value=New York]').attr('selected', 'true');
} else if (whereEvent == 'Los Angeles') {
$('select#field1 option[value=Los Angeles]').attr('selected', 'true');
} else if (whereEvent == 'Tokyo') {
$('select#field1 option[value=Tokyo]').attr('selected', 'true');
} else if (whereEvent == 'London') {
$('select#field1 option[value=London]').attr('selected', 'true');
} else if (whereEvent == 'Sydney') {
$('select#field1 option[value=Sydney]').attr('selected', 'true');
} else if (whereEvent == 'Paris') {
$('select#field1 option[value=Paris]').attr('selected', 'true');
}
});
</code></pre>
<p>Can someone help me out here? I promise I'll be grateful for your help. Thank you.</p>
|
javascript jquery
|
[3, 5]
|
118,302
| 118,303
|
Insert element into div with jQuery, append not working
|
<p>I have the following code:</p>
<pre><code>$('input[id$="txtTecnicas"]').bind('keypress', function (e) {
//if user presses enter
if (e.keyCode == 13) {
//cancel asp.net postback
e.preventDefault();
//if value of textbox is not empty
if ($(this).val() != "") {
//Save value into valueTec
var valueTec = $(this).val();
//Clear textbox value
$(this).val("");
//Create tag div to insert into div
var texthtml = '<span class="tag" title="' + valueTec + '">' + valueTec + ' <a>x</a><input type="hidden" value="1" name="tags"></span>';
//Append the new div inside tecTagHolder div
$('[id$="tecTagHolder"]').append(texthtml);
}
}
});
</code></pre>
<p>However, it is not inserting the code into tecTagHolder div, and since it need to insert into tecTagHolder many divs, one each time user press enter, I cannot use <code>.html()</code> command but with append it doesn't append even a "Hello" string! what could it be wrong? Thanks a lot!</p>
|
jquery asp.net
|
[5, 9]
|
5,212,242
| 5,212,243
|
Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null
|
<p>Hi anyone who have encountered a "System.Threading.ThreadAbortException" where a redirect has been used.</p>
<p>After some searches, i am ment to understand the redirect.end is what causes this. The sugestion is to specify the "bool endresponce" i.e. responce.redirect("mypage.aspx",false).</p>
<p>Any help will be highly appreciated.</p>
|
javascript asp.net
|
[3, 9]
|
2,084,750
| 2,084,751
|
Getting hours occupied in a day
|
<p>Say I have a variable <code>DayHours</code> and a <code>DateTime</code> called <code>CurrentDay</code>.</p>
<p>I have events with a start date, an end date, and hours. They all fall within <code>CurrentDay</code>
If it is the last day of the event and the end date == <code>CurrentDay</code>, then I need the remainder. So if a day lasts 5 hours and an event is 14 hours and today is the last day, I would return 4.</p>
<p>If the event starts and ends on the same day, I return its hours. If an event is multiple days and <code>CurrentDay</code> is not the last day of the event, I return <code>DayHours</code>.</p>
<p>How could I do this in C#?</p>
|
c# asp.net
|
[0, 9]
|
2,873,153
| 2,873,154
|
C# Javascript Beautifier
|
<p>I am wondering if anyone knows of an open source c# library for beautifying javascript. I would like to make use of such a library within my asp net website to make debugging messy javascript easier.</p>
<p>There are currently many online websites for this (ie. <a href="http://jsbeautifier.org/" rel="nofollow">http://jsbeautifier.org/</a>) however I would like to have access to such a utility within c#, even if it is just a wrapper for communicating with an online API.</p>
<p>Many Thanks,
Chris</p>
|
c# javascript
|
[0, 3]
|
5,823,002
| 5,823,003
|
Calling Function in a forloop
|
<p>I am trying to call a function inside the FOR LOOP. Since the format is same except for names of the data passed.</p>
<pre><code>renderCharts(data1, axis1, 'mainchart1');
</code></pre>
<p>What i am doing</p>
<pre><code>var data1 = [12, 45, 30, 80];
var axis1 = ['15 Jan', '22 Jan', '29 Jan', '5 Feb'];
var data2 = [89, 45, 30, 80];
var axis2 = ['15 Jan', '22 Jan', '29 Jan', '5 Feb'];
for(var i = 1; i <= 2; i++){
renderCharts("data"+i, "data"+i, "mainchart"+i)
}
</code></pre>
<p>Some reason its not working.</p>
|
javascript jquery
|
[3, 5]
|
569,418
| 569,419
|
How to remove row on click on confirm message true?
|
<p>I have a asp gridview. On row databound I add onclick event to view item details. I have also delete button. The problem is <strong>When I click item delete, it deletes item but also redirect to item preview page.</strong> It should not do a postback and redirect</p>
<p>here is my code</p>
<pre><code> protected void Grid_DataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Attributes["onClick"] = String.Format("location.href='" + "/Url/page.aspx?id=" + "{0}", DataBinder.Eval(e.Row.DataItem, "Id") + "'");
}
</code></pre>
<p>delete button</p>
<pre><code>public void GvDeleteHabit(object source, CommandEventArgs e)
{
int id= Convert.ToInt32(e.CommandName);
Delete(id);
}
<asp:LinkButton OnCommand="Delete" title="Delete" OnClientClick="javascript:return confirm('Do you want to delete?')"
CommandName='<%# Eval("Id")%>' runat="server" ID="BtnDelete"></asp:LinkButton>
</code></pre>
<p>on client side I have confirm message. So what I'm trying to achieve is when user click delete button and Yes, I need to remove onclick event from row and delete item.</p>
<p>if user click No stop page from loading. so user can click somewhere on row and view details of item</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
3,239,858
| 3,239,859
|
same session value exists among different users
|
<p>I am developing and intranet web application. In Global.asax file's session_start event I get the domain identity using user.idenity and put it into session value. Now I have a master page where I am accession that session value to show the user name.</p>
<p>I am using windows authentication and identity impersonation true. But after publishing it the user name who first logins in the system gets displayed to everyone.</p>
<p>I am not able to find out the cause. Please suggest.</p>
|
c# asp.net
|
[0, 9]
|
4,398,355
| 4,398,356
|
Set html from 1 div to another using jQuery
|
<p>I have 1 div and 1 text input field, the div is visible and the input is hidden. The input one gets its value from a range slider, I want to use jQuery somehow to take the value from this input area and populate the div on the fly, I've tried the following with no luck, can anybody see where i may be going wrong?</p>
<pre><code> $( ".value-slider" ).val( $( "#val-slider" ).slider( "value" ) );
$( ".price" ).html( $( ".value-slider" ).html() );
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,091,843
| 5,091,844
|
text is not allowed between starting and closing tags of an element <table>
|
<p>I have an error when playing with a table saying:<br></p>
<pre><code>"text is not allowed between starting and closing tags of an element table"
</code></pre>
<p>Table is like this....</p>
<pre><code><table id="Content2" class="createAccountTable" cellpadding="0" cellspacing="0" style="width: 240px;">
<tr>
<td colspan="2" align="left" valign="top" class="topicStyle">
<h3>Order Summary</h3>
</td>
</tr>
<tr align ="center">............
</code></pre>
<p>Thanks guys!! </p>
|
javascript asp.net
|
[3, 9]
|
6,018,074
| 6,018,075
|
JQUERY Sorting an Array of Objects
|
<p>I have an array that is holding a number of objects.</p>
<p>Array: </p>
<pre><code> var activeMembers=[];
</code></pre>
<p>The DIV objects in the above array look like as follows - each was added one at a time:</p>
<pre><code> <div id="mary" class="chatmember 1011"></div>
<div id="steven" class="chatmember 1051"></div>
<div id="adam" class="chatmember 1701"></div>
<div id="bob" class="chatmember 1099"></div>
<div id="peter" class="chatmember 1123"></div>
</code></pre>
<p>Is there a quick way to sort theses DIV objects in the array by the ID from A-Z?</p>
<p>thx</p>
|
javascript jquery
|
[3, 5]
|
4,136,161
| 4,136,162
|
Running js file only once
|
<p>I have a small intro with fadein's etc.. But i would only like this to run once. I dont want to run the intro every time the user returns to the home page. Is there a way to run a js file once?</p>
|
javascript jquery
|
[3, 5]
|
1,898,019
| 1,898,020
|
Can someone figure out what this JavaScript code is doing?
|
<p>I'm trying to figure out how a website works, and I've come to some packed JavaScript that won't seem to unpack with JSBeautifier.org. Can someone understand what it's doing?</p>
<pre><code>eval(function (p, a, c, k, e, r) { e = String; if (!''.replace(/^/, String)) { while (c--) r[c] = k[c] || c; k = [function (e) { return r[e] } ]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p } ('$(\'#0\').1(\'\');', 2, 2, 'timestamp|val'.split('|'), 0, {}))
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,056,208
| 1,056,209
|
Javascript for running code-behind code when a button is clicked
|
<p>i have a popup that is getting displayed when Save button is clicked. The popup has 2 buttons. Yes and No. No should cancel the popup
and yes should take you to function in the code-behind say, btnSave_Click(object sender, Eventargs e). How is it possible. Could someone help me, i am new to Javascript.</p>
<p>Below is the code where i am showin the popup.</p>
<pre><code>var mdlPopup = $find('<%= ModalPopupExtendersavechanges.ClientID %>');
if(mdlPopup)
{
mdlPopup.show();
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,805,210
| 2,805,211
|
Changing an element's ID with jQuery
|
<p>I need to change an element's ID using jQuery. </p>
<p>Apparently these don't work:</p>
<pre><code>jQuery(this).prev("li").attr("id")="newid"
jQuery(this).prev("li")="newid"
</code></pre>
<p>I found out that I can make it happen with the following code:</p>
<pre><code>jQuery(this).prev("li")show(function() {
this.id="newid";
});
</code></pre>
<p>But that doesn't seem right to me. There must be a better way, no? Also, in case there isn't, what other method can I use instead of show/hide or other effects? Obviously I don't want to show/hide or affect the element every time, just to change its ID.</p>
<p>(Yep, I'm a jQuery newbie.)</p>
<p><strong>Edit</strong><br>
I can't use classes in this case, I must use IDs.</p>
|
javascript jquery
|
[3, 5]
|
5,354,765
| 5,354,766
|
HtmlTextWriter to String - Am I overlooking something?
|
<p>Perhaps I'm going about this all wrong (and please tell me if I am), but I'm hitting my head against a wall with something that seems like a really simple concept.</p>
<p>This Render override is coming from a User Control.</p>
<pre><code>protected override void Render(HtmlTextWriter writer)
{
string htmlAboutToBeRendered = writer.GetWhatHasBeenWrittenToTheWriterSoFar();
// Do something nefarious, yet unrelated with htmlAboutToBeRendered
}
</code></pre>
<p>This seems like a there would be an obvious way to do this, but I can't seem to find it.</p>
<p>Can anyone shed some light on this for me, please?</p>
|
c# asp.net
|
[0, 9]
|
570,552
| 570,553
|
Set focus on first item of the suggestions list displayed in autocomplete
|
<p>I need to customize <code>autocomplete</code> widget so that the first item of the suggestions list is selected by default, so that as soon as user hits <code>enter</code> the first item of the suggestions list is selected in the autocomplete.</p>
<p>How can I do that ?</p>
<hr>
<p>I am <strong>not using jquery's autocomplete directly</strong> but through primefaces which doesnt provide option to specify autoFocus. Thus I would need to implement this autoFocus manually .</p>
<p>Can someone let me know how I can put the focus on the first item of list even while typing in the input field</p>
|
javascript jquery
|
[3, 5]
|
3,872,251
| 3,872,252
|
Empty Http Call but no error
|
<p>I'm trying to call a webservice with my application, but I get no error, the URL is the good one and return something (via the browser), but I get no content.</p>
<pre><code>try {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
int lenght = (int) entity.getContentLength();
is = entity.getContent();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection" + e.toString());
}
</code></pre>
<p>lenght is equal to -1 due to the empty response he receives</p>
<p>Does the response from the url need to be HTML ? Or anything I output can be grab by the HttpClient ?</p>
|
java android
|
[1, 4]
|
2,896,813
| 2,896,814
|
testing user entry on keyup and regex
|
<p>In my case the requirement is like - </p>
<p>The first name should allow alphabets, some chars like comma, dash and ascent chars.</p>
<p>The code works fine when we try to paste the ascent chars or use "abctajpu" add on in firefox. But as soon as user types in ALT+0192 or any ALT key with num pad. </p>
<p>The keyup function does not work. It lets the user to key in every possible combination with the ALT key.</p>
<p>Here is the sample code..</p>
<pre><code>var namePattern = /^[a-zA-Z,-. \'ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸçÇŠšŽžÅå]$/g;
var negateNamePattern = /[^a-zA-Z,-. \'ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸçÇŠšŽžÅå]/g;
</code></pre>
<hr>
<pre><code>$("#First_Name").bind('keyup paste altKey', function(event) {
var obj = $(this);
if (event.type == 'paste') {
setTimeout(function() {
validateRealTime(event, obj, namePattern, negateNamePattern)
}, 1);
} else {
validateRealTime(event, obj, namePattern, negateNamePattern);
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,914,055
| 2,914,056
|
JQuery selector for inline style property
|
<p>I would like to use a jquery to select the following span:</p>
<pre><code><span id="RequiredFieldValidator1" class="validationerror" style="color: Red; display: none;">*</span>
</code></pre>
<p>But not select the following span which differs from the original in that the style attribute has a display property whose value is inline instead of none.</p>
<pre><code><span id="RequiredFieldValidator2" class="validationerror" style="color: Red; display: inline;">*</span>
</code></pre>
<p>I am aware inline styles are evil but an asp.net web forms validator control is generating it and doing a lot of good as well as evil.</p>
<p>Can this be done using jquery selectors? I'm new to jquery.</p>
|
asp.net jquery
|
[9, 5]
|
3,160,137
| 3,160,138
|
What does BatteryStatus isCharging gives back?
|
<p>If you run this code, what does <code>isCharging</code> give back when it's charging and when it's full?</p>
<pre><code>public void onReceive(Context context, Intent intent) {
IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = context.registerReceiver(null, ifilter);
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
boolean isCharging = status == BatteryManager.BATTERY_STATUS_CHARGING ||
status == BatteryManager.BATTERY_STATUS_FULL;
}
</code></pre>
|
java android
|
[1, 4]
|
1,195,030
| 1,195,031
|
why my code that write by me is upper,when keyup
|
<pre><code>$('#a').keyup(
function(event){
alert(event.keyValue)
}
)
</code></pre>
<p>but error,coz 'keyValue' is not undefined,</p>
<p>how do i get the keyValue when the event keyup???</p>
<p>i use jquery.</p>
<p>thanks</p>
<hr>
<p>i do this:</p>
<pre><code>$('#a').keyup(
function(event){
alert(String.fromCharCode(event.which))
}
</code></pre>
<p>but it alert the value of upper</p>
<p>ex: </p>
<p>i alert I</p>
<p>l alert L</p>
<p>why???
)</p>
|
javascript jquery
|
[3, 5]
|
1,008,925
| 1,008,926
|
Finding out which CSS property is being animated by jQuery
|
<p>I see that <code>$element.is(':animated')</code> tells me if $element is being animated but is it possible to see which css properties are being animated.</p>
|
javascript jquery
|
[3, 5]
|
764,003
| 764,004
|
Don't want spaces in the text, but this regex is passing not sure why
|
<p>I am using the following regex</p>
<pre><code>/[a-zA-Z0-9]+/i.test(value)
</code></pre>
<p>If I enter a space in the word, it passes.</p>
<p>I don't see where spaces are aloud in the regex, why is it passing?</p>
|
asp.net javascript
|
[9, 3]
|
2,779,468
| 2,779,469
|
If statement not accepting variable value
|
<p>I have this code:</p>
<pre><code>meJi = 33;
$.ajax({
type: "POST",
url: mega,
data: string,
beforeSend: function() {
$('#loading').html("<img src='images/loading.gif'/>").fadeIn('fast');
},
complete: function() {
$('#loading').fadeOut('fast');
},
success: function(msg) {
loading_hide();
f = (msg).length;
if (f <= 1250) {
alert("su busqueda no presenta resultados");
code(3);
else {
$("#container").html(msg);
fdemandados();
}
}
});
function code(ig) {
console.log(img);
meJi = ig;
}
$("#select_comprobar3").on('click', function(event) {
tacuba = $("#amazon").val();
ca = "2";
dan = "g";
if (meJi ==3) {
avisobusqueda2 = $("#avisofiltro").html("zzzFiltro activado Busqueda por la palabra: " + tacuba + " - clic para quitar ").fadeIn('slow');
} else {}
if (!tacuba) {
alert("Debe ingresar una palabra");
} else {
lor = tacuba;
var page = "1";
loadData(page, dan, lor);
}
event.stopImmediatePropagation();
return false;
});
</code></pre>
<p>the problem is this:</p>
<pre><code>if (meJi==3) {
</code></pre>
<p>I don't know why but meJi variable never changes to 3 so the conditional always assume that meJi is 33.</p>
<p><strong>edit: Im change the conditional part but the problem still exist.</strong></p>
|
javascript jquery
|
[3, 5]
|
1,175,789
| 1,175,790
|
Java to php, Byte, Type, Array
|
<p>Here is a small Java Code Snippet.</p>
<pre><code>ConfigData[] cd = new ConfigData[1];
cd[0] = new ConfigData();
byte[] tmpbyte ={1,(byte)0x01};
cd[0].settmpdata(tmpbyte);
</code></pre>
<p>"ConfigData" is my custom Type (int, Byte Array). </p>
<p>In my last thread i found the tip how to Build / work with a "ByteArray" in php.
But this seems to be a question of the structure of those objects / array.</p>
<p>So..
How can i depict that in PHP.</p>
|
java php
|
[1, 2]
|
5,645,958
| 5,645,959
|
Jquery animation looping
|
<p>I am trying to make this animation loop</p>
<pre><code> $(".jquery_bounce").ready(function(){
$("img", this).animate({ marginLeft : '20px' } , {
duration: 200,
complete:function() {
$(this).animate({ marginLeft : '0px' } , {
duration: 200,
easing: 'easeInCubic',
});
}
});
})
});
<div class="example">
<h4>Bounce</h4>
<div class="jquery_bounce bounce">
<img src="images/bounceimg.png" class="bounceimg" />
</div>
</div>
</code></pre>
<p>Please help.</p>
|
javascript jquery
|
[3, 5]
|
5,362,729
| 5,362,730
|
DateTime Variable
|
<p>I want to pass a null value for a DateTime variable in C#. The value should be stored in the database as null.</p>
<p>I've tried using Datetime.Minvalue, but that stores a default value. It has to be a null in database. How do I do that?</p>
|
c# asp.net
|
[0, 9]
|
2,773,504
| 2,773,505
|
Android best practices
|
<p>I was wondering if there are any lists of best practices for Android/Java. I know there are in .Net like using String.Concat instead of blah & blah.</p>
<p>Are there any that you have found, others might not know about?</p>
|
java android
|
[1, 4]
|
246,593
| 246,594
|
Is Minus Zero some sort of JavaScript performance trick?
|
<p>Looking in the jQuery core I found the following code convention:</p>
<pre><code>nth: function(elem, i, match){
return match[3] - 0 === i;
},
</code></pre>
<p>And I was really curious about the snippet <code>match[3] - 0</code></p>
<p>Hunting around for '-0' on google isn't too productive, and a search for 'minus zero' brings back a reference to a Bob Dylan song.</p>
<p>So, can anyone tell me. Is this some sort of performance trick, or is there a reason for doing this rather than a <code>parseInt</code> or <code>parseFloat</code>?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
719,073
| 719,074
|
Increment counter unavailable outside of loop
|
<p>I am looping through json return values with jQuery's $.each() and adding the classes returned to their corresponding <code><div></code>'s; however the counter appears to be inaccessible for further processing outside of the immediate loop. I have tried using return's & external function calls to no avail. When I alert() the counter inside the iteration, it shows up correctly; and all of the classes update properly. Any insight would be much appreciated.</p>
<p>Code:</p>
<pre><code>var c = 0;
function refreshIt(){
var page = $(".navselected").attr('id');
var ids = $('.content div[id]').map(function(){
return this.id;
}).get();
$.ajax({
type:'POST',
url:page + 'functions.php',
data:{'idList[]':ids},
dataType:'json',
success:function(data){
$.each(data,function(element,load){
$("#" + element).slideUp(400,function(){
$("#" + element).removeClass("critical ok");
$("#" + element).addClass(load.status).html(load.number).slideDown(400);
if(load.status == 'ok'){
c++;
}
else{
c++;
}
});
});
$('.infostatus').addClass('infook').html("There are " + c + " errors on this page. Kudos!");
}
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.