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 |
|---|---|---|---|---|---|
5,484,839
| 5,484,840
|
Inserting a record to mysql using jquery
|
<p>I want to use a cloned div that contains a form to insert a record to the database using this code</p>
<pre><code>$(document).ready(function() {
$("#button").click(function() {
$("<div class='newclone' id='xxx'><article><form method='post' id='aj'><input type='checkbox'><label>Firstname</label><input type='text' value='' name='firstname'><label>Secondname</label><input type='text' value='' name='secondname'><label>City</label><input type='text' value='' name='city'><input type='hidden' value='4'></article><input type='submit' value='insert' class='one'><button class='two'>Delete</button><button class='three'>Cancel</button></form></div>").appendTo('.clone-container');
});
$('.one').click(function() {
$.ajax({
type: "POST",
url: "insert.php",
data: $("#aj").serialize(),
success: function() {
alert('Inserted!');
}
});
});
});
</code></pre>
<p>This is the php file</p>
<pre><code>$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("clone", $con);
$firstname=$_POST['firstname'];
$secondname=$_POST['secondname'];
$city=$_POST['city'];
mysql_query("INSERT INTO clone(firstname,secondname,city) VALUES ('$firstname','$secondname','$city')");
</code></pre>
<p>edit</p>
<p>the problem is that there seem to be nothing posted</p>
|
php jquery
|
[2, 5]
|
2,011,962
| 2,011,963
|
How to get the duration of call started from your app?
|
<p>In my app, when someone clicks on a button, a phone call is started.
Can i detect when the phone call is finished, so i will be able to measure the duration of this call?</p>
<p>Tnx.</p>
|
java android
|
[1, 4]
|
3,542,078
| 3,542,079
|
How do i call a function every day between 10 am to 11 am
|
<p>I create a function in c# and published on server. But now i want to run this function between 10am to 11am only. How can i create this?</p>
|
c# asp.net
|
[0, 9]
|
2,670,283
| 2,670,284
|
jQuery update HTML on the fly
|
<p>I have a slideshow that has 5 slides (each has an individual id) and a previous and next button. When hovering the previous or next button you get a tooltip, the tooltip uses jQuery to get the ID attribute from the previous and next div and show this. </p>
<p>Ive gotten it working fine on mouseenter only if you dont leave the div and keep clicking the Tooltip doesnt update, you have to leave the arrows after each click for the value to be aupdated, does this make sense?</p>
<p>my script is...</p>
<pre><code> $("div.arrows div").bind("mouseenter", function () {
$("div.arrows div.next").children("span").html($("div.roundabout-in-focus").next("div").attr("id"));
$("div.arrows div.prev").children("span").html($("div.roundabout-in-focus").prev("div").attr("id"));
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,013,718
| 3,013,719
|
Android service boot order
|
<p>Greetings, I am writing an application that will be utilizing a service that needs to be started before any other services listening for the BOOT_COMPLETED broadcast can start. After some cursory searching I have not found anything that would imply an ability to control the boot order. Is this something that can be accomplished via the java application SDK or will I need to start messing around with lower level code? This is for a legitimate security application and I have root access if needed.</p>
|
java android
|
[1, 4]
|
1,818,177
| 1,818,178
|
How to write memoery usage log in ASP.NET
|
<p>We got "out of memory" issue on production servers. What API can we use to get live memory (physical and managed) usage of the ASP.NET application?</p>
<p>Thanks.</p>
<p>PS: we're forbidden to profile memory with tools.</p>
|
c# asp.net
|
[0, 9]
|
3,573,540
| 3,573,541
|
Why should PyImport_AppendInittab() be called before Py_Initialize()?
|
<p>According to <a href="http://docs.python.org/c-api/import.html?highlight=pyimport_appendinittab#PyImport_AppendInittab" rel="nofollow">the Documentation</a>, PyImport_AppendInittab "should be called before Py_Initialize()."</p>
<p>There is no explanation of why this is the case, and ignoring this advice yields a working application. So, since this is working, under what circumstances will it not work?</p>
<p>Kind regards,
Daniel</p>
|
c++ python
|
[6, 7]
|
5,467,369
| 5,467,370
|
How Can I Know If An Input Is Checked If I Only Know His Value?
|
<p>I have a dynamic input in my php code like this one:</p>
<pre><code><input type="checkbox" id="advantage[]" name="advantage[]" value="Special Option" />
</code></pre>
<p>And I need to know if it's checked... I can have multiple checks in the same format in the code, my brain hurts because i can't find a solution!</p>
<p>Thanks 4 the help!</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,790,143
| 4,790,144
|
how to redirect to email login page based on email address domain
|
<p>i have a registration page there i am capturing user email address, once the registration is completed user has to activate an account.. this process is working fine.. now what i am looking here is</p>
<p>i would like to give "Go to my Inbox" button when the user click on this button it should automatically redirect to email login page</p>
<p>ex: when user enter yahoo email id at the time of registration in the next step it should redirect to yahoo login page..</p>
<p>ex: when user enter gmail email id at the time of registration in the next step it should redirect to gmail login page..</p>
<p>ex: hotmail
ex: aol...ect</p>
<p>can any one give me some suggestion on this</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,751,370
| 3,751,371
|
jQuery - Select children with $(this)
|
<p>I try to count the number of children inside a div using jquery <code>$(this)</code> selector and the element's class. And the results are different. I thought jquery's <code>$(this)</code> refers to the owner object of function, is there any thing special about <code>$(this)</code> that I am missing? </p>
<pre><code>$('.parent').ready(function(){
$('.parent').children().length; // 6
$(this).children().length; // 1
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
474,876
| 474,877
|
Difference between char in Java and C# (particular problem with (char)-1)
|
<pre><code>char x = (char)-1;
</code></pre>
<p>is valid in Java, but shows me the error (<em>Overflow in constant value computation</em>)</p>
<p>Should I use a different datatype in C#?</p>
|
c# java
|
[0, 1]
|
1,876,674
| 1,876,675
|
How to start a jQuery function after executing all the MySQL queries in that PHP page?
|
<p>I have a JavaScript timer function which contains a jQuery function, and the JS function is called for every 3000 milliseconds.</p>
<pre><code><script type="text/javascript">
function timer(){ $("div#display_time").load("timer.php");}
var t=setInterval("timer()",30000);
</script>
</code></pre>
<p>Inside the body tag I have some MySQL update queries. I am triggering this by using <code>onload</code> attribute to the <code>body</code> tag,
but these queries are not getting executed before the function is called.</p>
<pre><code><body onload="timer()">
<?php
........................
.......................
//here we will be using o,o,o,7,7,2011 as the standard of our time...
$t=((time())-(gmmktime(0,0,0,7,7,2011)));
$sql="UPDATE users
SET
user_level=1,
current_qno=1,
start_time=".$t.
"WHERE user_id=".htmlentities($_SESSION['user_id']);
$result=mysql_query($sql);
if(!$result)
{
echo'<p>some thing went wrong' .mysql_error(). '</p>';
}
$_SESSION['user_level']=1;
**echo'<div id="display_time" "></div>';**
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
3,284,511
| 3,284,512
|
jquery split() issue
|
<p>Hopefully this is easy for someone.</p>
<p>I have a set of checkboxes with values 1,2,3 etc with the same name attribute (cp_bundle).</p>
<p>I use the following code to get a comma-delimited list of those checkboxes.</p>
<pre><code>var hl_calling_plan_bundle = $('input[name="cp_bundle"]:checked').getCheckboxVal() || "";
jQuery.fn.getCheckboxVal = function(){
var vals = [];
var i = 0;
this.each(function(){
vals[i++] = jQuery(this).val();
});
return vals;
}
</code></pre>
<p>if I check the first and third checkboxes, the following will be returned:</p>
<pre><code>1,3
</code></pre>
<p>Then, I want to run a test to see whether a particular value (e.g. "3") exists in the the returned variable</p>
<p>But, I can't get past the split of the variable using the following:</p>
<pre><code>var aCallingBundle = hl_calling_plan_bundle.split(",");
</code></pre>
<p>This gives the error: </p>
<pre><code>hl_calling_plan_bundle.split is not a function
</code></pre>
<p>Any idea what's going on? </p>
|
javascript jquery
|
[3, 5]
|
1,045,487
| 1,045,488
|
Javascript source file download progress?
|
<p>I am sourcing a large mapping/widget javascript file (1.3 MB) and wanted to display a progress bar as it loads. I know firebug's net watch tab knows a lot of this information, but I would like something more lightweight. I came across this website:
<a href="http://blog.greweb.fr/2012/04/work-in-progress/" rel="nofollow">http://blog.greweb.fr/2012/04/work-in-progress/</a> </p>
<p>which almost gets me there except that I need to source the file I'm downloading. I didn't see any listeners on jQuery's getScript as the file downloads. Does anyone know how to get at the progress of a sourced file download?</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
4,324,787
| 4,324,788
|
javascript unterminated string constant
|
<p>I have the following function which I pass in a value, but this value is coming from the database. However I get the following javascript when doing the following: </p>
<pre><code>showrootcausedetails('showrootcause',true,'<%# eval("Root Cause Analysis").ToString() %>')
</code></pre>
<p>I know I have to escape the characters, but How can I do that without knowing what is in the actual string?</p>
<p>Thanks,</p>
<p>Jacob</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
4,911,457
| 4,911,458
|
Android: Increasing the height of textview dynamically
|
<p>I have a class which inflates linearlayout. The inflated xml contains a textview. </p>
<p>I want to change the height of that textview dynamically as per the content.</p>
|
java android
|
[1, 4]
|
3,686,328
| 3,686,329
|
storing multiple values in single viewstate object
|
<p>hi guy's here is one problem regarding asp.net state managenment.
I want to store three values into single viewstate.Is it possible to store in single or i will go for three viewstate variables.</p>
<p>the basic need is that,I am using gridview <strong>rowcommand</strong> event for finding three values.
and i wanted to use these values in <strong>button_click</strong> event.it is directely not possible so i prefer viewstate.</p>
<p>if any other way to do this you can post.I am new in .net development so please share some knowledge of you.</p>
|
c# asp.net
|
[0, 9]
|
4,242,222
| 4,242,223
|
Jquery Caching issue?
|
<p>I have a php function that called admin_head() which basically includes the css and jquery files.</p>
<pre><code>function admin_head()
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>FreshPowder</title>
<link rel="stylesheet" media="screen" type="text/css" href="includes/style/fp-admin-style.css" />
<script src="includes/js/nicEdit/nicEdit.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="includes/js/tagTo.js" type="text/javascript"></script>
<script src="includes/js/fp_admin.js" type="text/javascript"></script>
</head>
<body>
<?php
}
</code></pre>
<p>I call it at the top of files and everything displays how it should. The only problem is that jquery works on the index.php file, but when you click on a link to say 2.php jquery doesn't work. The two files are exactly the same.</p>
|
php jquery
|
[2, 5]
|
5,043,596
| 5,043,597
|
why does getTagValue throws nullpointer if empty
|
<p>I am parsing a xmlfile on android and I have something similar to:</p>
<pre><code><images>
<image></image>
</images>
</code></pre>
<p>I have the following code:</p>
<pre><code>Element imagesElement = (Element) poiElement.getElementsByTagName("images").item(0);
NodeList images = imagesElement.getElementsByTagName("image");
for (int n = 0; n < images.getLength(); n++) {
Element imgElement = (Element) images.item(n);
String imgUrl = getTagValue("image", imgElement);<< ERROR HERE
if (imgUrl != "") {
//do something here }
}
</code></pre>
<p>If I run the getTagValue("image",imgElement) when the tag is empty I get a null pointer exception, if I run it when there is something in it it returns the value. I'd expect an empty string if it was empty!</p>
<p>I've tried examining the imgElement in eclipses debugger to try and determine how I check if it's empty but I can't work out how! Can anyone help?</p>
<p>Bex</p>
|
java android
|
[1, 4]
|
4,836,191
| 4,836,192
|
How can I modify the returned value of jQuery's html() method?
|
<p>I have a div that I want to write to a popup window (for printing).</p>
<p>I'm grabbing the contents of the div's I want on the page using jQuery's html() function like so:</p>
<pre><code>function printOptions() {
var printwindow = window.open('', 'Report', 'height=600,width=600');
printwindow.document.write('<html><head><title>Report</title>');
printwindow.document.write('</head><body>');
printwindow.document.write($('#ReportHeader').html());
printwindow.document.write($('#ReportData').html());
printwindow.document.write('</body></html>');
printwindow.document.close();
printwindow.print();
return true;
}
</code></pre>
<p>However, before I document.write() the contents of the #ReportHeader and #ReportData div's, I would like to alter them a little.</p>
<p>Specifically, I would like to replace all textboxes with a simple span containing that textboxes value.</p>
<p>Something like:</p>
<pre><code>$("input[type=text]").each(function() {
$(this).replaceWith("<span>" + $(this).val() + "</span>");
});
</code></pre>
<p>How can I do that to just the contents of those divs without altering my existing page? I just want to modify what I'm going to be writing out to the print window. I don't think I can select on what the html() returns though, because it is just returning a string. </p>
<p>I do ~not~ want to modify the original page that is launching the popup. Just the contents of what I'm going to be writing to the popup.</p>
<p>Any ideas on how I could do this?</p>
|
javascript jquery
|
[3, 5]
|
2,549,219
| 2,549,220
|
portable java application
|
<p>In your answer</p>
<p><a href="http://stackoverflow.com/questions/1617524/writing-a-portable-java-application-using-jogl-and-android-opengl/1627609#1627609">http://stackoverflow.com/questions/1617524/writing-a-portable-java-application-using-jogl-and-android-opengl/1627609#1627609</a></p>
<p>can you please tell me how to automatically work out which platform you are running on.</p>
<p>Thank you very much</p>
|
java android
|
[1, 4]
|
912,955
| 912,956
|
Android On Focus Change
|
<p>I want to update an EditText when a user changes focus from the edittext to another item I want to check the contents of the edittext eg is the number larger than 10 if so change it to 10.</p>
<p>How should I do this.</p>
|
java android
|
[1, 4]
|
1,920,931
| 1,920,932
|
gmail style file upload in c#
|
<p>I need to implement Gmail style file upload in asp.net c#
where user will click on button and file dialog will open.
user selects a file,then process that file in code.
i dont want user to see file upload control he ll just click one button.
i have already used few solutions <br/>
example
</p>
<pre><code> function OpenFileUpload() {
var myFrame = document.getElementById('frameUpload');
$(myFrame).focus();
$(myFrame).contents().find("#FileUpload1").click();
var value = $(myFrame).contents().find("#FileUpload1").val();
if (value != '') {
$(myFrame).contents().find("#btnSubmit").click();
}
}
</code></pre>
<p>need better solutions.</p>
|
c# asp.net
|
[0, 9]
|
1,223,288
| 1,223,289
|
How correctly assign value to field
|
<p>I am trying to assign value for one edit field(not asp.net control) in asp.net application using JavaScript code. It seems that <strong><</strong> character in value string gives problems for ASP.NET. If I remove < and > characters from value everything works fine.</p>
<p>Where is the problem? How to pass <> characters to the field? I don't want to use ServerSide code I want to do it on ClientSide using JS and HTML Edit box.</p>
<pre><code> function loadShareBox(pageTitle) {
document.getElementById("shareHTML").value = '<a href="' + document.location.href + '" target=_blank>' + pageTitle + '</a>';
}
</code></pre>
<p>regards,
Tomas</p>
|
asp.net javascript
|
[9, 3]
|
4,243,354
| 4,243,355
|
How to pass the article id to the "View Article" Activity
|
<p>I'm a web developer in php. When I'm creating a view article page I was passing the id in GET
something like article.php?id=10.</p>
<p>But now in android if I have an activity which views the article, how to pass to it the article ID to select it's data from the database?</p>
<p>What is my best option?</p>
|
java android
|
[1, 4]
|
691,167
| 691,168
|
C# gets previously loaded values of text fields
|
<p>I have a pretty odd problem. I was working on an item editing page end encountered some odd bug, that ASP passess old values to C# <code>.cs</code> code.</p>
<p>In my <code>Page_Load</code></p>
<pre><code>private int SomeID = 0;
if (!IsPostBack) {
...
SomeID = Convert.ToInt32(Page.RouteData.Values["id"])
LoadFunction();
}
</code></pre>
<p>Loading function:</p>
<pre><code>DataBaseDataContext db = new DataBaseDataContext();
var Item = db.FirstOrDefault(k => k.ID == SomeID);
NameTextBox.Text = Item.Name;
PriceTextBox.Text = Item.Price.ToString();
</code></pre>
<p>Saving function:</p>
<pre><code>DataBaseDataContext db = new DataBaseDataContext();
var Item = db.FirstOrDefault(k => k.ID == SomeID);
Item.Name = NameTextBox.Text;
Item.Price = Convert.ToDecimal(PriceTextBox.Text);
...
db.SubmitChanges();
</code></pre>
<p>I was bothering, why it doesn't save changes for me, so I set breakpoint in <code>db.SubmitChanges()</code> in the saving function (loading works fine). But when I looked up in value preview in VisualStudio, it showed me that it wants to send previously loaded values and not those I edited in my form.</p>
<p>I must be missing something, as it works in other places of my code, but I have no idea what it is.</p>
|
c# asp.net
|
[0, 9]
|
4,259,091
| 4,259,092
|
Duplicated countdown timer after click event
|
<p>I have this function:</p>
<pre><code>var secondsRemaining = 45;
function countdown(secondsRemaining) {
var seconds = secondsRemaining;
if (secondsRemaining > 0) {
$('.timer > div').html(seconds);
secondsRemaining--;
} else {
if (secondsRemaining == 0) {
// Times up ....
}
}
setInterval(function() {
countdown(secondsRemaining);
}, 1000);
}
</code></pre>
<p>I am running the function in the Document ready function with: </p>
<pre><code> countdown(secondsRemaining);
</code></pre>
<p>and also I run it again after I clicked for answer.
the problem is that I have 2 countdown timer now running simultaneously, new one that start from 45 seconds and the old one that continue from where it was.</p>
|
javascript jquery
|
[3, 5]
|
1,841,612
| 1,841,613
|
Cloning a field with text in it clones text as well?
|
<p>I have a piece of code that clones three fields, but when it clones the three fields, it also clones the text entered inside of it, is there a way to clear the content inside of the field when it is cloned?</p>
<pre><code>$(document).ready(function() {
$('#btnAdd').click(function() {
var num = $('.clonedSection').length;
var newNum = new Number(num + 1);
var newSection = $('#clonedSection' + num).clone().attr('id', 'clonedSection' + newNum);
newSection.children(':first').children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);
newSection.children(':nth-child(2)').children(':first').attr('id', 'age' + newNum).attr('name', 'age' + newNum);
newSection.children(':nth-child(3)').children(':first').attr('id', 'school' + newNum).attr('name', 'school' + newNum);
$('.clonedSection').last().append(newSection);
$('.clonedSection').last().val(ping);
$('#btnDel').attr('disabled','');
if (newNum == 2)
$('#btnAdd').attr('disabled','disabled');
});
$('#btnDel').click(function() {
var num = $('.clonedSection').length; // how many "duplicatable" input fields we currently have
$('#clonedSection' + num).remove(); // remove the last element
// enable the "add" button
$('#btnAdd').attr('disabled','');
// if only one element remains, disable the "remove" button
if (num-1 == 1)
$('#btnDel').attr('disabled','disabled');
});
$('#btnDel').attr('disabled','disabled');
});
</code></pre>
<p>Thanx in advance!</p>
|
javascript jquery
|
[3, 5]
|
1,250,521
| 1,250,522
|
Dynamically creating a <div> element without getting its ID overridden
|
<p>I have a <code><div></code> element that I want to dynamically add some HTML <code><a></code> elements to. That part seems to be working just fine. Here is the HTML:</p>
<p><code><div id="crumbBar" runat="server"/></code></p>
<p>In my code behind, adding HTML anchors works as expected; however, when the page renders, the id is changed to 'workArea_crumbBar' (this is all in a master page).</p>
<p>I tried dynamically creating a <code><div></code> within the <code><div></code> with the appropriate id, but that also prepended the id with 'workarea_'.</p>
<p>I've got other code that relies on the id of the <code><div></code> element. Is there some way to keep IIS from changing the id of either the main or nested element?</p>
|
c# asp.net
|
[0, 9]
|
4,342,504
| 4,342,505
|
c# asp.net response.write shrinks text boxes
|
<p>I have a Web Form project I am developing C# ASP.Net 4.5. I have a class that calls a response.write to display a message for user input validation purposes. The call to response.write is made inside the class in a method from creating a new instance of the class, thus the class method, by pressing a button on the form. But using the response.write causes the textboxes on my page to shrink considerably. Then when I press a different button the textboxes go back to normal. It only happens when I use response.write. Any help would be appreciated. Code call in class method:</p>
<pre><code> HttpContext.Current.Response.Write("File not found");
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,118,158
| 4,118,159
|
javascript into an iframe (resubmitted)
|
<p>I am developing a live code editor and I am trying to add a javascript-specific box to it
to go alongside the css and html boxes that I already have, the problem is that I don't know how to do it, properly that is.</p>
<p>This is the script I've developed so far (based on jQuery 1.7)</p>
<pre><code>(function () {
$('.grid').height($(window).height());
var contents = $('#result').contents(),
body = contents.find('body'),
styleTag = $('<style></style>').appendTo(contents.find('head'));
$('textarea').keyup(function () {
var $this = $(this);
if ($this.attr('id') === 'html') {
body.html($this.val());
} else {
// it had to be css
styleTag.text($this.val());
}
});
</code></pre>
<p>If anyone could help me add the javascript area that would be awesome.</p>
<p>BTW please don't close this I have been wanting to find a solution but none of the questions are what i directly need.</p>
|
javascript jquery
|
[3, 5]
|
4,169,813
| 4,169,814
|
Soap service credential available from InputStream
|
<p>For a project I am doing, I am using a SOAP service to access some data from another system. I added the SOAP service as a web reference to my ASP.NET (C#) project.</p>
<p>Now, the service is kinda complicated, because a user has to be authenticated first with a cookie (don't ask). So what we did was:</p>
<ul>
<li>The user accesses our website.</li>
<li>Website redirects the user to a logon page on the server where the service is located.</li>
<li>User logs on, and a FormsAuthentication.SetAuthCookie is performed</li>
<li>User is redirected back to our site. Which then forwards the user to a page which should contain data from the webservice.</li>
</ul>
<p>That page instantiates the webservice as an object like this:</p>
<pre><code>MyService.MyServiceservice = new MyService.MyService();
</code></pre>
<p>Then I put the credentials in (now I do it hardcoded):</p>
<pre><code>service.PreAuthenticate = true;
service.Credentials = new NetworkCredential("Wim", "mypass");
</code></pre>
<p>When I call a method on that service, I want the Global.asax on the server containing the server, to be able to "catch" the username and password from the request. But somehow I cannot fetch it.</p>
<p>Don't ask why it has to be done like this, lets call it .. unfortunate :P</p>
<p>Does anyone know how to fetch the username and password from that request on the server side, preferable in the Global.asax Application_BeginRequest.</p>
|
c# asp.net
|
[0, 9]
|
898,677
| 898,678
|
how to import android in python script
|
<p>Am new bee to python actually when am importing android in my python script am getting error like *<em>No Module etc</em>*Please let me know how can i fix this issue. am using eclipse IDE for written python scripts.
thanks i advance </p>
|
android python
|
[4, 7]
|
4,529,444
| 4,529,445
|
Setting an attribute to the last position
|
<p><strong>Is it possible to set a new attribute to the last position of a html element using javascript/jQuery?</strong></p>
<p>This would be helpfull for me in a case where the attribute order is important to decide whether the paragraph has changed or not.</p>
<p><strong>Example:</strong></p>
<pre><code><p attribute1="true" attribute2="true">
</code></pre>
<p>Now, i would like to add a third attribute so that the resulting paragraph would look like</p>
<pre><code><p attribute1="true" attribute2="true" attribute3="true">
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,364,210
| 4,364,211
|
User.Identity.Name An object reference is required for the non-static field
|
<p>Inside my controller class I have private method which returns logged user which is fetched using User.Identity.Name as paramater which is all fine.</p>
<pre><code>private static Account GetLoggedUser()
{
AccountService accService = new AccountService();
Account userAccount = accService.GetAccountByUsername(User.Identity.Name);
return userAccount;
}
public ActionResult Edit()
{
var userAccount = GetLoggedUser();
...
}
</code></pre>
<p>Problem is that I'm getting this error on line <code>User.Identity.Name</code></p>
<blockquote>
<p>An object reference is required for the non-static field,
method, or property 'System.Web.Mvc.Controller.User.get'</p>
</blockquote>
<p><strong>Error is shown at the compiling time.</strong></p>
|
c# asp.net
|
[0, 9]
|
2,958,307
| 2,958,308
|
Open Document/file on client with impersonation
|
<p>I have an ASP.NET/c# web application.</p>
<p>There is a link on the page that i want to be able to click, open that file from a share, enable the user to edit it and then save it back to the share.</p>
<p>The share directory is locked down and can only be accessed via a seperate account, hence the need for impersonation.</p>
<p>I have tried many ways to do this, but have only managed to open the document on the client. (they are not able to save it directly back to the share without a seperate upload function)</p>
<p>Essentially, i would like to start a process on the client with impersonation so they can click save and will save directly back to the share.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,673,564
| 5,673,565
|
(jQuery) Scroll event.. I want to scroll the document to the point specified if the user scroll the page
|
<p>I want to implement a scroll function.. So the default of scroll is disabled. And if the user use the scroll button, I want it to be set to the point I want.. How can I implement this function? window.scrollTop is not working.. I tried a lot of different methods but all were not working..</p>
<pre><code>$(window).scroll(function() {
$(body).scrollTop = 3000px;
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,069,726
| 2,069,727
|
How to return value from new object instance method declaration (nested)?
|
<p>Ok this is the code:</p>
<p>public boolean alertDialog(String message){</p>
<pre><code> AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message).setCancelable(false).setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
TestBedAppActivity.this.agree = true;
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
TestBedAppActivity.this.agree = false;
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
</code></pre>
<p>Inside the setPositiveButton() methos there is a nested declaration of the method onClick(). I want to return the boolean result for the main method alertDialog(String message) but I cannot do it. What am I missing? Help!!!!!!!</p>
|
java android
|
[1, 4]
|
1,946,924
| 1,946,925
|
Font Resizer if else
|
<p>I have a font resizer that needs to be contained in one link. eg. show text link "Larger Type" and switch to text link of "Smaller Type" when clicked. I am not sure why it will toggle the class "plus/minus" but it will not switch the text or call the font resize function after the else statement?</p>
<p>Currently, it works the first click to resize the text and add the minus class but after that it does nothing. </p>
<p><a href="http://jsfiddle.net/infatti/P6SVv/" rel="nofollow">http://jsfiddle.net/infatti/P6SVv/</a></p>
<pre><code>var targetContainers = $('.two-thirds');
var newLargerSize = 16;
var newSmallerSize = 14;
$('.resize-font a').click(function(){
if ($(this).hasClass('plus')) {
$(targetContainers).css('font-size', newLargerSize);
$(this).text('Smaller Type').toggleClass('minus');
} else {
$(targetContainers).css('font-size', newSmallerSize);
$(this).text('Larger Type').toggleClass('plus');
};
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,141,742
| 3,141,743
|
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]
|
4,951,842
| 4,951,843
|
Postback collapsing fields
|
<p>I've got a login button with he following code.</p>
<pre><code>protected void prv_Click(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
if (!HttpContext.Current.Request.IsSecureConnection)
{
string postbackUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace("http", "https");
Response.Redirect(postbackUrl);
}
}
login_box.Visible = true;
}
</code></pre>
<p>The problem is, if the user is browsing using http and clicks on login link which fires off the prv_Click, the site redirects you to https which is correct, but the login_box which is standard div set to visible false and run at server never gets set to true. The user has to click on the login link again which then expands it.</p>
<p>Any help would be appreciated. </p>
|
c# asp.net
|
[0, 9]
|
2,324,950
| 2,324,951
|
jQuery match from value string
|
<p>I trying to match a variable from an url. This works fine if I use the expression directly in the match method. However I am having problem getting it to work if the expression is inside a string.</p>
<blockquote>
<p>var match = '/(page_art_list=\d+)/';</p>
</blockquote>
<p>match contains the value..</p>
<pre><code>var pattern = "/("+paramName+"=\d+)/";
var match = this.href.match(pattern);
</code></pre>
<p>match is null</p>
<p>I have double checked that both examples produce exactly the same string. </p>
<p>Any thoughts?</p>
<p>Best regards.
Asbjørn Morell </p>
|
javascript jquery
|
[3, 5]
|
919,056
| 919,057
|
Close child windows from postbacked parent window
|
<p>I need to close child windows which has been loaded by a parent window.<br>
The child windows are opened by using <code>window.open()</code> method.<br>
I need to close this child windows by clicking a logout button or close button which is in parent window.<br>
My code:<br></p>
<pre><code> var childWin = [];
//child window open event
function child_open(url)
{
childWin[childWin.length] = window.open(url);
}
//a logout button or close button event
function parent_close()
{
for (i=0; i<childWin.length; i++)
{
if (childWin[i] == null) return false;
childWin[i].close();
}
window.close();
}
</code></pre>
<p>This code is OK if the parent window don't postback to server.
When a postback occured in parent window,the value of variable(childWin) disappeared and I can't close child windows by this code.<br>
Problem is - <strong>want to close child windows even the parent postbacked.</strong>
Is there a solution for this?<br>
Thanks for all of your interests and replies.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,430,892
| 1,430,893
|
.remove() in jquery doesn't remove DOM instantly
|
<p>I have the following function to remove a DOM element "div", </p>
<pre><code>$('#emDiv').on("click", ':button[data-emp-del="true"]', function (evt) {
evt.preventDefault();
// Get Row - "emp0" or "emp1" etc ...
var rowId = "#" + $(this).data('emp-id');
// Remove the DIV
$(rowId).fadeOut('normal', function () {
$(this).remove();
});
// The results below returns even the one that was removed
// $('div[id^="emp"]')
return false;
});
</code></pre>
<p>How to completely remove the DIV above instantly as I want to loop over remaining DIVs change their IDs.</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,687,785
| 4,687,786
|
jQuery - Image management
|
<p>Is there a jQuery plug-in / JavaScript control that will allow me to display array of images, but with (at least) option to delete image on certain user action.</p>
<p>Something like this: <a href="http://www.gmarwaha.com/jquery/jcarousellite/index.php" rel="nofollow">http://www.gmarwaha.com/jquery/jcarousellite/index.php</a> but with dedicated delete button on every image.</p>
<p>First extra option that I can think of is to rearrange order of images.</p>
<p>If not... I guess I'll start extending mentioned jcarousellite myself....</p>
|
c# asp.net javascript jquery
|
[0, 9, 3, 5]
|
4,088,737
| 4,088,738
|
Android C++ programming
|
<p>Is there any way to programm C++ applications on Android? I mean - using your Android device for programming and compiling projects.</p>
|
c++ android
|
[6, 4]
|
95,520
| 95,521
|
Show elements depending on html value of a tag
|
<p>I would like to accomplish the following with jquery : </p>
<p>When I click on this link </p>
<pre><code><a href="#">Cars</a>
</code></pre>
<p>I would like all divs like those </p>
<pre><code><div class="product">
<div class="category">Cars</div>
</div>
</code></pre>
<p>to do something.</p>
<p>You get the idea, I have a menu with a list of categories, and a list of products, each containing a div with the category name, and I would like to make them hide/show.</p>
|
javascript jquery
|
[3, 5]
|
5,231,165
| 5,231,166
|
View above Dialog?
|
<p>Just a quick question. </p>
<p>Would it be possible to bring a View (Button) above a Dialog that is currently showing?</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
1,345,018
| 1,345,019
|
How does Python's handling of line-breaks differ from JavaScript's automatic semicolons?
|
<p>Javascript has a feature called Automatic Semicolon Insertion where basically if the parser encounters an invalid token, and the last token before that was a line break, then the parser will insert a semicolon where the linebreak is. This enables you to basically write all your javascript code without semicolons, but you have to be aware of some edge cases, mostly if you have a return keyword and then the value you want to return on a new line.</p>
<pre><code>function test(){
// This will return 'undefined', because return is a valid statement
// and "john" is a valid statement on its own.
return
"john"
}
</code></pre>
<p>Because of these gotchas there are dozens of articles with titles like 'Automatic semicolon insertion is Evil', 'Always use semicolons in Javascript' etc.</p>
<p>But in Python no one ever uses semicolons and it has exactly the same gotchas.</p>
<pre><code>def test():
# This will return 'undefined', because return is a valid statement
# and "john" is a valid statement on its own.
return
"john"
</code></pre>
<p>Works exactly the same, and yet no-one is deadly afraid of Pythons behaviour. </p>
<p>I think the cases where the javascript behaves badly are few enough that you should be able to avoid them easily. Return + value on a new line? Do people really do that a lot? </p>
<p>Any opinions? Do you use semicolons in javascript and why?</p>
|
python javascript
|
[7, 3]
|
1,824,516
| 1,824,517
|
Why does my function get called twice in jQuery?
|
<p>I have the following jQuery</p>
<pre><code>$('img[title*=\"Show\"]').click(function() {
//$e.preventDefault();
var position = $('img[title*=\"Show\"]').parent().position();
$('#popover').css('top', position.top + $('img[title*=\"Show\"]').parent().height() + 150);
console.log(position);
$('#popover').fadeToggle('fast');
if ($('img[title*=\"Show\"]').hasClass('active')) {
$(this).removeClass('active');
} else {
$('img[title*=\"Show\"]').addClass('active');
}
});
</code></pre>
<p>I have two images with the title "Show Options." For some reason whenever I click on any of these images, it gets printed TWICE. When I only have 1 image, it only gets printed once. Why is this?</p>
|
javascript jquery
|
[3, 5]
|
2,424,540
| 2,424,541
|
Automatically log in on another website at the click of a button using jQuery
|
<p>My goal is to have a button on my personal (secure) website which when I click it logs into some site for me automatically. Can jQuery be used in this way?</p>
<p>I'm thinking something like this:</p>
<ol>
<li>Open the login page in question in a frame or popup</li>
<li>Fill in the login form</li>
<li>Submit</li>
</ol>
<p>Possible?</p>
|
javascript jquery
|
[3, 5]
|
1,333,056
| 1,333,057
|
Make array hold 10 latest entries
|
<p>I am trying to get a array to hold the 10 latest values, so far it cant get it to work.</p>
<pre><code>var messages = new Array(10);
function addmessage(message) {
messages.unshift(message);
messages.length = 10;
}
</code></pre>
<p>But when i try to show the array i cant get it to show the messages in order...</p>
<p>And i display the array with</p>
<pre><code>$.each(messages, function(key, value) {
if(value != null) {
$("#messages").append(value + "<br>");
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,375,004
| 2,375,005
|
javascript id select
|
<p>I have a javascript function that someone made for me. I am kind of a noob at raw javascript. I use jquery quite often so I have been spoiled. Right now the function runs when someone clicks anywhere on the page because the <code>document</code> selector is used to trigger the function. I want the function to run when a specific id is clicked. I do have jquery installed as well. Anyone have any suggestions?</p>
<p><strong>addEvent('#id', 'click', function(){</strong> does not work</p>
<p><strong>addEvent(document.getElementById("id"), 'click', function(){</strong> does not work</p>
<pre><code>function addEvent(obj, type, fn) {
if ( obj.attachEvent ) {
obj['e'+type+fn] = fn;
obj[type+fn] = function(){obj['e'+type+fn]( window.event );}
obj.attachEvent( 'on'+type, obj[type+fn] );
} else
obj.addEventListener( type, fn, false );
}
addEvent(document, 'click', function(){
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,290,016
| 1,290,017
|
Help me change jquery slideshow to add additional class
|
<p>I have a slideshow, its only changing photos. I need to add a new div box on top of each photo. At the moment jquery code takes just #slideshow and .active. How to amend it to grab also new div class ".newbox" (.newbox1 for first photo, .newbox2 for second and so on). Each time a different box has to come up on top of different photos. This is my photo slideshow jquery code:</p>
<pre><code>function slideSwitch() {
var $active = $('#slideshow DIV.active');
if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
// use this to pull the divs in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow DIV:first');
// uncomment below to pull the divs randomly
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 5000 );
});
</script>
</code></pre>
<p>My html:</p>
<pre><code>div id="slideshow">
<div class="active">
<a href="http://www.mylink.com/" target="_blank"><img src="http://route/img.jpg" alt="alt" /></a>
<div class="newbox1"></div>
div class="newbox2"></div>
div class="newbox3"></div>
div class="newbox4"></div>
div class="newbox5"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,519,553
| 5,519,554
|
Need working solution to use Android Pattern Lock Screen in custom Application (and not source code redirects)
|
<p>I'd like to use the Android Lock Screen Pattern in my custom application while opening the app. I've searched a lot, but everyone asks to use the LockScreenUtils.java class from the source code. I'm having a tough time doing this.</p>
<p>One post on stackoverflow asks to make custom 3x3 matrix with a button on each cell and listen for the selection pattern, but then that doesn't look artistically good :)</p>
<p>Any thoughts or suggestions on how do I implement this?</p>
<p>Thanks!!!</p>
|
java android
|
[1, 4]
|
1,803,251
| 1,803,252
|
Dropdown List will not populate
|
<p>I'm not sure how to correct the following problem. I have dropdown list that has a object data source. Then in the code there is a method like this </p>
<pre><code>void InitPageData()
{
MembershipUser user = Membership.GetUser();
DataSetTableAdapters.MemberInfoTableAdapter da = new DataSetTableAdapters.MemberInfoTableAdapter();
DataSet.MemberInfoDataTable dt = da.GetMember((Guid)user.ProviderUserKey);
if (dt.Rows.Count == 1)
{
DataSet.MemberInfoRow mr = dt[0];
//rank.Text = mr.rank;
//position.Text = mr.position;
UserName.Text = user.UserName;
...
}
</code></pre>
<p>This method populates form fields on the page. What I'm trying to do is to have the rank dropdown list populated from the ods but use this method above to populate the selected item of the rank dropwon list with the line rank.Text = mr.rank. In this example the the line of code that throws the error is commented out otherwise it throws this: "'rank' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value".</p>
<p>I've chaned the code to rank.DataTextFiled = mr.rank and rank.DataValueField = mr.rankid.ToString() but this threw another error: "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Star'." "Star" is the value of the mr.rank.</p>
<p>Here is what the dropdown list and the ods look like:</p>
<pre><code><asp:DropDownList runat="server" ID="rank" CssClass="txtfield" DataSourceID="ODCRanks"
DataTextField="Rank" DataValueField="ID" AppendDataBoundItems="True">
<asp:ListItem Text="--- Select a Rank ---" Value="-1" />
</code></pre>
<p></p>
<pre><code><asp:ObjectDataSource ID="ODCRanks" runat="server"
OldValuesParameterFormatString="original_{0}" SelectMethod="GetRanks"
TypeName="RanksTableAdapters.RankTableAdapter"></asp:ObjectDataSource>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,336,294
| 2,336,295
|
Android - declaring namespace of my own app
|
<p>Hey, I tried to declare my own namespace, and use attrs.xml for holding some of attributes i need in application, but it just wont see my namespace.
in Manifest file I have</p>
<blockquote>
<p>manifest<br>
xmlns:android="http://schemas.android.com/apk/res/android"<br>
package="com.gierca"<br>
android:versionCode="1"<br>
android:versionName="1.0"</p>
</blockquote>
<p>and so on..
and in my layout.xml I declared namespace as</p>
<blockquote>
<p>LinearLayout<br>
xmlns:myapp="http://schemas.android.com/apk/res/com.gierca"<br>
myapp:attribute="some_string"</p>
</blockquote>
<p>autofill doesnt work with this namespace, and it just doesnt work either.
What am I doing wrong? I tried googling this, but even when I find some examples, they seem to be doing same thing as I do, and Im clueless</p>
|
java android
|
[1, 4]
|
3,762,365
| 3,762,366
|
Loading JavaScript Into Div Dynamically
|
<p>I need to load JavaScript code (which I don't have control over) from a URL into a div. The JavaScript code is a bunch of document.write() statements. Once the document.write() statements finish executing, I need to extract the resulting text from the div using jQuery or JavaScript and use that text for something else. Currently, I am doing the following to load the JavaScript into the div: </p>
<pre><code> $('body').append('<div id="mydiv" style="display: none"></div>');
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
$('#mydiv').append(script);
</code></pre>
<p>How would I know when the document.write statements have finished executing and I can safetly extract the text out of the div and use it? Or, is there a better way of doing this?</p>
|
javascript jquery
|
[3, 5]
|
683,418
| 683,419
|
Create new div arround anchor link when clicked
|
<p>How can I achieve this behaviors onclick with jquery :</p>
<p><strong>default state:</strong></p>
<pre><code><a href="something.html">Anchor</a>
</code></pre>
<p><strong>click state</strong></p>
<pre><code><div class="highlight">
<a href="something.html">Anchor</a>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
122,884
| 122,885
|
jquery div rotation with handle
|
<p>I want to rotate the div, but with a <code>handle ( button on its top-right corner )</code>, i tried but i did`nt get success, so if there is any plugin which do this job for me then please let me know? Thanks !</p>
|
javascript jquery
|
[3, 5]
|
1,625,817
| 1,625,818
|
immutable collection?
|
<p>i use a readonly collection to prevent users from altering my cached data, but the items themselves are ofcourse muatble.
Is there a way to prevent that behaviour?</p>
<p>Michel</p>
|
c# asp.net
|
[0, 9]
|
5,416,011
| 5,416,012
|
jQuery ancestors using jQuery objects
|
<p>I'd like to check ancestry using two jQuery objects. They don't have IDs, and are only going to be available as jQuery objects (or DOM nodes if you called <code>get()</code>). jQuery's <code>is()</code> only works with expressions, so this code would be ideal but will not work:</p>
<pre><code>var someDiv = $('#div');
$('a').click(function() {
if ($(this).parents().is(someDiv)) {
alert('boo');
}
}
</code></pre>
<p>Just want to see if one element is a child of another and I'd like to avoid stepping back into DOM land if possible.</p>
|
javascript jquery
|
[3, 5]
|
3,717,000
| 3,717,001
|
how to save edited image locally using aviary web widget and php
|
<p>I plugged the feather aviary web widget into my site and it looks and plays fantastically.but I am having a hard time with php to save the edited images locally(from aviary server to my server) and i want to overwrite original image into edited image.i read the aviary documentation(www.aviary.com/web-documentation) but i don't understand how to save the edited images locally.
here is aviary example:
</p>
<pre><code><script type="text/javascript">
var featherEditor = new Aviary.Feather({
apiKey: '1234567',
apiVersion: 2,
tools: ['draw', 'stickers'],
onSave: function(imageID, newURL) {
var img = document.getElementById(imageID);
img.src = newURL;
},
postUrl: 'http://example.com/featherposturl'
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>
<!-- Add an edit button, passing the HTML id of the image
and the public URL to the image -->
<a href="#" onclick="return launchEditor('editableimage1',
'http://example.com/public/images/goat.jpg');">Edit!</a>
<!-- original line of HTML here: -->
<img id="editableimage1" src="http://example.com/public/images/goat.jpg"/>
</code></pre>
<p>HERE is php coding:</p>
<pre><code><?php
$image_data = file_get_contents($_REQUEST['url']);
file_put_contents("photo.jpg",$image_data);
?>
</code></pre>
|
php jquery
|
[2, 5]
|
5,395,378
| 5,395,379
|
Year view calendar
|
<p>I need a calendar like <a href="http://arshaw.com/fullcalendar/" rel="nofollow">FullCalendar</a> but with full year view. The idea is that every user can select his own holidays using this calendar and store all the individual days withing a database.</p>
<p>Does someone know any library or something for that?</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,527,913
| 5,527,914
|
Dataview does not contains record in other event.
|
<p>I have defined dataview globally at Global declaration section. Now i am assigned the value of another dataview to that global defined dataview in one method. Now i am using that global defined Dataview into another method. But i am not getting the records that are defines in first method. I need it. How to do that?</p>
<pre><code>public partial class Properties : System.Web.UI.Page
{
//Declaration of Dataview :
DataView dtViewLink = new DataView();
protected void Page_Load(object sender, EventArgs e)
{
}
// define in this method
protected void myMethod(object sender, EventArgs e)
{
dtViewLink = null;
dtViewLink = dvEmployee; //dvEmployee is other Dataview that has two records.
}
// i am using it here
protected void ddlSortSortBy_SelectedIndexChanged(object sender, EventArgs e)
{
if (dtViewLink.Count > 0)
{
dtViewLink.Sort = "" + strName + " Asc";
}
}
}
</code></pre>
<p>That example will clear what i have to do</p>
|
c# asp.net
|
[0, 9]
|
4,599,810
| 4,599,811
|
Swapping a CSS class on jQuery .load event
|
<p>I have a list styled with CSS - standard stuff. The items within that feature jQuery .load to load the relevant info into another div. This works fine, however I also need to change the class in the list to reflect which item has been loaded. My existing code below, which will probably explain it better...</p>
<pre><code><ul class="inner-nav" id="tdlists">
<li class="active"><a onclick="$('##showlist').load('/lists/?List=#ListID#');">#ListName#</a></li>
<li><a onclick="$('##showlist').load('/lists/?List=#ListID#');">#ListName#</a></li>
<li><a onclick="$('##showlist').load('/lists/?List=#ListID#');">#ListName</a></li>
</ul>
</code></pre>
<p>The actual list is populated by a db query, however I've stripped that out as I don't believe it's relevant to the question and would only complicate matters!</p>
|
javascript jquery
|
[3, 5]
|
3,249,940
| 3,249,941
|
How can I temporarily disable click events on a button without actually disabling it?
|
<p>Using jQuery, I would like to, without changing the <code>disabled</code> attribute of a given button, disable all click events for it.</p>
<p>I was thinking of retrieving the click event handlers, unbind them, and storing them (say, using <code>data()</code>). </p>
<p>Then I can re-bind them once the button is enabled again. </p>
|
javascript jquery
|
[3, 5]
|
479,002
| 479,003
|
AndroidPlot only for answer
|
<p>I could not find on the Help how to change from one kind of chart to the other
for example from <strong>Line charts</strong>, <strong>Scatter charts</strong>, <strong>Bar charts</strong>, <strong>Step charts</strong> during development with Eclipse using latest <code>Androidplot-core-0.4.4-release.jar</code>.</p>
<p>I have 2 example that works <code>DynamicXYPlotExample</code> and <code>SimpleXYPlotExample</code> both use different plot. So how do i change at design time from one kind of plot to the other ?</p>
|
java android
|
[1, 4]
|
4,638,153
| 4,638,154
|
"Uncaught SyntaxError: Unexpected token [" all of a sudden in Chrome
|
<p>It was working fine up until very recently. Chrome tells me this is incorrect with "Uncaught SyntaxError: Unexpected token ["</p>
<pre><code>$.each($regions, function(index, [value1, value2]) {
$("#regions .options").children("#r").append("<div class='brick' id='" + index + "' name='" + value2 + "'>" + value1 + "</div>");
});
</code></pre>
<p>Firefox and firebug do not raise a stink and everything is working alright. I don't understand what happened in Chrome. I swear this exact code worked before.</p>
<p>Chrome v.12.0.742.122</p>
|
javascript jquery
|
[3, 5]
|
784,438
| 784,439
|
HttpContext.Current.Session is null
|
<p>I have a WebSite with a custom Cache object inside a class library. All of the projects are running .NET 3.5.
I would like to convert this class to use Session state instead of cache, in order to preserve state in a stateserver when my application recycles.
However this code throws an exception with "HttpContext.Current.Session is null" when I visit the methods from my Global.asax file. I call the class like this:</p>
<pre><code>Customer customer = CustomerCache.Instance.GetCustomer(authTicket.UserData);
</code></pre>
<p>Why is the object allways null?</p>
<pre><code>public class CustomerCache: System.Web.SessionState.IRequiresSessionState
{
private static CustomerCache m_instance;
private static Cache m_cache = HttpContext.Current.Cache;
private CustomerCache()
{
}
public static CustomerCache Instance
{
get
{
if ( m_instance == null )
m_instance = new CustomerCache();
return m_instance;
}
}
public void AddCustomer( string key, Customer customer )
{
HttpContext.Current.Session[key] = customer;
m_cache.Insert( key, customer, null, Cache.NoAbsoluteExpiration, new TimeSpan( 0, 20, 0 ), CacheItemPriority.NotRemovable, null );
}
public Customer GetCustomer( string key )
{
object test = HttpContext.Current.Session[ key ];
return m_cache[ key ] as Customer;
}
}
</code></pre>
<p>As you can see I've tried to add IRequiresSessionState to the class but that doesn't make a difference.</p>
<p>Cheers
Jens</p>
|
c# asp.net
|
[0, 9]
|
3,019,721
| 3,019,722
|
How to show a loading message while preloading images in a for loop?
|
<p>I'm using this code to preload all the images I need</p>
<pre><code>var cache = [];
function preloadImages() {
var i;
$("#loading").html("loading...");
for (i = 0; i <= 180; i++) {
var src = source.replace("###", i);
var cacheImage = document.createElement("img");
cacheImage.src = src;
cache.push(cacheImage);
}
$("#loading").html("loading completed");
}
</code></pre>
<p>And with that $("#loading").html stuff I was expecting to wait untill the loop ends to change the content, but it does not happen. It writes almost instantaneously "loading complete", while firebug tells me that the images are still downloading.</p>
<p>How can I make this work as expected? Why is this not working as one may expect?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
5,390,729
| 5,390,730
|
Can i use resolveurl in javascript
|
<pre><code> <script language="javascript" type="text/javascript">
banner2.add("FLASH", "../Banners/1.swf", 10, 60, 468,"http://www.techpint.com","_blank");
banner2.add("FLASH", "../Banners/2.swf", 10, 60, 468,"http://www.tapasya.co.in","_blank");
</script>
</code></pre>
<p>now here i want to get the base url of the site so that i can give path to my flash file in all pages.
this script is a part of my master page.
can i run " <%= ResolveUrl("~/Banners/1.swf") %> " in javascript.</p>
<pre><code>banner2.add("FLASH"," <%= ResolveUrl("~/Banners/1.swf") %> ", 10, 60, 468,"http://www.techpint.com","_blank");
</code></pre>
|
c# asp.net javascript
|
[0, 9, 3]
|
1,941,129
| 1,941,130
|
Set initial JQuery suggest value
|
<p>I have a JQuery suggest box using a key and a value. The key is the saved value, for example a userId and the value is the shown value such as a username.</p>
<p>When having a blank field it works great. I type a few characters, select a name and the value is added as the value that is posted with the HTTP request. Now, how should I prefill a form's suggest with when it already has a value. When placing the saved userId as the value the suggest shows the userId but, obviously I want to show the username. I also tried to echo the username that was selected but than, if the username is not changed the posted value will be the username. </p>
<pre><code> <script>
<!--
$(document).ready(function() {
$("#creatorUserId").autocomplete("Gateway.php?action=UserAction&subAction=suggest",{
parse: function(data) {
var parsed = [];
data = data.data;
for (var i = 0; i < data.length; i++) {
parsed[parsed.length] = {
data: data[i],
value: data[i].key,
result: data[i].value
};
}
return parsed;
},
formatItem:function(item, index, total, query){
return item.value;
},
formatResult:function(item){
return item.id;
},
dataType: 'json'
});
});
-->
</script>
<input type="text" name="creatorUserId" id="creatorUserId" value="3" size="40" />
</code></pre>
<p>How could I solve this?</p>
|
javascript jquery
|
[3, 5]
|
1,259,989
| 1,259,990
|
Change drop down list values when another user makes a choice from another drop down list in the same form
|
<p>My question is: How can i change the options-values from one list according to what a user choose from another drop down list. My issue here is that these both lists must be populated with a query.</p>
<pre><code><label for="category"></label>
<select name="category" id="category">
<option value="0" >Choose Category</option>
<?php foreach(Categories::find_all() as $id) :?>
<?php echo "<option value=".$id->id .">". $id->cat_name."</option>"; ?>
<?php endforeach?>
</code></pre>
<p></p>
<pre><code><label for="sub_category"></label>
<select name="sub_category" id="sub_category">
<option value="0" >Choose Sub Category</option>
<?php foreach(Categories_sub::find_by_cat_id(????) as $id) :?>
<?php echo "<option value=".$id->id .">". $id->cat_sub_name."</option>"; ?>
<?php endforeach?>
</code></pre>
<p></p>
|
php javascript
|
[2, 3]
|
5,081,450
| 5,081,451
|
add class to option in select
|
<p>Based on the value of an option would that be possible to add a class to an option?</p>
<p>So if i have this:</p>
<pre><code> <select class="rubrique" name="ctl00">
<option value="" selected="selected"></option>
<option value="1">1</option>
<option value="1">1</option>
</select>
</code></pre>
<p>i'll get that:</p>
<pre><code><select class="rubrique" name="ctl00">
<option class="" value="" selected="selected"></option>
<option class="1" value="1">1</option>
<option class="2" value="1">1</option>
</select>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,535,302
| 4,535,303
|
Is inputType="phone" limit the no of digits to take as inout
|
<p>I used <code>android:inputType = "phone"</code> to take phone number as input, but if i give six digits it takes otherwise force close and fires the error that </p>
<blockquote>
<p>"NumberFormat exception not valid int value"</p>
</blockquote>
<p>Actually i'm trying to convert that value to integer through:</p>
<pre><code>phone = Integer.parseInt(phoneNumber.getText().toString());
</code></pre>
|
java android
|
[1, 4]
|
3,235,669
| 3,235,670
|
Dynamic Loading of external javascript file
|
<p>How do I accomplish this? Every time I try to load an external javascript file from google maps, it crashes the webpage and it becomes blank.</p>
<p>I used the $JQuery.get(); function.</p>
<p>I am using JQuery to load the file into the head.</p>
|
javascript jquery
|
[3, 5]
|
563,919
| 563,920
|
Redirect to a dynamic page with Javascript
|
<p>This is what I am trying to do:</p>
<pre><code>function show_confirm()
{
var r=confirm("Are you sure you want to delete this record?");
if (r==true)
{
window.location = "delete.php?case=<?php echo $case; ?>";
}
else
{
window.close()
}
}
<input type="image" src="images/delete.gif" name="image" onclick="show_confirm()">
</code></pre>
<p>But it redirects here:
<a href="http://localhost/delete.php?case=" rel="nofollow">http://localhost/delete.php?case=</a></p>
<p>When it should redirect here:
localhost/delete.php?case=$case</p>
<p>*could not edit previous post</p>
|
php javascript
|
[2, 3]
|
1,193,866
| 1,193,867
|
C# ASP.NET Korzh Query Builder Custom Value Editor
|
<p>I would like to find out from someone if they have worked with <a href="http://devtools.korzh.com/" rel="nofollow">Korzh Query Builder</a> before.</p>
<p>If so, have you tried implementing a Custom Value Editor, and if so, how did you do this, and if possible do you have any links/documentation.</p>
<p>The provided exaples/documentation is a bit shoddy.</p>
<p>I have spent some time trying to figure this out, as the List examples are very slow once the number of items breach the 1000+ mark.</p>
<p>Any help/articles/links in this regrds will be greatly appreciated.</p>
|
c# asp.net
|
[0, 9]
|
3,515,004
| 3,515,005
|
Capture Copy/Paste/Select in Javascript
|
<p>How can i capture the following keys in <code>Textbox</code> using <code>JavaScript</code>?</p>
<p><kbd>Ctl</kbd> + <kbd>a</kbd> </p>
<p><kbd>Ctl</kbd> + <kbd>c</kbd></p>
<p><kbd>Ctl</kbd> + <kbd>v</kbd></p>
<h2>Following is the original Situation.</h2>
<p>I have three <code>Textboxes</code> for Phones numbers. <code>Textbox1</code> max length is 3 , 2nd's is 3 and 3rd is 4. When user types three digits in <code>TextBox1</code> the cursor moves automatically to <code>TextBox2</code> same thing happens with TextBox2 as well as TextBox3. I am handling this functionality in keyup event. Now, I am parallely using your code. But it moves in keyup event as well. This case happens when all TextBoxes are filled. Now suppose I am in TextBox1 and presses Ctl + A . This moves the user to third TextBox(unacceptable case). This is the issue.</p>
|
javascript asp.net
|
[3, 9]
|
3,137,626
| 3,137,627
|
How to get a specific frame within a frameset using jQuery?
|
<p>My main page:</p>
<pre><code><FRAMESET>
<FRAMESET >
<FRAME name="menu" src=<%=menu%>>
<FRAME marginWidth="0" src=<%=bottom%> >
</FRAMESET>
<FRAMESET>
<FRAME src=<%=title%>>
<FRAME name="main"src=<%=main%>>
</FRAMESET>
</code></pre>
<p></p>
<p>I want to get the menu frame using the <code>name attribute</code> selector instead of the <code>frames[index]</code>, so I want to replace the static selector:</p>
<p><code>window.parent.frames[0].document</code></p>
<p>for something with jQuery using name attr.</p>
|
javascript jquery
|
[3, 5]
|
2,571,106
| 2,571,107
|
$("html").animate does not work
|
<p>I'm using the following code for scrolling to top with the smooth animation. This works fine in Mozilla and IE browsers, but in chrome it is not working. Can any one please help.</p>
<pre><code>$("#animate_top a").click(function(){
$("html").animate({scrollTop : 0},'slow');
});
</code></pre>
<p>I have added the sample url, click "click to reach bottom" and click the "top" link at the bottom in chrome, mozilla and ie.</p>
<p><a href="http://www.sanatanapublications.org/demo/sample.html" rel="nofollow">http://www.sanatanapublications.org/demo/sample.html</a></p>
|
javascript jquery
|
[3, 5]
|
3,031,126
| 3,031,127
|
Why does this if/else not work in jquery for me?
|
<p>I have the following that fires off when a checkbox is changed.</p>
<pre><code>$(document).ready(function() {
$("#reviewed").change(function(){
if ($('#reviewed:checked').val() !== null) {
$.ajax({
url: "cabinet_reviewed.php?reviewed=yes",
cache: false,
success: function(html){
$("#reviewDate").replaceWith(html);
}
});
} else {
$.ajax({
url: "cabinet_reviewed.php?reviewed=no",
cache: false,
success: function(html){
$("#reviewDate").replaceWith(html);
}
});
}
});
})
</code></pre>
<p>This only works once. I'm looking to see when the check box is changed and what the value of it is once changed.</p>
<p>UPDATE:
I've change the code around to the following (based on everyone's comments)</p>
<pre><code>$(document).ready(function() {
$("#reviewed").click(
function() {
var rURL = 'cabinet_reviewed.php?reviewed=';
if ($("#reviewed").is(":checked"))
rURL = rURL + "yes";
else
rURL = rURL + "no";
alert (rURL);
$.ajax({
url: rURL,
cache: false,
success: function(html){
$("#reviewDate").replaceWith(html);
}
});
});
</code></pre>
<p>})</p>
<p>The file cabinet_reviewed.php simply echos the value of $_GET['reviewed']
With this updated code the alert shows the correct URL but the second click does not run the .ajax.
Do I need to do something so the .ajax is run again?</p>
|
javascript jquery
|
[3, 5]
|
3,100,733
| 3,100,734
|
.removeClass() not removing class. Possible specificity error
|
<p>I'm trying to simultaneously add a class to a clicked link, while simultaneously removing that same class from the DOM. The part of the code that adds the class works, but it just makes the class appear again and again. I'm also curious about the efficacy of a javascript solution vs. a server-side solution. </p>
<pre><code>$(document).ready(function() {
$(function() {
$('#header a span').click(function(e) {
var title = this.innerText;
//possible browser compatability from .text?
$('selected').removeClass('selected');
$(this).addClass('selected');
// Also prevent the link from being followed:
});
});
<div id="header" class="ui-corner-all ui-buttonset">
<a title="index" href="#" class="link" ><span>home</span></a>
<a title="code" href="#" class="link" ><span>code</span></a>
<a title="design" href="#" class="link" ><span>design</span></a>
<a title="illustration" href="#"class="link" ><span>illustration</span></a>
<a title="writing" href="#" class="link" ><span>writing</span></a>
<a title="links" href="#" class="selected" ><span>links</span></a>
<a title="about" href="#" class="selected"><span>about</span></a>
</div>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
1,929,061
| 1,929,062
|
How to get the value of usercontrol in codebehind of page
|
<p>How to get the value of usercontrol to page holding usercontrol?</p>
|
c# asp.net
|
[0, 9]
|
2,376,776
| 2,376,777
|
Replace text string with jQuery on page load?
|
<p>I have following code in my html </p>
<pre><code><p>6565655655|cell</p>
</code></pre>
<p>I want to remove this vertical line and wrap word "cell" into round bracket. So I want output like below </p>
<pre><code><p>6565655655 (cell)</p>
</code></pre>
<p>How I can do it using jquery when content of p tag loading dynamically by ajax call.</p>
|
javascript jquery
|
[3, 5]
|
32,732
| 32,733
|
jQuery AJAX URL path issue
|
<p>In jQuery AJAX url place, if I give <code>http://172.121.0.1/filename.php</code>, it's working. If I give <code>http://localhost/filename.php</code> then it's working. Please help me.</p>
<pre><code>$.ajax({
url: "http://172.22.0.155/login/login_check",
type: "POST",
data:$("#logins").serialize(),
beforeSend: function(){
$("#err").html("");
},
success: function($msg){
if($msg=="yes"){
document.location.href=urls+"main/";
}else{
$("#err").html("Please enter correct username and password");
return false;
}
},error:function (msg){
alert(msg);
}
});
</code></pre>
|
php jquery
|
[2, 5]
|
919,779
| 919,780
|
How to update onclick value when keyup?
|
<p>I’m trying to update the function parameter inside <code>onclick</code> when the user inserts a quantity in the input field.</p>
<p><strong>HTML</strong></p>
<pre><code><input type="text" id="quantity1" class="quantity_class" />
<input type="submit" id="onclick1" class="quantity_class" value="Add to cart" />
</code></pre>
<p><strong>JavaScript</strong></p>
<pre><code>$('#quantity1').keyup(function () {
$('#onclick1').attr('onclick', 'func(1,?)');
});
</code></pre>
<p>Now how can I replace <code>?</code> with the quantity value the user provided?</p>
<p><a href="http://jsfiddle.net/ruslyrossi/UA5By/5/" rel="nofollow">jsFiddle</a></p>
|
javascript jquery
|
[3, 5]
|
1,244,399
| 1,244,400
|
ASP.NET gridview control rowCreated function after button click
|
<p>I am wondering how can I control the execution order of server-side functions(asp.net and C#) for a post_back request?</p>
<p>For example:
I have two buttons on my webpage, and click on any of them will trigger a post_back request. The post back will update a gridview in an AJAXUpdatePanel. I found that if I click button1, the functions execution order is:
button1_onclick();
gridview1_rowCreated();</p>
<p>However, if I click button 2, the order is:
gridview1_rowCreated();
button2_onClick();</p>
<p>Is there anyway to make the order consistent? Any comment is truly appreciated. </p>
|
c# asp.net
|
[0, 9]
|
2,179,179
| 2,179,180
|
Which Language I Should Learn After Python?
|
<p>I'm 14. I'm currently learning Python Language. Now What Should I Learn After Python ? Here are the options:</p>
<ol>
<li>C++0x</li>
<li>C# or .Net</li>
<li>Java or any other like Scala, Groovy, etc.</li>
<li>D</li>
</ol>
<p>Sorry For First Post. Plz Help me this time.</p>
|
java c++ python
|
[1, 6, 7]
|
3,169,914
| 3,169,915
|
Stuck on Hello, L10N tutorial on Android Developer website
|
<p>I am brand new to Android development and so I'm making my way through the tutorials on the Android Developer website. I'm currently doing the Hello, L10N tutorial about localisation:
<a href="http://developer.android.com/resources/tutorials/localization/index.html" rel="nofollow">http://developer.android.com/resources/tutorials/localization/index.html</a>.
For this I have created an Android 2.1 environment.</p>
<p>There is a step mentioned in the tutorial that I don't understand:</p>
<h2>3. Open HelloL10N.java (in the src/ directory) and add the following code inside the onCreate() method (after setContentView).</h2>
<p>It's the second part of the sentence that I don't understand. By default there is a line in the code that says setContentView(R.layout,main); so I typed the required code all underneath it, but a ton of error messages crop up. </p>
<p>So my question is, where do I exactly enter the code?</p>
<p>Thanks for your help, apologies for the noob question! :)</p>
|
java android
|
[1, 4]
|
5,633,519
| 5,633,520
|
Question about inline aspx tags
|
<p>I have this div that's got a style attribute..In that I am setting it's background image by calling a function from code behind..</p>
<pre><code><div id="id1" style = "background-image: url(<%=GetImage()%>);"></div>
</code></pre>
<p>now when I add runat="server" attribute in this div..it shows the Image path as method name itself and not <a href="http://localhost/myweb/images/image.jpg" rel="nofollow">http://localhost/myweb/images/image.jpg</a></p>
<p>when I remove runat..image path displays alright..Isn't the runat supposed to be there because it's got inline aspx tag ??? I am confused.</p>
|
c# asp.net
|
[0, 9]
|
5,453,319
| 5,453,320
|
last selected option after refresh the page
|
<p>This is the my link</p>
<p><a href="http://www.developer.nextgenexperts.in/astika/products_.php" rel="nofollow">http://www.developer.nextgenexperts.in/astika/products_.php</a></p>
<p>When page will open then default currency is showing INR in top dropdown, and if i will select dropdown then i will also get GBP, and when we select GBP, then the price will convert in GBP, But after selecting GBP when i will refresh the page then page is INR, but I want to it last selected option, so how it will possible, pls help me...</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,059,316
| 2,059,317
|
ASP.NET: How to apply CSS class for a Table generated in C# codebehind
|
<p>I have an ASP.NET page and I am generating an HTML table in my server side code (codebehind file )as follows.</p>
<pre><code> HtmlTable iTblCart = new HtmlTable();
HtmlTableRow iRowHeader = new HtmlTableRow();
HtmlTableCell iCellHead1 = new HtmlTableCell();
iCellHead1.InnerText= "Item";
iRowHeader.Cells.Add(iCellHead1);
iTblCart.Rows.Add(iCartRow);
pnlPhoneCart.Controls.Add(iTblCart); //appending to a panel
</code></pre>
<p>I want to apply a CSS class to this table.I could not find such a property from the intellisense.Am i missing anything ? Can anyone guide me how to go ahead ?</p>
|
c# asp.net
|
[0, 9]
|
459,795
| 459,796
|
Creating TextViews in Android with an array
|
<p>Alright, I'm trying to create textviews dynamically with strings i have in an array. Everything works right now besides when i create the textviews instead of them going down they each stay on the same line and run off the screen. I want each textview i create under the next. Code Below works just need it to create under the next instead all on one line.</p>
<pre><code>public void GenList(){
DataBase entry = new DataBase(this);
entry.open();
String data = entry.getData();
int datanumber = entry.FindShit();
if(datanumber == 0 || datanumber == 1){
setContentView(R.layout.nowordlist);
}else{
int length = entry.results.length;
View linearLayout = findViewById(R.id.sayLinear);
for(int i=0;i<length;i++)
{
TextView value = new TextView(this);
value.setText(entry.results[i]);
value.setId(i);
value.setTextSize(50);
value.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
((LinearLayout) linearLayout).addView(value);
}
}
}
</code></pre>
|
java android
|
[1, 4]
|
2,231,260
| 2,231,261
|
exposing jQuery plugin properties
|
<p>Given the following JQuery plugin. Is it possible to expose the variable 'elements' to javascript external to the plugin? And if so, how is this done? For javascript external to this plugin, what would the syntax be to access 'elements'?</p>
<pre><code>(function($) {
$.fn.myPlugin = function() {
// I WANT TO EXPOSE THIS AS A 'PUBLIC' PROPERTY OF THIS PLUGIN
var elements = {};
return this;
};
})(jQuery);
$('.selector').myPlugin();
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,747,686
| 1,747,687
|
function is setting all instead of each
|
<p>I have a simple function that sets the width of a bar based on an argument.</p>
<p>And I call the function on .each with jQuery.</p>
<p>The console logs the statement correctly, showing me it seems to work. However, the style seems to be overridden by the last value found.</p>
<p>Here is the function:</p>
<pre><code>function barGraph(innerWidth, barWidth) {
innerWidth = parseInt(innerWidth) * .01 || .50;
barWidth = parseInt(barWidth) || 267;
// find percentage of total width
var innerWidth = Math.floor(innerWidth * barWidth);
var $innerBar = $('.slider-box div');
$innerBar.css('width', innerWidth + 'px');
console.log("Width should be: " + innerWidth + 'px');
}
</code></pre>
<p>then i call the function on each with jQuery:</p>
<pre><code>$(document).ready(function() {
var $innerBar = $('.slider-box div');
$innerBar.each(function(index) {
var newWidth = $(this).attr("data-bar-width");
barGraph(newWidth, 267);
});
});
</code></pre>
<p>the console log shows 10 times, with all appropriate widths. However, the style for all is the same as the last width.</p>
<p>Can someone help explain how I get the function to set the width of the currently selected div?</p>
<p>Thanks so much in advance,</p>
<p>Adam.</p>
|
javascript jquery
|
[3, 5]
|
1,843,078
| 1,843,079
|
Toggle text on button tag
|
<p>I have a show hide table rows feature but would now like to change my text. </p>
<pre><code><script language="javascript" type="text/javascript">
function HideStuff(thisname) {
tr = document.getElementsByTagName('tr');
for (i = 0; i < tr.length; i++) {
if (tr[i].getAttribute('classname') == 'display:none;') {
if (tr[i].style.display == 'none' || tr[i].style.display=='block' ) {
tr[i].style.display = '';
}
else {
tr[i].style.display = 'block';
}
}
}
}
</code></pre>
<p>The html is as follows...</p>
<pre><code><button id="ShowHide" onclick="HideStuff('hide');>Show/Hide</button>
</code></pre>
<p>I want to toggle the "Show/Hide" text. Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
3,394,263
| 3,394,264
|
PHP Variables inside JQuery/Javascript
|
<p>I have some javascript/jquery code and need to some php into it be the syntax seems to be wrong...</p>
<p>This is what I'm doing:</p>
<pre><code>$.post("myphp.php?something=$phpvariablehere",{ etc....
</code></pre>
<p>The result right now is that it's taking <strong><em>$phpvariablehere</em></strong> as a string and not the value of it.</p>
<p>Anyone know the right syntax?</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,766,713
| 1,766,714
|
Waiting for $.post answer
|
<p>I'm checking if the entered login is already registered in my database using ajax function below...</p>
<pre><code>function freelog(login) {
var data = {login:login};
$.post ('freelog.php', data, function(response){
if(response == '1') {
freelogin = true;
} else if(response == '0') {
freelogin = false;
} else {
freelogin = response;
}
});
return freelogin;
}
</code></pre>
<p>Of course I have a problem with the line:</p>
<pre><code>return freelogin;
</code></pre>
<p>The reason is that $.post need some time to answer... I have no idea how to solve this prroblem... Hope, You'll help me :)</p>
|
php javascript jquery
|
[2, 3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.