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,289,413 | 5,289,414 | Jquery - Accessing nested child elements | <p>Assume I have the following HTML - </p>
<pre><code><DIV id="ParentDiv">
<DIV id="SubDiv1"></DIV>
<DIV id="SubDiv2">
<INPUT id="input">
</DIV>
</DIV>
</code></pre>
<p>To access the input element using jquery, it would be simply $("#input"). What I'm trying to do is access it, assuming I only know the ID of the top level div. </p>
<p>Currently I have </p>
<pre><code>$($($("#ParentDiv").children()[1]).children()[0])
</code></pre>
<p>Which does seem to work. Is there a cleaner way of writing this, or is the way I am doing it ok?</p>
| javascript jquery | [3, 5] |
5,760,587 | 5,760,588 | Open 2 URLs on click from option select | <p>In my form there is a drop down list, and on button click I need to open 2 URLs, if user select option 1 then after button click a thank you page appear and another URL should be open.</p>
<p>I am able to open only one URL at current time. Please have a look at my fiddle.</p>
<p><a href="http://jsfiddle.net/ty65E/5/" rel="nofollow">http://jsfiddle.net/ty65E/5/</a></p>
<p>In addition in my page there are few buttons and I want they should initally disabled so they don't worj anymore. and I want to force user to fillup the form first then only he can access the other buttons.</p>
<p>Guys thanks for your Support.</p>
| javascript jquery | [3, 5] |
2,726,983 | 2,726,984 | Add spans to characters in a string (in an HTML element) | <p>I want to loop through the characters of a text in an element and add <code>span</code>s to the characters. This is pretty easy using <a href="http://api.jquery.com/jQuery.map/" rel="nofollow"><code>jQuery.map()</code></a>:</p>
<pre><code>$elem = $('h1');
var chars = jQuery.map($elem.text().split(''), function(c) {
return '<span>' + c + '</span>';
});
$elem.html(chars.join(''));
</code></pre>
<p>The above <a href="http://jsfiddle.net/F7KqP/" rel="nofollow">works great with a simple string</a>, but now I want to change the function so that it also will handle more 'complex' contents like: <code><h1>T<em>e</em><b>st</b></h1></code>. Which should be translated to: <code><h1><span>T</span><em><span>e</span></em><b><span>s</span><span>t</span></b></h1></code>.</p>
<p>This means I cannot simply loop through all the characters in the element anymore. Is there something I can use to loop through the contents (characters) of an element as well as all children? Or is there another way of achieveing what I want?</p>
| javascript jquery | [3, 5] |
3,948,559 | 3,948,560 | read cookies in jquery from other page | <p>I have called one php page inside the iframe</p>
<p>I have stored some values in cookies.I want to read that cookies values from that page to other page.</p>
<p>I used jQuery to read cookie.</p>
<pre><code>var value = $.cookie('artname');
</code></pre>
<p>'artname' is the cookie name.</p>
<p>But it displaying null value because cookies path is different,path is "/v/abcfile/frontend/".</p>
<p>But the path for the other cookies on the page i am trying to get is "/.</p>
<p>how can I get value of cookie?</p>
| javascript jquery | [3, 5] |
901,488 | 901,489 | Adding a function to one jQuery/DOM element | <p>I am authoring a plugin which instantiates a map. The map would then provide a function to move to another place on the earth.</p>
<p>The script makes the map just fine. However I can't "tack" the function on the element, to be used by another plugin in a callback.</p>
<p>Here's the approach I tried; in plugin:</p>
<pre><code>(function($){
$.fn.mapDo(options){
map = new BlahMap(this.get(0));
this.moveTheMap = function(place){
map.moveItToThat(place);
}; // nope.
}
})(jQuery);
</code></pre>
<p>Then, in view:</p>
<pre><code>$(map).mapDo();
$(otherElement).otherControl({
callback: function(place){
$(map).moveTheMap(place); // moveTheMap is not there on $(map)!
}
};
</code></pre>
<h3>The Question</h3>
<p>How do I add a function to the map jQuery or DOM element, if possible? If not, how can I provide that kind of functionality?</p>
<p>More importantly, am I going the right way here by separating the things that way? I'm a bit of a neophyte to Javascript, how are these tasks usually done while still keeping the components apart?</p>
<p>While that's the stab I took at it, more generally, I struggled with the concept of outputting things from a jQuery plugin while maintaining chainability. In this case, what I am trying to do is to <strong>output</strong> a callback from the plugin that will work on the called element later in the execution.</p>
| javascript jquery | [3, 5] |
2,492,643 | 2,492,644 | E.O. Datepicker Duration between two datepicker | <p>in my Reservation.aspx webpage i have a E.O. datepicker .How can i get the duration of two datepicker and show it on a textbox .. using c# codes, im using visual studio 2008.. thanks for any reply .. Need reply now.. </p>
| c# asp.net | [0, 9] |
251,511 | 251,512 | Android app causes SIGSEV, how do I debug this? | <p>As I understood it, we're not supposed to be seeing these unless working with native code, which I am definitely not. I'm simply calling a bunch of AsyncTasks that fetch web data and populate a listview.</p>
<p>How do I debug it? There is absolutely no indication on what causes it and it's pretty consistent, 1 out of every 6 or 7 runs of my action and it only happen on a GNex, not in the emulator. Is putting tons of logcat around it the only way?</p>
<pre><code>12-08 00:26:03.362: D/dalvikvm(10906): GC_CONCURRENT freed 651K, 12% free 10861K/12320K, paused 4ms+9ms, total 52ms
12-08 00:26:03.362: D/dalvikvm(10906): WAIT_FOR_CONCURRENT_GC blocked 18ms
12-08 00:26:03.362: D/dalvikvm(10906): WAIT_FOR_CONCURRENT_GC blocked 6ms
12-08 00:26:03.401: A/libc(10906): Fatal signal 11 (SIGSEGV), thread 10958 (pool-1-thread-9)
12-08 00:26:03.401: A/libc(10906): Fatal signal 11 (SIGSEGV) at 0x637f4008 (code=1), thread 10923 (pool-2-thread-1)
12-08 00:26:04.330: I/Choreographer(10906): Skipped 47 frames! The application may be doing too much work on its main thread.
</code></pre>
| java android | [1, 4] |
2,092,649 | 2,092,650 | jQuery : click event on child element on the list | <p>I have a script in jQuery/PHP, which receives other levels on the UL list. For example:</p>
<pre><code><ul class="obj">
<li>Object A</li>
<li>Object B</li>
</ul>
</code></pre>
<p>After click on the LI element, jQuery appends another list to this element received by POST:</p>
<pre><code><ul class="obj">
<li>Object A
<ul class="obj">
<li>Object A1</li>
<li>Object A2</li>
</ul>
</li>
</li>Object B</li>
</code></pre>
<p></p>
<p>Then when I want to click on 'Object A1' element and append another list to it, list appends to parent element, because both are ".obj li" elements..
My jQuery code:</p>
<pre><code>$(function(){
$(".obj li").click(function(){
var el = $(this);
$.post('get_rel.php',
function(data){
$(el).append(data)
el = null;
});
})
})
</code></pre>
<p>How to invoke a click event exactly on the clicked (child) element?
Thanks for help.</p>
| php jquery | [2, 5] |
2,124,321 | 2,124,322 | transfer data between activites | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android">How do I pass data between activities in Android?</a> </p>
</blockquote>
<p>how would i go about transferring some data between two activities? </p>
<p>my 1st activity takes current time</p>
<pre><code>startTime = System.currentTimeMillis();
</code></pre>
<p>and my second activity contains a little sum with the startTime</p>
<pre><code>long elapsedTime = System.currentTimeMillis() - startTime;
</code></pre>
<p>many thanks</p>
| java android | [1, 4] |
4,134,225 | 4,134,226 | Best way to refer to javascript in UserControl(ascx) | <p>I usually create usercontrol which is referring javascript file/block. For example, I have a cascading Nation/City selection which is based on AJAX in my Register.ascx(a usercontrol), certainly I need add the javascript file into page. I have 3 ways at present:</p>
<p>1.Writing <code><Script></code> element in .ascx file directly, but it will bring nonstandard HTML structure due to many <code><Script></code> elements would appear in <code><Body></code>. </p>
<p>2.Writing <code><Script></code> element in aspx page which will use the usercontrol, but the father(aspx) rely on child(ascx), it's listening too bad.</p>
<p>3.Using <code>ScriptManager</code> or <code>HtmlGenericControl</code> to register file/block in head, but I'm worrying about performance of them, and it's a bit weird that I bring javascript to c# file.</p>
| javascript asp.net | [3, 9] |
2,655,926 | 2,655,927 | How to pass values from MapOverlay | <p>I want to pass the values from <em>MapOverlay</em> class to another class. I tried to use an Intent </p>
<pre><code>Intent i = new Intent(getApplicationContext(), AnotherClass.class);
i.putExtra("value1", x1);
i.putExtra("value2", y1);
startActivity(i);
</code></pre>
<p>but Eclipse alerts me "The method getApplicationContext() is undefined for the type MapOverlay" so I can't use this method to pass the values. Please advise me on how I should do this.</p>
<p>Thanks in advance.</p>
| java android | [1, 4] |
2,467,871 | 2,467,872 | OOP javascript and jquery books | <p>I am looking for any good JavaScript and jquery books. Anybody have any suggestion?</p>
<p>I have a heavy development in object oriented JavaScript.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
1,155,841 | 1,155,842 | transfer data in functions ? Javascript | <p>how can i transfer certain data in function like <code>test()</code>;</p>
<p>I saw some people did this like putting the data in the brackets like test(data);</p>
<p>When the function executes it will use the data
for example:</p>
<pre><code>$('#element').click(function(){
test(somedata);
});
function text();{
//how can i get the data stored
}
</code></pre>
<p>am i doing it right? or is there a better way to do this?</p>
| javascript jquery | [3, 5] |
558,914 | 558,915 | JS/PHP: Wont alert error | <pre><code> <script type="text/javascript">
$(function() {
$("#continue").click(function () {
$.ajax({
type: "POST",
url: "dbc.php?check=First",
data: {full_name : $('#full_name').val(),
usr_email : $('#usr_email').val()},
success: function(msg){
if(msg==1){
$("#First_1").hide();
$("#Next_2").toggle();
}else{
alert(msg);
}
}
});
return false;
});
});
</script>
</code></pre>
<p>Here's dbc.php?check=First <a href="http://phpbin.net/x/249121011" rel="nofollow">phpbin.net/x/249121011</a></p>
<p>if it´s receiving echo 1; from dbc.php?check=First, then hide & toggle, else then alert the output error.</p>
<p>Please check the link for the php, what is wrong here?</p>
<p>Right now i just get an empty alert.</p>
| php javascript jquery | [2, 3, 5] |
2,334,976 | 2,334,977 | JavaScript before jQuery | <h3>Duplicate:</h3>
<blockquote>
<ul>
<li><a href="http://stackoverflow.com/questions/122902/what-are-some-of-the-pros-and-cons-of-using-jquery">What are some of the pros and cons of using jQuery?</a></li>
<li><a href="http://stackoverflow.com/questions/215589/should-i-avoid-using-a-javascript-library-while-learning-how-to-write-ajax-client/215599">Should I avoid using a JavaScript library while learning how to write AJAX client code?</a></li>
</ul>
</blockquote>
<p><hr /></p>
<p>I've read it so many times... "I'd learn JavaScript before learning something like jQuery" - but is this really necessary for every situation? Sure, some people like to know what's going on under the hood, but are there any serious negative side effect of heading straight for jQuery tutorials/books? I want to learn something in my spare time and I've decided on jQuery (or JavaScript if anyone can convince me strongly enough).</p>
| javascript jquery | [3, 5] |
3,551,825 | 3,551,826 | how to get selection inside a div using jquery/javascript | <p>there are lots of code to get selection in a page,
but i want a code to get selection inside a div,
if the selection is outside of my div, the function must return empty string;</p>
<p>there is a jquery plugin that works only for textarea but not div. <a href="http://plugins.jquery.com/project/fieldselection" rel="nofollow">(here)</a></p>
<p>thanks</p>
| javascript jquery | [3, 5] |
41,937 | 41,938 | OnClientClick event doesn't register javascript alert from code-behind | <p>Alright, I have an embarrassingly simple question that hopefully has an embarrassingly simple answer. I am trying to get an asp:ImageButton to display an alert message that contains variables from my codebehind. Here's the overly simplified version of the code:</p>
<pre><code>public string AlertMe
{
get
{
return "alert('hi');";
}
}
</code></pre>
<p>Now when I try and access it this way:</p>
<pre><code><asp:ImageButton ID="btn" runat="server" ImageUrl="/Images/img.ico" OnClientClick='<%=AlertMe%>'/>
</code></pre>
<p>I see a postback, but no alert message, as if it can't access my property at all. Meanwhile, these 2 lines:</p>
<pre><code><%=AlertMe%><br />
<a onclick="<%=AlertMe%>">click this</a>
</code></pre>
<p>both work fine and dandy. (The first displays the code for the javascript alert, and the second fires the alert with no issues.)</p>
<p>So my big question is: why does the OnClientClick event for an asp control fail to register the alert? Is there an obvious flaw I'm missing, or do I really need to register the entire event from code-behind?</p>
| c# javascript asp.net | [0, 3, 9] |
5,488,050 | 5,488,051 | JavaScript into Asp Page | <p>i am learning javascript client side scripting language and i am using js in ASP.. i dont know when i compile the code, it shows </p>
<blockquote>
<p>COMPILATION ERROR:Compiler Error
Message: CS1061: 'ASP.default_aspx'
does not contain a definition for
'popup' and no extension method
'popup' accepting a first argument of
type 'ASP.default_aspx' could be found
(are you missing a using directive or
an assembly reference?)</p>
</blockquote>
<p>here is my code : </p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WEB_test_app._Default" %>
<!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" >
<head runat="server">
<title>Shuraat Web ki</title>
<script type ="text/javascript">
function popup()
{
alert("popup!!");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick ="popup()"/>
<script type ="text/javascript">
document.write("Abid");
</script>
</div>
</form>
</body>
</html>
</code></pre>
| javascript asp.net | [3, 9] |
1,926,375 | 1,926,376 | When android device goes to sleep mode? | <p>I was searching SO and web but i couldn't find sufficient answer for my particular question. Ok here we go:</p>
<p>Every user can modify screen timeout on android. (when screen turns off when its idle for __ seconds/minutes - users choice ). But user can modify ONLY screen timeout and not when device goes actually to sleep. I found here what happens when device goes to sleep: (Really nice answer by CommonsWare) <a href="http://stackoverflow.com/questions/5120185/android-sleep-standby-mode">Android Sleep/Standby Mode</a></p>
<p>Ok my question is simple. How do i know when my phone will go to sleep? Will it go to sleep immediately after turning screen off? Will it stay "awake" a while after screen was turned off? And most important: Does sleep mode in particular device varies from brand device ( how manufacturer implement this ) or it depends on ROM version (For instance, all ICS powered devices will go to sleep X seconds after screen was turned off )?</p>
| java android | [1, 4] |
2,211,641 | 2,211,642 | Script doesn't always fully execute when ajaxed in with jQuery | <p>I've got this clause to execute a script under certain condition;</p>
<pre><code>//if artist page clicked run profile script
if (id == 'artist_link') {
$.getScript("AJAX/get_profile.js");
}
</code></pre>
<p>The problem i'm having is that the script will often not fully execute. Sometimes nothing will be executed other times only parts of it will execute. I can't really provide any more details than this. Strange occurence though is that it always executes fully when firebug is open and I can't find any problems. The browsers that i've tested on and both have this problem are chrome and firefox</p>
<p><a href="http://jsfiddle.net/TNt4s/" rel="nofollow">jsfiddle</a> with <code>get_profile.js</code> file in.</p>
| javascript jquery | [3, 5] |
5,181,132 | 5,181,133 | Good javascript-graph library | <p>I need do create a pretty complicated graph in Javascript. It's a line-graph with dots that are click-able. I've looked at the google-api, and it just won't do. Also, it needs to be able to rendre several graphs in one window.</p>
<p>Would be really nice if it was powered by jQuery, since the rest of the project is running on that platform.</p>
<p>Does anyone know about any good libraries? I have not gotten across any suitable yet.</p>
<p>Thomas</p>
| javascript jquery | [3, 5] |
5,908,063 | 5,908,064 | Thread in Android | <p>I have an example like this: </p>
<pre><code>package android.uiexample;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ProgressBar;
import android.widget.RadioGroup;
import android.widget.Toast;
import android.widget.ToggleButton;
import android.widget.RadioGroup.OnCheckedChangeListener;
public class BasicViewsExampleActivity extends Activity
{
private static int progress = 0;
private ProgressBar progressBar;
private int progressStatus = 0;
private Handler handler = new Handler();
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.basic_views);
progressBar = (ProgressBar) findViewById(R.id.progressbar);
//---do some work in background thread---
new Thread(new Runnable()
{
public void run()
{
//---do some work here---
while (progressStatus < 10)
{
progressStatus = doSomeWork();
}
//---hides the progress bar---
handler.post(new Runnable()
{
public void run()
{
progressBar.setVisibility(View.GONE);
}
});
}
//---do some long lasting work here---
private int doSomeWork()
{
try {
//---simulate doing some work---
Thread.sleep(500);
} catch (InterruptedException e)
{
e.printStackTrace();
}
return ++progress;
}
}).start();
}
</code></pre>
<p>}</p>
<p>In this example, it use Handler to post a Runable to exc progressBar.setVisibility(View.GONE);. I don't know why i can't call progressBar.setVisibility(View.GONE); directly:</p>
<pre><code> //---do some work here---
while (progressStatus < 10)
{
progressStatus = doSomeWork();
}
//---hides the progress bar---
progressBar.setVisibility(View.GONE);
</code></pre>
<p>Anybody can tell me why i can't?</p>
| java android | [1, 4] |
3,819,674 | 3,819,675 | jQuery imple form submission without reload | <p>Could someone provide me with the most simple code for form submission with jquery. On the web is with all sorts of gizmo coding.</p>
<p>Thanks in advance
Dave</p>
| php jquery | [2, 5] |
2,754,607 | 2,754,608 | Triggering javascript setTimeOut events prematurely | <p>I'm using setTimeOut to control an automatic slideshow.</p>
<p>(You can see it here: <a href="http://thingist.com/labs/ipad.shtml" rel="nofollow">http://thingist.com/labs/ipad.shtml</a> -- basically something pretty to look at while I'm working. Images are coming from reddit's API)</p>
<p>The code looks approximately like this:</p>
<pre><code>next() {
image_url = images[key]["url"]
$("#image").html(vsprintf("<img src='%s'>", [image_url]));
key++;
setTimeOut(function() { next(); }, 30000);
</code></pre>
<p>The problem is that if I trigger the "next" function in another way (for instance with a div onclick), the setTimeOut callback function is still queued. So I'll "next" an image, but when the callback fires, it "next"s an image again. If you "next" many times in a row, there is an approx 30 second delayed burst that will follow you. (Once all of the queued timeouts fire).</p>
<p>Is there a way to prematurely trigger a setTimeOut's callback? Or to just dequeue it altogether?</p>
| javascript jquery | [3, 5] |
5,699,896 | 5,699,897 | How do I from a JSON object convert to form of elements? | <p>I have a JSON object as <code>{a: 1, b: 2, c: [4, 5, 6], d: {x: 7, y: 8, z: [9, 0]}}</code>, how do I convert it to a form of elements?</p>
<p>I want to convert to this:</p>
<pre><code><input type="hidden" name="obj[a]" value="1"/>
<input type="hidden" name="obj[b]" value="2"/>
<input type="hidden" name="obj[c][]" value="4"/>
<input type="hidden" name="obj[c][]" value="5"/>
<input type="hidden" name="obj[c][]" value="6"/>
<input type="hidden" name="obj[d][x]" value="7"/>
<input type="hidden" name="obj[d][y]" value="8"/>
<input type="hidden" name="obj[d][z][]" value="9"/>
<input type="hidden" name="obj[d][z][]" value="0"/>
</code></pre>
<p>Any ideas?</p>
| javascript jquery | [3, 5] |
4,567,354 | 4,567,355 | Getting random urls from google and storing them into array | <p>I need to check the connection time to some url, i do it using <em>curl</em> (i only know how to do it for 1 url at the time tho, my problem is that i need to check it for many urls, not just 1)</p>
<p>Here is an example of how i calculate the connection time:</p>
<pre><code>$url1 = 'stackoverflow.com';
$curl1 = curl_init();
curl_setopt($curl1, CURLOPT_URL, $url1);
curl_setopt($curl1, CURLOPT_RETURNTRANSFER, TRUE);
curl_exec($curl1);
$contime1 = curl_getinfo($curl1, CURLINFO_CONNECT_TIME);
echo $contime1;
</code></pre>
<p>now lets say instead of 'stackoverflow.com' url i wanted to use multiple urls, like this array list for example:</p>
<pre><code>$imones = array ("php.net","w3schools.com", "stackoverflow.com");
while (list(, $value) = each($imones)) {
$imoneslist = "$value<br />\n";
</code></pre>
<p>how do i put $imoneslist array into $url1?</p>
| php javascript | [2, 3] |
3,796,268 | 3,796,269 | Access iPhone from Windows | <p>I've seen a couple programs running in Windows that could access the iPhone and iTouch with access to the photo library and music. What APIs are used for this kind of development?</p>
| iphone c++ | [8, 6] |
1,627,427 | 1,627,428 | Using hardware components in Android (Java) | <p>Hey,
Sorry to bother you with such a silly question, but I can't find the answer myself.</p>
<p>I'd like to use hardware components in my applications (or: sensors), but it seems that I don't have the necessary files, as writing <code>import android.hardware.Sensors;</code> causes an error ("The ... cannot be resolved"). It is weird because I can import all other classes without any problem; I've downloaded the SDK. So what is wrong?</p>
<p>Thank you in advance.</p>
| java android | [1, 4] |
2,746,977 | 2,746,978 | Customvalidator control - SetFocusOnError="True" not working for CheckboxList | <p>I am validating a checkbox list using custom validator and jquery to check required validation, its validating fine but its not getting focus on error. </p>
<p>the asp.net for CheckBoxList and CustomValidator is : </p>
<pre><code><asp:CheckBoxList ID="cblSellerCategories"
runat="server"
RepeatDirection="Horizontal">
</asp:CheckBoxList>
<asp:CustomValidator ID="CustomValidator2"
runat="server"
ClientValidationFunction="CheckSellerCategory"
CssClass="errorBox"
ErrorMessage="Select seller type"
SetFocusOnError="True">
</asp:CustomValidator>
</code></pre>
<p>and Jquery is </p>
<pre><code>function CheckSellerCategory(sender, args) {
args.IsValid = false;
$("[id$='cblSellerCategories']").find(":checkbox").each(function () {
if (jQuery(this).attr("checked")) {
args.IsValid = true;
return;
}
});
}
</code></pre>
<p>How to get focus on error(if any check box is not selected). I tried with validation group as well but no luck.</p>
| jquery asp.net | [5, 9] |
217,323 | 217,324 | monkey with rental cars - integration into third party websites, | <p>So,</p>
<p>I run a rental car company, and I want to integrate my service into a third party website - where people will be able to rent cars directly on the third party website. How can I integrate my service on the third party website efficiently? I am thinking that an iframe might be the best way or some sort of javascript call ... but I need the best way to integrate my service so that the third party site has to do less coding as possible.</p>
<p>I want people to check a box on the third party website if they want to rent a car and then a form pops up asking the customer for their payment details, then that information gets sent to my site, and my site processes that information and confirms the payment. </p>
<p>So basically, I was envisioning,</p>
<ol>
<li>Person clicks a checkbox on third party site</li>
<li>Third party site sends information about the person to my site</li>
<li>I use that information to send back a payment box with price details</li>
<li>Person submits payment information on third party site</li>
<li>My site gets the payment information and processes the information</li>
<li>My site sends back status response to third party site. </li>
</ol>
<p>The problem is, if the customer is a repeat customer, I would like the third party site to send me identifying information about the customer that will allow me to discern that she is a repeat- and thus charge her without her having to put her credit card details in the payment box.</p>
| php jquery | [2, 5] |
2,096,468 | 2,096,469 | jquery image gallery showing loader gif | <p>I am developing jquery image gallery plugin.
I checked loading of the image like this:</p>
<pre><code>$("#loading").show();
$('.preview').load(function () {
$("#loading").hide();
});
</code></pre>
<p>But I didnt success.
I want to show loading gif when my image is loaded.How can I do this? For ex:
<a href="http://blueimp.github.com/Bootstrap-Image-Gallery/" rel="nofollow">http://blueimp.github.com/Bootstrap-Image-Gallery/</a></p>
| javascript jquery | [3, 5] |
2,559,901 | 2,559,902 | How to access PHP methods inside a Javascript? | <p>I have made a method which will delete a file.
first i echo the url to this file.
like this </p>
<pre><code>echo "<a href='$fulr'>$filename</a>";
</code></pre>
<p>now basicaly i want to call the function <code>deletefile($file);</code>
how can i do it like this </p>
<pre><code>echo "<a onclick='$this->deletefile($filename)' href='$fulr'>$filename</a>";
</code></pre>
<p>is that even posible? </p>
<p>Or how can i implement something similiar inside the php code?</p>
| php javascript jquery | [2, 3, 5] |
5,315,385 | 5,315,386 | C++ to Java(openmp) | <p>I'd appreciate it if you could help on this</p>
<p>Basically what I need to do is to find the best way to load a cpp file through java. </p>
<p>Explaining more, I have a program written in C++ (openmp) and I need to write a Java Gui that will run this file along with some other tasks.</p>
<p>What is the most efficient and easier way to do this? Do you have any online books , or recommendations for it?</p>
<p>Also could this be done through xml? I mean have the xml structure and load the java's gui file and then the .cpp? How could this work?</p>
<p>Thanks</p>
| java c++ | [1, 6] |
4,448,741 | 4,448,742 | error after submit a form | <p>i have a php like this:</p>
<pre><code><?php
......
?>
<html>
<head></head>
<body>
<div id="content">
<form id="myform" name="myform">
<?php include_once("ronny.php"); ?>
.....
<input type="button" value="Save" id="Save" name="Save" onclick="if(check123()==true){document.myform.submit()}" />
</div>
</form>
...
</code></pre>
<p>Now, in this case after i click on save i have an error <code>document.myform.submit is not a function</code> in firebug and in IE the error is <code>Object doesn't support this property or method</code>.
If i delete the <code><?php include_once("ronny.php"); ?></code> everything is ok.</p>
<p>ronny.php is like that:</p>
<pre><code><?php
if(......)){
?>
<div></div>
<div></div>
<SCRIPT LANGUAGE="JavaScript">
....
</SCRIPT>
<?php } ?>
</code></pre>
<p>If i put the include in the php at the top it's ok as well.</p>
<p>thank you!</p>
| php javascript | [2, 3] |
4,396,399 | 4,396,400 | how to retrieve userId from membership users table | <p>i'm new to membership. i have a table named contact, with a field, userId that must get its data from the membership users table. so when a user is created i have to get the userId from membership users table. how can i do that?
thanx in advance</p>
| c# asp.net | [0, 9] |
546,529 | 546,530 | Breaking my javascript into modules, am I doing this right? | <p>I'm using the javascript module pattern, and have this so far:</p>
<pre><code>var APP;
if(APP == undefined) {
APP = {};
}
APP = (function() {
var userId = -1;
var privateVar = '';
var _init = function($userId) {
userId = $userId;
};
var _publicMethod = function($id){
privateVar = id;
};
return {
init = function($userId) {
_init($userId);
},
publicMethod = function($id) {
_publicMethod($id);
}
};
})();
</code></pre>
<p>I then have a common utils module:</p>
<pre><code>APP.utils = (function(){
})();
</code></pre>
<p>And then per page I am planning on having a module, so I don't wireup events (button clicks etc) for no reason on pages where these DOM elements don't event exist:</p>
<pre><code>APP.homePage = (function(){
return {
};
})();
</code></pre>
<p>So each module will have a init() method that I will call on the page to run things that have to be run (e.g. wiring up events, setting variables like say userId etc):</p>
<pre><code>$(document).ready(function() {
APP.init(<%= user.id %>);
APP.homePage.init('abc');
});
</code></pre>
<p>So now if the files get too big, I can break them out into separate files also.</p>
<ol>
<li><p>What if one module needs to call another, I guess the only way for this to work is to do this via the public api right?
e.g. what if homePage needs userId, should I pass that in the homePage#init method?</p></li>
<li><p>How is my coding style, any obvious style that is not considered best practise?</p></li>
<li>Any comments on this approach? Is it good in general?</li>
</ol>
| javascript jquery | [3, 5] |
2,177,746 | 2,177,747 | Writing a security suite | <p>Is there a way that I can integrate a pattern, say for a song tempo, into being used for access into a system?
To give more detail, if I wanted to discourage hackers from gaining access, is there a way that I can make a suite that would search the persons system covertly for a MAC address and ban that address if he/she doesn't get a certain tempo right with the keystrokes?</p>
| java javascript asp.net c++ | [1, 3, 9, 6] |
1,395,923 | 1,395,924 | Value of hidden input returns blank when it clearly isn't | <p>Why can't I get the value from this input? See the image below:</p>
<p><img src="http://i.stack.imgur.com/y5oEu.jpg" alt="enter image description here"></p>
| javascript jquery | [3, 5] |
2,422,025 | 2,422,026 | Why so many inner classes in Android? | <p>I am a new fish in Android development. While reading books and Android source code I found out that there so many inner classes in the Android application. Why does Android need so many inner classes?</p>
<p>I am confused by these inner classes.</p>
| java android | [1, 4] |
1,617,132 | 1,617,133 | does clone method in C# (or in java) use new operator internally? | <p>This was a interview question actually, about different ways to create class instances. new and reflection are well known. But clone() also creates objects. But does it internally use new keyword to create it ? This was asked in context of c#, but would also like to know about java.</p>
| c# java | [0, 1] |
1,445,178 | 1,445,179 | send fieldset values by jquery | <p>look at this code : </p>
<pre><code>[WebMethod]
public static string GetFacilities(string id)
{
int hotelid = System.Convert.ToInt32(Tools.DecryptString(id));
string ret = "";
foreach (var item in new FacilityGroupBL().Load())
{
if(item.Facilities.Count != 0)
{
ret += "<fieldset>";
if (item.Facilities.Count() != 0)
{
foreach (var subitem in item.Facilities)
{
if (subitem.HotelFacilities.Where(obj => obj.HotelId == hotelid).Count() != 0)
ret += "<input type='checkbox' checked='false' />" + subitem.Name;
else
ret += "<input type='checkbox' checked='true' />" + subitem.Name;
}
}
else
{
ret += "There is no facility in this fieldset.";
ret += "</fieldset>";
}
}
}
return ret;
}
</code></pre>
<p>by this code i load some checkboxes in a DIV,then user change some checkboxes and press the SAVE button.at this time ,i should send the values of these checkboxes to server to update my data in database.by i dont know how?:( please help</p>
<p>note: my default code for this probem is here but it does not work($("#FacilitiesDIV input[type=checkbox]").serializeArray() is empty)</p>
<pre><code>$.ajax({
type: "POST",
url: "HotelsList.aspx/SaveFacilities",
data: "{ 'id' : '" + $("#HiddenField").val() + "', 'Facilities' : '" + $("#FacilitiesDIV input[type=checkbox]").serializeArray() + "' }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
},
error: function () {
$('#dialogMessage').dialog('open');
$('#dialogMessage span').html("Operation Error");
}
});
</code></pre>
| c# jquery asp.net | [0, 5, 9] |
5,489,149 | 5,489,150 | How to write a table content to an xml? | <p>Can somebody tell me how can i write a clientside table control content to an xml on a button click . I'm using a clientside table "selectedTexts" and on save button click i need to save the table content to an xml. Please help.</p>
<pre><code> $(document).ready(function() {
$('#<%=btnSave.ClientID %>').click(function(event) {
var xml = "<schedule>";
$("#selectedColumns").find("tr").each(function() {
xml += "<data>";
xml += $(this).find("td").eq(1).html() + "\n";
xml += "</data>";
});
xml += "</schedule>";
this.isPrototypeOf(
alert(xml);
})
});
</code></pre>
<p>I managed to get the string in an xml format. How can i pass this string to my codebehind so that i can write it to an xml file. Or is it any other methods available to write it from the clientside itself?</p>
| javascript jquery asp.net | [3, 5, 9] |
1,339,640 | 1,339,641 | Replace a substring in C# | <p>I have the following string, "Last Run: 2011-10-03 13:58:54 (7m 30s ago) [status]" and I would like to replace "7m 30s" (it is not a fixed string) with another string I have generated. How can I do that with string manipulation in C#? </p>
| c# asp.net | [0, 9] |
1,090,364 | 1,090,365 | cropping and ajax uploading | <p>i want to upload profile pic like facebook and ajax upload the image and crop with the fix size
and ajax upload to server .
in jquery ,php ,</p>
<p>how can i do it ?</p>
<p>thanks
rahul </p>
| php jquery | [2, 5] |
992,209 | 992,210 | How to register Javascript function to find when HiddenField value changed? | <p>I have a page that contains a <code>HiddenField</code> control, I register some javascript on page load which contains a function I want to run when the HiddenField value has changed. </p>
<p>Currently, I have the following code which executes the function if an input field's value has changed:</p>
<pre><code>$(':input').change(function(){ pageHasBeenUpdated = true; });
</code></pre>
<p>What javascript would I need to set <code>pageHasBeenUpdated = true</code> if the value of the <code>HiddenField</code> control has been updated?</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
2,222,278 | 2,222,279 | Page does update with details from the database after i hit a button | <p>I have a code and the way it should work is,when they click on NEW CUSTOMER,it takes them to test1.php where in they enter the details and they hit submit.it saves all the details in properly in the database and when i go back and hit REFRESH ,it should come up with the customer details which they had entered in previously.
But what happens is, when i click on the REFRESH,it refreshes the same old page which is empty.I wanted to find out where am i missing the logic.Thanks in advance.
The sample code would be</p>
<pre><code><tr>
<td class="tdvisitbig" colspan="5">THIS IS A TEST</td>
</tr>
<tr>
<td class='tdvisitbig' colspan="5"><input type="button" onClick="openVisit('test1.php?id=<?=$key?>&name=<?=$name?>');return false;" value="NEW CUSTOMER" class="submit">&nbsp;<input type="button" value="REFRESH" name="add_xyz" class="submit" onClick="document.add.target='_self';document.add.action='test3.php?redirect=visit&section=test page';document.add.submit();"></td>
</tr>
<?
$q = "SELECT address,customernum,status FROM customer WHERE name='$name' ORDER BY customernum";
$r = mysql_query( $q , $Link );
while( $rw = mysql_fetch_assoc( $r ) )
{
extract( $rw );
?>
<tr>
<? } ?>
</code></pre>
| php javascript | [2, 3] |
4,877,648 | 4,877,649 | FTPClient constructor fails with latest SDK tools and ADT | <p>I have code which worked fine with previose version of SDK tools and ADT (v16). But after I updated both to v19 apache commons FTPClient constructor call cause program to crash without even throwing any exception!
Following line of code causes crash whenever I put it in my code:</p>
<pre><code>FTPClient client = new FTPClient();
</code></pre>
<p>I've tried to solve the issue by taking latest commons.net library (v3.1) but it did not help. I'm using SDK 2.2 (API 8). Any thoughts?</p>
<p>Thanks you in advance.</p>
| java android | [1, 4] |
3,689,019 | 3,689,020 | jquery: how to know an item is invisible in an aspx page? | <p>If the visible of a server side control is set to false, even I know it's id, is that possible to know that it is invisible by using jQuery? what code should I use, say the control id="test1".</p>
| jquery asp.net | [5, 9] |
866,160 | 866,161 | Hide all links except for one in javascript? | <p>What is the best way to hide all links except for one in javascript? (jquery is okay)</p>
<p>Say I have the following:</p>
<pre><code><div id="choices">
<div><a href="#">A<></div>
<div><a href="#">B</a></div>
<div><a href="#">C</a></div>
</div>
</code></pre>
<p>I want to make it such that if a user clicks link A, B, or C, the div's that do not contain the one that was selected disappear and the choice selected pops up in an alert box. Upon clicking on a reset button, all the divs appear again as normal. </p>
<p>Example: User clicks A, results in B and C divs hiding. User kicks Reset button and all show up again.</p>
<p>How do I accomplish this?</p>
<p>NOTE: I have been assigning IDs to each of the A, B, C divs respectively and made a function where when the user clicks B, it calls a $(divnotclicked).hide() for the ones I want to hide. And for the reset button I just do .show() for each of them $(A).show(), $(b) $.show()(C).show().... but theres gotta be a way to do with without me assigning IDs to each of them. Im looking for the best way to do it.</p>
<p>Im looking for the best way to do this, preferably without manually calling functions for each of them or assigning IDs to each div within the "choices" div. Or having to call on each individual div to ".show" upon clicking the Reset button.</p>
| javascript jquery | [3, 5] |
5,116,747 | 5,116,748 | lightbox description on the right of the image? | <p>i am having an issue trying to change the way the description showing, i don't want it to show below the image because the information in big, so i wanted to show beside the image but it always gives me error, i asked the support of the plug-in and i haven't got any replays i googled but with no luck, i even tried looking for another plug-in which support descriptions on the right of the image but no luck i used this plug-in</p>
<blockquote>
<p><a href="http://www.huddletogether.com/projects/lightbox2/" rel="nofollow">http://www.huddletogether.com/projects/lightbox2/</a></p>
<p><a href="http://www.sabayafrah.com/secure/" rel="nofollow">http://www.sabayafrah.com/secure/</a></p>
</blockquote>
<p>click on any image, the image well expand and the caption well show at the bottom where the user might not know, so i wanted to shift the whole caption to be on the right of the image</p>
<p>update #1
i added in the css <code>#imageDataContainer{ floating:right</code> and it did work but now i wanted to pull it up</p>
| javascript jquery | [3, 5] |
5,138,393 | 5,138,394 | Passing a PHP varible from a div tag to jquery when clicked | <p>I have a requirement to get a varible from PHP to Javascript when clicked by the user. I have an array of data returned by a query and I need to pass an ID value for the element clicked so that I can populate an additional data set via the .load using another PHP page. I am unsure how todo this?</p>
Javascript Code in Page:
<pre><code><script type="text/javascript">
$(function () {
$("#pass_userid_div").click(function () {
$("#another_div").load('remote_pages/get_info.php?userid=' + $GET_THE_USERID_AND_PASS_HERE);
});
});
</script>
</code></pre>
PHP Code in Page:
<pre><code>$query_str = "SELECT id, username, dateregistered FROM users";
$query = mysql_query($query_string) or die(mysql_error());
while ($results = mysql_fetch_array($query)) {
print "<div id='pass_userid_div'>{$results['username']}</div>";
print "<div>{$results['dateregistered']}</div>";
}
</code></pre>
| php javascript | [2, 3] |
3,812,652 | 3,812,653 | Reloading in a loop | <p>I am using this code to reload a page:</p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "window.location.reload();", true);
}
</code></pre>
<p>But it is reloading in a loop.</p>
<p>please Help.</p>
| javascript asp.net | [3, 9] |
3,730,821 | 3,730,822 | Java Dates - What's the correct class to use? | <p>So the whole Java Date/Calendar/GregorianCalendar thing is obviously a joke. What's the right Date class to use?</p>
<p><strong>Edit:</strong> Building an SDK for third parties on Android where the application needs to provide a date</p>
<p><strong>More Edit:</strong> Things that make this so obviously a joke:</p>
<ul>
<li>99% of Date is deprecated</li>
<li>Date's Year is offset from 1900</li>
<li>Date's Month is zero-indexed while day is one-indexed</li>
<li>Dates are mutable</li>
<li>You're supposed to use a Calendar to create a date...</li>
<li>... except you really have to use a GregorianCalendar
<ul>
<li>Do a significant percent of developers want to use a different calendar?</li>
</ul></li>
<li>Calendar.getTime() returns a Date</li>
<li>There's no Date math (like how far apart are two dates in years)
<ul>
<li>Messing with milliseconds since epoch doesn't count</li>
</ul></li>
<li>You can't chain parts together to get an expression (like the date one year ago today)</li>
<li>Probably more stuff</li>
</ul>
| java android | [1, 4] |
2,589,963 | 2,589,964 | Java - best way to implement a dynamic-size array of objects | <p>I am a novice with Java.</p>
<p>I have to implement an array of objects that changes in size during execution.</p>
<p>The code I am writing is going to be ported on Android, too.</p>
<p>According to your experience, what's the best class to implement that?</p>
<p>Thanks,<br>
Dan</p>
| java android | [1, 4] |
2,550,090 | 2,550,091 | Select elements text and add a comma | <p>I'm trying to get some elements in my page using the DOM: <code>$('ul li').text()</code></p>
<p>And after that (or maybe during that) I would like to add a comma. In some cases the text that I'm getting has white spaces and other characters.</p>
<p>As a result I would love to get an array like this for example <code>["first text", "second element", "third"]</code></p>
<p>What would be the easier way to do that using javascript functions or jQuery?</p>
<p>Thanks in advance for your help.</p>
| javascript jquery | [3, 5] |
3,438,235 | 3,438,236 | clickable grid view row asp.net | <p>i want asp.net gridview with its rows clickable.</p>
<p>i want to call a function when that row is clicked based on row index.</p>
<p>i tried to use RowDataBound event but it did not worked or me</p>
<p>i used the following code</p>
<pre><code>protected void PeopleGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes["onmouseover"] = "this.style.cursor='hand';this.style.textDecoration='underline';";
e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';";
e.Row.Attributes["onclick"] = ClientScript.GetPostBackClientHyperlink(this.PeopleGridView, "Select$" + e.Row.RowIndex);
}
}
</code></pre>
<p>where am i going wrong?</p>
<p>i dont want to redirect to any other page.
i want to fill the values in text box on the same page</p>
| c# asp.net | [0, 9] |
4,080,189 | 4,080,190 | What is unobtrusive JavaScript in client-side validation scripts | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4478795/what-is-unobtrusive-javascript-in-layman-terms">What is Unobtrusive Javascript in layman terms?</a> </p>
</blockquote>
<p>I refer a <a href="http://msdn.microsoft.com/en-us/library/ms171868.aspx#web" rel="nofollow">site</a> in which they mentioned as follows</p>
<blockquote>
<p>ASP.NET 4.5 includes the following new features:</p>
<ul>
<li>Support for unobtrusive JavaScript in client-side validation scripts.</li>
</ul>
</blockquote>
<p>What does "unobtrusive JavaScript" mean?</p>
| javascript asp.net | [3, 9] |
4,649,229 | 4,649,230 | How to run plain old java application on Android | <p>I want to run a Java application on Android. It does not have a user interface and embeds Jetty as a servlet containr. It implements a web application that is normally accessed online by its users but I need to run this offline on Android tablets.</p>
<p>Is this at all possible? All I have been able to find is information on how to develop Android apps. I simply want the equivalent of <code>java -jar ...</code> and any information would be welcome.</p>
| java android | [1, 4] |
4,500,027 | 4,500,028 | how to call javascript function at backend in asp.net? | <p>If I want to call a javascript function after some code has been run in backend, how to do that? I don't want to add onclientclick event in frontend. I need to run the frontend function after a certain backend code has been run. Thanks in advance.</p>
| c# asp.net | [0, 9] |
5,378,340 | 5,378,341 | Use javascript/jquery to append URL? | <p>Is it possible to use javascript/jquery to append something on the end of a url when a link is clicked?</p>
<p>For example, I have 5 tabs on a page (product.php), when I click a tab, then that tab opens. What I want to do is have the URL change to product.php#tab-3 (or whichever number tab is clicked) when you click on it.</p>
<p>The reason I am doing this is so that users will be able to bookmark the page on a specific tab.</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,807,956 | 2,807,957 | Appending to Second Last element | <p>This is the final output
<img src="http://img2.pict.com/cc/dc/64/3257730/0/20100330041140.png" alt="Output"></p>
<p>My HTML</p>
<pre><code><li id='$id'>TEXT
<ul class='indent'>
<li id='$id'>TEXT</li>
<li id='$id'>TEXT</li>
<li class='formContainer'> FORM </li>
</ul>
</li>
</code></pre>
<p>I want to append a <code>li</code> between <code>form</code> after all other <code>li</code> So in this example new li will be appended between <code>Test141</code> APPEND <code>Input Box</code></p>
<p>The <code>$id</code> are db ids of li which are unique</p>
| javascript jquery | [3, 5] |
2,375,136 | 2,375,137 | dynamically creating div with dynamic content | <p>I want to Create div dynamically with unique id.. base on id we need to get values form the database ..but here can get id but divTag.innerHTML=
not getting id to execute my sql query
please help me out
thanks in adnvce</p>
<p>
</p>
<pre><code>.dynamicDiv {
width:200px;
height:100px;
border:solid 1px #c0c0c0;
background-color:#e1e1e1;
font-size:11px;
font-family:verdana;
color:#000;
padding:5px;
}
.dynamicDiv{ float:left;}
</style>
<script type="text/javascript" language="javascript">
function createDiv($id)
{
var id =$id;
var divTag = document.createElement("div");
var id =$id;
divTag.id = "div1";
divTag.setAttribute("align","center");
divTag.style.margin = "100px auto";
divTag.className ="dynamicDiv";
divTag.innerHTML = "<?php $sql =mysql_query("SELECT * FROM TABLE WHERE ID='$id'");
$res = mysql_fetch_array($sql);
print_r($res);
?>";
document.body.appendChild(divTag);
}
</script>
</head>
<body style="float:left;">
<div style="float:left;">
<b>Click this button to create div element dynamically</b>
<input id="btn1" type="button" value=
"create div" onClick="createDiv('<?php echo rand(); ?>');" />
</code></pre>
<p>
</p>
| javascript jquery | [3, 5] |
1,447,366 | 1,447,367 | Python's equivalent of $this->$varName | <p>In PHP I can do the following:</p>
<pre><code>$myVar = 'name';
print $myClass->$myVar;
// Identical to $myClass->name
</code></pre>
<p>I wish to do this in Python but can't find out how</p>
| php python | [2, 7] |
4,090,406 | 4,090,407 | 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] |
3,608,929 | 3,608,930 | performItemClick in another view | <p>In my app i have two 10x10 grids which have different adapters. When i click on item on the first grid it should change graphic on both first and second grid.</p>
<pre><code>battleField = (GridView) findViewById(R.id.gridView1);
battleField2 = (GridView) findViewById(R.id.gridView2);
battleField.setAdapter(new ImageAdapter(getApplicationContext()));
battleField2.setAdapter(new ImageAdapter2(getApplicationContext()));
battleField2.setEnabled(false);
battleField.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view1, int position, long id) {
Toast.makeText(SendobjectActivity.this, "" + position, Toast.LENGTH_SHORT).show();
ImageView img = (ImageView)view1;
img.setImageResource(R.drawable.trafiony1);
//HERE IS THE PROBLEM
battleField2.performItemClick(view2, position, id);
}
});
battleField2.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view2, int position, long id) {
Toast.makeText(SendobjectActivity.this, "" + position, Toast.LENGTH_SHORT).show();
ImageView img2 = (ImageView)view2;
img2.setImageResource(R.drawable.trafiony2);
}
});
</code></pre>
<p>I implemented onItemClickListener for both grids. When an item on the first grid is clicked it's graphic changes and id like to call performItemClick method to do the same on second grid. Unfortunetly i dont know how to get view of my second grid. Any ideas?</p>
| java android | [1, 4] |
1,575,824 | 1,575,825 | prevent form submission if validation failed after iterating over each form element with jquery's .each() function | <p>I have the following code in which I'm trying to iterated over html text input elements, do some validation and prevent the form submission if the validation fails:</p>
<pre><code>$("#the_form").submit(function(){
$(":text", this).each(function(){
if($(this).val().length != 0)
{
var str = $(this).val();
str = $.trim($(this).val());
$(this).val(str);
if($(this).val().length < 4)
{
alert("You should enter at least 4 characters");
$(this).focus();
return false;
}
}
}) // end of each() function
return true;
})
</code></pre>
<p>If I remove the .each() function and do each element separately (which obviously is not a very good approach), I get the results wanted. However, if I use the code as it is, the form keeps on submitting even if the user has not entered at leas four characters. Any ideas on what I may be doing wrong here? Any help will be very appreciated. Thanks in advance.</p>
| javascript jquery | [3, 5] |
4,184,153 | 4,184,154 | combobox with checkbox and a Filter in a web solution | <p>I want to do a combobox, but my user can select more than one option, so, it will be usefull if I do a combobox with Checkbox.</p>
<p>But this combobox with checkbox is bound from my database, so I need to put a filter inside the combobox with checkbox.</p>
<p>How can I do that via Jquery, or ASP.NET/C# ?</p>
<p>I tryied <a href="http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/" rel="nofollow">this one</a> but I need to put a filter.</p>
| javascript jquery asp.net | [3, 5, 9] |
4,669,726 | 4,669,727 | JS/JQuery: I'm trying to move an li node under the one it matches | <pre><code>$(document).ready(function() {
var a = $("li.comment").attr("id");
var b = $("li.comment[id='"+a+"']");
var c = $("li.comment > div.comment-body div > p > a").attr("href");
var d = $("li.comment > div.comment-body div > p > a[href='"+c+"']");
var e = new RegExp("[#+'+b+']b")
if (d===e) {
d.parent().append(a);};
};)
</code></pre>
<p>If <code>d</code> matches <code>b</code>, I'm trying to move <code>d</code> (starting from the <code>li</code> node) to right under <code>b</code> who's id it matches. I can't figure it out. </p>
<p>Sample:</p>
<pre><code><li id="wow" class="comment">
<div class="comment-body">
<div>
<p>Any comments?</p>
</div>
</div>
</li>
<li id="rebble" class="comment"><div class="comment-body"><div><p>Wakatow</p></div></div></li>
<li class="comment" id="det">
<div class="comment-body">
<div>
<p>
<a href="#wow">Yeah! Hold on a sec...</a>
</p>
</div>
</div>
</li>
</code></pre>
<p>I'm trying to work it out on jsfiddle, but I can't get it done. When it comes out right, the <code>li</code> with the link is supposed to move under the first one</p>
| javascript jquery | [3, 5] |
4,270,650 | 4,270,651 | Where do I put the $(document).ready()? | <p>I've been trying to add JavaScript to my HTML/CSS, but been running around in circles.</p>
<p>My current set-up is where the html, CSS, and JavaScript files (2 files; my JavaScript code, and jQuery's code) are all separate, but linked to each other via the html page. </p>
<p>So here are my questions:</p>
<p>1) Do I put the link to the jQuery code within the html head? Or within my JavaScript code page?</p>
<p>2) Where does this code go? The html page, or my JavaScript page?</p>
<pre><code>$(document).ready(function(){
//Code here
});
</code></pre>
<p>3) Above, by 'code here', they mean JavaScript code, right? Not my html code?</p>
<p>4) I've read about initializing JavaScript code at the bottom of an html page. From what I take though, I don't have to do that with jQuery's .ready function, right?</p>
| javascript jquery | [3, 5] |
5,652,544 | 5,652,545 | How to echo a variable from jquery POST to another page | <p>How to use the a variable that is posted from page1 to page2 from jquery.I am using the following scenario</p>
<pre><code>page1.php
if ( this.checked ) {
$.ajax({
url: 'page2.php',
type: "POST",
data: ({name: 145}),
success: function(data){
//$("#result").html(data);
}
});
}
</code></pre>
<p>This is not working why,if i separatly opens a page2.php and wants further usage of the post data</p>
<pre><code> Page2.php
<?php
$userAnswer = $_POST['name'];
if ($_POST['submit']){
echo $userAnswer;
}
?>
<form method="post" action="page2.php">
<input type="submit" value="submit" name="submit" />
</form>
</code></pre>
<p>if i open page2.php and presses the submit button,the posted value from page1 is not displaying</p>
| php jquery | [2, 5] |
3,645,402 | 3,645,403 | How can I test if an element is already visible? | <p>In the HTML code, I use jQuery to hide or display an element having an ID. How can I test if an element is already visible?</p>
<p>For example, we use <code>show()</code> to display an element having an ID. But before calling <code>show()</code>, I need to test whether <code>show()</code> has been already used for that ID then how to compare?</p>
| javascript jquery | [3, 5] |
1,281,247 | 1,281,248 | ASP.NET button-click, using jQuery on a server control | <p>When you attach a client-side click event via jQuery to an ASP.NET button do you then lose the ability to do a postback? I merely need to do some jQuery prior to the server-side stuff happening and it seems to be interrupting this process. </p>
<pre><code> $('[id$="btnDisableAlarms"]').click(function () {
var commentValue = $('[id$="txtComment"]').val();
if (commentValue == "") {
// add red border (CSS)
$('[id$="txtComment"]').addClass("redCommentError");
}
return;
});
</code></pre>
<p>The button is wired up with a click event but the browser doesn't budge.</p>
<pre><code> btnDisableAlarms.Click+=new EventHandler(btnDisableAlarms_Click);
public void btnDisableAlarms_Click(object sender, EventArgs e)
{
Response.Write("Still able to manage a postback from server");
}
</code></pre>
| jquery asp.net | [5, 9] |
1,490,719 | 1,490,720 | How to use a session variable or cookies | <p>I have a main page with a large list of companies, I have a search button and if I want to find a company by state or city I can filter my search.</p>
<p>I decide to filter my search by cities, lets say Chicago, and I get 10 companies as a result of my search.</p>
<p>I click any company in that list and I go to the company details but I realize that is not the one I am looking for, so I want to go back to my 10 companies result list but instead I go back to the main company search interface and I have to re-start my search again.</p>
<p>How to use a session variable or cookies for this case?</p>
<p>Somebody can help me with this?</p>
| c# asp.net | [0, 9] |
2,247,023 | 2,247,024 | image button doesn't work correctly in datalist | <p>i have an image button in datalist to open a new page to send mail, but when i click on it for the first time , it doesn't work , it works when click for the second time , i use update panel inside datalist . here's the code </p>
<pre><code><asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:ImageButton ID="ImgBtnMail" runat="server" ImageUrl="../../../../Icons/Send-Email.jpg"
Width="22" Height="18" CommandName="DoMail"
CommandArgument='<%#DataBinder.Eval(((System.Web.UI.WebControls.DataListItem)(Container)).DataItem, "AdID")%>' />
</ContentTemplate>
</asp:UpdatePanel>
</code></pre>
<p>and the code behind :</p>
<pre><code> protected void DLAds_ItemCommand(object source, DataListCommandEventArgs e)
{
if(e.CommandName=="DoMail")
{
string TargetPage = "window.open('SendMail.aspx?',null,'height=150, width=150,left=500 ,top=300 ,status= no, resizable= no, scrollbars=no, toolbar=no,location=no,menubar=no ');";
ImageButton MailBtn = (ImageButton)e.Item.FindControl("ImgBtnMail");
MailBtn.Attributes.Add("onclick", TargetPage);
}
}
</code></pre>
| c# asp.net | [0, 9] |
3,866,831 | 3,866,832 | Switching xml string files | <p>I am working on a bilingual app menu. I am currently at a dilemma on how I would be able to switch the languages easy. At first I thought I could use String.xml file to store the data passed out in English then later on Chinese and just switch xml string file for a chinese menu but the String.xml can only use a unique name ID.</p>
<p>Is there any other way of doing this? In which I can create another string array and call it instantly like String.xml?</p>
<p>Any suggestions would be greatly appreciated, I am always willing to listen and get better if what I put down was no appropriate.</p>
| java android | [1, 4] |
5,789,954 | 5,789,955 | Load javascript before rendering page? | <p>I want to run some jquery code before my page have loaded. Im adding some classes which are changing the css with javascript, and when the page loads i see the "old" css for a short time. Any ideas? Thanks</p>
| javascript jquery | [3, 5] |
3,646,733 | 3,646,734 | Convert Base64 String to ImageView | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5441761/convert-base64-string-to-imageview">Convert Base64 String to ImageView</a> </p>
</blockquote>
<p>I have a byte that i get from base64.decode method</p>
<p>when i buil a bitmap to use in a imageview?</p>
| java android | [1, 4] |
3,502,320 | 3,502,321 | Post Form After Server Code Execution | <p>I have created a Webform which will be posted to another Webform after executing the server side code(C#).</p>
<p>I want to execute server code and based on the result of that I want to post the Webform to another Webform otherwise Webform should not be posted.</p>
<p>So, What should i do to achieve the above result?</p>
<p>Thanx in advance.</p>
| c# javascript asp.net | [0, 3, 9] |
5,984,806 | 5,984,807 | iterate through class, creating a serializeable object | <pre><code>public partial class VALUES
{
public struct Status
{
public const long Registered = 5;
public const long Active = 6;
}
}
</code></pre>
<p>I would like to dynamically create an anonymous object which i can serialize to JSON based on this class. Is there any way to iterate through the properties of the class above, to create something like this:</p>
<pre><code>new JavaScriptSerializer.Serialize(new {
Values = new
{
Status = new
{
Registered = VALUE.Status.Registered,
Active = VALUE.Status.Active,
},
} ....
</code></pre>
<p>Not sure if the code above compiles, just wanted to give you an idea of what im trying to achieve. Instead of mapping each value manually i would like to create the values dynamically. Thanks</p>
| c# javascript asp.net | [0, 3, 9] |
1,039,211 | 1,039,212 | Getting value from preferences? | <p>I have one check box in preferences and I get value</p>
<pre><code>SharedPreferences myPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
</code></pre>
<p>my check box from preferences is checked by default and I'm using this</p>
<pre><code>if(myPreferences.getBoolean("checkbox", false) == true)
</code></pre>
<p>to check if user change check box state. If condition from above is true I'll get notification in status bar(I will not present code for notification and service).
So, my problem is that I'm not getting notification until I click on preferences, then finally my PreferenceManager get value from check box and my notification trigger.
How can I fix that?
Thanks, Wolf.</p>
| java android | [1, 4] |
5,664,462 | 5,664,463 | Android posting to Twitter | <p>I have seen that there are a few good libraries out there. These seem to come with all the bells and whistles.</p>
<p>My application only needs to post a status update to a twitter account. Each time the user would have to enter their details. This is not the major part of my app, so I was wondering if there are any condensed libraries or simpler ways to achieve this without including all of the features that come with larger libraries.</p>
<p>Any advice greatly appreciated.</p>
| java android | [1, 4] |
3,170,468 | 3,170,469 | Error in populating data when there are no existing records. ASP.NET C# | <p>I have two DropDownLists and one ListBox namely: ddlYearLevel, ddlSubjects, and lstStudents.</p>
<p>The ddlSubjects and lstStudents are dependent on ddlYearLevel because I set the codes like this</p>
<pre><code>protected void ddlYearLevel_SelectedIndexChanged(object sender, EventArgs e)
{
PopulateSubjects(int.Parse(ddlYearLevel.SelectedItem.Value));
PopulateStudent(int.Parse(ddlSubjects.SelectedValue),
int.Parse(ddlYearLevel.SelectedValue));
}
</code></pre>
<p>If I have existing records of Subjects for the selected YearLevel, then there's no problem.</p>
<p>But when I have no existing records of Subjects, that's the time the error appears stating "Input String was not in a correct format".</p>
<p>My problem is, how can I set the value to null if there are no records?</p>
<p>FYR:</p>
<pre><code>private void PopulateSubjects(int yearLevel)
{
con1.Open();
SqlCommand com = new SqlCommand();
com.Connection = con1;
com.CommandType = CommandType.Text;
com.CommandText =
"SELECT Subjects.SubjectID, Subjects.SubjectCode, Subjects.YearID " +
"FROM Subjects WHERE Subjects.YearID = " + yearLevel;
SqlDataReader data = com.ExecuteReader();
if (data != null)
{
ddlSubjects.DataSource = data;
ddlSubjects.DataValueField = "SubjectID";
ddlSubjects.DataTextField = "SubjectCode";
ddlSubjects.DataBind();
}
else
lblAdd.Text = "No records found!";
data.Close();
con1.Close();
con1.Dispose();
}
private void PopulateYearLevel()
{
con5.Open();
SqlCommand com = new SqlCommand();
com.Connection = con5;
com.CommandType = CommandType.Text;
com.CommandText =
"SELECT * FROM YearLevels";
SqlDataReader data = com.ExecuteReader();
ddlYearLevel.DataSource = data;
ddlYearLevel.DataValueField = "YearID";
ddlYearLevel.DataTextField = "YearLevel";
ddlYearLevel.DataBind();
data.Close();
con5.Close();
con5.Dispose();
}
</code></pre>
| c# asp.net | [0, 9] |
1,374,884 | 1,374,885 | min and max jQuery character counter | <p>There are many max character counters in jQuery.</p>
<p>Has anyone found any useful <em>min</em> character counters?</p>
<p>I'm looking for something like what StackOverflow uses when creating a comment: </p>
<p><img src="http://i.stack.imgur.com/PHSzl.png" alt="n chars to go"></p>
| javascript jquery | [3, 5] |
4,674,924 | 4,674,925 | Add simple text to panel control | <p>I have a panel in C#:</p>
<pre><code> Panel aspPanel = new Panel();
Button aspbutton = new Button();
aspbutton.Text = "Download PDF";
aspbutton.Click += initDownload;
aspPanel.Controls.Add(aspbutton);`
</code></pre>
<p>I have added Attributes and buttons and all kinds of cool dynamic stuff. But I want to just add simple text and so far am unsuccessful.</p>
<p>I'm looking for how to add text behind the button. In the end the HTML code would render something like:</p>
<pre><code> <input type="button"/> Hello, this is a button, please click
</code></pre>
<p>Can someone point me in the right direction?</p>
| c# asp.net | [0, 9] |
1,724,038 | 1,724,039 | Setting header when user clicks on a link | <p>I would like to ask whether it is possible to set request header when user clicks on a link?</p>
| php javascript | [2, 3] |
5,763,125 | 5,763,126 | Two conditionals inside an if statement (jQuery) | <p>I'm trying to add an if statement which checks if the image is wider than 199px and if it hasn't got a < a > parent element.
<strong>This works:</strong></p>
<pre><code> $('div.post_body').each(function() {
$(this).find('img').each(function () {
var img = $(this);
if (img.is('a') !== true) {
img.wrap($('<a/>').attr('href', img.attr('src')).addClass('lightview limg'));
}
});
});
</code></pre>
<p><strong>This works</strong></p>
<pre><code> $('div.post_body').each(function() {
$(this).find('img').each(function () {
var img = $(this);
if (img.width() > 199) {
img.wrap($('<a/>').attr('href', img.attr('src')).addClass('lightview limg'));
}
});
});
</code></pre>
<p><em><strong>This DOESN'T work:</em></strong></p>
<pre><code> $('div.post_body').each(function() {
$(this).find('img').each(function () {
var img = $(this);
if ((img.width() > 199) && (img.is('a') !== true)) {
img.wrap($('<a/>').attr('href', img.attr('src')).addClass('lightview limg'));
}
});
});
</code></pre>
<p>Can someone help please?</p>
| javascript jquery | [3, 5] |
318,681 | 318,682 | Can this 2-liner jquery be shortened to 1 line? | <p>I have these divs, each have the same class <code>.onediv</code> and distinct ids <code>div1, div2, div3</code></p>
<pre><code><div class="alldivs">
<div class="onediv" id="div1">
</div>
<div class="onediv" id="div2">
</div>
<div class="onediv" id="div3">
</div>
</div>
</code></pre>
<p>I want to use jquery to change their css <code>display</code> property so that all of them are <code>display none</code> except <code>id=div2</code> which is <code>display block</code>. Right now I'm doing it this way with 2 lines. Is there a quicker way to do the same thing with one line only?</p>
<pre><code>$('.onediv').css('display', 'none');
$('#div2').css('display', 'block');
</code></pre>
| javascript jquery | [3, 5] |
4,477,828 | 4,477,829 | Why do we need to use img tag only? | <pre><code>$("<img src="+url+">").appendTo($("body"));
</code></pre>
<p>Why don't use remaining tags?</p>
| javascript jquery | [3, 5] |
1,728,673 | 1,728,674 | Jquery - Truncate Text by Line (not by character count) | <p>I need a Jquery script to truncate a text paragraph by line (not by character count).</p>
<p>I would like to achieve an evenly truncated text-block. It should have a "more" and "less" link to expand and shorten the text paragraph. My text paragraph is wrapped in a div with a class, like this:</p>
<pre><code><div class="content">
<h2>Headline</h2>
<p>The paragraph Text here</p>
</div>
</code></pre>
<p>The closest solution i could find on SOF is the one below (but it`s for textarea element and does not work for me):
<a href="http://stackoverflow.com/questions/556767/limiting-number-of-lines-in-textarea">Limiting number of lines in textarea</a></p>
<p>Many thanks for any tips.
Ben</p>
| javascript jquery | [3, 5] |
2,318,434 | 2,318,435 | Add an animation to jQuery scrolling sidebar | <p>I am using a scrolling sidebar function in jQuery and would like to add an animation to the transition. How do I edit my code to apply an animation to smooth the transition when scrolling up and down on the page?</p>
<p>Here is my <a href="http://jsfiddle.net/cearnhart/4VbDN/5/" rel="nofollow">FIDDLE</a></p>
<p>Here is my js:</p>
<pre><code>$(function() {
var $blah = $("#blah"),
$window = $(window),
offset = $blah.offset();
$window.scroll(function() {
if ($window.scrollTop() > offset.top) {
$blah.css('top','120px');
} else {
$blah.css('top','440px');
}
});
});
</code></pre>
<p>Here is my CSS:</p>
<pre><code>#blah {
display:none;
top: 320px;
right: 30px;
position: fixed;
margin: 0 20px 0 20px;
padding: 0px !important;
}
</code></pre>
| javascript jquery | [3, 5] |
3,016,765 | 3,016,766 | Locale country Android ISO | <p>What give you this in return</p>
<pre><code>getSimCountryIso()
</code></pre>
<p>Returns for USA for example "USA" "US" or something else?</p>
| java android | [1, 4] |
1,707,187 | 1,707,188 | Checking if any input or textarea element in the page is not empty | <p>I'm adding a mechanism in my website that's supposed to warn users whenever they are about to close a page they were working in. I'm binding a function <code>dropDraftConfirmation</code> to the <a href="https://developer.mozilla.org/en-US/docs/DOM/window.onbeforeunload" rel="nofollow"><code>window.onbeforeunload</code></a> event, like this:</p>
<pre><code>window.onbeforeunload = dropDraftConfirmation;
function dropDraftConfirmation()
{
if (<there is an input or textarea element not empty on the page>) {
alert('Your changes will be lost. Are you sure you want to exit the page?');
}
}
</code></pre>
<p>But this is called every time I close a page. So my question is, how to detect if there is an input or textarea element in the page that is <em>not</em> empty? I'm using <a href="http://jquery.com/" rel="nofollow">jQuery</a> by the way.</p>
| javascript jquery | [3, 5] |
1,634,638 | 1,634,639 | Javascript and overlaying an image on a div | <p>I have my code setup to overlay this div on an image when hovering, but then if the image is too big, i use a function to scale the image down and to scale down everything else according, but then the overlay image is moved all the way to left how can i scale it and not have it move?
my css code and the javascipt just changes the width and height</p>
<pre><code>#exif_data{
position:absolute;
z-index:2;
color:white;
background-color: black;
text-align: center;
margin-left: auto;
margin-right: auto;
opacity:0.6;
filter:alpha(opacity=60);
}
#image{
border: none;
z-index:1;
}
#content{
position:relative;
margin-left: auto;
margin-right: auto;
margin-top: 5.7%;
text-align: center;
}
</code></pre>
| javascript jquery | [3, 5] |
3,572,280 | 3,572,281 | jQuery data() may change elements that were not in the selector? | <p>It seems jQuery data can link data to multiple elements. In the example below, both elements get both properties, although it would appear that it should only affect the <code>#one</code> element.</p>
<p>I assume this is expected behavior in jQuery, since it's changing an object?</p>
<pre><code><div id="one" class="thing"></div>
<div id="two" class="thing"></div>
<div id="three" class="thing"></div>
<script>
jQuery(function($) {
$('.thing').data('obj',{a:'a'});
$('#one').data('obj',$.extend($('#one').data('obj'),{one:'one'}));
//Display:
for (i in $('#one').data('obj')) {
alert(i+' in obj.');
}
for (i in $('#two').data('obj')) {
alert(i+' in obj.');
}
})
</script>
</code></pre>
<p>JSFiddle:</p>
<p><a href="http://jsfiddle.net/qFZ6y/" rel="nofollow">http://jsfiddle.net/qFZ6y/</a></p>
<p>I know initializing with .each() function to set individual datas solves this problem, but would this be considered a bug in javascript or jQuery??</p>
| javascript jquery | [3, 5] |
195,698 | 195,699 | How to execute PHP code from within javascript escape/unescape? | <pre><code> <Script Language='Javascript'> <!-- document.write(unescape('<?php if ( ! defined('PROJECTNAME')) exit(''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </body> </html> ')); //--> </Script>
</code></pre>
<p>I did not copy paste the whole code. There is more PHP code within the javascript. How to make the browser understand that the php code is php and not treat it as a part of a html code?</p>
<p>EDIT:</p>
<p>Someone I know is asking me to make it hard for bots/novice users to steal source code. Please don't ask me why. </p>
<p>Now, to appease that person I tried encoding and it worked beautifully.
Converting everything into %C%22%2F</p>
<p>Now the problem is that it contains php code and that is being encoded. Now if only it took variables from the url and worked like how php should work, then everything will be perfect. </p>
| php javascript | [2, 3] |
5,721,901 | 5,721,902 | javascript regex test() function gives always true | <p>In javascript i am using the following regular expression to check whether the input string is 6 characters long and it should contains only alphabets and digits, </p>
<pre><code>var name = "a";
if(/[0-9a-zA-Z]{6,}/.test(name))
{ }
</code></pre>
<p>But this gives always true. Whats the problem ?</p>
| javascript jquery | [3, 5] |
2,230,789 | 2,230,790 | I don't understand what return does in programming? | <p>The question basically says it all. I'm a noob so make it gentle.</p>
| java c++ | [1, 6] |
2,805,460 | 2,805,461 | Python web client programming library | <p>I am working on a client-server simulation software. And I want the client to be implemented on the web, and also require that the client can do computations like matrix multiplication, random number generation etc., which framework can I use? And also I hope that the client side and server side communicate using simple socket, because the server code is implemented with c++. Any suggestions are really appreciated!! </p>
<p>Thanks </p>
<p>Simon </p>
| c++ python | [6, 7] |
4,796,169 | 4,796,170 | How to do a Proper Escape of this Function? | <p>I have a <code>DIV</code> tag generated from jQuery that goes like this:</p>
<pre><code>$('#results')
.append('<DIV id='
+ A.pid
+ ' onmouseover=function(){google.maps.event.trigger(marker, 'mouseover');};><H3>'
+ A.name
+ '</H3></DIV>');
</code></pre>
<p>Firebug is giving me an error "<strong>missing ) argument after list</strong>" as it does not recognise the <code>)</code> immediately after <code>'mouseover'</code>.</p>
<p>Doing a <code>\'mouseover\'</code> produces a syntax error upon mouseover of the <code>DIV</code>. The syntax error reads: <strong>function(){google.maps.event.trigger(marker,</strong>
and a look at the generated DIV shows:</p>
<pre><code><div id="1" 'mouseover');};="" onmouseover="function(){google.maps.event.trigger(marker,">
</code></pre>
<p>Doing a <code>"mouseover"</code> produces a <strong>blank</strong> document.</p>
<p>How do I do a proper escape for this function?</p>
<p><strong>UPDATE:</strong></p>
<p>This should work:</p>
<pre><code>$('#results')
.append('<DIV id='
+ A.pid
+ ' onmouseover=\"function(){google.maps.event.trigger(marker, \'mouseover\');};\"><H3>'
+ A.name
+ '</H3></DIV>');
</code></pre>
<p>I need to put escaped double quotes for the function and escaped single quotes for the argument.</p>
| javascript jquery | [3, 5] |
3,603,963 | 3,603,964 | asp:Button inside asp:hyperlink does not navigate to page in internet explorer | <p>I have an asp:button which is inside an asp:hyperlink. When you click the button in firefox, it goes to the correct url specified by the asp:hyperlink, but if you click the button in internet explorer, it stays on the same page. I am just using the PostBackUrl property on the button to resolve the issue, but here is an example of the code:</p>
<pre><code><asp:Hyperlink ID="hyp" runat="server" NavigateUrl="Page2.aspx">
<asp:Button ID="btn" runat="server" Text="Submit" /></asp:Hyperlink>
</code></pre>
<p><strong>Why does the above work in firefox, but not IE?</strong></p>
| c# asp.net | [0, 9] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.