Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
3,798,614 | 3,798,615 | Change direction of animation | <p>I am using this cloud effect <a href="http://solidgiant.com/2011/02/awesome-cloud-effect/" rel="nofollow">http://solidgiant.com/2011/02/awesome-cloud-effect/</a> but i want to change the direction of the cloud movement. i want them to move right to left, Can anyone help me with this</p>
<p>i am done with the change in direction as told by Nishchay Sharma, but still one problem is there, the clouds doesnt run in loop.. they just gte stuck when they reach left side :(</p>
| javascript jquery | [3, 5] |
3,476,738 | 3,476,739 | two JS variables refer to same Json object how to keep one constant? | <p>I have </p>
<pre><code> $.getJSON('json.ashx?mode=Gender', function (data) {
memberInfo = data[1];
options.series = data;
originalData = data[0];
...
...
});
</code></pre>
<p>which returns</p>
<pre><code>[
{"type" : "pie","name" : "Gender",
"data" : [["Male",32],["Female",11]]},
{"A123":"F","A223":"M","A423":"F","A332":"M","B327":"F"}
]
</code></pre>
<p>and</p>
<pre><code> function calcOptionsData() {
...
var maleCount = 0;
var femaleCount = 0;
...
...
$.each(val, function(index, item) {
if (memberInfo[item] == 'M')
maleCount += 1;
if (memberInfo[item] == 'F')
femaleCount += 1;
});
options.series[0].data[0][1] = originalData.data[0][1];
options.series[0].data[1][1] = originalData.data[1][1];
if (radioBttnClicked == 'Gender')
{
options.series[0].data[0][1] += maleCount;
options.series[0].data[1][1] += femaleCount;
}
}
</code></pre>
<p>I want every times the calcOptionsData() called the originalData resets the options.series[0].data to the value originally generated from the getJSON. The current code mirrors originalData with options.series[0].data.</p>
<p>Thanks,</p>
| javascript jquery | [3, 5] |
5,566,950 | 5,566,951 | C# display pdf document in iframe in asp.net page | <p>how can i display pdf document in iframe in c# web page:i have a drowpdownlist linked with pdf files,what i need is when i select one item from this list ,iframe will populated with the corresponding pdf document</p>
| c# asp.net | [0, 9] |
4,090,448 | 4,090,449 | Android: Create a new class? Or can I use the current Activity? | <p>Really I guess I am looking for a best practice answer. I like to leave applications with the lightest amount of code possible and the least amount of repeated code especially. I have a few Android applications that I have created. My question is, if I create a new Activity which in turn also needs a class to be created of a similar name, should I create the class separate or is there some way that I can keep the class that extends the Activity already? </p>
<p>Here is an example, lets say I want to create a small activity that is related to Pinging an Address. I could implement Parcelable on that Activity and use my Activity as a data holder Class. </p>
<pre><code>public class PingAddress extends Activity implements Parcelable{
public String Scan;
public String ScanName;
public String IpAddress;
public String Timeout;
public String NumberOfPings;
public PingAddress() {
}
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
}
</code></pre>
<p>What I have been doing is just creating the activity and then creating a separate class, using the example above, called PingAddressData, here is an example of that class.</p>
<pre><code>public class PingAddressData implements Parcelable{
public String Scan;
public String ScanName;
public String IpAddress;
public String Timeout;
public String NumberOfPings;
public PingAddress() {
}
</code></pre>
<p>Again, I am really looking for best practice here with Android. Does anyone know of repercussions that I would run into if I just implemented Parcelable on an Activity? My main objective is to cut down on code pages. I created a separate Package just to store all of the data classes in that I created, but were really a representation of that Activity.</p>
<p>Thanks</p>
| java android | [1, 4] |
1,388,352 | 1,388,353 | find the textfield which has got maximum value-jquery | <p>I have 5 input text fields on 5 rows . where all 5 textfields are optional .i want to get the id of the text field which has got maximum value </p>
<pre><code><div class="dt_distance_slab">
<g:textField class ="number distanceSlab1" name="distanceSlabCost1" id = "distanceSlabCost1" value=""/>
</div>
<div class="dt_distance_slab">
<g:textField class ="number distanceSlab2" name="distanceSlabCost2" id = "distanceSlabCost2" value=""/>
</div>
<div class="dt_distance_slab">
<g:textField class ="number distanceSlab3" name="distanceSlabCost3" id = "distanceSlabCost3" value=""/>
</div>
<div class="dt_distance_slab">
<g:textField class ="number distanceSlab4" name="distanceSlabCost4" id = "distanceSlabCost4" value=""/>
</div>
<div class="dt_distance_slab">
<g:textField class ="number distanceSlab5" name="distanceSlabCost5" id = "distanceSlabCost5" value=""/>
</div>
</code></pre>
<p>i have done a validation that input fields will aceept only numbers and values should be in ascending order.</p>
| javascript jquery | [3, 5] |
2,824,063 | 2,824,064 | create persistent connection | <p>In my android application I am trying create persistent connection for downloading images. Here is my code </p>
<pre><code> public class PersActivity extends Activity {
ImageView img;
String imageUrl="http://192.168.1.4/JRec/";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button bt3= (Button)findViewById(R.id.download);
bt3.setOnClickListener(getImgListener);
img = (ImageView)findViewById(R.id.image);
}
View.OnClickListener getImgListener = new View.OnClickListener()
{
@Override
public void onClick(View view) {
for (int i = 0; i<4;i++){
downloadFile(i,imageUrl+"images/"+i+".png");
}
}
};
Bitmap bmImg;
void downloadFile(int i, String fileUrl){
URL myFileUrl =null;
try {
myFileUrl= new URL(fileUrl);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
System.out.println("Opening connection");
HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
conn.setRequestProperty("Connection", "keep-alive");
conn.setDoInput(true);
conn.connect();
System.out.println("Downloading"+fileUrl);
InputStream is = conn.getInputStream();
bmImg = BitmapFactory.decodeStream(is);
img.setImageBitmap(bmImg);
if (i ==3){
System.out.println("Disconnected");
conn.disconnect();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
</code></pre>
<p>When I start download the file every time it should open connection for download, I want to open connection only one time and when the application end downloading all files the connection must be disconnected. Is there any way to do this. </p>
<p>Thanks anyone who get attention on this.</p>
| java android | [1, 4] |
1,479,329 | 1,479,330 | How to get object values and properties in jquery? | <p>I am using jQuery selector to get the values of all CMS components on the page using <code>$('div.cmscomponent')</code> but how can I test this to see if am actually getting the list of compoents on the page. </p>
<p>I use:</p>
<pre><code>var temp = $('div.cmscomponent');
alert(temp);
</code></pre>
<p>and result that I get is [object OBJECT] and so how can I test this ? and how can I get values of the object and its properties.</p>
| javascript jquery | [3, 5] |
4,676,498 | 4,676,499 | Faster Alternative to MD5 in JavaScript or JQuery | <p>I often code in PHP and for caching I like to use the md5 of a particular request (ie an sql statement) as the name of my cache key. md5 gives me a pretty string that is unique and thus, the reason why I use it.</p>
<p>Now, I am trying to implement some caching at the browser level using JQuery. It is for an address verifier form. To reduce the number of ajax calls I was thinking of turning the given address into a unique string that I could use as a key in an array.</p>
<p>Now I know there are plenty of JS MD5 solutions out there, but I was curious to know if JS or even JQuery have something native that I could use. Something like md5 or base64Encode.</p>
| javascript jquery | [3, 5] |
2,580,945 | 2,580,946 | For a DIV with scrollbars, is it possible to make that div scroll all the way to the bottom, using JQuery? | <p>How would you do that using JQuery?</p>
| javascript jquery | [3, 5] |
1,762,116 | 1,762,117 | Dynamically created checkbox checkedchanged event issue | <p>My issue is that i need to create checkboxes dynamically on a textchanged event of a textbox which are all checked and keeping their checked state count in an int variable assiging it to a label; till here all is successfully done but the problem is now if i uncheck any of the checkboxes i want their count to get decreased by one but the checkchanged event is not firing and by unchecking any of the checkboxes all are gone...
here is my code:</p>
<pre><code> if (DDLType.SelectedItem.Text == "Sick Leave")
{
DateTime f = DateTime.Parse(txtFrom.Text);
DateTime t = DateTime.Parse(txtTo.Text);
double daydiff = (t - f).TotalDays;
double p = daydiff;
for (int i = 1; i <= daydiff; i++)
{
string a = f.ToString("ddd");
chklist = new CheckBox();
chklist.AutoPostBack = true;
chklist.CheckedChanged += new EventHandler(CheckChanged);
chklist.ID = "chk" + i;
chklist.Text = a;
chklist.Font.Name = "Trebuchet MS";
chklist.Font.Size = 9;
chklist.Checked = true;
checkcount++;
pnlCheck.Controls.Add(chklist);
if (a == "Thu" || a == "Fri")
{
p--;
chklist.Checked = false;
checkcount--;
}
f = f.AddDays(1);
}
daydiff = p;
lblCheck.Text = checkcount.ToString();
</code></pre>
<p>}</p>
<pre><code> protected void CheckChanged(object sender, EventArgs e)
{
if (!chklist.Checked)
{
checkcount--;
lblCheck.Text = checkcount.ToString();
}
}
</code></pre>
<p>I don't know what is going wrong...</p>
<p>Any help in this regard will highly appreciated
Thanks in advance</p>
| c# asp.net | [0, 9] |
1,073,809 | 1,073,810 | how to change an element type using jquery | <p>I have the the following code </p>
<pre><code><b class="xyzxterms" style="cursor: default; ">bryant keil bio</b>
</code></pre>
<p>How would I replace the <code>b</code> tag to a <code>h1</code> tag but keep all other attributes and information?</p>
| javascript jquery | [3, 5] |
3,248,021 | 3,248,022 | How to escape ' in setParameter | <p>I have a javascript function which is broken because the ' ('Côte d'Azur') is not escaped:</p>
<p>Javascript:searchDay('month', 'France', 'Côte d'Azur', '0', '201208', '18');</p>
<p>The parameters are set as followed:</p>
<pre><code>$jsUrl = new JavascriptUrl(
"searchDay",
array("id", "country", "region", "city" , "month", "startDay" )
);
$jsUrl->setParameter("id", "month");
$jsUrl->setParameter('month', $monthCode);
$jsUrl->setParameter('country', $countryName);
$jsUrl->setParameter('region', $regionName );
</code></pre>
<p>How can i fix this?</p>
| php javascript | [2, 3] |
4,029,153 | 4,029,154 | jQuery on(); function | <p>I'm learning Backbone and had some issues with the on()-function. But actually it's a very basic JavaScript question.</p>
<p>Why is it that the first line of code below works, and the second doesn't?
Using the second line, the render-function is never triggered. Mind the brackets.</p>
<p><strong>Works</strong></p>
<pre><code>this.collection.on( 'reset', this.render, this );
</code></pre>
<p><strong>Fails</strong></p>
<pre><code>this.collection.on( 'reset', this.render(), this );
</code></pre>
| javascript jquery | [3, 5] |
4,377,250 | 4,377,251 | jQuery .append() does not work from .js file | <p>I have the following line of code:</p>
<pre><code>$('#text').append('<h2 style="color:white">afdghadfg</h2>');
</code></pre>
<p>If I paste this code inside of a script tag in the html, it works fine. However, when placed inside a .js file it does nothing. </p>
<p>Know that the .js file has plenty of other working javascript and jQuery code, it is only this line that won't work.</p>
| javascript jquery | [3, 5] |
2,106,591 | 2,106,592 | how to pass session parameter from jquery to ASHX handler | <p>Below is my Jquery code and I would like to pass Session paramater e.g. Session["ID"].
Jquery calls ASHX page</p>
<p>All below parameters are working fine and the session parameter has a value, but how can I pass session paramater from Jquery?</p>
<p>So below code "paramater Sessionparameter" should be replaced with Session["ID"] or something like that. How can I do that?</p>
<p>please advice?</p>
<pre><code> $('input[name$=btnTab1Save]').click(
function (e) {
// debugger;
// AJAX call to the handler
$.post(
'Consulting.ashx',
// data to the handler in the form of QueryString
{
tab: 'tab1',
// id is the second column within the row
Ilac_id: prevRow.find('td:eq(0)').text(),
ID: SESSION_PARAMATER,
begindate: $('input[name$=begindate]').val(),
weigth: $('input[name$=weigth]').val(),
continue: true,
freq: $('input[name$=freq]').val(),
reason: $('input[name*=radListreason]:checked').val(),
freq2: $('input[name$=radListfreq2]:checked').val(),
freetext: $('input[name$=freetext]').val()
},
// callback function
// data is the JSON object
function (data) {
if (data.Success) {
// close the tab
}
},
"json"
);
});
</code></pre>
<p>I can read my parameters like Convert.Toint(context.Request.Form["ID"]));</p>
<pre><code> data.weigth = Convert.ToInt32(context.Request.Form["weigth"]);
</code></pre>
<p>I tried : <code>'<%= Session["ID"] .ToString() %>'</code>, but it's not working....</p>
| c# jquery asp.net | [0, 5, 9] |
5,967,352 | 5,967,353 | PHP / javascript live chat using too much bandwidth | <p>So I am learning about javascript, so I am making a live chat system with PHP and javascript. I have it so the javascript refreshes the log (each message gets logged in a file on the server), and it refreshes every second. Im using firebug to monitor the resource usage, and I see under the net tab each times its updated, and the bytes add up really fast. I know I can change it to update less, but is there a way that when a user on the other end I'm talking to, when the send a message, it gets sent to the server, then an alert gets sent to me saying that the chatlog needs to update somehow. That way it only updates when the log is updated. let me know, thanks</p>
| php javascript jquery | [2, 3, 5] |
1,019,358 | 1,019,359 | Text of the clicked link | <pre><code><ul class="Buttons">
<li><a href="#" onclick="myFunc(); return false;">Accept</a></li>
<li><a href="#" onclick="myFunc(); return false;">Reject</a></li>
<li><a href="#" onclick="myFunc(); return false;">On Hold</a></li>
<li><a href="#" onclick="myFunc(); return false;">Completed</a></li>
</ul>
</code></pre>
<p>In my script.js:</p>
<pre><code>var myFunc = function () {
// I want to get the Text of the link e.g. if the first list item link is
// clicked, store "Accept" in a variable.
};
</code></pre>
<p>How can I achieve this?</p>
| javascript jquery | [3, 5] |
520,810 | 520,811 | c# Convert string into URL friendly | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/37809/how-do-i-generate-a-friendly-url-in-c">How do I generate a Friendly URL in C#?</a> </p>
</blockquote>
<p>By URL friendly I mean turning:</p>
<blockquote>
<p>Convert string to DateTime in c#</p>
</blockquote>
<p>into</p>
<blockquote>
<p>convert-string-to-datetime-in-c</p>
</blockquote>
<p>Thank's for any help!</p>
| c# asp.net | [0, 9] |
4,960,266 | 4,960,267 | jquery/javascript menu issue | <pre><code>$(function(){
$("li.level2").hide();
$("li.level3").hide();
$("ul.navigation").delegate("li.level1", "click", function() {
$("li.level2").toggle().siblings("li.level3").hide();;
});
$("ul.navigation").delegate("li.level2", "click", function() {
$("li.level3").toggle();
});
});
</code></pre>
<p>I'm using this script to make a drop down menu for my page in jquery, but currently when you click on a level1 list it opens up every level1, when i just want to open the one that was clicked on. ie. it is doing this when i click on the first 1:</p>
<pre><code>1
2
1
2
</code></pre>
<p>when i want it to do this</p>
<pre><code>1
2
1
</code></pre>
<p>I understand you can use the $this function to only open the one selected, but i am unsure how to implement it and whenever i try (this).next it only opens the next one when</p>
<p>I included an active page with styling to make it easier to interpret: <a href="http://jsfiddle.net/K6TSv/1045/" rel="nofollow">http://jsfiddle.net/K6TSv/1045/</a></p>
<p>thanks for your help in advanced, this has been driving my head on.</p>
| javascript jquery | [3, 5] |
556,317 | 556,318 | Keeping Pop-ups in viewport | <p>I am using a <a href="http://users.tpg.com.au/j_birch/plugins/superfish/#getting-started" rel="nofollow">Superfish</a> plugin to display menu pop-ups but the problem is when a menu item is big it gets overflow from viewport.</p>
<p>How can I adjust the position of pop-up menu to always keep it in the viewport.<br>
<img src="http://i54.tinypic.com/1676pp1.png" alt="alt text"></p>
| javascript jquery | [3, 5] |
1,534,779 | 1,534,780 | Using HttpApplicationState outside ASP.NET session | <p>I have following problem. I am trying to use web services wrote in ASP.NET in application as intermediate layer, stored inside WCF service layer. So I am instancing some WebService classes and I call web methods like normal C# methods.
Unfortunately some of them are using asp.net specific solutions like using HttpContext and Application object(of type <strong>HttpApplicationState</strong>). I am trying to add items to this collection before webservice call, but nothing happens! Items are not there after using <strong>Add method</strong>. No exception, nothing. I thought that there is some functionality inside implemenatation of HttpApplicationState class, that prevents this operation in certain cases, but I insepcted code in reflector and everything should be fine...
Am I missing something?</p>
| c# asp.net | [0, 9] |
4,402,115 | 4,402,116 | ASP.NET - Internal messaging system | <p>I want to implement a messaging system in my Web application similar to the one Chase and Facebook have on their websites. Should I develop this on my own, or should I find a 3rd party control or other solution? Would google provide some sort of API to make this easy? I'm leaning towards developing this on my own because it probably won't involve too much but wanted to know my options. </p>
<p>All suggestions/comments are appreciated! </p>
| c# asp.net | [0, 9] |
3,132,956 | 3,132,957 | add class and fadeIn using jquery | <p>I have the following code:</p>
<pre><code>$("#rade_img_map_1335199662212").hover(function () {
$("li#rs1").toggleClass("active"); //Toggle the active class to the area is hovered
$("li#rs1").fadeIn("slow");
});
</code></pre>
<p>I need to add the class active then fadeIn. I have css which has <code>li'rs1</code> set to <code>visibility:hidden</code> and when the class is applied i simply style that.</p>
<p>How can i utilise fadeIn?</p>
<p>Also am i structuring this right? - I have 13 different <code>li#rs1</code>, <code>li#rs2</code> ... all the way to <code>li#rs13</code> with different image map ids. This is why i think i need 13 blocks of code.</p>
<p>EDIT: I have area ids so need need to reduce the code down:</p>
<pre><code>$(document).ready(function () {
$("map#rade_img_map_1335255669666 area#1").hover(function () {
$("li#rs1").toggleClass("active"); //Toggle the active class to the area is hovered
});
});
</code></pre>
| javascript jquery | [3, 5] |
5,326,733 | 5,326,734 | How to apply tax, discount to invoice using jQuery | <p>How to apply Tax, discount to subtotal and calculate grand total??</p>
<p>I have these paragraphs with the following ID's</p>
<pre><code><p id="subtotal">15000</p>
<p id="tax">10</p> // In percentage
<p id="discount">1000</p>
<p id="grandtotal"></p> // Grandtotal will be calculated and displayed here using jquery
</code></pre>
<p>The grand total would be 15000 + (1500 //tax) - (1000 //discount) = 15500</p>
<p>How do i calculate this using jQuery?</p>
| javascript jquery | [3, 5] |
2,767,016 | 2,767,017 | How can I fire jQuery outside document.ready block? | <p>The common method of starting jQuery is putting it in</p>
<pre><code>$(document).ready(function() {
// put all jQuery stuff here
});
</code></pre>
<p>But what if I have a complicated site which uses basic jQuery in <code><head></code> <strong>and</strong> some custom functions that depend on the page type (e.g. if I have login page, fire some login ajax stuff).</p>
<p>So, how can I attach code to <code>$(document).ready()</code> <strong>or</strong> fire it later? Which JS syntax should I use?</p>
<p>Thanks for help!</p>
<hr>
<p>My page structire is similar to this:</p>
<ol>
<li>Display <strong>static</strong> header using PHP's <code>include()</code></li>
<li>Add content inside <code><body></body></code></li>
<li>Display the template footer</li>
</ol>
<hr>
<pre><code><?php
include_once('system/classes/class.display.php');
$d = new IFDisplay();
$d->display_header(array('subtitle' => 'Log In')); <-- Here it displays static
head tags. There is
document.ready in there.
I can't change it.
?>
<script type="text/javascript">
AND WHAT DO I NEED TO PUT HERE
</script>
<div>...</div>
<?php
$d->display_footer();
?>
</code></pre>
| javascript jquery | [3, 5] |
5,845,316 | 5,845,317 | Convert Python for -loop to PHP | <p><strong>How can you convert the following code to PHP?</strong></p>
<pre><code>summat = [sum(arra[i:i+4]) for i in range(0,len(arra),4)]
</code></pre>
<p>My attempt</p>
<pre><code>$summat = array()
foreach ( range(0, $arra.length, 4) as $i) {
$summat = array ( array_sum( array_slice( $array, $i, $i+5) ) ) // don't know how to append the sums the array
</code></pre>
| php python | [2, 7] |
994,315 | 994,316 | Fastest way of getting a list of installed packages in an Android device | <p>I'm getting a list of packages installed in an Android devices very similar to the code here - <a href="http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon" rel="nofollow">http://www.androidsnippets.com/get-installed-applications-with-name-package-name-version-and-icon</a></p>
<p>The problem is that it takes quite a while to complete detection of all apps. I've discovered that the slow operations are those that call p.applicationInfo.loadLabel() and p.applicationInfo.loadIcon(). Once I comment those out and set them to dummy info, the detection is almost instantaneous.</p>
<p>Since I would still like to retrieve the app name and icon, I can't simply comment them out. Is there a faster way of retrieving this data?</p>
<p>Thanks.</p>
| java android | [1, 4] |
2,814,613 | 2,814,614 | JQUERY / JAVASCRIPT won't work in mobile devices | <p>I got a message system which requires a minimum amount of characters. Therefore I use a a submit button which is disabled by default. When the character limit is passed the submit button needs to be enabled.</p>
<p>The current code I use is:</p>
<pre><code> $(window).load(function(){
var amountArray = new Array(85,90,95,120);
$('#message').keyup(function(){
var length = $(this).val().length;
if(length < amountArray[0]){
$('.verzendenMSG').css('color','red');
}else if(length < amountArray[1]){
$('.verzendenMSG').css('color','darkorange');
}else if(length < amountArray[2]){
$('.verzendenMSG').css('color','olive');
$('.verzendenMSG').removeAttr('disabled');
}else if(length >= amountArray[3]){
$('.verzendenMSG').css('color','green');
$('.verzendenMSG').removeAttr('disabled');
}
});
</code></pre>
<p>With this code you get on desktop browsers (also Safari) a red text in the submit button and when you get closer to the limit the color is more green and when you get to the defined minimum the disable option of the submit button will disappear. </p>
<p>This all won't work in a mobile browser, such as the ipad browser and the windows phone 7 browser. </p>
<p>My question is, what could be the issue and how can I solve the issue. Since this code is actually really simple?</p>
| javascript jquery | [3, 5] |
15,069 | 15,070 | jquery detecting mouseup | <p>I have a problem.</p>
<p>The code works fine in Firefox but in Chrome it messes up.</p>
<p>The code is rather basic.
There's a div with a background. Upon jquery's mousedown upon that div I set a function to run at an interval. Upon mouseup the interval is cleared. Simple, right?</p>
<p>So problem is this. Say the user right-clicks in Chrome and brings up the context menu. Or they drag the div. The mouseup event is no longer registered.</p>
<p>Any ideas?</p>
<p>I had an idea where I'd just get the status of the mouse button. But that seems to be impossible to do without a mouse even firing.</p>
<pre><code> function mouseD(e){
mouseE = e;
timer = setInterval(scroller, 50);
$(document).mouseup(function(){
clearInterval(timer);
});
//mouseB = e.button;
//mouseW = e.which;
//console.log(e.button + " D " + e.which);
}
imgbox.mousedown(mouseD);
</code></pre>
<p>EDIT:
So I managed to solve the context menu and dragging problems by disallowing such acts. The user just can't do it anymore. But if the user right- and left-clicks at the same moment the mouseup never registers.</p>
| javascript jquery | [3, 5] |
188,789 | 188,790 | Displaying image on tooltip? | <p>In my application I would like to display an image on a tool tip.</p>
<p>How can I do this? Can you help me, or provide me with any references?</p>
| c# asp.net | [0, 9] |
4,820,362 | 4,820,363 | Wizard Control on next button submit not postbacking after previous button submit | <p>Struck of with this problem...... I google for this query but no help...........</p>
<p>I have a wizard control with three steps, when user clicks the next button in first step it post back to server and then user comes back to previous page or the same page and click next button it doesn't post back to server.</p>
<p>code:</p>
<h2>STEP 1</h2>
<pre><code><asp:WizardStep ID="wsPersonalDetails" runat="server" Title="Personal Details">
<ASP TABlE>
</asp:WizardStep>
</code></pre>
<h2>STEP 2</h2>
<pre><code><asp:WizardStep ID="wsProfessionalDetails" runat="server" Title="Professional Details">
<ASP TABlE>
</asp:WizardStep>
</code></pre>
<h2>STEP 3</h2>
<pre><code><asp:WizardStep ID="wsExperienceDetails" runat="server" Title="Experience Details">
<ASP TABlE>
</asp:WizardStep>
</code></pre>
<p>Problem is: when user go back from second step to first step, it is not post back to server. (NextButtonClick event is not firing)</p>
| c# asp.net | [0, 9] |
1,632,125 | 1,632,126 | How can I do OR in jquery for an element selector? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/10515888/combine-two-selectors-with-one-jquery-object">Combine two selectors with one jQuery object</a> </p>
</blockquote>
<p>I have the following jquery code:</p>
<pre><code> $("#try").click(function(){
...
</code></pre>
<p>If I click on <code>#try</code>, the browser executes the function. Suppose I want to add another element, <code>#try2</code>, that will execute the same function. How would I add an <code>or</code> to the above code? I've tried using,</p>
<pre><code> $("#try" or "#try2").click(function(){
...
</code></pre>
<p>but it doesn't work.</p>
| javascript jquery | [3, 5] |
2,619,528 | 2,619,529 | How to set 'ClientValidationFunction' property in <asp:CustomValidator> | <p>I need to use asp:CustomValidator for a tool. The problem am facing is that on calling a function using the property 'ClientValidationFunction', the function is getting called but even a single line of javascript is not getting executed. I placed a simple alert() inside the function. Its also not executed.</p>
<p></p>
<p>Can any one please suggest a solution for this?
Thanks in advance</p>
| c# asp.net | [0, 9] |
1,319,692 | 1,319,693 | Executing program on server-side with ASP.Net | <p>I have an executable file that works fine by hand locally. It converts a file to another new file by some parameters. I'm using ASP.Net and that executable installed win2003 server
sp2. I can use it from local but, I can't execute the program from a web browser using system.diagnosting.process. When I use that, I can see the process in task manager with user name "NETWORK SERVICE", and it won't dissappear without ending process by hand and won't work. </p>
<p>I tried impersonation, try as a web service, edited local policies, apply all privilages, etc...</p>
<p>Is there any suggestions about this problem?</p>
| c# asp.net | [0, 9] |
3,138,863 | 3,138,864 | Using punjabi character in my android application | <p>I am trying to read character from one of the URL : <a href="http://www.searchgurbani.com/hukum/sis_ganj" rel="nofollow">http://www.searchgurbani.com/hukum/sis_ganj</a> </p>
<p>using the below code :</p>
<pre><code> String htmltext=null;
String inputLine;
URL urlinstance = new URL(url);
BufferedReader in = new BufferedReader(
new InputStreamReader(urlinstance.openStream()));
while ((inputLine = in.readLine()) != null)
htmltext+=inputLine;
in.close();
htmltext = htmltext.getBytes("UTF-8").toString();
System.out.println("HTMLTEXT"+htmltext);
</code></pre>
<p>but when I am trying to read it I am unable to do that.
Can somebody tell me how I can make this work.</p>
<p>Thanks,
Aman</p>
| java android | [1, 4] |
2,469,353 | 2,469,354 | jQuery - calling function with parameters inside method | <p>I'm wondering how is possible to call a function with parameters inside a method.
I have 2 functions and i'd like to call function deleteCode() when clicked on list element which is created by addCode() function.
I'm sure the solution is really simple, but i just can't see it right now.
Many thanks!</p>
<pre><code>function addCode(code) {
$('#codeList').append('<li class="codeList" onClick="deleteCode(code);">' + code + '</li>');
}
function deleteCode(code) {
$('#'+code).remove();
}
</code></pre>
| javascript jquery | [3, 5] |
3,704,144 | 3,704,145 | Run a Javascript On Page Load | <p>I would like to know how to run a javascript function on page load.. in my asp.net page. I do not want to do it in from my .cs file OnLoad, I want to keep it in the aspx page if at all possible.</p>
<p>I am new to javascript so any ideas?</p>
| c# javascript asp.net | [0, 3, 9] |
1,107,186 | 1,107,187 | how can i create a dynamic map that shows our company locations? | <p>I'm searching for a jquery plugin that allows me to create a dynamic world map and mark the countries that we have a branch there in a different color or put a logo of our company on that country.
I need to have access to that map so when a user clicks on a country i can fire a jquery event.</p>
<p>i think Google has something like this but I'm not sure</p>
<p>Thank you</p>
| javascript jquery | [3, 5] |
2,128,086 | 2,128,087 | Writing this jQuery click function in JavaScript | <p>I am slowly making my way from jQuery to vanilla JS, but I am struggling with wanting to write the following in JavaScript, would I have to setup a 'for' loop for each element? How would I target the child elements an an ID?</p>
<p>Here's what I would want to understand:</p>
<pre><code>$('#id li').click(function(){
$(this).addClass('active');
});
</code></pre>
<p>I understand document getElementById to grab the '#id' but how would I achieve getting the child <li> elements? And how would I get the 'onclick' function to work for ANY list element clicked? Would I have to setup a 'for' loop for each element? Any help much appreciated!</p>
| javascript jquery | [3, 5] |
5,461,358 | 5,461,359 | Re-sizing the webpage content | <p>In my project I have a webpage which has 2 div areas right and left. The left div takes almost 60% of the whole page width and the right one takes around 36% of the page. I wanted to resize the both div areas in a proper ratio when I shrink the browser from the right side or left side. The UI is getting generated from Javascript. This is the code. </p>
<pre><code>boardHolderPadding = $board.outerHeight() - $board.height();
$board.height(viewportHeight - siblingsHeight - boardHolderPadding);
this.$('#board .droptarget').setWidthAsRatioOfHeight(this.options.ratio);
$('#sidebar').width($(window).width() - $board.find('#board').width() - 50);
</code></pre>
<p>I tried with JQuery resize plugin but couldnt get the proper result I'm looking for. Anyone have suggestion?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
4,635,638 | 4,635,639 | manipulate a property of a child element | <p>I have the following row element with a double click event atached to it.</p>
<pre><code><tr ondblclick="onLabelDoubleClicked(this)">
<td><label id="labelId" >My Label</label></td>
<td><input type="text" id="myInput" data-bind="kendoDropDownList: { data: source, value: myValue, enable: true }" /></td>
</tr>
</code></pre>
<p>On double click I need to set the <code>enable</code> property of <code>kendoDropDownList</code> in input element to toggle true/ false.</p>
<p>javascript:</p>
<pre><code>onLabelDoubleClicked = function (event) {
}
</code></pre>
<p>I searched through the <code>event</code> properties but could not find anything useful to get the <code>enable property</code> and manipulate it. Any help with working example will be greatly appreciated. Thank You!</p>
| javascript jquery | [3, 5] |
2,921,922 | 2,921,923 | Uncaught TypeError: Cannot read property 'safari' of undefined | <p>I have this jjavascript to resize iframes:</p>
<pre><code> $(function () {
var iFrames = $('iframe');
function iResize() {
for (var i = 0, j = iFrames.length; i < j; i++) {
iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';
}
}
if ($.browser.safari || $.browser.opera) {
iFrames.load(function () {
setTimeout(iResize, 0);
});
for (var i = 0, j = iFrames.length; i < j; i++) {
var iSource = iFrames[i].src;
iFrames[i].src = '';
iFrames[i].src = iSource;
}
} else {
iFrames.load(function () {
this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
});
}
});
</code></pre>
<p>In chrome, it has trouble here:</p>
<pre><code> if ($.browser.safari || $.browser.opera) {
</code></pre>
<p>Is there any reason why I get this error? I am using the latest JQuery?</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
2,073,572 | 2,073,573 | Capture who clicked a link from Website A to Website B? | <p>Assume I have a website called Website A and it has some links on it to other websites. One of these links could be a link to Website B. Is there a way, using some existing solution, open source, or something you have to pay for where you can track who, what, where, etc clicked the link to go from Website A to Website B?</p>
<p>Website B could be Stackoverflow and my website is www.websiteA.com, so on my website, I have a link to www.stackoverflow.com. If a user clicks on www.stackoverflow.com from my page, I want to capture information, such as name, phone, etc (not sure if I can do this unless the user is actually logged into my website). In this case, this is a public page which anyone from anywhere can access. If I can't do it from my website, is there a way I can tell stackoverflow that this particular person clicked on my link to get to your website and I need their information.</p>
| c# asp.net | [0, 9] |
2,903,945 | 2,903,946 | Use variable as key value for FormView Insert | <p>This sounds really simple and for the life of me I can not find out how to do this. I have a FormView where the user can create a new contact. I am passing into this page a key variable. In the insert statement I need to have this key be part of the insert statement. It is currently defined as a public variable in my cs file but how do I use it as a parameter? This key does not show up on the FormView. All of my insert work is done on the ASP page.</p>
| c# asp.net | [0, 9] |
5,724,645 | 5,724,646 | Most efficient way to select all elements with an array of values | <p>Let's suppose I have a <code><select></code> element:</p>
<pre><code><select id="foobar" name="foobar" multiple="multiple">
<option value="1">Foobar 1</option>
<option value="2">Foobar 2</option>
<option value="3">Foobar 3</option>
</select>
</code></pre>
<p>And let's suppose I have an array of values, something like:</p>
<pre><code>var optionValues = [2, 3];
</code></pre>
<p>How can I select the <code><option></code>s with values 2 and 3 most efficiently?</p>
<p>I'm working with a <code><select></code> that has thousands of <code><option></code>s, so doing it manually like this won't work:</p>
<pre><code>var optionElements = [];
$("#foobar").children().each(function() {
if($.inArray($(this).val(), optionValues)) {
optionElements.push($(this));
}
}
</code></pre>
<p>It's just too slow. Is there a way to hand jQuery a list of values for the elements I need to select? Any ideas?</p>
<p>P.S. In case you're wondering, I am in the middle of optimizing my <a href="http://code.google.com/p/jquery-ui-picklist/" rel="nofollow">jQuery PickList widget</a> which currently <a href="http://code.google.com/p/jquery-ui-picklist/issues/detail?id=6" rel="nofollow">sucks at handling large lists</a>.</p>
| javascript jquery | [3, 5] |
4,260,320 | 4,260,321 | Jquery and PHP rating function problem | <p>I know that I was already posted similar question but I just can't find the answer and figure it out how to solve this problem.</p>
<p>I'm trying to customize Jquery Star Rating plugin (<a href="http://php.scripts.psu.edu/rja171/widgets/rating.php" rel="nofollow">link text</a>) but I do not know what to do to show the message based on response of PHP script.</p>
<p>Jquery script successfully send rating data to PHP scripts that query the database and based on that echo message of proper or improper rating.</p>
<p>What should I add to an existing JS code so I can get echo from PHP and base on that write a message on some DIV beside rating star?</p>
<p>Jquery:</p>
<pre><code>$('#gal').rating('gl.php?gal_no=<?=$gal_no;?>&id=<?=$id;?>', {maxvalue:10,increment:.5, curvalue: <?=$cur;?>});
</code></pre>
<p>Simplified PHP code:</p>
<pre><code>$br=mysql_query("SELECT count(gal) as total FROM ...")
if ... {
echo '0';
}
else echo '1';
}
</code></pre>
<p>Jquery code successfully transmitted data to PHP script and when the PHP done with checking data echo the result ('1' or '0'). How can I get this PHP result back to Jquery and based on them write a message? Something like:</p>
<pre><code>if(data=="1")
{
$("#error").show("fast").html('not correct').css({'background-color':'#F5F5F5','border-color' : '#F69'});
}else{
$("#error").show("fast").html('correct').css({'background-color' : '#FFF','border-color' : '#3b5998'});
}
</code></pre>
<p>If someone has an idea...I would appreciate it.</p>
| php jquery | [2, 5] |
2,820,715 | 2,820,716 | Somehow accessing Javascript output? | <p>So,</p>
<p>Say there's a remote PHP file that's generating some output in JavaScript.<br>
I can do <code><script src='some_file.php type='text/javascript'></script></code>, and the code will run, but when I click View Source it just shows the above code. Is there any way I can access the actual code that that PHP file is running?</p>
<p>Also, when I right click on the output of the javascript and go to 'this frame' -> 'view frame source' I get the actual output. I want to be able to use it.</p>
| php javascript | [2, 3] |
3,382,727 | 3,382,728 | People Like this button - dynamic counter increase when clicked | <p>I need to create a button that says 3 people like this and when clicked it goes to 4 etc.. See this example it is perfect, but only for WordPress. Any suggestions? Ideas?</p>
<p>Thank you.</p>
<p><a href="http://rosepritchard.ca/themeTests/" rel="nofollow">http://rosepritchard.ca/themeTests/</a></p>
| java php jquery | [1, 2, 5] |
1,546,109 | 1,546,110 | How to write a jQuery function with a callback that you can pass Params to? | <p>I have the following function:</p>
<pre><code>function loadProjects(pID) {
$.ajax({
url: myURL,
success: function (dataJS) {###Run any supplied call back here####}
});
}
</code></pre>
<p>I call this function like so loadProjects(1);</p>
<p>Issue is I want to be able to define a callBack function after success, and I'd like to include it when I do loadProjects(1, pong(12)). I want to be able to supply params to the callback.</p>
<p>How can I have a function accept a callback?
How can I pass a callback to that function?</p>
<p>Something like</p>
<pre><code>function loadProjects(pID, callback) {
$.ajax({
url: myURL,
success: function (dataJS) {###Run any supplied call back here####}
});
}
</code></pre>
<p>Where I could then call:</p>
<pre><code>loadProjects(22, pong(12))
</code></pre>
<p>Problem is when I try this, pong(12) is running immediately, and not later when called in the loadProjects function?</p>
<p>Ideas? Thanks</p>
| javascript jquery | [3, 5] |
3,635,885 | 3,635,886 | How is this website's architecture structured? | <p>Refer to this url: <a href="http://imagemechanics.com.au/" rel="nofollow">http://imagemechanics.com.au/</a></p>
<p>Every page seems to have its own unique URL, but the "/#!/" leads me to believe it's all one giant page with anchor tags defining the sections. Is each section truly its own .html page or is it just one page?</p>
| javascript jquery | [3, 5] |
2,413,309 | 2,413,310 | ProfileBase.GetProperty() does not work on a new thread | <p>Why does this code not work if called within a new thread? The error returned is <code>Object reference not set to an instance of an object.</code> on the </p>
<pre><code>return pb.GetPropertyValue("Name").ToString();
</code></pre>
<p>this works</p>
<pre><code>GetFullName(m);
</code></pre>
<p>while this doesnt</p>
<pre><code>Thread t = new Thread(GetFullName);
t.IsBackground = true;
t.Start();
public string GetFullName(string username)
{
ProfileBase pb = ProfileBase.Create(username);
return pb.GetPropertyValue("Name").ToString();
}
</code></pre>
| c# asp.net | [0, 9] |
667,791 | 667,792 | Grid Sizer with jQuery | <p>I'm writing myself a little game in JavaScript, using jQuery. The game has a board, with cells in it, much like Minesweeper: the user clicks a cell, and its data needs to be changed in some way. Each cell is presented by a simple image, but has some more data associated with it.</p>
<p>What I mostly need is, when the user clicks a cell, I have to somehow determine the row and column which was clicked, manipulate the data appropriately and change the view.</p>
<p>On one hand, setting the click handler on every individual cell seems like an overkill, but if you set the click handler on the whole table, it becomes PITA to determine which table cell was clicked. </p>
<p>How would you handle such a situation? Maybe there is a plugin already that can simplify the whole thing?</p>
| javascript jquery | [3, 5] |
4,711,180 | 4,711,181 | Javascript slider not sliding, how to tell if there is a JS conflict? | <p>I have an existing website that the image slider no longer performs its slideshow function or slide arrow no longer advance the slideshow. I'm assuming another script is causing this one to malfunction. Can anyone tell me how or take a look and tell me where the problem is from a browser by chance?</p>
<p>URL: </p>
| php javascript jquery | [2, 3, 5] |
1,935,274 | 1,935,275 | inline image captions plugin? | <p>Is there such thing as an inline image caption plugin for jquery?</p>
<p>So a user can someone select a point on an image, and then insert a text caption. Whenever someone hovers over the image, the caption displays.</p>
<p>Flickr has this type of functionality.</p>
| javascript jquery | [3, 5] |
5,653,068 | 5,653,069 | post selextbox values to php page in jquery | <p>I am using jquery button click to post all the values in a selectbox to a PHP page, but this code does not seem to work. Can anyone please help?</p>
<pre><code><script type="text/javascript">
$(function() {
$("#btn1").click(function () {
var arr= new Array;
$("#target_select option").each (function () {
// You can push the array on an array
arr.push( $(this).val() );
//alert( $(this).val() ); not getting the alert to display too
});
$.post("test.php", { name: arr } );
});
});
</script>
</code></pre>
<p>Generate</p>
| php jquery | [2, 5] |
893,548 | 893,549 | Javascript update causing grief | <p>I am not a javascript developer by any means what so ever, however am stuck behind a JS problem.</p>
<p>If somebody could help me figure out what the problem may be would be amazing.</p>
<p>The bit of script that is falling over is:</p>
<pre><code> $('button').each(function()
{
var curr_title = $(this).attr('title');
if(curr_title.length > 0) $(this).button({ icons: { primary: curr_title } });
else $(this).button();
});
</code></pre>
<p>The error is </p>
<blockquote>
<p>TypeError: Cannot read property 'length' of undefined.</p>
</blockquote>
<p>This works no problems at all in previous releases of the code. however the only change is updated Jquery.</p>
<p>Does anyone know if this is likely to be the problem?</p>
<p>Again. Apologies if im being stupid.</p>
| javascript jquery | [3, 5] |
2,390,283 | 2,390,284 | How to get the text of several td which have same id name? | <p>i have table in that
five td which contain same id. Id="divParent" but in that different text,
i want to access all the text in array which id ="divParent" in other page using java script.
how to get this
i tried to do this using this code;</p>
<pre><code>var divParent=new Array();
divParent=window.parent.document.getElementById('divParent');
</code></pre>
| javascript asp.net | [3, 9] |
5,511,573 | 5,511,574 | Iterate over defined elements of a JS array | <p>I'm using a JS array to Map IDs to actual elements, i.e. a key-value store. I would like to iterate over all elements. I tried several methods, but all have its caveats:</p>
<pre><code>for (var item in map) {...}
</code></pre>
<p>Does iterates over all properties of the array, therefore it will include also functions and extensions to Array.prototype. For example someone dropping in the Prototype library in the future will brake existing code.</p>
<pre><code>var length = map.lenth;
for (var i = 0; i < length; i++) {
var item = map[i];
...
}
</code></pre>
<p>does work but just like </p>
<pre><code>$.each(map, function(index, item) {...});
</code></pre>
<p>They iterate over the whole range of indexes 0..max(id) which has horrible drawbacks:</p>
<pre><code>var x = [];
x[1]=1;
x[10]=10;
$.each(x, function(i,v) {console.log(i+": "+v);});
0: undefined
1: 1
2: undefined
3: undefined
4: undefined
5: undefined
6: undefined
7: undefined
8: undefined
9: undefined
10: 10
</code></pre>
<p>Of course my IDs wont resemble a continuous sequence either. Moreover there can be huge gaps between them so skipping undefined in the latter case is unacceptable for performance reasons. How is it possible to safely iterate over only the defined elements of an array (in a way that works in all browsers and IE)?</p>
| javascript jquery | [3, 5] |
4,498,168 | 4,498,169 | How to add &ref=123 every link | <p>How would i be able to put the follow on the end of every link of my website with out editing every link?</p>
<p>e.g <code>www.WebsiteName.com/?ref=123</code></p>
<p>so if i went to <code>www.WebsiteName.com/aboutus.php</code> i want it to add <code>?ref=123</code> onto the end of the url.</p>
| php javascript jquery | [2, 3, 5] |
1,884,324 | 1,884,325 | jQuery : drag and drop : find the id of the target | <p>I am developing a drag and drop app. I have a DIV that is draggable along the document and there are some other divs in the document, I can drag one div to other divs, but how can I find the id of the div to which I dropped the dragging DIV,</p>
<p>I just want to know the id of the target DIV after placing another DIV over it.</p>
<p>Thanks </p>
| javascript jquery | [3, 5] |
1,950,131 | 1,950,132 | Session from javascript | <p>I'd like to inspect the session variable. Best case something that works in the firebugs little interpreter, but if I have to put it in the file thats fine. Right now I just made a short PHP to output $_SESSION, but if I could find something analogous to be done right in the browser that would be ideal. document.cookie doesn't seem to do what im looking for, at least not that i see.</p>
<p>Basically looking for something analogous to $_SESSION that I can use in javascript</p>
<p>EDIT - was trying to see if i could get anything more than, or extract the meaning PHPSESSID=o147cf52u9d7qr251hc3n6ilu2; ASESSIONID=101wvpe-3FA77F204CFF55BA61E696AD3F62F0F8 on the client-side. As it stands I guess i can just write a small ajax function to a url that echos the session. Thanks for the help!</p>
<p>PS - Do those document.cookie values have anything to do with whats inside the session, or are they just identifiers to tell one session from another?</p>
| php javascript | [2, 3] |
4,498,323 | 4,498,324 | Jquery working with two or more variables at the same time | <p>I am having code like this:</p>
<pre><code> var input = $('input');
var select = $('select');
var text = $('textarea');
var name = $('#name');
var email = $('#email');
var phone = $('#phone');
var subject = $('#subject');
var message = $('#message');
var sum = $('#sum');
(input, select, text).focus(function(){
$(this).css('z-index', 100)
});
</code></pre>
<p>When input element is focus, it needs to change z-index to a 100, and non focused elements need to change their z-index to 1. How can I do this?</p>
| javascript jquery | [3, 5] |
299,211 | 299,212 | Display alert when the user enters text in input area | <p>I am trying to display an alert when the user enters text into the search box but it does not work. Please guide. </p>
<p><a href="http://jsfiddle.net/zcH54/" rel="nofollow">http://jsfiddle.net/zcH54/</a></p>
<pre><code><div id="form" style="float:right;" >
<form method="get" >
<input type="submit" value="Search" class="btn" >
<input name="q" type="text" id="search" size="32" maxlength="128" class="txt" >
</form>
</div> <!--form ends-->
</code></pre>
<p>Here is the JS,</p>
<pre><code> $(document).ready(function() {
$("#search").keyup(function() { // function starts when a key is entered in the search bar
alert("I am an alert box!");
});
});
</code></pre>
| javascript jquery | [3, 5] |
240,774 | 240,775 | Highlighting characters by their number | <p>Consider having the following string and it's numerical value:</p>
<p><img src="http://i.stack.imgur.com/YQ6Z4.png" alt="enter image description here"></p>
<p>You then allow the user to type in to a textbox: <code>1|17|7|19</code>, how would I be able to highlight the text as follows:</p>
<p><img src="http://i.stack.imgur.com/lDZeO.png" alt="enter image description here"></p>
<p>I can have it work when calculating in spaces and paragraphs, but when I completely remove all white space and new lines (e.g. "Thisissomedummytext") I cannot work out how I would go about achieving this.</p>
<p><strong>EDIT</strong></p>
<p><a href="http://jsfiddle.net/rubeE/" rel="nofollow"><strong>This</strong></a> is what I have so far, it takes into account spaces and new lines (nl's count as 1 char).</p>
| javascript jquery | [3, 5] |
5,911,767 | 5,911,768 | Is it considered bad practice if you use an <input> for a textbox compared to <asp:Textbox>? | <p>I have an ASP.NET page that contains a form and a button. In order to use the <code>OnKeyPress</code> and a javascript function (to stop the user from using the enter key and without adding a <code>FilteredTextBoxExtender</code>) attribute I had to change the <code><asp:Textbox></code> to an <code><input></code> with <code>type="text"</code>.</p>
<p>Is this considered bad practice? Or are there valid situtations where should be used? </p>
<p>To ensure this question isn't subjective - are there any other ways to prevent the user using the enter key when typing in an ASP.NET textbox? (without putting code in the code behind)</p>
| c# javascript asp.net | [0, 3, 9] |
5,580,996 | 5,580,997 | Obtain Decimal values after Division | <p>How can i obtain the decimal value after division ?
after doing this </p>
<p><code>days = miliseconds/(24 * 60 * 60 * 1000)</code></p>
<p>suppose the value(i.e days) is 27.8351
how do i get 8351 ?
Tried </p>
<p><code>hours = days % (int) days</code> thought it s doing 27.8351 / 27
but still it returned a big Zero, havent tried converting it into string and then splitting based on DOT (.) but i dont like this way have i over looked some thing ?</p>
| java android | [1, 4] |
1,773,225 | 1,773,226 | How do I determine the checked state of checkboxes from an array returned by JQuery? | <p>How do I determine the state of a checkbox (i.e. checked or unchecked) with the following code:</p>
<pre><code>function deleteItems() {
var items = $('.td_checkbox');
for (var item in items) {
// this doesn't work
if ($(item).is(:checked) == true)
alert('delete my div if checked!');
}
}
</code></pre>
| javascript jquery | [3, 5] |
5,653,737 | 5,653,738 | Importing script files into ASP.NET page: intellisense shows the methods, but trying to call one errors. Any ideas? | <p>I put a function in an existing.js file (I tried two different files) so that the method would be available multiple places without repeating the code. I even created a simple function just to make sure it wasn't something my function was messing up. </p>
<pre><code>function doNothing() {
alert("Dammit.");
}
</code></pre>
<p>I can see the method in the intellisense list in my .ascx control, but as soon as I try to step into it, it fails. </p>
<p>Below is how I tried to reference the file and it seemed to work as far as seeing the methods, but it won't work.</p>
<pre><code><script src="/javascript/messages.js" language="javascript" type="text/javascript"></script>
</code></pre>
<p>Any ideas? Any common mistakes that I may be making? It looks like it should work.</p>
<p>Note: when the methods are inside the .ascx file, they work fine, even with missing semi-colons. </p>
| javascript asp.net | [3, 9] |
2,230,801 | 2,230,802 | Converting a WS to WAP | <p>Ive been trying to convert my asp.net website into a web application following the guide provided on msdn. However, ive run into a problem with some of my usercontrols that implements templating, getting the following error:</p>
<p><b>'System.Web.UI.UserControl' does not have a public property named 'ContentTemplate'</b></p>
<p>The codebehind clearly defines the template property like this which works fine in WS´s.</p>
<pre><code>[TemplateContainer(typeof(ContentContainer))]
[PersistenceMode(PersistenceMode.InnerProperty)]
[TemplateInstance(TemplateInstance.Single)]
public ITemplate ContentTemplate { get; set; }
</code></pre>
<p>Update: I dont know how or why but some of these controls have managed to convert into WAP usercontrols (with the designer file added), and the problem then is that no asp controls i define within these templates can be found anymore in code behind.</p>
<p>The error:</p>
<p><b>The name 'DropDownRoles' does not exist in the current context</b></p>
<p>The markup:</p>
<pre><code><%@ Register src="~/Controls/Containers/ContainerFrame.ascx" tagname="ContainerFrame" tagprefix="uc" %>
<uc:ContainerFrame ID="ContainerFrame1" Title="Layout" runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownRoles" runat="server" />
</ContentTemplate>
</uc:ContainerFrame>
</code></pre>
<p>Any ideas?</p>
| c# asp.net | [0, 9] |
2,209,987 | 2,209,988 | How can avoid this "A potentially dangerous Request" | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the-client">A potentially dangerous Request.Form value was detected from the client</a> </p>
</blockquote>
<p>A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$txtPickUpOrderInstruction="...x the mail<br>1 x the mirrorValidateRequest="false". 2. I have too many textboxes so <code>Server.HtmlEncode(TestString);</code>.Method is not possible.Its development is over.Re work i have to reduce.</p>
<p>But i want to restrict the user to enter these special characters?(Scripts or function-in master page that will do the same)</p>
| c# javascript asp.net | [0, 3, 9] |
5,433,998 | 5,433,999 | maintain scroll postion from one page to the next page | <p>I want to maintain scroll postion from one page to the next page after clicking the link.</p>
<p>Can some one tell how i can do this?</p>
<p>e.g. I want to click a link in <code>index.php</code> and then after opening the next page it should have the same scroll position that was in <code>index.php</code>.</p>
| php javascript | [2, 3] |
94,977 | 94,978 | Dynamically changing photo with dropdown | <p>I am new to PHP and am trying to figure out how to code some specific functionality. I have a product page that shows a photo and has two dropdown menus, one for size and one for color. What I would like to do is when the page first loads I set a variable that has the default product SKU. When the menus change I want to change the variable to the combined values of the two menu items selected. As the variable changes I want to reflect this in the photo and in a hidden form value (for eventual submission to a cart).</p>
<p>So when the page loads it shows picture A with the associated values in the size and color dropdowns. Then when either of the dropdowns change the photo dynamically changes to reflect it (while also updating the hidden form value).</p>
<p>Any suggestions would be much appreciated.</p>
| php javascript jquery | [2, 3, 5] |
1,748,141 | 1,748,142 | How to display List items in Listview? | <p>I have a ListView in my aspx file like this:</p>
<pre><code><asp:ListView ID="ListView1" runat="server"></asp:ListView>
</code></pre>
<p>and then I have List like this:</p>
<pre><code>List<string> mylist = new List<string>();
</code></pre>
<p>Im trying to populate the ListView like so:</p>
<pre><code>foreach(string elem in mylist)
{
ListView1.Items.Add(new ListViewItem(elem));
}
</code></pre>
<p>But my compiler is telling me best overload match error & cannot convert string to ListViewItem. This is a asp.net 4.0 web app. Any suggestions?</p>
| c# asp.net | [0, 9] |
3,829,948 | 3,829,949 | View Page source of web page on button click | <p>I am making a app on which I want to provide a facility to "VIEW SOURCE" of any webpage on button click.User will only enter URL and will get source of that page.I also want to show contents,stylesheets,images of that webpage .I want to get all these and show in my asp.net pages according to my formats.Please Help....</p>
| c# asp.net | [0, 9] |
1,625,143 | 1,625,144 | How to Submit only after Jquery finished updating the field | <p>I have a form where a user inputs a word, when pressing the button I want it to translate the word (using the jquery script) into the same field.
Only after completed to populate the field, it should continue and submit the translated word.</p>
<p>everything is working except that it will submit as soon as it translating causing the original word to be submitted instead of the translated one.
the original page shows that the word had been translated.</p>
<p>please help on how to make it submit only after the word have been translated in the text field. ?
should I use a delay ? if so how ?
or is there an oncomplete, "onpopulate" or something like that ?</p>
<p>here is the script: </p>
<pre><code><script type="text/javascript">
$(function transle() {
$('#transbox').sundayMorningReset();
$('#transbox input[type=submit]').click(function(evt) {
$.sundayMorning(
$('#transbox input[type=text]').val(),
{ source:'', destination:'ZH', menuLeft:evt.pageX, menuTop:evt.pageY},
function(response) {
$('#transbox input[type=text]').val(response.translation);
}
);
});
});
</script>
</code></pre>
<p>and the form:</p>
<pre><code> <table id="transbox" width="30px" border="0" cellspacing="0" cellpadding="0">
<form action="custom-page" method="get" name="form1" target="_blank" id="form1" >
<tr>
<td><input id="q" name="q" type="text" class="search_input" value="Evening dress" /></td>
<td><input type="submit" /></td>
</tr>
</form>
</table>
</code></pre>
<p>there are another JS called for the script but I don't sure its needed for the question.</p>
<p>thank you.</p>
| javascript jquery | [3, 5] |
3,796,509 | 3,796,510 | Loading stylesheet dependant on User Agent | <p>I have to load a different Stylesheet depending on whether the User Agent is an iPad or other. I know that generally, detecting browsers isn't the most fantastic idea and will probably cripple our maintainability sometime in the future..not my decision.</p>
<p>So here we have some JavaScript to detect the user agent. It isn't working. I may have mis-escaped something. The error I am getting is a red herring (object reference), but only shows up when I execute the JavaScript.</p>
<pre><code> $(document).ready(function () {
alert('ready fired');
if (navigator.userAgent.indexOf("iPad") != -1) {
//alert('bleep bloop blop...iPad detected');
var stringToWrite = '<script src=\'\<\%\= ResolveUrl("~/Scripts/iscroll.js") \%\>\' type="text/javascript"><\/script>';
stringToWrite += '<link href=\'\<\%\= ResolveUrl("~/Stylesheets/scrollbar.css") \%\>\' rel="stylesheet" type="text/css" \/>';
stringToWrite += '<link href=\'\<\%\= ResolveUrl("~/Stylesheets/iPadCommon.css") \%\>\' rel="stylesheet" type="text/css" \/>';
alert(stringToWrite);
document.write(stringToWrite);
}
//else
//alert('bleep bloop blop...who cares browser');
});
</code></pre>
| javascript jquery | [3, 5] |
2,139,864 | 2,139,865 | use an anchor to load a page sending post data | <p>I'm not even sure if this is possible, but I need to send POST data to a page via a user-clicked link. Can this be done?</p>
<p>To be clear, I do not want the data returned to the current page; the target page should load in the browser just as though the user had submitted a form, but I need to send the post data without a form, if possible</p>
| javascript jquery | [3, 5] |
5,764,702 | 5,764,703 | how to close activity without actually finishing? | <p>I want to:</p>
<pre><code>open 1, 2, 3 activities
1 > 2 > 3
back to #2
1 > 2
open #4 activity
1 > 2 > 4
back to #2
1 > 2
restore #3 activity
1 > 2 > 3
</code></pre>
<p>"Restore" means open previously closed activity without re-creating.
How can i do that?</p>
<p>Thanks!</p>
| java android | [1, 4] |
1,493,491 | 1,493,492 | How to open a new window with generated javascript code? | <p>I am trying to open a new window and write some elements and javascript tag.</p>
<p>The code looks like,</p>
<pre><code>var OpenWindow = window.open("ImagePreview.html", "mywindow","height=768,width=1024");
OpenWindow.document.write("<style type='text/css'>.normal{zoom:20%; -moz-transform:scale(0.2); cursor:pointer;}.notZoomed{zoom:20%; -moz-transform:scale(0.2); cursor:pointer;}.zoomed{zoom:100%; -moz-transform:scale(1); cursor:pointer;}</style>");
OpenWindow.document.write("<script type='text/javascript'>$(function(){$('#imageFullView').data('zoomed', false);$('#imageFullView').click(function(){$('#imageFullView').removeClass('normal');if($('#imageFullView').data('zoomed')){$('#imageFullView').removeClass('zoomed');$('#imageFullView').addClass('notZoomed');$('#imageFullView').data('zoomed', false);}else{$('#imageFullView').removeClass('notZoomed');$('#imageFullView').addClass('zoomed');$('#imageFullView').data('zoomed', true);}})");
OpenWindow.document.write("<img id='imageFullView' class='normal' src='" + data.previewImage + "' alt='img'/>");
OpenWindow.document.write("<br>");
OpenWindow.document.write("<center><a href='javascript:self.close()' target='_self'>Close</a></center>");
</code></pre>
<p>But the code breaks while trying to write javascript tag with code.
If i remove that line code executes without breaking.</p>
<p>Is it not the right way to add javascript code to a page <code>window.open()</code>?</p>
<p>How to do it using jquery?</p>
<p>Thanks!</p>
| javascript jquery | [3, 5] |
2,966,408 | 2,966,409 | Making table rows but not table headers clickable in jquery | <p>Currently I am using</p>
<pre><code>$('#mytable tr').click(function() {
blah blah
});
</code></pre>
<p>This makes all rows, including the headers clickable. How can I exclude the headers or <code><th></code>'s?</p>
| javascript jquery | [3, 5] |
4,114,789 | 4,114,790 | Submit form after return false | <pre><code>$('#form').submit(function(e){
e.preventDefault();
$.ajax({
//ajax stuff
success: functtion(data){
//do stuff with data, then submit form
$('#form').submit(); // <-- this wont submit the form
}
});
});
</code></pre>
<p>How can I submit this form after my ajax call is complete? Thanks in advance</p>
| javascript jquery | [3, 5] |
1,353,949 | 1,353,950 | Using jQuery and PHP to Display Data | <p><strong>Background</strong></p>
<p>I don't know much about PHP or jQuery, and I was wondering if what I'm trying to do is possible. I have a server with access to a database behind a firewall. I want to use jQuery to push the data out to an external server's PHP script every 5 seconds where it will be displayed publically. This external server does not have access to a database that I know of. If this is possible, what would I have to put in the PHP script?</p>
<p><strong>What I Have So Far</strong></p>
<p>internalServer.js:</p>
<pre><code>function timedPost() {
$.ajax({
type: 'POST',
url: 'http://externalserver/display.php',
crossDomain: true,
data: '{"some":"json"}',
dataType: 'json'
});
setTimeout("timedPost()", 5000);
}
</code></pre>
<p>externalServer.php</p>
<pre><code><?php
switch ($_SERVER['HTTP_ORIGIN']) {
case 'http://internalServer': case 'https://internalServer':
header('Access-Control-Allow-Origin: '.$_SERVER['HTTP_ORIGIN']);
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers: Content-Type');
break;
}
?>
</code></pre>
| php jquery | [2, 5] |
3,029,294 | 3,029,295 | Defining variables in jQuery | <p>Can someone explain the difference between using a $ when defining variables in jQuery and not. Does it have any impact on performance?</p>
<pre><code>var $someVar = $("a");
var someVar = $("a");
</code></pre>
<p>Also, what is the difference in calling variables with and without $(someVar) For example:</p>
<pre><code>$(someVar).html();
someVar.html();
</code></pre>
| javascript jquery | [3, 5] |
1,646,659 | 1,646,660 | Getting A Specific Twitter Status | <p>I've been trying to get the contents of a specific status using the status url e.g <a href="http://twitter.com/#!/jquery/status/36102693709680640" rel="nofollow">http://twitter.com/#!/jquery/status/36102693709680640</a> and also get the username associated with the status. In this case, @jquery</p>
<p>Is there a way to do this in php and/or jquery?</p>
| php jquery | [2, 5] |
2,808,409 | 2,808,410 | Restrict the text length assigned for Link Button from DB | <p>I have some text being fetched from the DB, which I am binding to the DataList <code>ItemTemplate</code> in the following form:</p>
<p><code><asp:LinkButton runat="server" Text='<%#Eval("url")%>' /></code></p>
<p>The text that is fetched from the DB might be long and I want to restrict it to (let's say 50 chars at max. with a ... afterwards) in the above <code>eval</code> assignment.</p>
<p>How can this be done here?
Secondly, how do I specify the link here in <code>LinkButton</code> so that on clicking on it, it goes to the specified, the link should open in a new window as in <code>taget=_blank</code></p>
| c# asp.net | [0, 9] |
229,794 | 229,795 | Is it better to learn the DOM or jQuery first? | <p>I have gotten very familiar with the core functionality of Javascript and now I am aiming at learning DOM manipulation. I have already thought of learning jQeury for this but I don't know if it is good idea to learning it before first getting familiar with the core functionality of the DOM.</p>
<p>Should I first learn the core functionality of the DOM and then learn jQuery? If so, why? Or should I just go on ahead and learn jQuery?</p>
| javascript jquery | [3, 5] |
5,924,874 | 5,924,875 | Javascript Background color switching | <p>I am trying to use javascript to control the background color of a form element, what I have so far:</p>
<pre><code> <script type="text/javascript">
$(document).ready(function() {
$('option.POIs').click(function() {
$(this)
.css('background-color','#EE178C')
});
});
</script>
</code></pre>
<p>It works well, however I would like for it to toggle between to different colors. Default color would be #FFFFFF and the other would be #EE178C. So when the page loads the bg color is #FFFFFF when I click on the item the bg changes to #EE178C, and if I click on it again it goes back to #FFFFF.</p>
<p>Any help would be appreciated!</p>
| javascript jquery | [3, 5] |
3,570,843 | 3,570,844 | Programmatically add text to the clipboard in C# | <p>Is there a way to programmatically add text to the clipboard in C# (3.5) or javascript ? Does the client machine type make a difference? </p>
<p>Edit: Sorry, forgot to mention am using asp.net.</p>
| c# javascript asp.net | [0, 3, 9] |
4,727,363 | 4,727,364 | Fadeout div after executing script with jQuery | <p>With this function I want to submit data (res_id) to a script and fadeout the div by it's id (using variable pos), the script is executed but the div won't fade out. Why is that?</p>
<pre><code>$('.remove_resort').click(function() {
pos = $(this).attr("id");
rem_res();
});
function rem_res() {
$.get("/snowreport/request/remove.php", {
res_id: pos
}, function(data1) {
pos.fadeOut("slow");
});
}
</code></pre>
| javascript jquery | [3, 5] |
4,454,739 | 4,454,740 | How to logout of android app after particular time? | <p>I'm building an android app which has a login and logout option. How do I make the app go back to login screen if the user has logged in and not used it(or kept idle) for some time(say 10min)? Also, how do I check for multiple logins? Please note that my app uses an external database(mysql). I did this using php code. Also, how do I check for multiple logins(I've multiple users) from mysql and allow each user to log in? </p>
<p>This is my code for authentication:</p>
<pre><code>try
{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://10.0.2.2/user_validate.php");
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
byte[] data = new byte[256];
buffer = new StringBuffer();
int len = 0;
while (-1 != (len = inputStream.read(data)) )
{
buffer.append(new String(data, 0, len));
}
inputStream.close();
}
catch (Exception e)
{
Toast.makeText(Login.this, "error"+e.toString(), Toast.LENGTH_LONG).show();
}
if(buffer.charAt(0)=='Y')
{
Intent intent = new Intent(getApplicationContext(),
Home.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
finish();
startActivity(intent);
}
</code></pre>
| java android | [1, 4] |
4,664,242 | 4,664,243 | Setting IFrame size from within the IFrame | <p>I've been trying a few things like the following trying to get the iframe to be reset from within the iframe but I am not sure what I am doing wrong. Ideas?</p>
<pre><code> window.top.$("#ID").width(324);
window.top.$("#ID").height(369);
</code></pre>
<p>Has not worked.</p>
| javascript jquery | [3, 5] |
5,161,148 | 5,161,149 | JQuery: get radio button value | <p>I have the following HTML:</p>
<p>HTML:</p>
<pre><code><input type="radio" name="abc" value="0" selected="selected" style="display:none" />
<input type="radio" name="abc" value="1" />1+
<input type="radio" name="abc" value="2" />2+
<input type="radio" name="abc" value="3" />3+
</code></pre>
<p>JQuery to get the selected radio button</p>
<pre><code>$('input:radio[name=abc]:checked').val();
</code></pre>
<p>Why doesn't the code above work on page load, BEFORE a user selected a radio button? It's strange because the code above does work AFTER a user selected a radio button.</p>
<p>It seems to me that I have set the default radio button value to be <code>0</code>, but if you</p>
<p>Meaning, if the radio button value is selected, return the selected value - otherwise, return 0 (when no value has been selected)</p>
| javascript jquery | [3, 5] |
2,796,796 | 2,796,797 | Redirection from HTML page to PHP page using jQuery | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4655535/how-to-redirect-by-using-jquery">How to redirect by using jquery?</a> </p>
</blockquote>
<p>In my site I want to redirect a user from HTML page to PHP page using jQuery.</p>
<p>How can I do this?
Is this possible?</p>
| php javascript jquery | [2, 3, 5] |
4,123,422 | 4,123,423 | how to read text from notepad? | <p>I have a notepad with in fix format sentence like</p>
<pre><code>name...
Image...
Text...
</code></pre>
<p>I need to read all Text option with given criteria from notepad.</p>
<p>First i need calculate all words which are starting with #.</p>
<p>Second i need to calculate repeated word excluding like a,an,the,is,am,are,do,did.</p>
<p>How can i calculate this?</p>
| c# asp.net | [0, 9] |
3,694,099 | 3,694,100 | How do I tell difference between object and string in javascript? | <p>I have a javscript function (actually a jQuery plugin) which I will want to call as either</p>
<pre><code>myFunction("some input");
</code></pre>
<p>or</p>
<pre><code>myFunction({ "prop": "value 1", "prop2": "value2" });
</code></pre>
<p>How do I, in the function, tell the two apart?</p>
<p>In other words, what should go in the <code>if</code> conditions below?</p>
<pre><code>if (/* the input is a string */)
{
// Handle string case (first of above)
}
else if (/* the input is an object */)
{
// Handle object case (second of above)
}
else
{
// Handle invalid input format
}
</code></pre>
<p>I have jQuery at my disposal.</p>
<p><strong>Update:</strong> As noted in an answer, if the input is <code>new String('some string')</code>, <code>typeof(input)</code> will return <code>'object'</code>. How do I test for <code>new String('')</code>, so I can handle that the same way as <code>''</code>?</p>
| javascript jquery | [3, 5] |
4,454,691 | 4,454,692 | How do you put a comma after the information from selected checkbox into a Textbox? | <pre><code> foreach (GridViewRow row in GridView1.Rows)
{
var chk = row.FindControl("myCheckBox") as CheckBox;
if (chk.Checked)
{
var email = row.FindControl("LabelEmail") as Label;
txtEmails.Text += (string.Join(",", email.Text));
}
</code></pre>
<p>I'm extracting the email from the grid view and suppose to put the email accordingly with a comma separating them. I tried using the string.join method however it's not appearing in the textbox at all. I tried not using string.join but the comma will be added beside every email. How do I separate the email properly? </p>
<p>Example : [email protected], [email protected], [email protected]</p>
| c# asp.net | [0, 9] |
2,311,497 | 2,311,498 | Is calling $find a relatively expensive operation? | <p>I am just wondering what the pros/cons would be between these two styles of coding:</p>
<pre><code>var foo;
$(document).ready( function() {
foo = $find(fooID);
});
function OnBarClicked()
{
foo.doStuff();
foo.doMoreStuff();
}
</code></pre>
<p>compared to</p>
<pre><code>function OnBarClicked()
{
$find(fooID).doStuff();
$find(fooID).doMoreStuff();
}
</code></pre>
<p>I feel like there's probably a gotcha in the former, but I'm not aware of why there would be a gotcha. In addition, if there's any seek time for <code>$find()</code>.. is it more efficient to find all variables guaranteed to be 'found' 2+ times at the start, and then use the one instance?</p>
<p>EDIT: <a href="http://msdn.microsoft.com/en-us/library/bb397441.aspx" rel="nofollow">$find description and usage</a></p>
<pre><code>var radListBox1ID = "<%= RadListBox1.ClientID %>";
var radListBox = $find(radListBox1ID);
alert(radListBox.get_id()); //Alerts RadListBox1.ClientID
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
4,916,843 | 4,916,844 | jQuery: value.attr is not a function | <p>I have this snipped in my page:</p>
<pre><code>$('#category_sorting_form_save').click(function(){
var elements = $("#category_sorting_elements > div");
$.each(elements, function(key, value) {
console.info(key," : ",value);
console.info("cat_id: ",value.attr('cat_id'));
});
});
</code></pre>
<p>And when it is executed, I get:</p>
<pre><code>0 : <div class="dragable" cat_id="6" value="" style="opacity: 1;">
value.attr is not a function
console.info("cat_id: ",value.attr('cat_id'));
</code></pre>
<p>What am I doing wrong here? I am trying to get the value of the div.cat_id element.</p>
<p>Thanks :)</p>
<p>Eric</p>
| javascript jquery | [3, 5] |
4,027,246 | 4,027,247 | project.properties in android project | <p>I just cloned this from <a href="https://github.com/jgilfelt/android-mapviewballoons">github</a> and when I tried to import it to eclipse as an android project, it doesn't have a default.properties. Why is this and how do I handle this?</p>
| java android | [1, 4] |
1,210,489 | 1,210,490 | sales tax calculation (city limits vs not in city limits) | <p>I've been tasked with creating a tool to calculate sales tax. So I signed us up for a monthly update of all zip codes and their associated tax rates. The problem I'm running into is that in 1 zip code you may have some addresses that are in city limits (so you have to charge city sales tax) and another that is out of city limits (then you dont charge city sales tax). Every example of tax calculation I find is based off zip code...not necessarily street address. Can anyone provide me some insight on how I go about figuring out exact sales tax? </p>
<p>Update: This would be sales tax on a website and also a tool for salesman to reference when cutting quotes.</p>
| php javascript | [2, 3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.