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,724,083 | 3,724,084 |
appointment scheduling with jquery
|
<p>I'm going to create a simple appointment scheduling to set appointment for doctor,some thing like this : <a href="http://arshaw.com/fullcalendar/" rel="nofollow">http://arshaw.com/fullcalendar/</a></p>
<p>I almost know anything about jquery and javascript but I hope this be a commence to learn more and of course my boss has asked me to do that.because the created appointment scheduling plugins don't support persian date,they're useless for me,where should I start form?I wanna set appointment be done bye drag and drop on the surface,like google calendar:</p>
<p><a href="http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/full_demo/weekcalendar_full_demo.html" rel="nofollow">http://jquery-week-calendar.googlecode.com/svn/trunk/jquery.weekcalendar/full_demo/weekcalendar_full_demo.html</a></p>
<p>please suggest me references and some required steps to study and do this.</p>
<p>I appreciate any help</p>
|
javascript jquery
|
[3, 5]
|
3,014,956 | 3,014,957 |
French characters to html entities
|
<p>I am passing some French characters in an ajax call to our database. They are expecting É to be passed as <code>%26Eacute%3B</code>, é to be passed as <code>%26eacute%3B</code>, etc. How can I do this in javascript?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
193,573 | 193,574 |
jQuery/Javascript - Remove All target="_blank"
|
<p>I'm messing around with jQuery and ran in to a problem I can't seem to solve. I know it's possible with jQuery, but can't find a proper example to work off of. I have a page with a couple regular links with the value <strong>target="_blank"</strong> added to it. What's the best approach with jQuery/Javascript to remove that value from every link on the page?</p>
<p>Any help is greatly appreciated, thank you!</p>
|
javascript jquery
|
[3, 5]
|
641,690 | 641,691 |
Javascript alert test not working
|
<p>I should be sleeping but this is really bugging me. I can't get a simple javascript alert box to display in my asp.net project. Hopefully someone can see what I'm doing wrong. My test page is this:</p>
<pre><code><%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="JSTest.aspx.cs" Inherits="Proj.JSTest" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Header" runat="server">
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript" language="javascript" >
$(document).ready(function() {
alert("Working");
});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" runat="server">
</asp:Content>
</code></pre>
<p>The masterpage is pretty standard as well. Here's the header part of it (which I figure is the key bit)</p>
<pre><code><head runat="server">
<title></title>
<%--<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> --%>
<link href="App_Themes/Default/Default.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="Header" runat="server">
</asp:ContentPlaceHolder>
</head>
</code></pre>
<p>I know I must be missing something obvious - probably just need sleep :D. But if anyone can see why this isn't working, that would be great!</p>
<p>Thanks!</p>
|
asp.net javascript jquery
|
[9, 3, 5]
|
1,592,083 | 1,592,084 |
Create element using JavaScript and jquery
|
<p>Suggest a better way to do the following in jquery . also give me the native js code to do it</p>
<pre><code>$('<div id="dialog-confirm" title="'+confirmbox.title+'"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>'+confirmbox.message+'</p></div>')
.appendTo('body');
</code></pre>
<p>Why the need. look at "Idiomatic Syntax for Creating Elements" section of this link <a href="http://stackoverflow.com/tags/jquery/info">http://stackoverflow.com/tags/jquery/info</a></p>
|
javascript jquery
|
[3, 5]
|
4,573,022 | 4,573,023 |
ASP.NET Usercontrol client side name not resetting after being renamed
|
<p>I have a usercontrol in an ASP.net website which client side id was "contact_us" with the ct00 etc, but I have renamed the usercontrol to "feedback", cleaned, rebuilt, published and recycled the app pool and still the name "contact_us".</p>
<p>Does anyone have any idea why the client side name is not reflecting its server side name after being renamed?</p>
<p>This is an important issue which I need to resolve (client not happy).</p>
<pre><code>public partial class Contact_Us: TransactionUserControl
{
#region Public ...
public partial class Feedback : TransactionUserControl
{
#region Public ...
</code></pre>
<p>Thanks for your time</p>
|
c# asp.net
|
[0, 9]
|
2,922,580 | 2,922,581 |
injecting today's date in javascript
|
<p>When the page loads, I want a variable inside my JavaScript to hold today's date. So far I have this:</p>
<pre><code><script type="text/javascript">
var TodayDate = <%Eval('System.DateTime.Now') %>;
</script>
</code></pre>
<p>It massively bugs. Any suggestions?</p>
|
javascript asp.net
|
[3, 9]
|
3,859,091 | 3,859,092 |
jQuery: Onclick, open a new div with ID
|
<p>I'm creating a footer chat bar from this tutorial here: <a href="http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/" rel="nofollow">chat bar tutorial</a></p>
<p>I'm trying to make it so when I click a username in the buddylist, it opens up a new chat box div in the chat bar itself. And, when the div is created/opened, it also assigns an ID to it. For example, it assigns the buddy's username to it.</p>
<p>I'm not sure if you need anymore information. If so, I'd be glad to provide it. Or if I don't make sense, I'll try to clarify more.</p>
<p>Thanks.</p>
|
php jquery
|
[2, 5]
|
2,206,633 | 2,206,634 |
jQuery rich text editor with word counter
|
<p>I need a rich text editor like this one used on this site, with a word counter on it, i will love to restrict the total work count like on twitter, preferrably written with jQuery, please any tip, i will greatly appreciate it.</p>
|
javascript jquery
|
[3, 5]
|
4,957,370 | 4,957,371 |
Setting a delay whilst in a for loop Jquery/Javascript
|
<p>Getting a little confused here, not sure if its the monday morning blues! Its just not working :(</p>
<p>What I am trying to achive is:</p>
<p>Fade in each element with the interval set as the rel.</p>
<p>My code for the HTML is (these are all hidden with CSS)</p>
<pre><code> <div id="rpStage">
<div class="rpItem" rel="500">
<p>0</p>
</div>
<div class="rpItem" rel="4000">
<p>1</p>
</div>
<div class="rpItem" rel="6000">
<p>2</p>
</div>
</div>
</code></pre>
<p>And my javascript/jquery.</p>
<pre><code>function fadeInrpItem (rpItem, rpDelayTime) {
rpItem.stop().animate({"opacity" : 1}, 400);
setInterval(rpDelayTime);
};
function startTheRp () {
for(var index=0; index < $('.rpItem').length; index++) {
var rpItem = $('.rpItem').eq(index);
//Pull in our delay attribute from the div
var rpDelayTime = rpItem.attr('rel');
fadeInrpItem(rpItem, rpDelayTime);
}
};
$(document).ready(function(){
startTheRp();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,033,856 | 6,033,857 |
http module: Request is not available
|
<p>I'm creating an http module where I want to check if a request is coming from an authenticated user and redirect to the login page if it's not.</p>
<p>I registered the module in the web.config file and I have the following code that's throwing an exception: </p>
<pre><code>public class IsAuthModule : IHttpModule
{
public void Dispose() { }
public void Init(HttpApplication TheApp)
{
var TheRequest = TheApp.Request;
}
}
</code></pre>
<p>It throwing an exception that says "Request is not available in this context"</p>
<p>What am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
3,439,869 | 3,439,870 |
Trigger window.print() two or more times
|
<p>I have a page which contains, let's say 3 divs which I want to print seperatly - and I can do that manually. However, the webapp is running Chrome with silent printing and I need to print these 3 divs, in 3 seperate print jobs. A print stylesheet is not what I need - 3 SEPERATE PRINT JOBS IS NEEDED...</p>
<p>So I need to trigger window.print() multiple times. The best and only solution I have come up with is trigger my print function 3 times, like this:</p>
<pre><code>setTimeout(function() { printContent('print1', 'letter'); }, 0);
setTimeout(function() { printContent('print2', 'letter'); }, 1);
setTimeout(function() { printContent('print3', 'letter'); }, 2);
</code></pre>
<p>However, somethimes Chrome fails to run the function three times. How can I make sure, that the function is triggered corretly 3 times in a row?</p>
<p>Should anyone find it interesting, my printContent() function is this:</p>
<pre><code>function printContent(divContent, divClass) {
var divContent = $('#' + divContent).html();
$('#print-spooler-box').html('').addClass(divClass).html(divContent);
window.print();
$('#print-spooler-box').removeClass(divClass);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,278,386 | 2,278,387 |
delay images for display purposes not efficiency using javascript?
|
<p>I have run into numerous sites that use a delay in loading images one after the other and am wondering how to do the same.</p>
<p>So i have a portfolio page with a number of images 3 rows of 4, what i want to happen is for the page to load,except for the images in img tags. Once the page has loaded i want images 1 of each row to load then say 0.5 seconds later the next image in the row(s) and so no. I'm going to have a loading gif in each image box prior to the actual image being displayed.</p>
<p>I know its doable but cant seem to find the term for doing this. This is purely for looks as it is a design site.</p>
<p>Thanks for the help.</p>
|
javascript jquery
|
[3, 5]
|
2,121,159 | 2,121,160 |
Math.pow JS vs. PHP
|
<p>I need help to "translate" this snippet to PHP from JS.</p>
<p>The original JS code is this:</p>
<pre><code>result = A * ( B / 1200 ) /
( 1 - 1 / Math.pow( 1 + ( B / 1200 ), C * 12 ) ) * D;
</code></pre>
<p>I need this code in PHP. I try with this, but it gives me a different result:</p>
<pre><code>$result = $A * ( $B / 1200) /
( 1 - 1 / pow( 1 + ( $B / 1200 ), $C * 12 ) ) * $D;
</code></pre>
|
php javascript
|
[2, 3]
|
2,067,573 | 2,067,574 |
Sound error is played when $(document).keydown is called using ALT + Some Key. [?]
|
<pre><code>$(document).keydown(function(e){
if(e.altKey && e.keyCode == 77){
document.title = 'Something';
return false;
}
});
</code></pre>
<p>The function is pretty simple, it's an event listener to get when the User press ALT M, then do something.
But this code is playing a sound error when we hit ALT M, yes it changes the title as expected, but it also plays a sound error. (I'm testing on Windows 7 in Google Chrome)</p>
<p>What should I do to make it not play this error?</p>
|
javascript jquery
|
[3, 5]
|
4,073,821 | 4,073,822 |
Leading space is not getting retained in IE
|
<p>I am working on one application, i am facing one problem on Internet Explorer while retrieving inner HTML of div.</p>
<p>I have below input for retrieving :</p>
<pre><code><div> This is first segment</div>
</code></pre>
<p>I have used jquery script to extract content.
i.e.</p>
<pre><code>$('div').html();
</code></pre>
<p><strong>Output after using above statement :</strong></p>
<pre><code>This is first segment
</code></pre>
<p>Here not retrieving leading space present in div.<br>
I am expecting here is :</p>
<pre><code> This is first segment
</code></pre>
<p>I am facing this problem on Internet Explorer, It's working properly on FireFox.</p>
<p>Please suggest your thoughts on this.</p>
<p>Thanks in advance </p>
|
javascript jquery
|
[3, 5]
|
364,056 | 364,057 |
fadeOut a prepend div
|
<p>I've prepended a div like </p>
<pre><code><div id="p">
lol
</div>
</code></pre>
<p>with <code>$("#stream").prepend("<div id="p">lol</div>");</code> and then, when i click on a button, i wanna fadeOut it. <code>$("#p").fadeOut();</code> doesn't work, how to fix it?!</p>
<p>The prepend it's because of an ajax post call, i prepend the response of the php (it insert mysql into the db and show the div with the post) but i can't delete it. also OnHover for opacity doesn't work D:</p>
<p>EDIT: it was a problem with ajax, sry</p>
|
javascript jquery
|
[3, 5]
|
3,606,900 | 3,606,901 |
>Javascript Comparing 2 dates
|
<p>I have this code in comparing dates</p>
<pre><code>var startDate = jQuery("#startDate_field_id").val();
var endDate = jQuery("#endDate_field_id").val();
var startDateSplit = startDate.split("-");
var endDateSplit = endDate.split("-");
var start = new Date();
var end = new Date();
start.setFullYear( startDateSplit[0], startDateSplit[1], startDateSplit[2] );
end.setFullYear( endDateSplit[0], endDateSplit[1], endDateSplit[2] );
if( end < start ) {
alert("End Date should be less than Start Date of the Event");
}
</code></pre>
<p>The value of #startDate_field_id is <strong>2011-10-05</strong>
<br>
white the value of $endDate_field_id is <strong>2011-10-04</strong></p>
<p>What do you think is the reason why this isn't working.</p>
<p>Any help would be greatly appreciated and rewarded.
Thanks! :)</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,333,510 | 5,333,511 |
how can I access my public method from aspx code behind to a public class?
|
<p>I have a public method in my aspx code behind called PhotoDatabinding, what it does is to bind the database to List view control.</p>
<pre><code>public void PhotoDatabinding()
{
lnqPhotoDataContext dbCon = new lnqPhotoDataContext();
var res = from p in dbCon.Photos orderby p.PhotoID descending select new { p.PhotoID, p.FileName };
lvSubAlbumDB.DataSource = res;
lvSubAlbumDB.DataBind();
}
</code></pre>
<p>Now, inside my public class called Process I have a a method called UpdateSave. my question is how can I access the PhotoBinding method so that it will look like this</p>
<pre><code>public class Process
{
public UpdateSave()
{
....some code
PhotoDatabinding();
}
}
</code></pre>
<p>Thanks and appreciate all your help and suggestions.</p>
|
c# asp.net
|
[0, 9]
|
5,756,207 | 5,756,208 |
use jQuery to expand/collapse text
|
<p>I want to cut off text based on a fixed height.When the text is cut off, a "more" link is used to expand to text. When the text is expanded, a "less" link is used to collapse the text. I wrote the js as this:</p>
<pre><code>$(document).ready(function () {
// line height in 'px'
var maxheight=218;
var showText = "More";
var hideText = "Less";
$('.textContainer_Truncate').each(function () {
var text = $(this);
if (text.height() > maxheight){
text.css({ 'overflow': 'hidden','height': maxheight + 'px' });
var link = $('<a href="#">' + showText + '</a>');
var linkDiv = $('<div></div>');
linkDiv.append(link);
$(this).after(linkDiv);
link.click(function (event) {
event.preventDefault();
if (text.css('height') == 'auto') {
$(this).html(showText);
text.css('height', maxheight + 'px');
} else {
$(this).html(hideText);
text.css('height', 'auto');
}
});
}
});
});
</code></pre>
<p>The html code is:</p>
<pre><code><div class="textContainer_Truncate">
<p>content</p>
</div>
</code></pre>
<p>My problem is that the "more" link works but the "less" doesn't. That is, when more is clicked, the text is expanded but it won't go back when the less is clicked.What's wrong here?
Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,923,032 | 1,923,033 |
Android drawBitmap draws a kind of checkerboard pattern
|
<p>Okay maybe I'm missing something here but when I do </p>
<pre><code> canvas.drawRGB(0x80, 0x80, 0x80);
</code></pre>
<p>I get a clean and expected grey screen:
<img src="http://i.stack.imgur.com/BIqrD.png" alt=""></p>
<p>But when I use this code</p>
<pre><code>pixels = new int[800*480];
...
for(int x = 0; x < 800; x++)
{
for(int y = 0; y < 480; y++)
{
pixels[x+y*800] = 0xff808080;
}
}
canvas.drawBitmap(pixels, 0, 800, 0, 0, 800, 480, false, null);
</code></pre>
<p>My phone draws something like this: (note the 'checkerboard' pattern; which shouldn't be there)
<img src="http://i.stack.imgur.com/5T64b.png" alt="enter image description here"></p>
<p>The same happens in the emulator, so I guess I'm doing something wrong?</p>
|
java android
|
[1, 4]
|
3,236,642 | 3,236,643 |
Filter strings with jQuery/Javascript
|
<p>Im trying to use $.get to load pages without reloading the page. </p>
<pre><code><script>
$('#top_links a').click(function (e) {
e.preventDefault();
var link = $(this).attr('href');
$('#content').empty();
$.get(link, { },
function(data) {
$('#content').empty().append(data);
}
)
});
</script>
</code></pre>
<p>This works but the entire requested page is getting stuffed into <code>#content</code>. Instead of detecting the ajax request and filtering the data on the server-side, I would like to do it client-side. Is there a way to use javascript to effectively filter the string so that I only get certain divs? The content that I want to preserve will all be contained inside of a div called <code>#content</code> ( Im just trying to swap the current page's <code>#content</code> with the requested page's <code>#content</code>).</p>
|
javascript jquery
|
[3, 5]
|
3,384,367 | 3,384,368 |
How to trigger a class-targeted method AFTER the class has been added to an element?
|
<p>In the below markup, the <code>#enable</code> button will add a class to the <code>#show</code> div. This class has a method attached to it that fades in/out the <code>#hidden</code> span.</p>
<p>However, even though the class is added to the <code>#show</code> div, the method attached to the class isn't triggered.</p>
<p><strong>HTML</strong></p>
<pre><code><input type='button' id='enable' value='Enable' />
<div id='show'>
Testing.. <span id='hidden'>Testing, 1, 2, 3.</span>
</div>
</code></pre>
<p><strong>JS</strong></p>
<pre><code>$(function() {
// Adds .testing class after the button is clicked. however..
$('#enable').click(function() {
$('#show').addClass('testing')
});
// It will not trigger after .testing class has been added to DIV?
$('.testing').hover(function() {
$('#hidden').fadeIn();
}, function() {
$('#hidden').fadeOut();
});
});
</code></pre>
<p>Fiddle to work with: <a href="http://jsfiddle.net/jS3nM/" rel="nofollow">http://jsfiddle.net/jS3nM/</a></p>
<p>It seems I am missing something conceptually. What is the correct way to handle this?</p>
|
javascript jquery
|
[3, 5]
|
5,632,229 | 5,632,230 |
Grab code behind property in Javascript?
|
<p>I would like to burn in a c# code behind property into the javascript alert(<%= someProperty%>); . For some reason it is not working. Is there a way you can burn the codebehind property into the javascript? thanks</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
4,368,367 | 4,368,368 |
ASP.NET - Passing a C# variable to HTML
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1531586/why-works-in-one-situation-but-not-in-another">Why <%= %> works in one situation but not in another</a> </p>
</blockquote>
<p>I am trying to pass variables declared in C# to html. The variables have all been declared as public in the code-behind.</p>
<p>This is the HTML code I am using:</p>
<pre><code><asp:TextBox ID="TextBoxChildID" Text='<%= Child_ID %>' runat="server" Enabled="false"></asp:TextBox>
</code></pre>
<p>The problem is that when the page loads, the text '<%= Child_ID %>' appears in the textbox instead of the value in the variable.</p>
<p>What is wrong please?</p>
|
c# asp.net
|
[0, 9]
|
1,939,921 | 1,939,922 |
Android SharedPreferences NullPointerException on getSharedPreferences
|
<p>I'm trying to create a single class which will deal with storing and retrieving two user settings 'radius' and 'cluster'.</p>
<p>Upon loading the 'Settings' activity I get a null pointer exception.</p>
<p><strong>Snippet from the user settings:</strong></p>
<pre><code> storage = new Persistence();
radius = (EditText) findViewById(R.id.etRadius);
radius.setText(String.valueOf(storage.getRadius())); <-- Problem
</code></pre>
<p><strong>Class to deal with persistence:</strong> </p>
<pre><code>public class Persistence extends Activity {
private static final String PREFERENCES = "tourist_guide_preferences";
private SharedPreferences settings;
private SharedPreferences.Editor editor;
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
settings = getSharedPreferences(PREFERENCES, 0);
editor = settings.edit();
}
public int getRadius()
{
return settings.getInt("radius", 2000);
}
public int getClusterSize()
{
return settings.getInt("cluster", 50);
}
public void setRadius(int radius)
{
editor.putInt("radius", radius);
editor.commit();
}
public void setClusterSize(int size)
{
editor.putInt("cluster", size);
editor.commit();
}
}
</code></pre>
|
java android
|
[1, 4]
|
5,141,669 | 5,141,670 |
Applying Jquery Accordion on a class
|
<p>How to apply jquery accordion function to a div with a particular class... i.e. div id='abc'we use $("#abc").accordion(); but how to accomplish if we have div class='abc'??</p>
|
javascript jquery
|
[3, 5]
|
4,088,281 | 4,088,282 |
How can I get elements I add with jQuery to follow the actions I've applied to a class?
|
<p>I've found out that when I use jQuery to add something to a page (via <code>.append</code> ) then the class actions I've set don't seem to apply to the new elements. <br />For example in my <code>$(document).ready</code> function I'll add a <code>$(".clickable").click(doSomething)</code> it works for anything that's on the page before it's called, but if I append something with a <code>clickable</code> class, then the new element won't be clickable even if it has a <code>clickable</code> class.</p>
<p>While I was posting I tried and realized that I could get around this by recalling the <code>$(".clickable").click(doSomething);</code> after adding the elament, but that just makes it call doSomething more times for every element I add. <br />In other words if I added 5 elements when I click on a clickable class doSomething would be called 5 times in a row for 1 click. </p>
<p>I'm wondering if there is a more elegant solution so I don't have to recall any jQuery actions everytime I add an elament, perhaps there's a smarter method than append? </p>
|
javascript jquery
|
[3, 5]
|
1,328,643 | 1,328,644 |
jQuery Sliding a div
|
<p>I want to slide a div up, and after it has slided up completely, I want to slide the other <code><div></code> down (which is by default hidden).</p>
<p>I am trying following code, it does what I want, but I only don't get the effect that the div slides down after the first has slided up completely, it looks like the div starts appearing as soon the other div starts sliding above.</p>
<p>So how can I make it wait till the first div slides up completely and then it starts sliding down.</p>
<p><strong>HTML:</strong></p>
<pre><code><div class="box">
<div class="up"></div>
<div class="down"></div>
</div>
<a href="#" id="hidediv">Hide me</a>
</code></pre>
<p><strong>CSS:</strong></p>
<pre><code>.up{
width: 100px;
height: 100px;
background: orange;
display: block;
}
.down{
width: 100px;
height: 100px;
background: red;
display: none;
}
</code></pre>
<p><strong>jQuery:</strong></p>
<pre><code>$("#hidediv").click(function () {
$(".up").slideUp(800);
$(".down").slideDown(800);
});
</code></pre>
<p><strong>Demo:</strong></p>
<p><a href="http://jsfiddle.net/hFyvw/" rel="nofollow">http://jsfiddle.net/hFyvw/</a></p>
|
javascript jquery
|
[3, 5]
|
3,281,691 | 3,281,692 |
Display alert when the user enters text in input area
|
<p>I am trying to display an alert when the user enters text into the search box but it does not work. Please guide. </p>
<p><a href="http://jsfiddle.net/zcH54/" rel="nofollow">http://jsfiddle.net/zcH54/</a></p>
<pre><code><div id="form" style="float:right;" >
<form method="get" >
<input type="submit" value="Search" class="btn" >
<input name="q" type="text" id="search" size="32" maxlength="128" class="txt" >
</form>
</div> <!--form ends-->
</code></pre>
<p>Here is the JS,</p>
<pre><code> $(document).ready(function() {
$("#search").keyup(function() { // function starts when a key is entered in the search bar
alert("I am an alert box!");
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
649,427 | 649,428 |
How to get a value of element that was added with ajax in a "live" event?
|
<p>Here's the thing -
a click event adds a bunch of elements on the page, and they all have the same id (is there something wrong here?).</p>
<p>I use a live function to assign click event to all of these elements:</p>
<p><code> $("#tag").live('click', function() {
console.log($("#tag").html());
});</code></p>
<p>When I click on any of them, only the value of first element gets logged.</p>
<p>How can I let the click event know on which of this elements I actually click?
Thanks a lot!</p>
<p>Update: using classes and $(this) is the way to go. Problem solved. Thanks griegs and John!</p>
|
javascript jquery
|
[3, 5]
|
5,656,635 | 5,656,636 |
Loading all of a users songs into a tableview and playing the song when they tap
|
<p><img src="http://i.stack.imgur.com/bUcWK.png" alt="TableView with music loaded"></p>
<p>After this point I do not know how to let the user tap on a cell and play the song they tap on. Any help would be great. I am a little stumped </p>
|
c++ iphone
|
[6, 8]
|
4,720,616 | 4,720,617 |
Converting Python code to PHP
|
<p>What is the following Python code in PHP?</p>
<pre><code>import sys
li = range(1,777);
def countFigure(li, n):
m = str(n);
return str(li).count(m);
# counting figures
for substr in range(1,10):
print substr, " ", countFigure(li, substr);
</code></pre>
<p>Wanted output for 777</p>
<pre><code>1 258
2 258
3 258
4 258
5 258
6 258
7 231
8 147
9 147
</code></pre>
|
php python
|
[2, 7]
|
5,569,778 | 5,569,779 |
jquery menu hanging (not working properly)
|
<p>my dropdown menu is given below , which is dynamically created at server side,,,
but it <strong>becomes hanged</strong> sometimes automatically (not working)......
can anyone help me about this..........plz see it--></p>
<pre><code> if (Request.QueryString["cate_id"] != null)
{
string cate_id = Request.QueryString["cate_id"].ToString();
//string subcate_id = Request.QueryString["subcate_id"].ToString();
string Expand = " $(document).ready("+
"function () { $(' #cate_id"+cate_id+" > ul').show(); }"+
"function () {"+
"$(' #cate_id" + cate_id + " > ul > li:has(ul) > ul').hide();" +
"$(' #cate_id" + cate_id + " > ul > li:has(ul) ').hover("+
"function () {$(this).find('> ul').stop().slideDown('fast');}," +
"function () {$(this).find('> ul').stop().slideUp('fast');}"+
");});";
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "cateExpand", Expand, true);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,842,637 | 4,842,638 |
Can i consolidate function calls in JQuery?
|
<p>I have following and would like to be able to use one function only preferably...</p>
<pre><code>$(document).ready(function(){
$("#home_p1").editInPlace({
url: './include_eip_77994477/eip.php',
});
$("#home_p2").editInPlace({
url: './include_eip_77994477/eip.php',
});
$("#home_p3").editInPlace({
url: './include_eip_77994477/eip.php',
});
});
</code></pre>
<p>This could go to 15 or 20 instances on some pages...is it possible?</p>
|
javascript jquery
|
[3, 5]
|
3,591,614 | 3,591,615 |
Javascript ConfirmBox not showing when called in Update Panel
|
<p>I'm trying to show a javascript confirm box whenever a link button in my repeater is clicked and has passed some condition.</p>
<p>My Repeater is inside an Update Panel that is inside an Ajax Accordion Content Template.</p>
<pre><code><Accordion><UpdatePanel><Repeater>this is where the link button is</Repeater></UpdatePanel></Accordion>
</code></pre>
<p>Here's my code, i put it inside a Repeater_ItemCommand method:</p>
<pre><code> Page.ClientScript.RegisterStartupScript(this.GetType(), "ConfirmDelete", "return confirm('Are You Sure Want To Delete?');");
</code></pre>
<p>I've looked into several code solution, but still isn't working.
What did i do wrong?</p>
<p>UPDATE:</p>
<p>If i call the javascript from the html. it works just fine.
Code: </p>
<pre><code><asp:LinkButton ID="lbDelete" runat="server" OnClientClick="return confirm('Are you sure want to delete?');">Delete</asp:LinkButton>
</code></pre>
<p>But i still cant call it from code behind</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,266,939 | 4,266,940 |
Explanation on how this code using web namespace
|
<pre><code>HttpContext context = ((HttpApplication)sender).Context;
</code></pre>
<p>In the above example, why do we cast sender to a HTTPApplication and not HTTPContext? </p>
<p>Also, what is the purpose of the brackets? I know they are for casting, but if you get rid of HTTPApplication and the surrounding brackets, that leaves:</p>
<pre><code>(sender).Context;
</code></pre>
<p>Why not sender.Context? Or generically, why the use of brackets anyway? I vaguely remember it is a way of casting but can't remember specifics.</p>
<p>Secondly:</p>
<pre><code> string url = context.Request["url"];
int cacheDuration = Convert.ToInt32(context.Request["cache"] ?? "0");
string contentType = context.Request["type"];
</code></pre>
<p>EDIT: I realised that you can write:</p>
<pre><code>collection["key"] = "value";
</code></pre>
<p>This is for a key-based collection and you store value where there is a key called "key". So am I right in thinking you get the url where the key is "url"?</p>
<p>I know this is using HTTPContext, but in the indexer, what is "url" meant to mean? It is just a string saying url, not even a real url. Likewise for "cache" and "type". If one writes "type", as in the last line of code, does that get back the type (HTTP/HTTPS) used?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
1,020,240 | 1,020,241 |
android getInputType in JAVA code
|
<p>I defined a EditText in XML with attribute <strong>android:inputType="numberSigned"</strong>, so, when I try to get it in Java Code like: <p></p>
<blockquote>
<p><code>int type = mEditText.getInputType();</code><br>
<code>switch(type){</code><br>
<code>case InputType.TYPE_NUMBER_FLAG_SIGNED:</code><br>
<code>//do when I get EditText defined with 'numberSinged'</code><br>
<code>//do something</code><br>
<code>break;</code><br>
<code>}</code></p>
</blockquote>
<p>But, It doesn't work for me. So I try to check Android source code, <code>TYPE_NUMBER_FLAG_SIGNED=4096</code>. When I try to print <code>println(mEditText.getInputType())</code>,it turns to be <code>4098</code>. And I can't find any variable equals <code>4098</code>. <br>
Can anybody tell me the reason?
<br>
<p>
<i>I'm not good at English, may you can understand me! Thanks!</i></p>
|
java android
|
[1, 4]
|
4,776,317 | 4,776,318 |
How to provide elements/tags dynamically inside the find() in jquery
|
<p>I have created several div with id's such as window1, window2 and so on. Now all I want to is find the <p> tag from these above created divs. I am doing this inside the for loop but it is not working for me. Here is what I am doing</p>
<pre><code> for(connectWindow=1;connectWindow<=xmlLength;connectWindow++)
{
//look for the to tag inside the html
var windo = "window"+connectWindow;
var to = "to"+connectWindow;
alert("Making connections" + windo +to)
//$("div#windo").find('strong#to')(function())
$("div#windo").find('p#to').each(function(){
alert("@@@@@@@@@@@@@@@@@@@@");
var name = $(this).text();
//display_function(name,country);
alert("Name is :::"+name);
});
}
</code></pre>
<p>Please let me know where I am going wrong. Also please let me know if there is any solution in JavaScript either.
Thanks !</p>
|
javascript jquery
|
[3, 5]
|
3,369,139 | 3,369,140 |
How to alter and animate a div the right way?
|
<p>i have a div like this:</p>
<pre><code><div class="class1">
<div class="class2"></div>
<div class="class3"></div>
<div class="class4">
<div class="class5"></div>
</div>
</div>
</code></pre>
<p>This div exists several times on the page.</p>
<p>Now i want to remove some of the child elements, rearrange others and animate that process the right way.</p>
<p>Currently i do it like this.</p>
<p>Example:</p>
<pre>
var mainElement = $('class1');
mainElement.find('class2').css('property','value');
mainElement.find('class3').remove();
mainElement.find('class4').animate({'property': 'value'});
</pre>
<p>This works but it is not as smooth as i would like it to be. When doing it to one element at a time it works but even that is a bit choppy. However, the main problem is that this code is execute on page load and like i said before, it is applied to more then on element at the same time. Then it gets really choppy, to a point where you don't see the animation at all.</p>
<p>Could someone explain to me how to do it the right way?</p>
<p>When i do, for example $('class1').fadOut() that works pretty smooth, even for 50 elements at the same time.</p>
<p>Greetings,
Andy</p>
|
javascript jquery
|
[3, 5]
|
4,635,383 | 4,635,384 |
jQuery seems to have an enable function, but not a disable function. Why?
|
<p>Until now I was using the following to disable/enable form fields -</p>
<pre><code>$('#fieldid').attr('disable','disable');
$('#fieldid').removeAttr('disable');
</code></pre>
<p>And that got the job done. But yesterday, I absent-mindedly typed the following to enable the field -</p>
<pre><code>$('#fieldid').enable();
</code></pre>
<p>And it worked! I silently kicked myself for not trying the the handy 'enable'/'disable' functions built into jQuery (or so I thought), and proceeded to change the line to disable to -</p>
<pre><code>$('#fieldid').disable();
</code></pre>
<p>And to my surprise, that did NOT work.</p>
<p>Am I missing something? Why is the enable() function defined but the disable() function is not? And even weirder, I could find no mention of either enable() or disable() in the jquery docs. Does anyone have any explanations?</p>
<p>I'm using jQuery 1.6.</p>
|
javascript jquery
|
[3, 5]
|
4,066,971 | 4,066,972 |
how to check if a control of a certain type?
|
<p>When I use th below code, it works. All the controls are hidden.</p>
<pre><code>foreach (Control ctr in eItem.Controls)
{
ctr.visible = false;
}
</code></pre>
<p>However, I want to hide only labels and dropdownlists. That why I'm trying to use the below code without success</p>
<pre><code>foreach (Control ctr in eItem.Controls)
{
if(ctr is Label | ctr is DropDownList)
{
ctr.visible = false;
}
}
</code></pre>
<p><strong>EDIT</strong></p>
<p>Here's the whole method</p>
<pre><code> private void HideLabelAndDDLOnPageLoad()
{
foreach (ListViewItem eItem in lsvTSEntry.Items)
{
foreach (Control ctr in eItem.Controls)
{
if (ctr is Label || ctr is DropDownList)
{
ctr.Visible = false;
}
}
}
}
</code></pre>
<p>When I remove the if, all the controls get hidden. When I put it back, nothing happens.</p>
<p>Thanks for helping</p>
|
c# asp.net
|
[0, 9]
|
3,097,990 | 3,097,991 |
val() returns Placeholder value instead of the actual value in IE8,9 when the field is empty
|
<p>Placeholder attribute shown below works fine in firefox but if val() is called when the field is <strong>empty</strong> it returns the placeholder value instead of the actual value in the text.</p>
<p>JSFiddle - <a href="http://jsfiddle.net/Jrfwr/2/" rel="nofollow">http://jsfiddle.net/Jrfwr/2/</a></p>
<pre><code><input id="tlt" type="text" placeholder="Enter Title" />
</code></pre>
<p>JSCode </p>
<pre><code>function placeHolderFallBack() {
if ("placeholder" in document.createElement("input")) {
return;
}
else {
$('[placeholder]').focus(function () {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function () {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {
input.addClass('placeholder');
input.val(input.attr('placeholder'));
}
}).blur();
$('[placeholder]').parents('form').submit(function () {
$(this).find('[placeholder]').each(function () {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
}
})
});
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,868,919 | 4,868,920 |
Treeview asp.net
|
<p>I have a treeview control on an asp.net page. Everytime I select a node in the tree, a duplicate copy of the tree is displayed under it. I am unable to understand. I have not written any code so far. I'm probably missing out on some property that I should have set. No matter which node I click on another tree is displayed under the existing tere. Please help!</p>
|
c# asp.net
|
[0, 9]
|
5,023,303 | 5,023,304 |
SetInterval says function does not exist
|
<p>I don't know what I am missing here. When the setInterval starts to run it says the function does not exist. I know it is there ( I did not include the variables...as that is not the issue). Any idea on why I am getting an error saying the functions don't exist?</p>
<pre><code>function midgroundFunc() {
$('#midground').css({
backgroundPosition: '0px 0px'
});
$('#midground').animate({
backgroundPosition: "(" + midX + " " + midY + ")"
}, midTime, midEase);
}
function foregroundFunc() {
$('#foreground').css({
backgroundPosition: '0px 0px'
});
$('#foreground').animate({
backgroundPosition: "(" + foreX + " " + foreY + ")"
}, foreTime, foreEase);
}
function backgroundFunc() {
$('#back').css({
backgroundPosition: '0px 0px'
});
$('#back').animate({
backgroundPosition: "(" + backX + " " + backY + ")"
}, backTime, backEase);
}
$(document).ready(function() {
$('#midground').css({
backgroundImage: 'url(' + midImage + ')'
});
$('#foreground').css({
backgroundImage: 'url(' + foreImage + ')'
});
$('#back').css({
backgroundImage: 'url(' + backImage + ')'
});
$.backstretch(backgroundStretch);
midgroundFunc();
foregroundFunc();
backgroundFunc();
setInterval("midgroundFunc()", midTime);
setInterval("foregroundFunc()", foreTime);
setInterval("backgroundFunc()", backTime);
});
</code></pre>
<p>This is the error I am getting:</p>
<p>Error: backgroundFunc is not defined
Line: 96</p>
<p>Error: midgroundFunc is not defined
Line: 94</p>
<p>Error: foregroundFunc is not defined
Line: 95</p>
|
javascript jquery
|
[3, 5]
|
1,063,365 | 1,063,366 |
How to Loop Through a JavaScript Object
|
<p>I used </p>
<blockquote>
<p>console.log(response);</p>
</blockquote>
<p>and got the following in console (in Firebug). How do I loop through to check if "LMNOPQ" exists?</p>
<pre><code>data [Object { name="Excel in ABCD", category="Book", id="327361517327399", more...}, Object { name="LMNOPQ", category="Product/service", id="175625882542984", more...}, Object { name="UVWXYZ", category="Book", id="260641707360118", more...}, 7 more...]
0 Object { name="Excel in ABCD", category="Book", id="327361517327399", more...}
category "Book"
created_time "2012-04-04T05:31:04+0000"
id "327361517327399"
name "Excel in ABCD"
1 Object { name="LMNOPQ", category="Product/service", id="175625882542984", more...}
2
Object { name="UVWXYZ", category="Book", id="260641707360118", more...}
</code></pre>
<p>Then as suggested by Baptiste Pernet, I tried the following:</p>
<pre><code>for(var i in response) {
console.log(response[i].name);//gives me undefined
console.log(response[i]);//gives me another object (it is nested, check below)
}
</code></pre>
<blockquote>
<p>[Object { name="Excel in ABCD", category="Book", id="327361517327399",
more...}, Object { name="LMNOPQ", category="Product/service",
id="175625882542984", more...}, Object { name="UVWXYZ",
category="Book", id="260641707360118", more...},</p>
</blockquote>
<p>How do I get this name now? I'm stuck at:</p>
<pre><code>console.log(response[i]);
</code></pre>
<p>What should I write in order to get the properties of nested objects? Another loop?</p>
|
javascript jquery
|
[3, 5]
|
2,194,234 | 2,194,235 |
Use C# to write ASP code on a page
|
<p>I have ASP code like this:</p>
<pre><code><ext:Panel ID="pnlHelp" CtCls="help-panel" AnimCollapse="true"">
<Content>
<h1>some text</h1>
<p>
More text[...]
</p>
</Content>
</ext:Panel>
</code></pre>
<p>I would like to generate the tag dynamically using C#. I tried this, like with regular HTML tags:</p>
<pre><code><ext:Panel ID="pnlHelp" CtCls="help-panel" AnimCollapse="true"">
<Content>
<% Response.Write("<h1>some text</h1>"); %>
<p>
More text[...]
</p>
</Content>
</ext:Panel>
</code></pre>
<p>But the text ends up somewhere near the beginning of the page where I didn't intend it to go. How can I do this?</p>
|
c# asp.net
|
[0, 9]
|
2,524,526 | 2,524,527 |
HTMLDocument getElementById for a custom control returns null, why, and is there a different way to access it?
|
<p>I have the following in an aspx page inside a body tag:</p>
<pre><code><form id="Form1" method="post" runat="server">
<customControl:menu id="Menu1" runat="server">
</customControl:menu>
</form>
</code></pre>
<p>And from a different aspx page I have this javascript function:</p>
<pre><code><script type="text/javascript">
function testFunction(args, name) {
alert(top.frames[0].document); //gives me [object HTMLDocument]
alert(top.frames[0].document.getElementById("Form1")); //gives me [object HTMLFormElement]
alert(top.frames[0].document.getElementById("Menu1")); //gives me [null]
}
</script>
</code></pre>
<p>Why is the third alert giving me null? (The <code>menu</code> is a control with an <code>ascx</code> extension)</p>
<p>Thanks,
Voodoo</p>
|
javascript asp.net
|
[3, 9]
|
5,370,154 | 5,370,155 |
Looping and pausing after loading ajax content in Javascript JQuery
|
<p>I have what I though was a simple problem to solve (never is!) I'm trying to loop through a list of URL's in a javascript array I have made, load the first one, wait X seconds, then load the second, and continue until I start again.
I got the array and looping working, trouble is, however I try and implement a "wait" using setInterval or similar, I have a structural issue, as the loop continues in the background.</p>
<p>I know about setTimeOut and setInterval, but haven't been able to format the code in a way that works. I'm new to javascript and as such often make various stupid mistakes, and would really appreciate being able to understand how best to structure this, as well as some working examples!</p>
<p>I tried to code it like this:</p>
<pre><code>$(document).ready(function(){
// my array of URL's
var urlArray = new Array();
urlArray[0] = "urlOne";
urlArray[1] = "urlTwo";
urlArray[2] = "urlThree";
// my looping logic that continues to execute (problem starts here)
while (true) {
for (var i = 0; i < urlArray.length; i++) {
$('#load').load(urlArray[i], function(){
// now ideally I want it to wait here for X seconds after loading that URL and then start the loop again, but javascript doesn't seem to work this way, and I'm not sure how to structure it to get the same effect
});
}
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,062,569 | 4,062,570 |
How to get CPU utilization using Javascript or Java
|
<p>How can I get the CPU utilization of client's machine.</p>
<p>I have created a Java web application and where I need to get the CPU utilization of client's machine.</p>
<p>Can it be done using either Javascript or Java?</p>
|
java javascript
|
[1, 3]
|
3,114,906 | 3,114,907 |
Append option values to a hidden field?
|
<p>With the push of a button, I'm iterating through a list of options in a select. I wish to append all of these option (values of the options) to a hidden fields, separated by a pipe <code>|</code>. So far I've come up with this, however, It just puts the last value of the option in the select in the hidden field?</p>
<pre><code>//Select all cities
$jq("input#checkcities").click(function () {
$jq(".select-cities > option").each(function () {
var zipCodeValue = $jq(this).val();
$jq(".select-cities option").attr("selected", "selected");
$jq(".select-cities option").appendTo(".chosen-cities");
//Put value of cities in hidden field.
$jq('.hiddenFieldChosenCities').val(zipCodeValue);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,284,174 | 1,284,175 |
authorization via url checking
|
<p>i have a table <strong>USERS</strong> with 3 columns:
<strong>userid,username,password</strong>.</p>
<p>Then table <strong>Menu</strong> with columns: <strong>id,url,canview</strong></p>
<p>How do i check a url on page load to verify if a user is allowed to view that url in asp.net & C#?
i.e if canview = yes ,user can view, else redirect to no access page.</p>
|
c# asp.net
|
[0, 9]
|
1,308,596 | 1,308,597 |
populate document using javascript pattern
|
<pre><code><table id="session">
<thead>
<tr>
<div class="borderContainer">
<div></div>
</div>
<script type="template" id="thead">
<div class="borderContainer">
<div></div>
<h3>{ColName}</h3>
</div>
</script>
</tr>
</thead>
<tbody>
<script type="template" id="tbody">
<tr>
<td class="row">
<div class="borderContainer">
<div></div>
<h3>Row I</h3>
</div>
</td>
<!--
When the parent pattern is appended to the DOM
populate the table additionally.
-->
</tr>
</script>
</tbody>
</table>
</code></pre>
<p>There are two questions that I really would like two find the answer:</p>
<p>1.How to trigger event that tells me that since this pattern is populated it tells that:
Now the page is ready for a second addition of content.
Or to paraphrase it : How to load dynamically content on two stages without DOM loading events affect the speed?</p>
<p>2.Is there a way to nest patterns or any other approach allowing to load contents dynamically on different levels of document hierarchy on one stage?</p>
<p>10x for your kind help</p>
|
javascript jquery
|
[3, 5]
|
2,796,643 | 2,796,644 |
How can I access a multidimentional php array in javascript?
|
<p>The code is like this:</p>
<pre><code><SCRIPT LANGUAGE="JavaScript">
function showReview(){
//javascript stuff
<?php
$http="obj.href ='http://localhost/PROJECT1/thispage.php'";
if (array_key_exists(0, $arr)){
$http .= "+'&PQID={$arr[0]['ID']}'+
'&PQNo={$arr[0]['QNo']}'+
'&PNextSWF={$arr[0]['NextSWF']}';";
}
echo $http;
?>
}
</SCRIPT>
</code></pre>
<p>But I can't access <code>$arr</code> array. I tried to declare it global or use the <code>$GLOBALS</code> variable.</p>
<p>Show Review is called during onclick.
<code>$arr</code> is set in the main php code.
I tried just accessing the array in the main php code and passing the resulting string to the javascript which is the '?&PQID=ar&PQno=1...' part of the URL but it doesn't pass successfully. I tried passing the array itself to the javascript but js but I couldn't access the contents.</p>
|
php javascript
|
[2, 3]
|
3,451,099 | 3,451,100 |
How Do I Find the Index of An Element Within an Array
|
<p>Say I have html similar to the following</p>
<pre><code><ul>
<li> hi </li>
<li> hoi </li>
<li> privyet </li>
<li class="selected"> bonjour </li>
<li> hallo </li>
</ul>
</code></pre>
<p>and I use jQuery to get all the <code>li</code> elements in the <code>ul</code></p>
<pre><code>$("ul li")
</code></pre>
<p>how can I get the index of the <code>li</code> element with the class <code>selected</code> within the jQuery array of <code>li</code> elements?</p>
|
javascript jquery
|
[3, 5]
|
1,301,585 | 1,301,586 |
How to catch exception occured in DAL of ObjectDataSource object?
|
<p>I have ObjectDataSource and GridView on one of the pages of my asp.net web project.</p>
<p>To initialize ObjectDataSource i use Init event:</p>
<pre><code> protected void ObjectDataSource1_Init(object sender, EventArgs e)
{
ObjectDataSource1.EnablePaging = true;
ObjectDataSource1.TypeName = "CustomerDataSource";
ObjectDataSource1.DataObjectTypeName = "Customer";
ObjectDataSource1.SelectMethod = "GetCustomers";
ObjectDataSource1.UpdateMethod = "Update";
ObjectDataSource1.SelectCountMethod = "GetCustomersCount";
ObjectDataSource1.MaximumRowsParameterName = "maximumRows";
ObjectDataSource1.StartRowIndexParameterName = "startRowIndex";
}
</code></pre>
<p>Somewhere in DAL:</p>
<pre><code>public static List<Customer> GetCustomers(int maximumRows, int startRowIndex)
{
try {
... some select to database here...
}
catch (Exception ex)
{
Utils.LogError(ex);
throw ex;
}
}
</code></pre>
<p>Now let's imagine that GetCustomers for some reason throws an exception. How could i catch this exception and handle it? I know i can use Application_Error, but i would like to catch this exception somehow on my page and show some friendly message to the user. Is that possible?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,437,445 | 4,437,446 |
nodeName for selected text in Javascript
|
<p>I am making a HTML text editor.
For this,i have a div with contenteditable set to true.
For making a selected text "bold",i am trying to find node of the selected text.
How should i do this or is there is any other way to implement this(particular in ie).</p>
|
javascript jquery
|
[3, 5]
|
2,183,448 | 2,183,449 |
Convert .NET UTC Time in JavaScript
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/206384/how-to-format-a-json-date">How to format a JSON date?</a> </p>
</blockquote>
<p>I have an HTML page that uses JQuery. My JQuery hits a .NET Web Service that does the following:</p>
<pre><code>return DateTime.UtcNow;
</code></pre>
<p>An example value returned looks like the following:</p>
<pre><code>"/Date(-62135578800000)/"
</code></pre>
<p>In my JavaScript, I'm try to parse the date as follows:</p>
<pre><code>var lastOrderDate = GetValueFromService();
var d = new Date(parseInt(lastOrderDate));
alert(d);
</code></pre>
<p>When the alert statement is hit, I see "Invalid Date" in the alert window. What am I doing wrong?</p>
|
c# javascript
|
[0, 3]
|
3,854,927 | 3,854,928 |
How does one share data between a C++app and a C# app without files?
|
<p>I have a C++ application with data that needs to be shared with a C# application.
I'm currently transferring the data via files, but with speed and quantity of the data becoming an issue I would like to find a way to share the data through memory.</p>
<p>I'm a beginner to intermediate programmer at best, and so far I have heard of two methods that may be able to help me do this: Socket Programming & Memory Mapped Files</p>
<p>So my questions is, which is the best way to do this? (yes, speed is a factor)</p>
<p>and any info or links to info that could help me in my research and comprehension of the method you suggest would be very much appreciated.</p>
<p>Thank you,</p>
|
c# c++
|
[0, 6]
|
3,952,881 | 3,952,882 |
data appear and disapear when jquery loads
|
<p>i have this code bellow and i have select options with <code>$menucompare</code> values .</p>
<pre><code><script>
function displayVals() {
var singleValues = $("#menucompare").val();
$("#hiddenselect").attr("value", singleValues );
$("p").html("Procent of: " + singleValues);
}
$("select").change(displayVals);
displayVals();
</script>
<table width='100%' border='1' cellspacing='0' cellpadding='0'>
<th>weeks</th>
<th style="text-align: left; padding-left:5%;"><?php echo "<p></p>"; ?></th>
</code></pre>
<p>which i can get this value (Procent of: $menucompare) . but the problem is when i select one option , the value appears right when jquery is loading , and when jquery is finished loading it disapears this (Procent of: $menucompare) , of course the variable $menucompare commes with the right value. </p>
<p>so i want even when jquery finished loading this value stays in the table . hope can get some fix for this .</p>
|
php jquery
|
[2, 5]
|
2,330,051 | 2,330,052 |
Virtual scrolling grid In asp.net
|
<p>I would like to implement a Virtual scrolling Grid like Yahoo Inbox. I Don't want to use Telerik or other third party dlls.</p>
<p>I'm looking for an open source solution.</p>
|
c# asp.net
|
[0, 9]
|
5,044,488 | 5,044,489 |
Accessing a public variable from another class?
|
<p>The app I'm currently developing has more than one class created, with a corresponding
.xml file for each. My app requires progressing from one screen to the next
after a calculation has been completed.</p>
<p>In one class, I have declared a public double called V, which is the result
of a voltage calculation.</p>
<p>When the user presses "NEXT", a new class (ed: Activity?) is called, and the xml file will change the screen view to a new layout.</p>
<p>In this new class, I need to use the variable (double V) for a new calculation.</p>
<p>I thought that if a variable was public, it could be used anywhere in the package. Do I need to import this variable, or re-declare it somehow?</p>
<p>Any answers would be much appreciated. I've tried everything that I can think of, but
Eclipse just keeps saying V cannot be resolved.</p>
|
java android
|
[1, 4]
|
1,788,483 | 1,788,484 |
find() function not working on page load in jquery
|
<p>I have the following jquery code to remove the style attribute of all <code>table</code>, <code>tr</code> and <code>td</code> elements located inside a <code>div</code> with <code>id="testdiv"</code>. </p>
<pre><code>$(document).ready(function(){
$("#testdiv").find("table, tr, td").removeAttr("style");
});
</code></pre>
<p>If i run the <code>$("#testdiv").find("table, tr, td").removeAttr("style");</code> line in the firebug console directly it works,but its not working automatically when the page loads.
How can this problem be fixed?</p>
|
javascript jquery
|
[3, 5]
|
1,311,249 | 1,311,250 |
fire event after scrollling scrollbars or mousewheel javascript
|
<p>i would like to know if it is possible to fire an event <strong>after</strong> the scrolling of the page, when using the scrollbar or mousewheel (or possibly with a swipe on a touch device). it's like detecting when the user has stopped scrolling, where i would like to load AJAX stuff after that rather than load while scrolling.</p>
<p>it seems that jQuery's <code>.scroll()</code> is just firing everytime a user scrolls and is clunky to have an event fire all the time. if there is such thing as <code>.onScrollAfter()</code>, synonymous to the <code>.onMouseUp()</code>. As much as possible, i'd like to have a no-framework approach (to know if it does exist or possible without) but i also accept, especially in jQuery.</p>
|
javascript jquery
|
[3, 5]
|
859,362 | 859,363 |
asp .net Scan folder once a day
|
<p>I have web application in asp .net. I want to scan a folder once a day in order to find if new files are imported and do some processing. Where do you suggest me to put this code?. Do i have to make a service?. </p>
|
c# asp.net
|
[0, 9]
|
2,522,571 | 2,522,572 |
Can you enumerate links in C# that pass attributes to a method?
|
<p>I am trying to create a directory for our website in C#/ASP.NET. I already have the ability to search by name and position when you type it in a textbox. I want to add the functionality of searching by the first letter of the last name or by clicking on positions. </p>
<p>I wanted to create my array of letters an links as such:</p>
<pre><code>protected void displayAlphabet() {
char[] az =
Enumerable.Range('a', 'z' - 'a' + 1).Select(i => (Char)i).ToArray();
foreach (var c in az)
{
Response.Write(
"<a href=\"#\" onclick=\"domainQuery(" + c + ")\">" + c + "</a>"
);
if (c.ToString() != "z")
{
Response.Write("-");
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,931,501 | 3,931,502 |
Getting string value from input in query to reveal div
|
<p>just wondering why this isn't working for me:</p>
<pre><code> $(document).ready(function(){
$('.box').hide();
$("#name").blur(function() {
var value = $(this).val();
$("div:contains("+value+")").FadeIn(1000);
});
});
</code></pre>
<p>Pretty new at Javascript/JQuery, and trying to figure out where I went wrong......I'm trying to get the value of an input (which is the "#name" id) and match that up with the divs in the document (which are initially hidden) and when the string value of the input is contained within a div (in this case, ".box") in the document, I want that div to display. Any help would be greatly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
5,840,901 | 5,840,902 |
Server Error in '/' Application, The resource cannot be found
|
<h2>Server Error in '/' Application.</h2>
<p>The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. </p>
<p>Requested URL: /public/google_setup.aspx</p>
<p>I am getting the above error when i host the site on the server. In my local computer it is working fine. google_setup.aspx is referring to a master page which is also on the server. I have developed other pages using that master page <strong>before</strong> and they are working fine.</p>
<p>Any idea what is wrong.</p>
<p>If someone can suggest a way to get little bit more detail information on this error i would be able to fix it</p>
|
c# asp.net
|
[0, 9]
|
5,263,983 | 5,263,984 |
returning List<string> from JSON call in Jquery has undefined length
|
<p>I am making a call to a webservice from jquery and trying to return an List (I have also tried a string[]). When I get the results back I can see it holds an array with the values I need, but I can not iterate through them in Javascript because there is no length value.</p>
<p>my C# Webservice is as follows:</p>
<pre><code> [WebMethod]
public string[] GetMultiChoiceOptions(int keyId)
{
string connectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["OBConnectionString"].ConnectionString;
SitesUtil db = new SitesUtil(connectionString);
List<MultiChoiceOption> keys = db.GetMultiChoiceOptions(keyId, 1); //TO DO CHANGE THIS TO REAL USERID
return keys.Select(a => a.OptionValue).ToArray();
}
</code></pre>
<p>and My Jquery/javscript call is as follows:</p>
<pre><code>function GetKeys(keyid) {
var pageUrl = '<%=ResolveUrl("~/WebService/UpdateDatabase.asmx")%>'
$.ajax({
type: "POST",
url: pageUrl + "/GetMultiChoiceOptions",
data: '{keyId:' + keyid + '}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: GetKeysSuccessCall,
error: OnErrorCall
});
}
function GetKeysSuccessCall(response) {
/* TO DO */
var i = 0;
for (i =0; i < response.length; i++) {
$("#popupList").append('<li>' + response[i] + '</li>');
}
}
</code></pre>
<p>I'm not sure how I deal with an array without a length in javascript?</p>
|
c# javascript jquery asp.net
|
[0, 3, 5, 9]
|
3,270,870 | 3,270,871 |
cannot download data in csv format from yahoo with python or java
|
<p>i have two p rograms (java and python) which download data from yahoo finace.
I am using this URL</p>
<p><a href="http://finance.yahoo.com/d/quotes.csv?s=GE&f=sl1d1" rel="nofollow">http://finance.yahoo.com/d/quotes.csv?s=GE&f=sl1d1</a></p>
<p>It has always worked until two days ago. i tried to debug, but it seems that yahoo has problems in sending data via csv format.
if i use the same URL used in normal yahoo html page</p>
<p><a href="http://finance.yahoo.com/q?s=GE&ql=1" rel="nofollow">http://finance.yahoo.com/q?s=GE&ql=1</a></p>
<p>everything works fine.</p>
<p>could anyone assist? i have opened the same url for the last year and it has alwasy worked...</p>
<p>thanks and regards
marco</p>
<p>here's sample python code i am using (opening a URL)</p>
<p>f = urllib2.urlopen(myurl)
data = f.read()
print data</p>
|
java python
|
[1, 7]
|
3,439,545 | 3,439,546 |
Javascript cookie expiration/deletion on different browsing scenarios
|
<p>A client requested cookie functionality where if the browser is not closed, the cookie has a 30 minute expiration, but then it needs to be removed if/when a user closes the browser.</p>
<p>Here's how I was going to do it: </p>
<pre><code>delCookie = function() {
document.cookie = 'cookieName=;expiration=Thu, 01-Jan-70 00:00:01 GMT;';
};
$(window).unload(function() {
delCookie();
})
</code></pre>
<p>I then realized that when user navigates to a different site, it also triggers .unload which will delete the cookie instead of keeping the cookie with expiration. </p>
<p>Is there any way I can detect using javascript when browser is being closed or a user is navigating away from the site?</p>
|
javascript jquery
|
[3, 5]
|
1,972 | 1,973 |
Not able to use Log android
|
<p>I'm making about my 4th android app, and nothing that I try to log is showing up, I'm so confused. All my other apps will log things just fine, but this won't I think this is the error message for logging,
<code>ignoring message with no sender credentials</code>
Although I'm not sure, as it shows up alot. Here is what I'm doing to log. </p>
<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.d("SMS", "testing");
}
</code></pre>
<p>I really don't understand what could be wrong. I've compared the application manifests with those of my other apps, and they don't seem to be different.</p>
<p>Any help is much appreciated, thanks.</p>
|
java android
|
[1, 4]
|
5,784,195 | 5,784,196 |
Adding offset to each line
|
<p>I am new to javascript, so excuse my lack of actual code.</p>
<p>I have a block of text that I want to fit into a space. I want to break it into rows. I need to find where the newlines are to add a new line and some offset. Then I want to subtract the offset from the row word length (if needed) and get a new cycle until there is something to do.</p>
<p>I was actually hoping to get an answer on the splitting on newlines, or at least finding out how long a row is by pixels.</p>
|
javascript jquery
|
[3, 5]
|
386,824 | 386,825 |
Convert from JavaScript to jQuery Syntax?
|
<p>Is there in the world any tool or sample-based tutorial on converting JavaScript to jQuery Syntax?
Not scattered documentation but sample-based converting.</p>
<p>Need to re-write this snippet:</p>
<pre><code>var cssmenuids = ["navmenu"];
var csssubmenuoffset = -1;
function createcssmenu()
{
for (var i = 0; i < cssmenuids.length; i++)
{
var ultags = document.getElementById(cssmenuids[i]).getElementsByTagName("ul");
for (var t = 0; t < ultags.length; t++)
{
ultags[t].style.top = ultags[t].parentNode.offsetHeight + csssubmenuoffset + "px";
ultags[t].parentNode.onmouseover = function()
{
this.style.zIndex = 100;
this.getElementsByTagName("ul")[0].style.visibility = "visible";
this.getElementsByTagName("ul")[0].style.zIndex = 0;
}
ultags[t].parentNode.onmouseout = function()
{
this.style.zIndex = 0;
this.getElementsByTagName("ul")[0].style.visibility = "hidden";
this.getElementsByTagName("ul")[0].style.zIndex = 100;
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", createcssmenu, false);
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu);
</code></pre>
<p>Related question & Final answer <a href="http://stackoverflow.com/questions/16035139/javascript-to-jquery-syntax-building-custom-css-horizontal-menu">JavaScript to jQuery syntax Building custom CSS horizontal menu</a></p>
|
javascript jquery
|
[3, 5]
|
1,207,671 | 1,207,672 |
ASP Checkbox and JS
|
<p>I'm trying to check to see if the aspboxes are checked in js. Can I set an ID number to the listItems and check each one by one?</p>
<pre><code> <asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem Text="Asset Classes" value="Asset Classes"></asp:ListItem>
<asp:ListItem Text="Asset Types" Value="Asset Types"></asp:ListItem>
<asp:ListItem Text="Asset Manufactuerer" value="Asset Manufactuerer"></asp:ListItem>
<asp:ListItem Text="Asset Voltage Class" Value="Asset Voltage Class"></asp:ListItem>
</asp:CheckBoxList>
</code></pre>
<p>Thanks!</p>
|
javascript asp.net
|
[3, 9]
|
4,510,825 | 4,510,826 |
Automatically showing div on mouseover
|
<p>This is probably a simple problem I'm having, but for the life of me, I can't seem to figure it out. If any of you could help me with this, I would be much obliged.</p>
<p>I'm using JQuery to make a menu appear when a user hovers over a certain div. The menu will be displayed on the top left of the div.
I got this to work, but when I try to click on a menu item of the div that appeared, the div disappears again, because the mouse is technically not over the div, but over the menu.</p>
<p>In the example below, "#blockMenu" is the menu that dynamically appears. I fade the current div ($this)) out a bit, to emphasize the menu as well.</p>
<p>I use the following code to make this happen:</p>
<pre><code>$("div.editable").hover(function () {
$(this).fadeTo(500, 0.25);
$('#Menu').css("position", "absolute");
$("#Menu").css("top", $(this).offset().top);
$("#Menu").css("left", $(this).offset().left);
$("#Menu").css("zIndex", "10000");
$('#Menu').show();
}, function (e) { // on mouseout
$(this).fadeTo(500, 1);
$("#Menu").hide();
});
</code></pre>
<p>I want the menu to disappear when the cursor leaves the div, while the div remains faded out when the cursor is on the menu. When the cursor leaves the menu AND the div at the same time, the div should fade back in and the menu should disappear.</p>
<p>Does anyone have an idea of how I could edit my code to make this work correctly? </p>
<p>Thank you very much for any help you can give me.</p>
|
javascript jquery
|
[3, 5]
|
5,030,900 | 5,030,901 |
jQuery function not moving... can't find anything wrong with it?
|
<p>I'm trying to take these moving clouds: <a href="http://vintageskytheme.tumblr.com/" rel="nofollow">http://vintageskytheme.tumblr.com/</a> (it's a theme I've already bought from themeforest, but its for tumblr)</p>
<p>I'm trying to put it on wordpress. here: <a href="http://pawprintsinmypancakes.com/" rel="nofollow">http://pawprintsinmypancakes.com/</a></p>
<p>it used to be $() function and i see it giving errors in console every 30 milliseconds so i know the rest of the code IS working... but when i change it to jQuery()... console is just silent. I have no idea whats wrong</p>
|
javascript jquery
|
[3, 5]
|
3,488,808 | 3,488,809 |
I have binded a grid with List<int> (temporary list), how can i pick the list text into controls text in item template in grid view
|
<p>I have binded a grid with List (temporary list),
how can I pick the list text into controls text in item template in grid view.</p>
<p><strong>aspx</strong></p>
<pre><code><asp:GridView ID="gvDenomination" runat="server">
<Columns>
<asp:TemplateField HeaderText="Value">
<ItemTemplate>
<asp:Label ID="lblValue" runat="server" Text='<%#Eval("lstdenomination") %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton runat="server">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</code></pre>
<p><strong>CodeBehind</strong></p>
<pre><code>stdenomination.Add(Convert.ToInt32(txtDenomination.Text));
gvDenomination.DataSource = lstdenomination;
gvDenomination.DataBind();
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,652,916 | 2,652,917 |
Random Integer: Android
|
<p>I'm guessing this is very simple, but for some reason I am unable to figure it out. So, how do you pick a random integer out of two numbers. I want to randomly pick an integer out of 1 and 2.</p>
|
java android
|
[1, 4]
|
2,612,975 | 2,612,976 |
Cycle through int values
|
<p>I need some input.</p>
<p>Say you have an int-based Enum with values 1 through 10. If you then have a variable that is, say, value corresponding to 7, how can you easiest set it to next value in the given range without going out of bounds? If the value reaches the limit, it should reset itself to first in the range.</p>
<p>I want a one-liner solution to this. I don't want to do ++ and then check and reset value, plus it has to work in both C# and JavaScript. I suppose something in the Math object might be of help, I don't know...</p>
<p>thanks</p>
|
c# javascript
|
[0, 3]
|
3,967,467 | 3,967,468 |
how to register events for ajax returned html tags?
|
<p>I'm new to jquery so I don't know if I have titled the question correctly. For post back html marks, I can register events for the like:</p>
<pre><code>$(document).ready(function () {
$(":input[data-autocomplete]").each(function () {
...});
</code></pre>
<p>now I need to allow user to click a button to add more items by triggering an ajax call and append the server response that contains the marks for the new item :</p>
<pre><code>$(this).click(function(){
$.get("my url", {}, function (data) {$("#xxx").append(data);});
});
</code></pre>
<p>My question is: now there are some new marks with attribute [data-autocomplete] within returned "data",how can I do the same events registration for them? Thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,437,501 | 1,437,502 |
Which is best way to design a webpage?
|
<p>I'm interested in developing a website using asp c#. I am new to asp.net c# platform. I want to design a website with css styles that have drop down menu items and new style. So how to start design and which software should I use?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,236,278 | 3,236,279 |
How do I count how many span of the same id on my page?
|
<p>I have this html code:</p>
<pre><code><span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
<span id="post"></span>
</code></pre>
<p>I want to count how many spans are there with the <code>id="post"</code> in my page. when I tried to use <code>.length</code> and <code>alert</code> I got <code>1</code>
what is the way to do this ?</p>
|
javascript jquery
|
[3, 5]
|
2,161,664 | 2,161,665 |
ASP.NET Conditional Markup Rendering According to Web.config Key
|
<p>I have a key in web.config as -</p>
<pre><code><add key="IsDemo" value ="true"/>
</code></pre>
<p>I want to show/hide markup based on above web.config entry for a <strong>non-server html tag</strong> without using code behind file (as there is no .cs file and there are no runat=server controls).
Something similar to following pseudo code:</p>
<pre><code>IF ( IsDemo == "true" )
THEN
<tr>
<td id="tdDemoSection" colspan="2" align="left" valign="top">
<.....>
</td>
</tr>
ENDIF
</code></pre>
<p>Does anyone know that we can write such conditional logic in .aspx markup?
Please help!!!</p>
<p><strong>EDIT:</strong>
Section I'm hiding or showing have some data like username and password. So, I do not want user to use Firebug or Web Developer Tools to see hidden markup. markup should not go to client side.</p>
|
javascript asp.net
|
[3, 9]
|
3,330,223 | 3,330,224 |
styling external widget
|
<p>My website has an external widget that displays a table.</p>
<p>The widget comes with some inline CSS. Is there a way to remove this CSS before appending the widget to my page, so that only my css file rules will apply?</p>
<p>The markup looks like this:</p>
<pre><code><div id="widgetContainer">
<script language='javascript' src='http://www.esake.gr/scripts/create_widget.php?pw=1&maw=242&fof=Verdana&tifs=14&tic=3A3A3A&tibc=FFFFFF&dafs=12&dac=3A3A3A&dabc=FFFFFF&ces=0&cep=1&langid=gr'></script>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,368,710 | 4,368,711 |
jquery attribute selector problem: Dynamic attribute selector
|
<p>My code is here</p>
<pre><code>$("a[href=$.jqURL.url()]").hide();
</code></pre>
<p><code>$.jqURL.url()</code> return current page url. </p>
<p>But this code don't work</p>
<p>Is it possible to select dynamically?</p>
|
javascript jquery
|
[3, 5]
|
1,466,169 | 1,466,170 |
my array "is not a function" error message
|
<p>I am trying to store some DOM information into an Array so I can use it elsewhere.</p>
<p>This works if I use a Variable, but if I try to use an Array I get "Arrayname is not a function" error message? I'm not sure why this would work in a Variable and not an array.</p>
<p>This is the code I'm running:</p>
<pre><code>function testmove(total) {
for (var x=1; x<=total; x++) {
allstore(x) = jQuery('#block-views-items-block .views-row-1').children('div');
x++;
}
}
</code></pre>
<p>This works:</p>
<pre><code>function testmove(total) {
store1 = jQuery('#block-views-items-block .views-row-1').children('div');
}
</code></pre>
<p>Am I missing something/doing something wrong here?</p>
|
javascript jquery
|
[3, 5]
|
4,070,936 | 4,070,937 |
How to access element id and other attributes using jQuery?
|
<p>I have JavaScript method which acts when a particular class (mcb) of forms are submitted:</p>
<pre><code>function BindCloseMessage() {
$(".mcb").submit(function(event) {
alert("closing..."); //Here I want to get the id of form
event.preventDefault();
});
}
</code></pre>
<p>In place of alert call, I need to access the id of form whose submit is called. How can I do it? Even better will be the tip for accessing any attribute...</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,728,660 | 3,728,661 |
calling click event of a button serverside
|
<p>how can i click or load the click() event of a button in codebehind?<br>
i already treid</p>
<pre><code> btn.Click();
</code></pre>
<p>but this gives an error<br>
i am using asp.net</p>
|
c# asp.net
|
[0, 9]
|
2,375,267 | 2,375,268 |
php header("location: test.php") not working. But java script redirect working
|
<blockquote>
<p><strong>php header("location: test.php")</strong></p>
</blockquote>
<p>not working. But java script redirect working .</p>
<p>I tried with header() doesn't redirects?</p>
<blockquote>
<p><strong>header("location: test.php");</strong></p>
</blockquote>
<p>but i tried with java script its working</p>
<blockquote>
<p><strong>window.location ="http://www.test.com/test.php"</strong></p>
</blockquote>
<p>what is the problem. please give some solution</p>
<p>before calling header there no <strong>echo</strong> ( output commands )</p>
<p>there is no error / warning messages</p>
<p><strong>My exact code :</strong></p>
<pre><code>if($contlogin >0 && $LoginID!="")
{
$_SESSION['LoginID'] = $LoginID;
if($_SESSION['currentUrl']) {
header("location: http://".$_SESSION['currentUrl']);
}
else {
if($LoginID==1) {
header("location:admin/index.php");
}
else {
header("location:dashboard.php");
}
}
}
else {
header("location:index.php?err=1");
}
</code></pre>
|
php javascript
|
[2, 3]
|
4,168,735 | 4,168,736 |
how can change the text string to date object?
|
<p>i am getting string from server and i need to covert that fetching string in to new date object.. for doing this, i tried this function, but no use, any one can help me to convert strings to date object?</p>
<p>my code is :</p>
<pre><code>var nationZone = {
getNewYorkLocalTime : 'getTime.php?lat=40.71417&lan=74.00639',
getLondonLocalTime : 'getTime.php?lat=51.5&lan=0.1166667',
getChennaiLocalTime : 'getTime.php?lat=13.0833333&lan=80.2833333',
getBangaloreLocalTime:'getTime.php?lat=12.9833333&lan=77.5833333'
}
$.each(nationZone , function(key, value){
$.get(value, function(response){
var newdate = $(response).find('localtime').text();
if(key == "getNewYorkLocalTime"){
var newyourktime = new Date(newdate);
newyourktime.getTime()
}
});
});
</code></pre>
<p>but, the newyourktime is showing local time only.. any help please? as well i am getting the response from server is : 17 Nov 2011 18:09:47 - like this.</p>
|
javascript jquery
|
[3, 5]
|
5,885,020 | 5,885,021 |
setTimeout for each instance of object
|
<p>I have this object (this is only part of it, obviously...):</p>
<pre><code>function room() {
this.data = {
sender_name: '',
room_id: 0
}
this.create = function (sender_name) {
// (code to set this.data)
this.removeTimer();
}
this.removeTimer = function() {
var t = this;
console.log(t.data.sender_name) // log #1
$.tGet('roomInfo', {'room_id': this.data.room_id}, function(edata) {
console.log(t.data.sender_name) // log #2
if(edata.exists == 'false') {
// remove room code...
}
else {
setTimeout(function() {
t.removeTimer();
}, 1000)
}
})
};
}
</code></pre>
<p>and I create its instances from DB like this:</p>
<pre><code>$.tGet('getRooms', {'user_id': mUser}, function(edata) {
var i = 0, n;
for(i = 0; i<edata.length; i++) {
n = new room();
n.create(edata[i].sender_name);
}
})
</code></pre>
<p>Now, the problem is that what console prints is only the last room created. I don't know what's going on...</p>
<p>The first time this code runs, log #1 is completely correct. However, log #2 is already problematic because it gives me only the last room in the DB (or in the loop...) and, of course, after the timeout log #1 becomes wrong too.</p>
<p>What's going on? I'm really just a begginer at javascript, so... </p>
<hr>
<p><code>tGet</code> function:</p>
<pre><code>$.tGet = function(action, data, callback, error) {
$.get('php/ajax.php?action='+action, data, callback, 'json').fail(error);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,192,755 | 5,192,756 |
Jquery show & hide not working but native change to style.display does work
|
<p>Why does toggling display between block/none work but jQuery show/hide does not?</p>
<p>Javascript:</p>
<pre><code><div style="width: 100px; height: 100px; background-color: red;"
onmouseover="document.getElementById('div1').style.display = 'block';"
onmouseout="document.getElementById('div1').style.display = 'none';">
<div id="div1" style="display: none;">Text</div>
</div>
</code></pre>
<p>jQuery:</p>
<pre><code><script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div style="width: 100px; height: 100px; background-color: red;"
onmouseover="$('#div1').show();" onmouseout="$('#div1').hide();">
<div id="div1" style="display: none;">Text</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,725,222 | 4,725,223 |
3rd Party Script Breaking my JS
|
<p>I have a 3rd party script that displays some data on my site. When the script loads it breaks all of the JS on any page the script is in. I remove the script and my page works without issue. </p>
<p>Are there ways to prevent 3rd party scripts from interacting with my page in a way the breaks the page?</p>
<p><strong>Notes:</strong></p>
<ul>
<li>I have no access to the 3rd party script to edit.</li>
<li>I am using jQuery for the scripts that are breaking. I have in place <code>jQuery.noConflict</code> yet it still breaks the page. </li>
<li>I have attempted to load the script in an iframe to see if that made a difference. It did not.</li>
<li>The script does write data to the page, mainly CSS and HTML</li>
</ul>
<p>Note: The below code may contain references/links to drug content, mainly marijuana. </p>
<p>I am building a site for a medical marijuana dispensary. I am importing the menu of the dispensary from a site called WeedMaps. Their embed code looks like this: </p>
<pre><code><script type="text/javascript">var wmenu_id = 1111;</script> //The number correlates to the menu I need to pull, I have changed it in this question
<script type="text/javascript" src="http://legalmarijuanadispensary.com/components/com_weedmenu/weedmenu-widget.js"></script>
</code></pre>
<p>When I use the above code the JS of my site breaks. How to I prevent my code from breaking when using 3rd party scripts over which I have no control. </p>
<p><strong>UPDATE</strong></p>
<p>Here is a <a href="http://jsfiddle.net/Lynda333/u8gH3/1/" rel="nofollow">JS Fiddle</a>. The menu opens but doesn't close properly. Remove the script that is generating the menu from weedmaps and the menu works correctly. (The weedmaps menu script is in the bottom of the HTML panel.)</p>
|
javascript jquery
|
[3, 5]
|
4,191,146 | 4,191,147 |
Killing The Application In Android
|
<p>I have an application which shows a notification in the status bar for users to click to get resumed into the activity.</p>
<p>In the application, I will also have a close application button which runs:</p>
<pre><code>android.os.Process.killProcess(android.os.Process.myPid());
</code></pre>
<p>When I click the close app button, the app will get killed as long as I didn't enter the app through clicking on the notification.</p>
<p>If I have entered the app by clicking on the application, the application will "blink" for a second and a new copy is shown. I suppose a new copy is shown.</p>
<p>Do anyone happen to know what's causing this?</p>
|
java android
|
[1, 4]
|
5,017,581 | 5,017,582 |
How to represent static struct in Java
|
<p>Following is a static struct in C++. How can this be represented in java.</p>
<pre><code>static struct {
int c1;
int c2;
} pair[37]= {{3770,3780}, {3770,3781}, {3770,3782}, {3770,3785},
{3770,3786}, {3770,3787}, {3771,3780}, {3771,3781},
{3771,3782}, {3771,3785}, {3771,3786}, {3771,3787},
{3772,3780}, {3772,3783}, {3773,3780}, {3773,3781},
{3773,3782}, {3773,3785}, {3773,3786}, {3773,3787},
{3774,3780}, {3774,3781}, {3774,3782}, {3774,3783},
{3774,3785}, {3774,3786}, {3774,3787}, {3776,3780},
{3776,3785}, {3776,3786}, {3776,3787}, {53,3770},
{53,3771},{53,3772},{53,3773},{53,3774},{53,3776}};
</code></pre>
<p>Thanks</p>
|
java c++
|
[1, 6]
|
2,125,127 | 2,125,128 |
How to use jQuery/Javascript to fadein/out text after a while
|
<p>On <a href="http://envylabs.com/" rel="nofollow">Envylabs' site</a> they have a feature where, below the logo, some text keeps changing after a few seconds. </p>
<p>I'm trying to find out what kind of JS/jquery function would do that. Can someone point to a tutorial for this?</p>
|
javascript jquery
|
[3, 5]
|
2,300,775 | 2,300,776 |
How can I access JavaScript function argument outside the function?
|
<p>Can I access the function arguments outside the function?</p>
<p>Here is my code:</p>
<pre><code>function viewmessage(username,name) {
//alert(name + " : " + username);
$('#heading').html(name);
$.get('/notification/viewmessage', {user:username}, function(data) {
$('#messagesfrom').html(data);
$('#newmessage').slideDown(200);
});
}
alert(name + " : " + username);
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,301,738 | 3,301,739 |
Problem in empty select - remove all options from select
|
<p>If I have select with id="select_test", how to delete all options inside but select stay on page, so I can load again some new options ? ( I get answer how to load, but I cannot empty, I tried like <code>$('#select_test').empty();</code></p>
<p>and </p>
<pre><code>$('#select_test').find('option').remove();
</code></pre>
<p>but it doesn't work ). Can someone say what I did wrong ?</p>
|
javascript jquery
|
[3, 5]
|
1,262,962 | 1,262,963 |
Why is my jquery val() not picking the actual selected value from my select box?
|
<p>When I type <code>$('select[id*=lstAdvGradYear]')</code> chrome gives me </p>
<pre><code><select name="Views\ContentArea$ctl00$lstAdvGradYear" id="Views\ContentArea_ctl00_lstAdvGradYear" class="ddReplace" style="display: none; ">
<option value="2016">2016</option>
<option value="2015">2015</option>
<option value="2014">2014</option>
<option selected="selected" value="2013">2013</option>
<option value="2012">2012</option>
</select>
</code></pre>
<p>When I type <code>$('select[id*=lstAdvGradYear]').val()</code> chrome replies with <code>"2016"</code>.</p>
<p>When I type <code>$('select[id*=lstAdvGradYear] option:selected ').val()</code> chrome also replies with <code>"2016"</code></p>
<p>When I type <code>$('select[id*=lstAdvGradYear] option:selected')</code> chrome replies with <code>[<option value="2016">2016</option>]</code></p>
<p>What am I doing wrong? </p>
<p>I have verified that there are no other drop downs with a similar name</p>
<p><hr>
<b>EDIT:</b> To be clear, my issue is that <code>.val()</code> should be returning 2013 NOT 2016</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.