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,163,163
| 5,163,164
|
Combining two separate forms into one
|
<p>I've been messing around with a two forms and would like to combine them. Each form has a separate JS. </p>
<p>I'd like to be able to take the values in Form #1 and have them placed in the Form#2 answers.</p>
<p>Could somebody please assist?</p>
<p><strong>Form #1</strong></p>
<pre><code>$(window).load(function(){
jQuery(function($) {
var multiTags = $("#multi");
function handler(e) {
var jqEl = $(e.currentTarget);
var tag = jqEl.parent();
switch (jqEl.attr("data-action")) {
case "add":
tag.after(tag.clone().find("input").val("").end());
break;
case "delete":
tag.remove();
break;
}
return false;
}
function save(e) {
var tags = multiTags.find("input.tag").map(function() {
return $(this).val();
}).get().join(',');
alert(tags);
return false;
}
multiTags.submit(save).find("a").live("click", handler);
});
});
</script>
</code></pre>
<p><strong>Form #2</strong></p>
<pre><code>$(document).ready(function(){
$('.submit').click(function(){
var answers = [];
$.each($('.field'), function() {
answers.push($(this).val());
});
if(answers.length == 0) {
answers = "none";
}
alert(answers);
return false;
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,247,179
| 3,247,180
|
how to select a radio button by clicking on an option and not the actual button itself
|
<p>say i have the following three options and each with a radio button beside</p>
<ul>
<li>London</li>
<li>Newyork</li>
<li>Dubai</li>
</ul>
<p>I need jQuery that when the user clicks on the word the radio button selects! </p>
|
javascript jquery
|
[3, 5]
|
237,216
| 237,217
|
Html editor - Remove tags
|
<p>I am having a html editor in my page . I want to store the text in word document with the styles like bold,italic etc.. Im using this code to write in word document..</p>
<pre><code>object strTextToWrite = txtdocument.Text.Trim();
oWordApplic = new Word.ApplicationClass();
object missing = System.Reflection.Missing.Value;
oDoc = oWordApplic.Documents.Add(ref missing, ref missing, ref missing, ref missing);
oDoc.Activate();
string test = StripTagsCharArray(txtdocument.Text);
string test2 = test.Replace("&nbsp;", " ");
oWordApplic.Selection.TypeText(test2);
object path =Server.MapPath("~/Documents/"+txtfrom_name.Text + ".doc");
oDoc.SaveAs(ref path, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
oDoc.Close(ref missing, ref missing, ref missing);
oWordApplic.Application.Quit(ref missing, ref missing, ref missing);
</code></pre>
<p>The split function is</p>
<pre><code>public static string StripTagsCharArray(string source)
{
char[] array = new char[source.Length];
int arrayIndex = 0;
bool inside = false;
for (int i = 0; i < source.Length; i++)
{
char let = source[i];
if (let == '<')
{
inside = true;
continue;
}
if (let == '>')
{
inside = false;
continue;
}
if (!inside)
{
array[arrayIndex] = let;
arrayIndex++;
}
}
return new string(array, 0, arrayIndex);
}
</code></pre>
<p>Now im getting the plain text without bold,italic.. I need the bold,italic,underline functions in my word document ,,, Please help me</p>
|
c# asp.net
|
[0, 9]
|
2,309,590
| 2,309,591
|
jQuery - Error: 'style' is null or not an object
|
<p>When I put jQuery on my page I get an error <code>Error: 'style' is null or not an object</code></p>
<p>All i did was add the following to the <code><head></code></p>
<pre><code><script type="text/javascript" src="js/jquery-1.5.js"></script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,154,965
| 5,154,966
|
javascript\jquery: Event that fires when textbox changes
|
<p>I'm looking for a jquery/simple javascript (not some other library) solution that set an event to a textbox that will fire when the textbox being changed? (not after blur)<br>
I need it to fire no matter how it was changed (keyboard char key/tab/enter or mouse paste) And I need it to be fired one time only.</p>
|
javascript jquery
|
[3, 5]
|
1,654,270
| 1,654,271
|
Question using jQuery "load" method along with a GET request
|
<p>I want to load the results of a get request of an external php file into a div.</p>
<p>Here is the jQuery code that I am using:</p>
<pre><code><script>
$(document).ready(function() {
$("#output").load("php/create_rows.php?" + $.param({ "type": "unique", "unit": "day", "interval": 2 }));
});
</script>
</code></pre>
<p>Here is the code on my php page:</p>
<pre><code> $type = $_GET['type'];
$unit = $_GET['unit'];
$interval = $_GET['interval'];
echo("The type is: " . $type);
echo("The unit is: " . $unit);
echo("The interval is: " . $interval);
</code></pre>
<p>The console has no errors, so I am sure that the jQuery load is working correctly.</p>
<p>I expected the div with ID output to contain the values of type, unit, and interval that I passed in. Unfortunately, the div with ID output is empty. </p>
<p>I am new to PHP, so maybe I am using echo wrong? I don't know.</p>
<p>Edit 1:</p>
<p>The get parameters are being sent correctly. Here is the output:
The type is: unique
The unit is: day
The interval is: 2
The property is:
The property_value is:
000%00%</p>
<p>Inside of my create_rows.php file, I have a require: require("processData.php");</p>
<p>I put an "echo 'Hello World';" in the processData.php file, but it is not showing up in the console.</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,309,529
| 2,309,530
|
how to slow down the picture when it springs back
|
<p>I have written an app that can drag an image and then spring back the image. But the speed of spring back is too fast. I have tried but can't find a way to slow down it.</p>
<p>How can I control the speed of this?</p>
<pre><code>public class CustomViewActivity extends Activity {
float mx,my;
ImageView switcherView;
Bitmap bitmap;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_custom_view);
switcherView = (ImageView) this.findViewById(R.id.img);
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.kh06);
switcherView.setImageBitmap(bitmap);
switcherView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent event) {
float curX, curY;
//System.out.println(switcherView.getScrollX()+"--------view axis-----");
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mx = event.getX();
break;
case MotionEvent.ACTION_MOVE:
curX = event.getX();
switcherView.scrollBy((int) (mx - curX), 0);
mx = curX;
break;
case MotionEvent.ACTION_UP:
switcherView.scrollTo(0, 0);
break;
}
return true;
}
});
}
}
</code></pre>
<p>scaleType of image is the center,the image hasn't been zoomed.</p>
|
java android
|
[1, 4]
|
5,391,904
| 5,391,905
|
panel.defaultbutton is not working in IIS 7.5, but it IS working in VS Express 2012
|
<p>I'm working on a Quiz application that has three sections - Quizzes, Questions, and Answers. Each section is a child of the one above. For example, I have a gridview object that displays all of the quizzes that a quiz admin creates. If you select one of those quizzes in the GridView, there is another GridView object that shows all of the questions for that quiz. And if you select a Question from the "gvQuestions" GridView, all of the answers pertaining to that question are displayed in a third GridView ("gvAnswers") in the last section. </p>
<p>Within each panel (besides the GridView object) there is an area where a new Quiz, Question, or Answer can be added, respectfully. That is, the "pnlQuiz" panel has a GridView object that shows all of the user's quizzes, and also a couple of textboxes and a button so that a user can click the "btnAddNewQuiz" button to add a new Quiz to the database. Likewise for the Questions and Answers Panels. I have the default button for each panel set for the add new button in each panel (btnAddNewQuestion and btnAddNewAnswer).</p>
<p>When I run the app from VS Express 2012 for Web, everything works fine. But when I upload my files to my webserver (Windows 2008 R2) the btnAddNewQuestion button is ALWAYS the default, regardless of which panel/textbox my cursor is in when I press Enter. </p>
<p>Has anyone else run into this issue? Is there a workaround? I have to assume there's some setting on my webserver that's causing the issue since it's working as it should when I run it from VS Express.</p>
<p>I DID install .Net Framework 4.5 on the server and attempt to set the web.config file to use it, but no luck.</p>
<p>Thanks for any help you can provide.</p>
|
c# asp.net
|
[0, 9]
|
2,591,479
| 2,591,480
|
C# run code every 30 days
|
<p>If I were to run some code, perhaps send an email, every 30 days to users of my site, how would that be done?</p>
|
c# asp.net
|
[0, 9]
|
5,817,630
| 5,817,631
|
Getting all HTML elements in the DOM where an attribute name starts with some-string
|
<p>I've stumbled upon a tricky one, that I haven't been able to find any references to (except one here on Stackoverflow, that was written quite inefficiently in Plain Old Javascript - where I would like it written in jQuery).</p>
<p><strong>Problem</strong></p>
<p>I need to retrieve all child-elements where the <strong>attribute-name</strong> (note: <strong>not</strong> the <em>attribute-value</em>) starts with a given string.</p>
<p>So if I have:</p>
<pre><code><a data-prefix-age="22">22</a>
<a data-prefix-weight="82">82</a>
<a href="#">meh</a>
</code></pre>
<p>My query would return a collection of two elements, which would be the first two with the <strong>data-prefix-</strong>-prefix</p>
<p>Any ideas on how to write up this query?</p>
<p>I was going for something like:</p>
<pre><code>$(document).find("[data-prefix-*]")
</code></pre>
<p>But of course that is not valid</p>
<p>Hopefully one of you has a more keen eye on how to resolve this.</p>
<p><strong>Solution</strong></p>
<p>(See accepted code example below)</p>
<p>There is <em>apparently</em> <strong>no direct way to query on partial attribute names</strong>. What you should do instead (this is just one possible solution) is </p>
<ol>
<li>select the smallest possible collection of elements you can</li>
<li>iterate over them</li>
<li>and then for each element iterate over the attributes of the element</li>
<li>When you find a hit, add it to a collection</li>
<li>then leave the loop and move on to the next element to be checked. </li>
</ol>
<p>You should end up with an array containing the elements you need.</p>
<p>Hope it helps :)</p>
|
javascript jquery
|
[3, 5]
|
4,917,443
| 4,917,444
|
Checking if user is autheticated always results in true
|
<p>I am trying to check when a user is authenticated and I am always getting that the user is authenticated. Here is my code:</p>
<pre><code> if( User.Identity.IsAuthenticated )
{
addProfiledata();
}
</code></pre>
<p>This condition always is true even if I log in and log out.</p>
<p>How can I correct this?</p>
|
c# asp.net
|
[0, 9]
|
4,789,414
| 4,789,415
|
How to optimize the scenario of getting a random picture?
|
<p>I have about 100 pages, every of which has 10-100 images attached. The path to the images are kept in a database.</p>
<p>Then, I have an area at every page where user can see random pictures from the list of pictures mentioned above. This image changes every 3 seconds.</p>
<p>To archieve such scenario I use a javascript function, which calls itself every 3 seconds.</p>
<pre><code>function GenerateNewImg() {
$.ajax({
url: "myurl.php",
type : "get",
dataType: 'json',
async:true,
success: function(data){
$("#imgtochange").attr("src", data.res);
}
});
t = setTimeout('GenerateNewImg()',3000);
}
</code></pre>
<p>And in myurl.php I randomly choose a page and then an image.</p>
<p>I think, this is not very good solution, because it consumes processor time at the server.</p>
<p>Are there better ways to get a behaviour I need?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,271,728
| 3,271,729
|
Problem importing existing Android project
|
<p>So I got a new laptop and I setup everything but now, when I try to import an existing project I get all kinds of problems. </p>
<p>The console gives me this message...</p>
<blockquote>
<p>[2011-07-01 21:18:38 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\Program Files\Android\android-sdk\AndroidManifest.xml: java.io.FileNotFoundException: C:\Program Files\Android\android-sdk\AndroidManifest.xml (The system cannot find the file specified)</p>
<p>[2011-07-01 21:18:38 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Unable to read C:\Program Files\Android\android-sdk\AndroidManifest.xml: java.io.FileNotFoundException: C:\Program Files\Android\android-sdk\AndroidManifest.xml (The system cannot find the file specified)</p>
<p>[2011-07-01 21:33:31 - Notepadv3] AndroidManifest.xml file missing!</p>
</blockquote>
<p>Within the app the various classes are telling me to remove the <code>@Override</code> annotation. Any ideas??</p>
|
java android
|
[1, 4]
|
1,206,427
| 1,206,428
|
Replacing selected text in the textarea
|
<p>what is the best way to do this in jQuery? This should be a fairly common use case.</p>
<ol>
<li>User selects text in a textarea </li>
<li>He clicks on a link </li>
<li>The text in the link replaces the selected text in the textarea</li>
</ol>
<p>Any code will be much appreciated - I am having some issues with part 3. </p>
|
javascript jquery
|
[3, 5]
|
2,994,815
| 2,994,816
|
How can I refresh a page if its load time is more than 10 seconds?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/12019126/quit-function-on-body-onload">Quit function on body onLoad</a> </p>
</blockquote>
<p>I want to refresh my page if the page load time is more than 10 seconds. The solution can be in PHP or JavaScript/jQuery. How can I do that?</p>
<pre><code><meta http-equiv="refresh" content="0">
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
1,567,584
| 1,567,585
|
Need to manipulate a global var, but can't in Ajax. Need a way around this
|
<p><a href="http://pastebin.com/x5UnA1sE" rel="nofollow">http://pastebin.com/x5UnA1sE</a></p>
<p>Here's a paste of a bit of my troubled coded.</p>
<p>I'm trying to manipulate a global variable "data" within the jQuery.get callback function in order to format the data and return this data where it is needed.</p>
<p>However, this global variable is not manipulated at all in the callback function most likely due to Ajax being asynchronous. </p>
<p>How can I get the information I need from the database and eventually return it into a variable as I'm trying to do in this code? </p>
<p>Any direction would be much appreciated!</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
4,484,808
| 4,484,809
|
Conversion from jQuery into JavaScript
|
<p>I've a script:</p>
<pre><code><form id="myform">
<input type="text" value="" id="input1">
<input type="text" value="" id="input2">
<input type="submit" value="submit">
</form>
<img id="image" src="http://mydomain.com/empty.gif" />
<script>
$(document).ready(function () {
$("#myform").submit(function (ev) {
ev.preventDefault();
var val1 = $("#input1").val();
var val1 = $("#input2").val();
$("#image").attr("src", "http://mydomain.com/image?val1="+val1+"&val2="+val2);
});
});
</script>
</code></pre>
<p>How would it look like if written in JavaScript?</p>
|
javascript jquery
|
[3, 5]
|
2,883,510
| 2,883,511
|
How to call Asp.Net Button click event when Browser Close or(ALT+F4)
|
<p>I need to call Asp.net button click event When browser is manually closed or(ALt+F4).
I have tried the below,</p>
<p>First of all, create a new ASP.NET page in your favorite IDE and add an instance of the ScriptManager to it. Make sure you configure the ScriptManager to enable Page Methods.
Listing 1</p>
<pre><code><asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true" />
</code></pre>
<p>Next, we will subscribe to the unload event of the body tag of the ASP.NET page and assign a callback method to be called when this event fires.
Listing 2</p>
<pre><code><body onunload="HandleClose()">
</code></pre>
<p>The HandleClose function is placed within the Head section of the page.
Listing 3</p>
<pre><code><script language="javascript" type="text/javascript">
function HandleClose() {
alert("calling button click event");
PageMethods.call();} </script>
</code></pre>
<p>in aspx.cs Page:</p>
<p><code>[WebMethod]</code> </p>
<pre><code>public static void call()
{
--Btn_click(object sender,e);
Tried to call button event; }
</code></pre>
<p>But obviously I cant achive it in static method....Is it any other way to achive my scenario....</p>
|
c# asp.net
|
[0, 9]
|
3,109,389
| 3,109,390
|
Error in accessing global variable in jquery
|
<p>I've got the following js. The issue is that, I am unable to access the variable jasonServiceUrlObject in the getMajorGroups function. I've declared the variable globally but firebug throws a not defined error when the alert runs! </p>
<pre><code>var jsonServiceUrlObject = null;
function loadServiceXml(){
$.get("/xml/ServiceUrls.xml", function(xml){
jsonServiceUrlObject = $.xml2json(xml);
});
}
function getMajorGroups(){
var element = $(".item-group-button").first();
var serviceUrl = getServiceURL("getAllMajorGroups")
alert(jsonServiceUrlObject.service[1].service_key);
$.get(serviceUrl , function(data){
if(data.majorGroups.length != 0){
$('.panel_list').empty();
element.empty();
}
for(var i = 0; i < data.majorGroups.length; i++){
var clone = element.clone();
clone.append("<h3>" + data.majorGroups[i].description + "</h3>");
clone.attr("id", data.majorGroups[i].majorGroupId);
$('.panel_list').append(clone);
}
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
777,547
| 777,548
|
What type of data storage should I use in Android?
|
<p>I want to download 90+ items from an RSS Feed and I want to display it using a Listview and a custom arrayadapter. What form of data storage should I use to store these deals? I could just pass an array of objects filled with strings and ints(the strings are long btw) but I don't know whether this is a proper design pattern in Android. </p>
|
java android
|
[1, 4]
|
67,449
| 67,450
|
Anonymous function on page load
|
<p>I'm trying to get better with JavaScript and learn how to utilize my code in functions and keep everything clean. I'm trying to run a function on page-load...</p>
<pre><code>var setColors = function(){
this.init = function(){
$.getJSON('js/colors.json', function(colors) {
$.each(colors, function(i, colors) {
$('<li>', {
text: colors['color'],
'name' : colors['color'],
'data-hex' : colors['hex'],
'data-var' : colors['var']
}).appendTo('#picker');
})
});
}
}
</code></pre>
<p><em>(This is not a color-picker, just a list of colors)</em>
I want <code>setColors()</code> to be executed as soon as the page starts. I read that an anonymous function runs automatically, but this one isn't, I also tried...</p>
<pre><code>$(function(){
setColors();
});
</code></pre>
<p>Below the <code>setColors()</code> function and that isn't working ether (The page is just blank). What am I doing wrong and how do I get my function to run on page load? I'm trying to learn so an explanation would be great.</p>
|
javascript jquery
|
[3, 5]
|
3,962,619
| 3,962,620
|
Execute a function with sliding delay
|
<p>Say I have an html page which diplays a list of some elements. There is a textbox which allows the user to filter the elements. To update the displayed elements, I need to do an ajax call to retrieve the elements that match the filter value. I want the ajax call to be executed two seconds after the last letter was typed in the filter textbox. I know about <code>settimeout</code> but I want the two second delay to be "sliding", meaning that if within the two second delay period the user types another letter, then I want to reset the delay. How would I go about that? </p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
4,241,123
| 4,241,124
|
Passing a URL string to a Javascript fuction
|
<p>I need to pass a URL to a Javascript function something like the following. </p>
<pre><code><script type="text/javascript" language="javascript">
var xmlhttp='';
function ajax()
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp = new ActivexObject("Microsoft.XMLHTTP");
}
}
function someFunction(orders_per_page, url)
{
ajax();
var val=document.getElementById("txt_order_amount").value;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("list").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",url, true);
xmlhttp.send();
}
</script>
<select
id="cmb_page" name="cmb_page"
onchange="someFunction(this.value, "reports/OrderAmount.php?val="+val+"&orders_per_page="+orders_per_page+"&pageNo="+getSelectedPage();">
<option value="1">Some Value</option>
</select>
</code></pre>
<p>I need to pass a URL string as mentioned on the <code>onchange</code> even of the <code><select><option></option></select></code> element. Is it possible?</p>
|
php javascript
|
[2, 3]
|
3,745,580
| 3,745,581
|
jquery class selection
|
<p>I am having a hard time trying to figure out how to properly select a class inside the menu. </p>
<p>It worked fine until I put the menu in a ul. Can anyone tell me what is going on and how to fix it?</p>
<p><a href="http://jsfiddle.net/nategines/7XrUk/" rel="nofollow">http://jsfiddle.net/nategines/7XrUk/</a> </p>
|
javascript jquery
|
[3, 5]
|
3,817,267
| 3,817,268
|
how can concatenate the set variable in a for loop to be use as name in an input to get the value?
|
<p>how can concatenate the set variable in a for loop to be use as name in an input to get the value?</p>
<pre><code><script>
var k=0;
var counter = 50;
for(k=0; k<=counter; k++){
var choices = $('input[name=choices'+ k]).val();
var choices = choices.replace(/\ /g, '%');
var choices_ = choices_ +";"+ choices;
}
alert(choices);
</script>
</code></pre>
<p>there are multiple input field namely choices1,choices2 and so on.
how can i get the value of those fields using for loop?
how can i concatenate the name choices and the variable k?
can you help me solve this problem??</p>
|
javascript jquery
|
[3, 5]
|
5,661,953
| 5,661,954
|
Sorting list by value
|
<p>I have a <code>List<String></code> and a <code>List<Integer></code></p>
<p>Both are in specific order(they are linked). <code>List<String></code> contains names and <code>List<Integer></code> their values</p>
<p>Is there a way to sort <code>List<Integer></code> by size but also change ordering of <code>List<String></code> so that values and names stays linked.</p>
|
java android
|
[1, 4]
|
3,573,354
| 3,573,355
|
Disabling Android Button depending on Permissions
|
<p>I have an android app that uses the permission "<strong>CALL_PHONE</strong>". This simple app would just contain a button that would use the call intent to call a specific number. I would like to install this app on both tablets and phone but when it is installed on the tablet, I would like the button to be disabled during runtime so errors wouldn't show when the user tries to call using the tablet without a call function. </p>
<p>At the moment, I am using the <code>setEnabled()</code> and <code>setClickable()</code> method in my <code>MainActivity.java</code> and setting it to false when the user clicks on the button the first time. My question is whether the button can be disabled and the text changed during runtime or when the app is first opened (in a tablet) so the user wouldn't have to click the button first for it to show that the "<strong>call</strong>" button should be disabled and unclickable?</p>
|
java android
|
[1, 4]
|
5,858,552
| 5,858,553
|
coin slider jquery --> how do I pass 100% width argument to this? Only seems to allow pixel configuration of images?
|
<p>I am using the jQuery coinslider, and would like to pass a 100% width argument (rather than the current pixel size arguments). Is there a way to do this?</p>
<p>Thanks!</p>
<pre><code><script type="text/javascript">// <![CDATA[
(function($) {
$(document).ready(function() {
$('#coin-slider').coinslider({ effect: 'rain',width:680,height:275, delay: 5000,navigation: true, pause:200 });
});
})(j142);
// ]]></script>
<div id="coin-slider"><a href="#" target="_blank"> <img src="img1.jpg" alt="" />
</a> <a href="#"> <img src="#" alt="" />
</code></pre>
<p>Rather than pass width 680, I want to pass width 100% (or anything so that it sizes for width of the browser. Does anyone know how to do this?</p>
<p>thanks much in advance!!</p>
|
javascript jquery
|
[3, 5]
|
5,111,288
| 5,111,289
|
Copy-Paste from MS Excel fails with IE but works with Firefox
|
<p>I built a very simple app using a PHP form with a bit of Javascript.</p>
<p>In my form, I have a text input which I used to run a database search. In case I have multiple values, I have a bit of code that puts a comma in between each.</p>
<p>The weird part is this:</p>
<p>In Firefox, I can go do MS Excel, copy 5 values and paste them in the text input control. I can see all 5 values pasted and commas in between.</p>
<p>In Internet Explorer version 8, I can go do MS Excel, copy 5 values but only ONE value (the first number) gets pasted in the text input control.</p>
<p>This is my html </p>
<pre><code><fieldset>
<label for="DBRIDs">RIDs</label><input type="text" id="DBRIDs" name="DBRIDs" onchange = "removespaces(this)">
</fieldset>
</code></pre>
<p>This is my Javascript in my page header</p>
<pre><code><script language="javascript" type="text/javascript">
function removespaces(which) {
str = which.value;
str = str.replace (/\s|\n/g,","); // replace space or newline by commas
document.myform.DBRIDs.value = str;
}
</code></pre>
<p>Pretty basic stuff. What am I missing? How come IE cannot paste like Firefox??</p>
<p><strong>EDIT</strong></p>
<p>I had a typo so using textarea is working now. I can copy a column and paste it from IE</p>
<p>Of course (sarcasm), it is introducing a new problem: It duplicates my commas and I am unclear it's because of textarea or my Javascript.</p>
|
php javascript
|
[2, 3]
|
4,687,687
| 4,687,688
|
How to autoscroll to the end of iframe using JavaScript (or jQuery)?
|
<p>I have the following code:</p>
<pre><code><iframe id="preview" onLoad="scrollToBottom()"></iframe>
</code></pre>
<p>My objective - When the frame reloads, the "scrollToBottom()" function is triggered, which will take the user to the end of the iFrame (instead of the beginning of the frame, which is by default). The code I have now is:</p>
<pre><code>function scrollToBottom() {
window.scrollTo(0, document.body.scrollHeight);
}
</code></pre>
<p>I know, somehow I have to figure/pass the scrollHeight of the iframe, but I am not sure how to do that. A solution in JavaScript or jQuery is what I want. There are a few solutions I saw here, but none of them are working for me. BTW...I don't need any animation or effects...just need a simple/plain solution.</p>
<p>Any help will be appreciated. Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,665,709
| 5,665,710
|
How can I include javascript in content loaded with jquery using $.ajax
|
<p>I want to load some HTML which include a bit of javascript, using jQuery. I've tried using both load() and ajax(). The HTML is inserted nicely into the DOM, but any script-tags seems to be filtered out. If I alert() the returned HTML, the scripts are included, but when i use html() or append(), the scripts are missing.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
3,910,520
| 3,910,521
|
find and remove character within label text string with jquery
|
<p>I have this code</p>
<pre><code><div class="new">
<label> text text text (=price) </label>
</div>
</code></pre>
<p>I want to remove the "(=" and ")" around the price,</p>
<p>I've tried the following but to no avail:</p>
<pre><code> jQuery(document).ready(function() {
jQuery(".new label").each(function() {
jQuery(this).text(jQuery(this).text().replace(/[(=]/, ""));
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,036,420
| 2,036,421
|
How to attach class onClick event using JavaScript?
|
<p>I have a full AJAX page with elements that act like buttons (with events like <code>onclick="$('#workcont').load('pages/mypage.html #m3-to-12');"</code>). The elements being referenced are <code><li></code> and <code><tr></code> (in a table). </p>
<p>How do I attach event handlers to add the class <code>selected</code> on click?</p>
|
javascript jquery
|
[3, 5]
|
167,440
| 167,441
|
jQuery 'document', 'body' and 'html' selectors not working on iPhone
|
<p>I need to run a function when you click anywhere on the page. Initially I used this: </p>
<pre><code>$('html').click(function() {
// stuff to happen
});
</code></pre>
<p>This works perfectly in my android phone and in firefox, but doesnt work on iPhones. Ive tried changing 'html' to 'body' and 'document' but still no luck. </p>
<p>Is there a proper iPhone way to use anything as a selector? I guess I could use '*' but I dont want the overhead as this is a mobile optimised site. Thanks </p>
|
jquery iphone
|
[5, 8]
|
4,824,367
| 4,824,368
|
Enhancing the SimpleCursorAdapter to check the data in Android?
|
<p>I have a sqlite database. I am able to query it and get a cursor with results. It populates the data well in a list view which has 1 image view and 2 text views. However the cursor result set which has 2 columns is of text. This is shown in the 2 text views. Everything till here works fine.</p>
<p>Now based on the value of one of the column I need to show different images in the image view in the list item. How do I do this. As of now I am using the below code. How do I modify it to get a image view changes based on the column value?</p>
<p>Cursor mCursor = mDbHelper.fetchAll();
startManagingCursor(mCursor);</p>
<pre><code> String[] from = new String[]{"TITLE","BODY"};
int[] to = new int[]{R.id.text1,R.id.text2};
SimpleCursorAdapter listValues =
new SimpleCursorAdapter(this, R.layout.row_item, mCursor, from, to);
setListAdapter(listValues );
</code></pre>
|
java android
|
[1, 4]
|
910,398
| 910,399
|
javascript, looping fields and validating
|
<p>I'm using below code to check some form fields and render datatable table on a button click. My intention is to stop the table from being rendered if any of the fields are empty. Apparently <code>return false</code> inside the loop is not working.</p>
<p>Is this the correct way to accomplish? any better ways? </p>
<pre><code>$('#advance_search').click(function(){
var ds = $('.advance_search .filter_field');
$.each(ds, function(index, value){ //this loop checks for series of fields
if ($(this).val().length === 0) {
alert('Please fill in '+$(this).data('label'));
return false;
}
});
dt.fnDraw(); //shouldn't be called if either one of the field is empty
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,754,571
| 1,754,572
|
Python as a web scripting language?
|
<p>I've recently been developing with Python, and I absolutely love it. It's a <em>huge</em> step up from PHP as a quick scripting language (imagine, no crazy function names!), and I would love to be able to use it as a web development language.</p>
<p>I've heard about Django, but I want something a bit more simple.</p>
<p>I run Lighttpd, and I've already gotten a Python script to work, but I can't pass arguments to it via the URL, like <code>http://localhost/index.py?foo=bar</code>. Is there a function/library that allows this?</p>
<p>I could be going at this all wrong, so please tell me if I am. But I absolutely <em>hate</em> PHP, now that I've seen Python. ;)</p>
|
php python
|
[2, 7]
|
1,708,963
| 1,708,964
|
Login into a website using python
|
<p>I would like to use python to log into a website. I know this question has been answered lots of times (on this forum and others) but I'm unable to use any of the techniques to my situation.</p>
<p>Here is the form I have: <a href="http://www.esprit.presse.fr/" rel="nofollow">http://www.esprit.presse.fr/</a>, name="FRMLogin"</p>
<p>If you have any idea that could work, I would much appreciate!
Thanks a lot by advance.</p>
|
php python
|
[2, 7]
|
4,066,117
| 4,066,118
|
jQuery AJAX and ASP.NET
|
<p>I have this little problem...
I have this asp.net website.
I have a menu, all done with html and css.
So when I click on home, the ajax loads the other content into the specified div element.
Working 100%.</p>
<p>In the content that was loaded into the div element, I have a button. An ASP.NET button.</p>
<p>When I click on the button, it gives me a "The resource cannot be found." error.</p>
<p>There must be something I am missing. If you dont understand, heres the ajax:</p>
<pre><code>//Load the Home page on click.
$(document).ready(function () {
$('.home').click(function () {
$("#content").load("html/home/home.aspx");
});
});
</code></pre>
<p>Now the aspx page that was loaded into the content div, displays a button, btnAdd:</p>
<pre><code><asp:Panel ID="pnlAddNewBlog" runat="server">
<asp:TextBox ID="txtAddNewBlog" runat="server" TextMode="MultiLine"></asp:TextBox>
<br />
<asp:Button ID="btnAdd" runat="server" Text="Add" />
</asp:Panel>
</code></pre>
<p>When I click on that button, the error appears.</p>
<p>What I want to achieve is to: when the user clicks on the button, the text in txtAddNewBlog gets added into a database. Now this I can achieve using C#... but not if this error is in my way. Any ideas?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,033,942
| 5,033,943
|
Explain this fragment of Javascript to me
|
<p>I am newbie to jQuery,
can someone explain what this code does:</p>
<pre><code>$("#currency form").submit(function(e) {
triggers.eq(1).overlay().close();
return e.preventDefault();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,688,445
| 3,688,446
|
jquery tabs, onload event on first tab
|
<p>I'm using JQuery tabs plugin and ajax json mvc to retrieve data inside these tabs.
Everything works ok with onclick events but I need to load content inside first tab as soon as page load.
Here's the code</p>
<pre><code><script>
$(function () {
$("#tabs").tabs();
// how to add onload event for Tab One GetTabData(id);
$(".tabLink").click(function (event) {
var id = $(this).parent().text();
GetTabData(id);
});
});
</script>
<div class="demo">
<div id="tabs">
<ul>
<li><a href="#tab-1" tabId="1" class="tabLink">Tab One</a></li>
<li><a href="#tab-2" tabId="2" class="tabLink">Tab Two</a></li>
<li><a href="#tab-3" tabId="3" class="tabLink">Tab three</a></li>
<li><a href="#tab-4" tabId="4" class="tabLink">Tab four</a></li>
</ul>
<div id="tab-1">
</div>
<div id="tab-2">
</div>
<div id="tab-3">
</div>
<div id="tab-4">
</div>
</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
481,648
| 481,649
|
How to create a table programmatically with making it open for update using checkbox?
|
<p>I am a new ASP.NET developer. I need to develop a table that combine the data of four tables in the database. The schema of each table:
Employee Table: Username, Name, Job, DivisonCode
Division Table: DivisionCode, DivisionName
Course Table: CourseID, CourseName, GroupID
Group Table: GroupID, GroupName
Employee_Course Table: Username, CourseID
(The first key in each table is the primary key)</p>
<p>I already developed this table using GridView, but I faced many problems in making it open for updates since I inserted checkboxes in the cells under the Courses to update the record for each employee very fast and in one place. I need now to develop this table programmatically and since I have three groups or types of courses I will need to three tables like the above one. Besides that, each table has different number of rows and cells since the Group #2 consists of 7 courses and Group #3 consists of 9 courses.</p>
<p>Therefore, how to develop this kind of tables programmatically?</p>
|
c# asp.net
|
[0, 9]
|
5,495,010
| 5,495,011
|
Code not reaching SelectedIndexChanged event
|
<p>I've a user control contined in <code>MyPage.aspx</code>.
The user control contains few drop-down lists; each with <code>Autopostback = true</code> but when I run the code & change the drop-down item, other events gets fired but not <code>SelectedIndexChanged</code>.</p>
<pre class="lang-xml prettyprint-override"><code><asp:DropDownList ID="ddPages1" runat="server" EnableViewState="true" AutoPostBack="true"
onselectedindexchanged="ddPages1_SelectedIndexChanged">
</asp:DropDownList>
</code></pre>
<p>Code behind of ascx:</p>
<pre><code>protected void ddPages1_SelectedIndexChanged(object sender, EventArgs e)
{
...
}
</code></pre>
<p>ascx also has <code>ReportViewer</code> & I'm populating number of pages in the report into drop-down list.</p>
<pre><code>protected override void Render(HtmlTextWriter writer)
{
TotalPages = ReportViewer1.LocalReport.GetTotalPages();
txtPageCount1.Text = Convert.ToString(TotalPages);
if (TotalPages > 0)
{
for (int i = 1; i <= TotalPages; i++)
{
ListItem listItem = new ListItem();
listItem.Value = i.ToString();
listItem.Text = i.ToString();
ddPages1.Items.Add(listItem);
}
}
base.Render(writer);
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
548,369
| 548,370
|
Understanding $.proxy() in jquery?
|
<p>From docs i understand that .proxy() would change the scope of the function passed as an argument.Can someone please explain this better ?, why should we do this?</p>
|
javascript jquery
|
[3, 5]
|
5,802,361
| 5,802,362
|
How can jQuery behave like an object and a function?
|
<p><code>jQuery</code> or <code>$</code> seems to be a function:</p>
<pre><code>typeof $; // "function"
</code></pre>
<p>And it acts like one:</p>
<pre><code>$('div').removeClass(); // $ constructs a new object with some methods like removeClass
</code></pre>
<p>But when I drop the function parentheses it behaves like an object:</p>
<pre><code>$.each(/* parameters */); // $ is an object with some methods like each
</code></pre>
<p>I'd like to know how this is possible and how I can implement this behaviour to my own functions.</p>
|
javascript jquery
|
[3, 5]
|
1,707,555
| 1,707,556
|
Executing method from object, where method name is passed as string?
|
<p>I'd like to know if I have a function defined as:</p>
<pre><code>void executeFunc(String funcName)
</code></pre>
<p>can I somehow execute MyObject.funcName();?</p>
<p>What I'm trying to do is have one Class that handles all calls to a server and they return XML data back, so I'd like to use the one AsyncTask to handle the 15 or so different types of calls.</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
2,681,071
| 2,681,072
|
Undefined argument in custom javascript function
|
<p>I hope this is the right place for this question. I have a function which takes two arguments that are coming from a mysql database and stored in a php variable. the first argument is an int and the second argument is a string. These variables are passed to my javascript function, but when the function is called the first argument is correct but the second argument is undefined and my browser breaks into debug mode.</p>
<p>This is part of my php code that calls the javascript function:</p>
<pre><code>"<td><a href='javascript: confirmDelete(".$row['users_info_id'].", ".$row['firstname'].")' id='delete'>Delete</a></td>"
</code></pre>
<p>This is my javascript function:</p>
<pre><code>function confirmDelete(id, dealer){
alert(id + "<br />" + dealer);
//var answer = confirm("Are you sure you want to delete " + dealer + "?");
//if(answer == true){
//window.location = "process_dealers.php?delete=" + id;
//alert("Dealer has been deleted from the database!");
//}
//else{
//alert("Dealer has not been deleted from the database!");
//}
}
</code></pre>
<p>I have commented most of the code out so I can see what is being returned in the alert function.
The first argument returns the correct value but the second argument returns the name of the dealer, but as undefined. I have tried everything and spent last night and this moring trying to figure this out. I would greatly appreciate any suggestions.</p>
|
php javascript
|
[2, 3]
|
3,350,799
| 3,350,800
|
row data from tablesorter plugin using php
|
<p>HI...All</p>
<p>I used tablesorter plugin for sorting.Now if i click a row i need the data of that row to be assigned to a variable and passed to next page using php</p>
|
php jquery
|
[2, 5]
|
4,113,164
| 4,113,165
|
Java vs. C#, what are the advantages and disadvantages, for a web application
|
<p>I have heard that they are mainly similar and competing technologies, and it is mostly an issue of skill and manpower availability. Do you agree or are there technological differences in:</p>
<ul>
<li>Performance</li>
<li>Ease of development</li>
<li>Open source components availabilty</li>
<li>Tools availability</li>
<li>Community support</li>
<li>Hardware/Software compatibility</li>
<li>Other factors</li>
</ul>
|
c# java
|
[0, 1]
|
1,267,973
| 1,267,974
|
if/else statement
|
<p>I am trying to write an if/else statement that will hide my <code>.thumb</code> <code><div></code>s whenever the "about" or "contact" links are clicked. I want all of the <code>.thumb</code> <code><div></code>s to slide up. </p>
<p><a href="http://dl.dropbox.com/u/14080718/Final/UITabs15.html" rel="nofollow">http://dl.dropbox.com/u/14080718/Final/UITabs15.html</a></p>
<p>I don't have much experience writing if/else statementsI cant seem to figure out the right syntax any help you can give would be much appreciated. </p>
<pre><code> $(function(){
$('.thumb').hide();
$('.subnav').click(function(){
var $menuelement = $('.thumb').eq($(this).closest("li").index());//find the matching nth element in the menu
if($menuelement.hasClass('active')){//if clicked element is already expanded
$menuelement.removeClass('active').slideUp();//remove the active class and hide it
} else {//otherwise,clicked element is not already expanded...
if ($('.active').length>0) {//...but another element is expanded
$('.active').removeClass('active').slideUp( function(){
$menuelement.addClass('active').slideDown();//add the active class and show it
});
} else {//another element is not expanded
$menuelement.addClass('active').slideDown();//add the active class and show it
}
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,139,503
| 1,139,504
|
Upload photo from client's webcam
|
<p>How can I create a webcam snapshot button in my website so the user can take a photo and upload the taken photo to my server?</p>
<p>I am using a C# web application; please help me with some links or code.</p>
|
c# jquery
|
[0, 5]
|
4,122,730
| 4,122,731
|
How to get selector attribute in jquery qTips?
|
<p>I'm trying to get the "id" attribute of a tag that also calls jQuery qTips. The setup is as follows:</p>
<pre><code>$('.selector').qtip({
content: {
text: 'Loading...', // The text to use whilst the AJAX request is loading
ajax: {
url: 'getInfo.php', // URL to the local file
type: 'GET', // POST or GET
async: false,
data: { id: $(this).attr('id')}, // !! PROBLEM HERE
success: function(data, status) {
// Set the content manually (required!)
this.set('content.text', data);
}
}
}
});
</code></pre>
<p>The caller is as such:</p>
<pre><code><a href='http://www.google.com' class='selector' id='Jerome'>Jerome</a>
</code></pre>
<p>but for some reason $(this).attr("id") is undefined. The qTip shows up but is blank, and the GET call shows up as not passing any data in Firebug. What am I missing?</p>
<p>Thanks!</p>
<p>Edit: also, <code>this.attr</code> returns "this.attr is not a function"</p>
|
javascript jquery
|
[3, 5]
|
6,010,841
| 6,010,842
|
how to search a div inside a html and see if its exist or not
|
<p>Im a newbie in PHP and jquery and I'm in the middle of building a lite ecommerce site, so now I am on an idea which a function that will search a div inside a html and check if its exist or not, if its exist then echo found else if not then echo "not exist", but i dont know how to get that, this is just an expirement and I will going to implement that on my project once I get it right to final. Please can someone give me an idea on how to do it? thanks in advance.Im open in suggestions anyway.</p>
|
php jquery
|
[2, 5]
|
2,640,602
| 2,640,603
|
How to combine 2 click events functions
|
<p>I currently have this and it works fine but I wanted to have a nicer way to do the same thing, possibly having one single function rather than 2 distinctive ones and save lines.
Just some more elegant way than so many lines. The 2 following functions look similar but what they do are slightly different as you can see.
Anyone? Thanks</p>
<pre><code>$("#container").on({
"mouseenter": function () {
$(this).stop().animate({
"opacity": "1"
}, 400);
$(this).prev(".caption").stop().fadeTo(0, 0).css('visibility', 'visible').fadeTo('fast', 1);
},
"mouseleave": function () {
$(this).stop().animate({
"opacity": "0.3"
}, 400);
$(this).prev(".caption").stop().fadeTo(0, 1).css('visibility', 'visible').fadeTo('fast', 0);
}
}, "img");
$("#container").on({
"mouseenter": function () {
$(this).stop().animate({
"opacity": "0.3"
}, 400);
},
"mouseleave": function () {
$(this).stop().animate({
"opacity": "1"
}, 400);
}
}, ".gallery a img");
</code></pre>
|
javascript jquery
|
[3, 5]
|
162,743
| 162,744
|
Access Web Page from .ashx WebHandler
|
<p>Quick question. Is it possible, and if so how do you access the webpage from the webhandlers?</p>
<p>Basically, when i button is clicked i kick off some JavaScript, which then kicks off a C# webhandler which return data from the server. What i would like to do then is rather than feed it back to the JavaScript, id like to add a GridView directly to the webpage from the webhandler.</p>
<p>Equally, within the handler it would be incredible useful to be able to read values of dropdowns etc from the webpage.</p>
<p>All help or suggestions are welcome!</p>
<p>Thanks in advance.</p>
<p>Chris</p>
|
c# asp.net
|
[0, 9]
|
501,173
| 501,174
|
does not login at the first attempt
|
<p>i have got a unique issue, i had put this script on body onload</p>
<p><code><body onload="document.getElementById('User_Email').focus();"></code></p>
<p>this script will automatically place the mouse cursor in email text field when the page is loaded...but the problem iam facing now is...sometimes once we enter the username and password for the first time and after we click on login button ,cursor will move back to username textbox by removing the password,and if we enter the username and password for the second time it works fine...</p>
<p>i dont know why its happening,bcos it does not happen all the time .have any of you guys faced the same problem.... </p>
<p>any solution for this???</p>
|
php javascript jquery
|
[2, 3, 5]
|
5,887,986
| 5,887,987
|
jquery deep replace
|
<p>Here is a overly simplistic version of what I am trying to do.</p>
<pre><code>var usersChoice;
var object1 = {name: 'fu', id:'123', infoArray: [1,2,3,4,5]};
var object2 = {name: 'bar', id:'456', infoArray: [9,8]};
jQuery.extend(true, usersChoice, object1);
</code></pre>
<p>Then if I want to change my mind</p>
<pre><code>jQuery.extend(true, usersChoice, object2);
</code></pre>
<p>The result:</p>
<pre><code>usersChoice = {name: 'bar', id:'456', infoArray: [9,8,***3,4,5***]};
</code></pre>
<p>What I want is the old object to be totally replaced with the new. Even just a deep erase function I could call just before extend like...</p>
<pre><code>userChoice.nukeItFromOrbit();
</code></pre>
<p>For the record I have tried just userChoice = new object or not copying but just pointing to the original objects. Both solutions have an annoying tendency of going out of scope at some point along the line. (some of these objects are being passed along as a 'this' I suspect is the culprit)</p>
<p>So how do I do this without reinventing the deep copy wheel? Been looking all over and all I have found is reinventing the wheel or being told their is no reason I would ever have to do what I am doing. =/</p>
|
javascript jquery
|
[3, 5]
|
384,502
| 384,503
|
If P tag is display:none; Javascript
|
<p>I have the following...</p>
<pre><code> $(document).ready(function() {
$('p:contains("You")').parent('span').prev('input').addClass('error');
});
</code></pre>
<p>My function works fine given that it adds the class to the correct inputs but it should only add the class if the paragraph containing 'you' is display:inline. </p>
<p>Has anybody any idea of how I can do this? </p>
<hr>
<p>My markup for each input is similar to this....</p>
<pre><code><li class="yourdetli">
<label class="yourdet">House Number</label>
<input type="text" id="ctl00_ContentPlaceHolder1_TB_HNumber2" name="ctl00$ContentPlaceHolder1$TB_HNumber2">
<span style="color: Red; display: none;" class="errorp" id="ctl00_ContentPlaceHolder1_RequiredFieldValidator9">
<p>You must complete this field</p>
</span>
</li>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,563,896
| 5,563,897
|
Need help understanding Javascript setinterval and function declaration
|
<p>I am very new to js and jquery and need help understanding why this script does not work. I've checked it over any number of times, but in all my research, there is something that I am missing. Any help would be appreciated. The code should just set text value in div once every 2 seconds. I cut this code down from its real functionality so ignore the fact that it does nothing. Forgive and correct me if I am not posting this properly. It's my first post.
code below: </p>
<pre><code><html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript">
</script>
<script type="text/javascript">
var test=0;
var timer = setInterval(save_it(), 2000);
var test=0;
$(document).ready(function(){
var save_it = function(){
testdiv.innerhtml = test++;
};
});
</script>
</head>
<body>
<div id="testdiv"></div>
</body>
</html>
</code></pre>
<p></p>
|
javascript jquery
|
[3, 5]
|
4,507,188
| 4,507,189
|
Load Jquery on buttonclick asp.net
|
<p>Hi i am trying to load the following jquery on buttonclick in the code behind, however nothing seems to be happening;</p>
<pre><code> StringBuilder sb = new StringBuilder();
sb.Append("$(document).ready(function () {");
sb.Append("$.gritter.add({");
sb.Append("title: 'This is a regular notice!',");
sb.Append("text: 'This will fade out after a certain amount of time. Vivamus eget tincidunt velit. Cum sociis natoque penatibus et <a href='#' style='color:#ccc'>magnis dis parturient</a> montes, nascetur ridiculus mus.',");
sb.Append("image: 'http://a0.twimg.com/profile_images/59268975/jquery_avatar_bigger.png',");
sb.Append("sticky: false,");
sb.Append("time: ''");
sb.Append("});");
sb.Append("});");
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), sb.ToString(), true);
</code></pre>
<p>Can anyone see what i am doing wrong?</p>
|
jquery asp.net
|
[5, 9]
|
2,214,624
| 2,214,625
|
How to Create Google images engine effect?
|
<p>I am trying to create google image engine effect that shows images credits when user hovers the image (enlarge the image and show credits). I am not sure how to pop the image up and ignore the flow of the contents. </p>
<p>I know lightbox would do the similar effect but all I need is a simple hover and show images credits effect. I have search google and all I got are popup plugins like lightbox. I was wondering if anyone give me a direction or tutorial for that? Thanks a lot. </p>
|
javascript jquery
|
[3, 5]
|
5,530,236
| 5,530,237
|
What causes this error? The TargetControlID of <CheckBoxControlName> is not valid. The value cannot be null or empty
|
<p>I have searched on the net for this error, but there doesn't appear to be alot on it.</p>
<pre><code>The TargetControlID of 'CheckBoxControlName' is not valid. The value cannot be null or empty.
</code></pre>
<p>Does anyone know of the main causes for this error?</p>
|
c# asp.net
|
[0, 9]
|
2,468,754
| 2,468,755
|
How to display jquery on more than 1 field?
|
<p>i can not use this keypad plugin on multiple fields. The first one works perfect but the other ones do not work. what do i need to do to make it work on all?</p>
<pre><code><script type="text/javascript">
$(function () {
$('#item_fee').keypad();
});
</script>
</head>
<body>
<tr>
<?
$query="SELECT * FROM item WHERE orderr_reference ='$ref' order by item_name";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$item_fee = mysql_result($result,$i,"item_fee");
?>
<td><input name="item_fee[]" id="item_fee" type="text" value="<?=$item_fee;?>" size="6" /></td>
</tr>
<? $i++; } ?>
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
4,539,181
| 4,539,182
|
How to know when an input has changed its class
|
<p>I have function which is removing and adding class into input tag, i want to when we add or remove class then one function should alert that you have made changes.</p>
<pre><code><head>
<script type="text/javascript">
$(function() {
$('a').click(function() {
$('input').removeClass()
var cl = $(this).attr('class')
$('input').addClass(cl)
})
})
function activitydone() {
alert('class change')
}
</script>
<style>
.first { border:solid 1px #F00 }
.second { border:solid 1px #0F0 }
.third { border:solid 1px #00F }
</style>
</head>
<body>
<input type="text" onchange="activitydone()" />
<a href="#" class="first">first</a>
<a href="#" class="second">second</a>
<a href="#" class="third">third</a>
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,835,919
| 1,835,920
|
How to implement BFS for hexagon field (in javascript)
|
<p>I work on a hexagon map based browser game. I have this: <a href="http://www.dark-project.cz/wesnoth/map-view/1" rel="nofollow">http://www.dark-project.cz/wesnoth/map-view/1</a> and now I have a problem I want to mark the fields at which the unit can go (it has limited movement).
If the movement is 1 there isn't any problem but if it's higher it doesn't work right (try it).</p>
<p>I work with a coordinates system <a href="http://www.dark-project.cz/wesnoth/coor.png" rel="nofollow">http://www.dark-project.cz/wesnoth/coor.png</a></p>
<p>My actual js is here: <a href="http://www.dark-project.cz/wesnoth/js/map/base.js" rel="nofollow">http://www.dark-project.cz/wesnoth/js/map/base.js</a></p>
<p>In other question ( <a href="http://stackoverflow.com/questions/6813526/movement-algorithm-on-a-hexagon-map">Movement algorithm on a hexagon map</a>) @unkulunkulu recommend me to use the BFS algorithm. But I have no experience with algorythms like this and its implementing into javascript and then its use on hexagon map. He say that the BFS algorithm is better for that because I can easy expand it later (add some obstacles etc.).</p>
<p>If you have some link to a javascript tutorial about this or something similar it will be amazing.</p>
|
javascript jquery
|
[3, 5]
|
4,480,566
| 4,480,567
|
How to change WebView Height?
|
<p>I load in WebView some table from res.
These tables have a different size.
How do I change the size of the height of the WebView content?</p>
<p>I tried:</p>
<pre><code>LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
myWebView.setLayoutParams(params);
</code></pre>
<p>after load content but it doesn't work...</p>
|
java android
|
[1, 4]
|
2,012,894
| 2,012,895
|
how to latebind click handler after ajax call without using callback
|
<p>we are trying to create a custom cms where when inside anchor tag you put a rel attribute and a target position and it automatically attach a click that can fetch data from specified location in rel tag. again new content(came through ajax) can have anchor tag with rel attribute.</p>
<p>how can i achieve it without using callback<br>
current code</p>
<pre><code>$(document).ready(function(e) {
$("a[rel $= txt]").each(function(index, element) {
$(this).click(function(){
var path = $(this).attr("rel");
path = "./"+path;
var target = $(this).attr("data-target")
$(target).load(path, function(){
$("a[rel $= txt]", this).each(function(){
$(this).click(function(){
var path = $(this).attr("rel");
path = "./"+path;
$("#result").load(path,function(){
$.getScript("js/common.js")
});
})
});
$.getScript("js/common.js");
})
})//click ended
});
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,201,904
| 3,201,905
|
Javascript php variable not passing with http_build_query
|
<p>Why does this not work?</p>
<pre><code> var data1 = "<? http_build_query($_GET); ?>";
var data2 = "buy.php?";
var url = data2+data1
document.getElementById('framebox').src = url;
</code></pre>
<p>Thanks.</p>
|
php javascript
|
[2, 3]
|
1,245,968
| 1,245,969
|
From PHP to Java. Any advice?
|
<p>I've been doing web application development for the last 3 years in PHP. I'm now on the verge to give Java a go. My last use of the language was nearly 8 years ago and was mostly academic. </p>
<p>I'm reasonably well acquainted with PHP's object model (version 5) and I have almost exclusively been coding in OO. I would now like to transport that experience and use it to develop in Java.</p>
<p>Where I'm coming from:</p>
<ul>
<li>linux as a desktop and server</li>
<li>Vim/gVim + plugins as an editor</li>
<li>MySql for db</li>
<li>apache httpd</li>
<li>experience with a bunch of PHP frameworks, Zend+Doctrine being the ones I use most</li>
</ul>
<p>What I've garnered so far about a move to Java:</p>
<ul>
<li>I need an IDE: IntellijIDEA, NetBeans or Eclipse</li>
<li>I need to pick a development framework. Some recurrent names: Spring MVC, stripes, wicket.</li>
</ul>
<p>Now I need some insight that could help make this transition smoother. But from the way people talk about it, Java seems to be an entirely new beast with its own ecosystem. It sounds as though moving to Ruby or Python would actually be easier, which is curious since, when I look at it, Java conceptually seems the closest to PHP, albeit stricter and precompiled. </p>
<p>As weird as this may sound, very few people have publicly documented their experience of such moves. I have searched google, amazon and stackoverflow for similar questions and the results leave to desire. I just can't believe that I would need to start the same as a newbie if I wanted to be productive as a web developer in Java fast.</p>
<p>Anybody is welcome to respond, but I somewhat think that people with some valuable experience in both languages would enrich this discussion the most.</p>
<ul>
<li>What helped you get going quickly in Java? </li>
<li>What concepts are omnipresent in Java and absent from PHP and vice versa?</li>
<li>Some gotchas for PHP developers going Java.</li>
<li>How long before you felt the transition was complete?</li>
</ul>
|
java php
|
[1, 2]
|
1,834,179
| 1,834,180
|
Why is my app crashing?
|
<p>I am making an android tic tac toe app. When I run the app on my <strong>GS2</strong>, the app crashes. I can't figure what the problem is, so here is my <strong>onCreate()</strong> method.(I havent added any more methods, my app is just starting..):</p>
<pre><code>super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Typeface font = Typeface.createFromAsset(getAssets(), "coolvetica.ttf");
final Button button1 = (Button) findViewById(R.id.button1);
final Button button2 = (Button) findViewById(R.id.Button01);
button1.setTypeface(font);
button2.setTypeface(font);
button1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
button1.setBackgroundResource(R.drawable.startbuttonpressed);
}
});
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
button2.setBackgroundResource(R.drawable.resetbuttonpressed);
// Perform action on click
}
});
</code></pre>
|
java android
|
[1, 4]
|
129,355
| 129,356
|
sending a php variable to onclick event
|
<p>can i send a php variable to my javascript function using onclick event of a link like this</p>
<pre><code><a onclick="change(<?php echo $description ?>)">
</code></pre>
<p>when I echo the description it is available but when I send it to my javascript function it says undefined </p>
<p>How can I do this ?</p>
<p>Thanks</p>
|
php javascript
|
[2, 3]
|
4,136,818
| 4,136,819
|
Events lost after popup window from colorbox
|
<p>I'm using colorbox in asp.net
but after popup show and close it .if i want like ie:logout i can't it is located to the popup location not doing the event.and this problem happen in chrome .in IE and Firefox when i click logout nothing happen.</p>
<p>Need help</p>
|
jquery asp.net
|
[5, 9]
|
5,257,724
| 5,257,725
|
How can a simple server load measurement be taken with server side only
|
<p>I am looking for/would like to write a simple load testing script in C# for my server. I would particularly like to measure cpu and memory load (i.e. how little of each are free); I am not concerned about band width.</p>
<p>I guess there methods involving loops and timers but I don't know how Windows Server works - even though it is heavily loaded, the speed at which scripts are run may be unchanged.</p>
<p>I would prefer to keep the bench-marking server side if possible.</p>
<p>I would be very interested to hear from people who have done something similar or who have ideas.</p>
<p>Thanks in advance!</p>
<p>Note: The precision of the reading of cpu and memory load could be as little as red, yellow or green (a traffic light) if that is all that can be done on the server alone.</p>
|
c# asp.net
|
[0, 9]
|
4,776,863
| 4,776,864
|
Weird Behaviour in jQuery's html method
|
<p>Any good reason why $("p").html(0) makes all paragraphs empty as opposed to contain the character '0'?</p>
<p>Instead of assuming I found a bug in jQuery, it's probably a misunderstanding on my part.</p>
|
javascript jquery
|
[3, 5]
|
4,857,029
| 4,857,030
|
Android hierarchyviewer load times
|
<p>I've seen a lot of different tutorials of how to use the android hierarchy viewer. In all of them the tutorial will have a picture of 3 circles colored green red or yellow, and 3 times, Measure, Layout, Draw.</p>
<p>I have 2 different applications and loading the hierarchy view with either I get n/a for all 3 of the times, and no dots. </p>
<p>Has anyone experienced this? The device I'm running against is 2.2, is that to old for the times to load?</p>
|
java android
|
[1, 4]
|
4,895,058
| 4,895,059
|
Form fields in hidden DIV
|
<p>I have a form with some fields that are in a hidden DIV (style="display: none;"). The user can click a button that displays these additional fields if they wish.</p>
<p>Now if the user submits the form in its "compact" state, the form variables in the hidden div are also submitted and displayed in the address bar.</p>
<p>How can I change this behaviour so that only the visible form fields are submitted?</p>
|
php javascript
|
[2, 3]
|
1,503,296
| 1,503,297
|
How can I uncheck a checked checkbox programmatically
|
<p>Say I have the following sample:</p>
<pre><code><input name="Opt1" id="Opt1" type="checkbox" value="1" alt="1948" title="RQlevel1" src="2" checked="checked" onclick="levels();"/> <label style="cursor:pointer" for="OptID12851948">PADI Advanced Open Water</label>
<input name="Opt2" id="Opt2" type="checkbox" value="2" alt="1953" title="RQlevel2" src="" onclick="levels();"/> <label style="cursor:pointer" for="OptID19521953">PADI Rescue</label>
<input name="Opt3" id="Opt3" type="checkbox" value="3" alt="1957" title="RQlevel2" src="" onclick="levels();"/> <label style="cursor:pointer" for="OptID19521953">PADI Rescue2</label>
</code></pre>
<p>If I click PADI Advanced Open Water checkbox, which will then call the levels() javascript function, how can I programmatically uncheck this checked checkbox using jQuery?</p>
<p>I have tried the following but doesn't work:</p>
<pre><code>if ($("input[value='1']:checked").attr("checked")){
$("input[value='1']:checked").attr(“checked”, false);
}
</code></pre>
<p>Any help would be appreciated.</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
5,469,620
| 5,469,621
|
How to get to a child of a parent when multiple exist?
|
<p>There is problem with the following code. I am trying to Increase the dollar amount for all the numbers independently (by 0.01 per click). But it only seems to work on the first "content" class, not on the other 2. Each of these are identical besides the amount.</p>
<p>Layout:</p>
<pre><code><div class="content">
<div class="item"><span class="number">$10.11</span><a href="#" class="incNumber"> Increase</a></div>
</div>
<div class="content">
<div class="item"><span class="number">$5.04</span><a href="#" class="incNumber"> Increase</a></div>
</div>
<div class="content">
<div class="item"><span class="number">$3.45</span><a href="#" class="incNumber"> Increase</a></div>
</div>
</code></pre>
<p>Script:</p>
<pre><code>$(function () {
$(".incNumber").click(function() {
brother = $(this).closest('div').children('.number');
amount = $(brother).html().replace(/[^\d\.]/g, "");
amount = parseFloat(amount);
$(brother).html('$'+String(amount.toFixed(2)));
return false;
});
});
</code></pre>
<p>This script seems to function fine. converting it to a float and then back seems to increase it by 0.01 however this is not intentional...</p>
|
javascript jquery
|
[3, 5]
|
2,397,826
| 2,397,827
|
Using a string to reference a custom class member of an array list
|
<p>so I have a list 'Screens' which contains custom class objects of type 'screen' these are read from an XML file at run time. Also in the XML is a section called 'path' which contains strings, these are stored as further members of the 'screen' objects. What I'm trying to do is read the string value of path.left on the current screen and use to set the new value of currentScreen.
ie.
i know.. currentScreen.path.left = "park"
so i want.. currentScreen = currentChapter.Screens.park;</p>
<p>but it doesnt like it.. I tried the following but it wont find it in the list because the list is of 'screen's and not strings. Thanks.</p>
<pre><code>String tmppath = currentScreen.path.left;
int index = currentChapter.Screens.indexOf(tmppath);
currentScreen = currentChapter.Screens.get(index);
</code></pre>
<p>the screen and path objects look like this:</p>
<pre><code>public class Screen {
public String id;
public Integer backdrop;
public Paths path;
public List<Integer> areaMode = new ArrayList<Integer>();
public List<String> areaName = new ArrayList<String>();
public List<Region> areaArray = new ArrayList<Region>();
public Screen(String mid, Integer backDrop, Paths mpath, List<Integer> mareaMode ,List<String> mareaName, List<Region> mareaArray) {
id = mid;
backdrop = backDrop;
path = mpath;
areaMode = mareaMode;
areaName = mareaName;
areaArray = mareaArray;
}
}
public class Paths {
public String left;
public String right;
public String top;
public String bottom;
public Paths(String mleft, String mright, String mtop, String mbottom) {
left = mleft;
right = mright;
top = mtop;
bottom = mbottom;
}
}
</code></pre>
<p>Another problem i think I'm having is that I'm trying to find the 'Screen' instance using the 'id' string I've created inside of it.</p>
|
java android
|
[1, 4]
|
1,088,449
| 1,088,450
|
Calculating Total Overtime Working Hours using Condition
|
<p>Need your help with my case.</p>
<p>How to make calculating total overtime working hours using condition ?
Example :</p>
<p>using input type,</p>
<pre><code>OT From <input type="text" name="ot_from">
OT To <input type="text" name="ot_to">
Total Hours <input type="text" name="total_hours">
</code></pre>
<p>Working days : from 08.00 - 17.00 (normal working days)
If I working until 19.00, should be calculate that I do overtime for 2 hours.</p>
<p>In my rules, from 18.00 - 18.30 not calculate overtime because that's a break time.
So should be my total Overtime hours is 1.5 not 2 hours.</p>
<p>Someone can give me a solution ?
Appreciate your help.</p>
<p>Thank you.
David</p>
|
php javascript
|
[2, 3]
|
2,455,231
| 2,455,232
|
Jquery animation disappears after several clicks
|
<p>I'm doing jquery small animation of fade in to form validation</p>
<p>This is working perfectly fine, but after several clicks the div opacity is changing to its lowest until it totally disappears</p>
<p>Here is my fade in code </p>
<pre><code>$("#edit-username check").addClass("right").css("display","none").stop().fadeIn();
</code></pre>
<p>And here what I do to hide this class effect</p>
<pre><code>$("#edit-username #check").removeClass("right");
</code></pre>
<p>Here is the jsfiddle to my code (the problems appear best on tab click several times)
<a href="http://jsfiddle.net/77BbA/20/" rel="nofollow">http://jsfiddle.net/77BbA/20/</a>
thanks alot in advance</p>
|
javascript jquery
|
[3, 5]
|
670,728
| 670,729
|
How can I stop jquery effects from cloning nearby elements during execution of effect?
|
<p>I have observed some strange behavior with a few jquery effects. The one that always exhibits the behavior that concerns me is slideUp(1000). My HTML is formatted similar to:</p>
<pre><code><ul>
<li>Nav Element</li>
<li>Another...</li>
<li>...</li>
</ul>
<div id="action_area">
Stuff
</div>
</code></pre>
<p>Then my jquery call is:</p>
<pre><code>$('#action_area').slideUp(1000);
</code></pre>
<p>When this call is executed the formatted navigation tabs appear to be cloned just above the "Stuff" in the action_area div during the time the slideUp effect is executing. This action area can be reopened and when it is the navigation tabs don't appear again. They only "appear" to be there when the slideUp function is being executed? Is this normal? If so then why? Is there a way to prevent this?</p>
|
javascript jquery
|
[3, 5]
|
4,841,996
| 4,841,997
|
overwrite default properties in jQuery plugin
|
<p>could someone explain overwriting default properties and even extending them with jQuery inside my plugin example and also the closure function</p>
<pre><code>$.fn.myObject = function(overwriteProperties) {
var properties = {myproperty1: "defaultvalue"}
// overwrite properties here
function doStuffHere() {
}
return (function() {
return this; // does this part here refer to the object of myDiv
});
}
$('#myDiv').myObject({myPoperty1:"newValue"});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,781,447
| 2,781,448
|
Jquery animation based on matching strings on page load
|
<p>I have the following code</p>
<pre><code> $('.rsName').ready(if{($('.companyName').html() == $(this).html()){
$(this).siblings(".rsDistribution").slideDown('slow', function() {});
});
</code></pre>
<p>What I'm trying to do, is check if rsName and companyName are equal. If they are equal, I'd like to slide down the .rsDistribution which is a sibling div of rsName.</p>
<p>Any ideas why this isn't working?</p>
|
javascript jquery
|
[3, 5]
|
4,534,484
| 4,534,485
|
can jquery toggle the original css(style.css) value and the new value(set in the .animate{})?
|
<p>erm...can jquery toggle the original css(style.css) value and the new value(set in the .animation{})?</p>
<pre><code>$(function() {
$('a.maximize').click(function() {
$($(this).attr('href')).animate({
position: "absolute",
top: 0,
left: 0,
height: '99.5%',
width: '99.5%',
opacity: 1,
},1000)
});
});
</code></pre>
<p>this is the jquery code i have now,but how to toggle the a href target to the new value(code above)</p>
<p>or set the .animate{} change after click,and change back the previous .animate{} after click again.</p>
<p>example: the same button,
but first time click, change it to width height 100%,</p>
<p>but the second time click on the same button, change them back to the width height 50%</p>
<p>the third time change to width height 100% and so on..</p>
|
javascript jquery
|
[3, 5]
|
4,019,273
| 4,019,274
|
How to format an EditText's numeric value on unfocus (or at all!?) in Android to use commas
|
<p>I'm trying to take the user input, which may or may not have a comma in it, and put a comma in the correct places upon the user deselecting the field (or at all, if that's not possible).</p>
<p>I would also like to know how I can subtract the commas to make the number just an integer.</p>
<p>Thanks in advance for your help!</p>
|
java android
|
[1, 4]
|
1,287,378
| 1,287,379
|
How do I detect a postback in jQuery
|
<p>I have a form that I pre-populate with test data though jQuery.</p>
<pre><code>$('INPUT[name=subscription.FirstName]').val('Jef');
</code></pre>
<p>but I only want to do this before submit. What is the best way to test this?</p>
|
javascript jquery
|
[3, 5]
|
2,785,606
| 2,785,607
|
javascript focus problem
|
<p>I have a form with 3 fields. Country, state and users</p>
<p><img src="http://i.stack.imgur.com/beWVs.jpg" alt="none"></p>
<p>I am trying to do the following. when United states is selected as a country, the state field will show. The problem is that when i use the tab key on the keyboard, it is skipping the state field and its going on the users field. So i tried using the focus property so when i select United states, the state will show + selected, but I had no luck.. Below please find the code I am using</p>
<pre><code>$(document).ready(function () {
$("#cmbCountries").change(function () {
$("#cmbCountries option:selected").each(function () {
if ($(this).text() == "United States") {
$("#cmbstate").show();
$("#cmbstate").focus();
}
else {
$("#cmbstate").hide();
}
});
}).change(); });
</code></pre>
<p>Any help please?</p>
|
javascript jquery
|
[3, 5]
|
4,581,481
| 4,581,482
|
how can access data from a webserver using a windows application
|
<p>I would like to create a touch screen application.It will be a windows application, so using that how can i get data from a web server?</p>
|
java php
|
[1, 2]
|
1,868,475
| 1,868,476
|
How to capture the onload event of a window with attachment response?
|
<p>I have the following download request in javascript:</p>
<pre><code>var exportWindow = window.open('Download.ashx?source=1', '');
exportWindow.onload = function() {
alert('finished');
};
</code></pre>
<p>My problem is that the above alert box does not appear.
The download.ashx sets up the following response (which will be saved as a csv file), which works fine.</p>
<pre><code> context.Response.ClearContent();
context.Response.ContentType = "application/text";
context.Response.AddHeader("content-disposition", "attachment; filename=\"" + fileName + "\"");
context.Response.Write(resultWriter.ToString());
context.Response.Flush();
context.Response.Close();
</code></pre>
<p>If I replace the download.ashx with a normal aspx page, then the alert appears.
So my question would be: is it possible to know programatically when the dowload.ashx returned with a response?
(using FF3)</p>
<p>Thanks in advance,
Geza</p>
|
asp.net javascript
|
[9, 3]
|
915,679
| 915,680
|
How can I over-ride the click of each LI in jQuery?
|
<p>I have the following UL:</p>
<pre><code> <ul class="xbreadcrumbs" style="position:absolute; bottom:0px">
<li><a href="someURL">A Crumb</a></li>
</ul>
</code></pre>
<p>This is being dynamically created by my javascript. How can I override the click for each LI that is inside of a UL called xbreadcrumbs in jQuery and have it do something instead of go to a new hyperlink?</p>
<p>Also, how can I get the behavior to be different for each li?</p>
<p>Updated:</p>
<pre><code>$.each('.xbreadcrumbs li', function(){
$(this).live('click',function(e){
e.stopPropagation();
console.log('clicked for each li');
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,796,556
| 5,796,557
|
jQuery.get() fails with full url
|
<pre><code>var url = "/example/somelink";
jQuery.get( url, params, callback); //works fine
var url = "http://www.yahoo.com";
jQuery.get( url, params, callback); //fails!
</code></pre>
<p>when I give the full URL of a site, get() fails...any idea why this is happening?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,625,633
| 3,625,634
|
Why can't i use this string as a method call?
|
<p>This is my script, for some reason when i use <code>contactForm.container[contactForm.container.config.effect]();</code> it says "contactForm.container.config is undefined " ... I can very well see it defined! what am i doing wrong? Thank you</p>
<pre><code><script>
(function(){
$('html').addClass('js');
var contactForm ={
container: $('#contact'),
config: {
effect:'slideToggle'
},
init: function(){
$('<button></button>',{
text: 'Contactame'
})
.insertAfter('article:first')
.on('click', this.show);
},
show: function(){
contactForm.close.call(contactForm.container);
contactForm.container[contactForm.container.config.effect]();
},
close: function(){
var $this = $(this);
$('<span class=close>X</span>')
.prependTo(this)
.on('click',function(){
$this.hide();
})
}
};
contactForm.init();
})();
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
527,613
| 527,614
|
Jquery fadeout - wait to complete - then delete <TR>
|
<p>Good evening all. I'm trying to do a fadeout with Jquery to a with unique id which works but after that, i delete the with simple function removeElement which works too. My problem is that the removeElement function kicks in so fast that you cannot see the slow transition of the fadeout. I tried using the Javascript native setTimeout function, but still no help. </p>
<pre><code>var elem_comment_release_container = 'release_' + release_id + '_comment_' + comment_release_id;
//fade to <TR>...nice effect
$("#" + elem_comment_release_container).fadeTo('slow','0.00');
//removeElement(elem_comment_release_container)
setTimeout(removeElement(elem_comment_release_container),31000);
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,015,593
| 4,015,594
|
Isset post and break for loop
|
<p>I have this code below</p>
<pre><code>for ($p=1; $p<30000; $p++) {
if(isset($_POST['stop_loop'])) {
break;
}
loop do something
}
</code></pre>
<p>My question is how stop the loop after I post stop_loop?</p>
<p>Maybe I should use die(); but I try and it doesn't work is there any way?
If not maybe Neal was right</p>
|
php javascript
|
[2, 3]
|
2,544,165
| 2,544,166
|
select data from table and display them in a label with checkboxes
|
<p>I retrieved my data from table and put it in a label. Now I want for each row to generate a checkbox. How can I do that? so..</p>
<pre><code> option1..checkbox1
option2..checkbox2....
</code></pre>
<p>This is my code for obtaining the data:</p>
<pre><code>SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["erp"].ConnectionString);
con.Open();
string intero = "Select * from judete";
SqlCommand cmd = new SqlCommand(intero, con);
SqlDataReader rdr;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Label1.Text +=rdr[0] + "" + rdr[1] + "<br/>";
}
rdr.Close();
con.Close();
</code></pre>
<p>I'm using C# in an asp.net web application</p>
|
c# asp.net
|
[0, 9]
|
3,879,836
| 3,879,837
|
Get child <ul> in <ul> list without id and with e.preventDefault() on first level of <ul><li><a>
|
<p>I have some menu with structure like this:</p>
<pre><code><ul id="menu">
<li><a href="#"><span>First level link 1</span></a>
<ul>
<li><a href="#"><span>Child link 1</span></a></li>
<li><a href="#"><span>Child link 2</span></a></li>
</ul>
</li>
<li><a href="#"><span>First level link 2</span></a>
<ul>
<li><a href="#"><span>Child link 2</span></a></li>
<li><a href="#"><span>Child link 2</span></a></li>
</ul>
</li>
</ul>
</code></pre>
<p>It need to show only first level ul li, its ok, but then it needs to show by on click second level links. And i cant usw id or rel attr in ul or li - this is my problem to catch child .</p>
<p>My code is like:</p>
<pre><code>var menuRaw = $("ul#menu > li:lt(5)");
menuRaw.click(function(e){
e.preventDefault();
var menuItem = $(this);
menuRaw.removeClass("selected");
menuItem.addClass("selected");
$('#menu ul').hide();
menuItem.find("ul").show();
}
</code></pre>
<p>And it works but e.preventDefault() is blocking all links in menu (but on second level links needs to be working links as normally they do)</p>
<p>Sorry for my English, and this is first question on stackoverflow.</p>
|
javascript jquery
|
[3, 5]
|
2,215,104
| 2,215,105
|
giving null pointer when using InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
|
<p>Hi I'm trying to input this piece of code to hide the soft keyboard on the android, but it's returning a null pointer.</p>
<p>code:</p>
<pre><code>public void testSetTestEnvironment (){
solo.clickInList(4);
solo.clickOnMenuItem(ConfigVariables.CATALOGSERVER);
assertTrue(solo.searchText(ConfigVariables.CATALOGSERVERURL));
//Enter KeyCode
solo.clickInList(5);
View myEditText = solo.getViews().get(0);
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY);
solo.enterText(solo.getEditText(0), "");
solo.enterText(0, ConfigVariables.KEYCODE);
assertTrue(popupClickButtonHandler("Enter KeyCode", "OK"));
</code></pre>
<p>the logs show:</p>
<p>java.lang.NullPointerException</p>
<p>Thanks.</p>
|
java android
|
[1, 4]
|
1,851,643
| 1,851,644
|
What is registration ID in Android and how does it creates internally?
|
<p>I'm new to Android and I don't understand some concepts.What is registration ID used in Google Cloud Messaging?How does it creates internally - it is unique device id as Apple device token or something else?How does it differs from application id? It is may be a stupid question but I really don't understand the concepts.</p>
|
java android
|
[1, 4]
|
2,448,600
| 2,448,601
|
get id of checked checkbox in gridview in javascript
|
<p>I am having checkbox in each itemTemplate of asp:gridview</p>
<p>I want to get ids or values of those many selected checkboxes using only javascript</p>
|
javascript asp.net
|
[3, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.