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 |
---|---|---|---|---|---|
4,521,955 | 4,521,956 |
Split value into percentage with a slider
|
<p>im new to jQuery and searching a way for doing smthing like this:</p>
<p>I have a value [100] and 5 categorys [apple, banana, kiwi, lemon, orange]</p>
<p>What I want is to have for each category a slider (a line with a point on it you can move)</p>
<p>So every category starts with a value of 20 (100 / 5).</p>
<p>When there is more banana than apple and you "slide" banana to the value of 40 the other values should decrase so I've still the full percentage of 100%.</p>
<p>Anyone knows a plugin or has a handy snippet?</p>
<p>Thx in advance!</p>
|
javascript jquery
|
[3, 5]
|
2,953,072 | 2,953,073 |
Slider sliding back to the first image
|
<p>I am using jQuery to slide through some images.</p>
<p>The slide animation is achieved using:</p>
<pre><code>$('#slideInner').animate({ 'marginLeft' : slideWidth*(-currentPosition)});
</code></pre>
<p>This works fine, however when I reach the final image, and it loops back to the start, this animation will quickly slide through all of the previous elements to display the first (obviously because I am suddenly reducing the left margin).</p>
<p>What code would I need to write in order to allow the transition from last image back to first image to continue being a LEFT slide animation, displaying only the transition from last slide to first (without showing all other slides).</p>
<p>To make things a little more complex, I have left/right buttons allowing the user to move forward/backwards through the slider. These work fine, but it does mean that the solution cannot break these buttons.</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
1,773,420 | 1,773,421 |
Capture Click on Android Tablet Javascipt Submit to File
|
<p>I am new to JavaScript and am in need of some help. I would like to bring it up with a picture in the background. Then I would like to click points and have cross hairs put over them, as well as connecting them with a line as it goes. When I am done clicking, I need a submit button. I would like a text file to be exported on the server with the list of points in order.</p>
<p>Any help would be greatly appreciated! </p>
|
javascript android
|
[3, 4]
|
2,067,432 | 2,067,433 |
Java - find next file in sequence
|
<p>I have a directory with a number of images. Each image is in the format image-xxx.png, where xxx is a random integer (between 0 and 1million). Not all numbers are taken, so for instance it is possible to have image-1.png followed by image-27.png, etc (they're not 0 padded). Let's say I have the following files in my directory:</p>
<pre><code>image-1.png
image-27.png
image-1511.png
image-125252.png
</code></pre>
<p>How can I find the next integer after 27 (1511) without looping through each possible integer between 28 to 1511 and checking if file.exists()?</p>
|
java android
|
[1, 4]
|
3,405,335 | 3,405,336 |
how to access javascript variable in global.asax?
|
<p>I have a javascript variable in a page default.aspx</p>
<pre><code>var name="user1"
window.location="test.aspx"
</code></pre>
<p>this page will submit to test.aspx and in global.asax while firing Application_BeginRequest event ,i need to access the variable "name". i need to do this without cookies.
Anyone can help me on this?</p>
|
javascript asp.net
|
[3, 9]
|
5,628,642 | 5,628,643 |
How to cancel TimerTask safely?
|
<p>I have been developing the Android application and I use <code>Timer</code> and <code>TimerTask</code> objects for executing one task after particular time. But there is one problem - sometimes I need to cancel timertask, but if I do it that Android will cause an <code>IllegalStateException</code>. How can I cancel the task safely? </p>
|
java android
|
[1, 4]
|
3,387,829 | 3,387,830 |
jQuery Plugin Check Version
|
<p>When writing a new jQuery plugin is there a straightforward way of checking that the current version of jQuery is above a certain number? Displaying a warning or logging an error otherwise.</p>
<p>It would be nice to do something like:</p>
<pre><code>jQuery.version >= 1.2.6
</code></pre>
<p>in some form or another.</p>
|
javascript jquery
|
[3, 5]
|
1,254,335 | 1,254,336 |
jQuery > on checkbox change run code
|
<p>I have rows of "To Do" on a checklist, each row has a "Completed" checkbox. Upon clicking the box with the mouse, the following code runs and correctly posts the information (updates the database to track that the task has been completed):</p>
<pre><code> $(function ()
{
$('[id*="howto_step_complete"]').mousedown(function ()
{
var id = $(this).attr('id');
var howto_used_id = id.substr(id.length - 2);
var howto_step_minutes = $('#howto_step_minutes' + howto_used_id).val();
if (!$(this).is(':checked'))
{
var checked = true;
}
else
{
var checked = false;
}
var value = $('#howto_used_id').val();
if (howto_step_minutes != '')
{
$.post("updateChecklist.php",
{
howto_used_id: howto_used_id,
howto_step_complete: checked,
howto_step_minutes: howto_step_minutes
},
function (data)
{
var obj = jQuery.parseJSON(data);
var howto_used_id_returned = obj.howto_used_id;
var howto_step_complete = obj.howto_step_complete;
alert(howto_step_complete);
});
$(this).trigger("change");
}
else
{
alert('Minutes must be filled out before checking complete');
}
});
});
</code></pre>
<p>The problem is, if a person uses tabs to move around the form and then uses the spacebar to check the box instead, this isn't triggered, as it's using mousedown. I tried changing this to <code>change()</code> instead but then my alert box keeps coming up over and over again with "false".</p>
<p>It should be true since I've just checked the box and I don't understand why it continually comes up. </p>
<p>What can I use instead of <code>mousedown()</code> to get this code to post properly?</p>
|
javascript jquery
|
[3, 5]
|
547,793 | 547,794 |
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]
|
5,855,224 | 5,855,225 |
How to determine the best "framerate" (setInterval delay) to use in a JavaScript animation loop?
|
<p>When writing a JavaScript animation, you of course make a loop using setInterval (or repeated setTimeout). But what is the best delay to use in the setInterval/setTimeout call(s)?</p>
<p>In the <a href="http://api.jquery.com/animate/">jQuery API page for the .animate() function</a>, the user "fbogner" says:</p>
<blockquote>
<p>Just if anyone is interested: Animations are "rendered" using a setInterval with a time out of 13ms. This is quite fast! Chrome's fastest possible interval is about 10ms. All other browsers "sample" at about 20-30ms.</p>
</blockquote>
<p>Any idea how jQuery determined to use this specific number?</p>
<hr>
<p>Started bounty. I'm hoping someone with knowledge of the source code behind Chromium or Firefox can provide some hard facts that might back up the decision of a specific framerate. Or perhaps a list of animations (or frameworks) and their delays. I believe this makes for an interesting opportunity to do a bit of research.</p>
<hr>
<p>Interesting - I just took the time to look at Google's <a href="http://www.google.com/pacman">Pac-Man</a> source to see what they did. They set up an array of possible FPSes (90, 45, 30), start at the first one, and then each frame they check the "slowness" of the frame (amount the frame exceeded its allotted time). If the slowness exceeds 50ms 20 times, the framerate is notched down to the next in the list (90 -> 45, 45 -> 30). It appears that the framerate is never raised back up, presumably because the game is so short-lived that it wouldn't be worth the trouble to code that.</p>
<p>Oh, and the setInterval delay is of course set to 1000 / framerate. They do, in fact, use setInterval and not repeated setTimeouts.</p>
<p>I think this dynamic framerate feature is pretty neat!</p>
|
javascript jquery
|
[3, 5]
|
1,181,550 | 1,181,551 |
JavaScript, transform object into array
|
<p>I've got an object:</p>
<pre><code>var obj = {
"Mike": 24,
"Peter": 23,
"Simon": 33,
"Tom": 12,
"Frank": 31
};
</code></pre>
<p>I want to create an array that holds the values of the object. The keys (key names) can be disregarded:</p>
<pre><code>[24, 23, 33, 12, 31]
</code></pre>
<p><strong>The order of the values is NOT important!</strong> </p>
<p>One solution (obviously) would be do have a function that takes the values and puts them into an array:</p>
<pre><code>var arr = valuesToArray(obj);
</code></pre>
<p>I will accept such a function as the answer. However, I would be more pleased if there would be an API function (ECMAScript, jQuery, browser-specific, ...) that could do this. Is there such a thing? </p>
|
javascript jquery
|
[3, 5]
|
396,894 | 396,895 |
Add fade in effect on onload
|
<p>How can i add fade in for this specefic code? I want the pictures to fade in on onload.
Have done some research on Stackoverflow, but couldn't find anything useful. Some help would be appreciated.</p>
<pre><code><script type="text/javascript">
window.onload = function(){
var img = document.getElementById('img')
if(img.clientHeight<$('#div').height()){
img.style.height=$('#div').height()+"px";
}
if(img.clientWidth<$('#div').width()){
img.style.width=$('#div').width()+"px";
}
}
</script>
</code></pre>
<p>Extra question: Is it also possible to add a load-function to this code? </p>
|
javascript jquery
|
[3, 5]
|
4,284,216 | 4,284,217 |
Php/Javascript to make a browser game?
|
<p>I've been on and off intrested in making a text based browser game.
I have been turned off by the idea because of the daunting amount of things to learn.</p>
<p>PHP (or another sever side scripting language)
Javascript
HTML
MySql</p>
<p>And the fact of severs and apache..</p>
<p>Can I just pay for web hosting and by-pass having to set-up apache?</p>
<p>Also how long will it take me to learn all thoose things well enough to start work on my game?</p>
<p>Should I just stick with Flash and then C# for XNA?</p>
|
php javascript
|
[2, 3]
|
1,716,347 | 1,716,348 |
php post data in if else statement
|
<p>I have a sign up form came with 3 pages.
I use jquery $post to post error message back without refresh
2nd php page will check all data. if all data correct than it will send to 3rd page(agreement page). If user click agree in 3rd page, than all data will write into database.</p>
<p>However I have problem to post data to 3rd page in php by using if & else</p>
<p>This is a sign up form. Therefor I can't use $_GET[]</p>
<pre><code>ex. else{header("location:agreement.php?email=somedata&pw=somedata");}
</code></pre>
<p>is any way I can pass those data to 3rd page in php?</p>
<p>1st page</p>
<pre><code> <form>
<input type="text" name="email"/>
(some input)...
<input type="button" onclick="get();"/>
</form>
JQUERY
function get(){
$('#error').hide();
$.post('signup.php',{firstname:signup.firstname.value,...},
function(output){$('#error').html(output).fadeIn(50);})
}
</code></pre>
<p>2nd page </p>
<pre><code>signup.php
if(will check everything){echo "error";}
//Jquery will output error without refresh the page
else{
[Need to POST all sign up data from 1st page to 3rd page]
header("to agreement.php");
}
</code></pre>
<p>3rd page </p>
<pre><code>agreement.php
if user tick agree. All sign up data will insert into database.
</code></pre>
|
php jquery
|
[2, 5]
|
2,738,329 | 2,738,330 |
Want to add a value and remove on a single click using javascript or jquery
|
<p>I am using a onclick function and adding a value to by paasing a value to it. If the value already exists den i remove that value from the list.</p>
<pre><code>function send_value(str)
{
//alert(str);
var sub_id = document.getElementById('selected_sub_id').value;
//alert(sub_id.indexOf(str));
if(sub_id.indexOf(str)==-1)
{
if(sub_id=="")
{
sub_id+=str;
}
else
{
sub_id+=',';
sub_id+=str;
}
}
else
{
sub_id = sub_id.replace(str+",", "");
sub_id = sub_id.replace(","+str, "");
sub_id = sub_id.replace(str, "");
}
//alert(sub_id);
document.getElementById('selected_sub_id').value=sub_id;
}
</code></pre>
<p>This is the function. Suppose i have the values 1,2,3,4 in the <code>selected_sub_id</code> and i am passing 5 to it, it will be stored as 1,2,3,4,5
now i am passing 24 it will be stored as 1,2,3,4,5,24
No suppose i want to remove 2, so when i send 2 to the function it removes all the occurrences of 2 so i am left with only 1,3,4,54...
kindly help me with this thanks in advance..</p>
|
javascript jquery
|
[3, 5]
|
5,214,513 | 5,214,514 |
Calculation of per unit of Electricity
|
<p>I'm trying to build a electrical units calculator. I have developed one but I am not satisfied with my code. I am here to ask you guys is there any other way to develop this calculator. </p>
<p>Following is my code :</p>
<p><strong>HTML</strong></p>
<pre><code><input name="" type="text" value="" onblur="check()" id="bill" />
</code></pre>
<p><strong>SCRIPT</strong></p>
<pre><code><script>
function check()
{
var a=0,b=0,c=0;
var tot = 0;
var tot1=0;
var tot2=0;
var tot3=0;
var a = document.getElementById('bill').value;
if(a>200)
{
b = a - 200;
alert('b is: '+b);
if(b>200)
{
c= b-200;
alert('c is: '+c);
tot1 = 200*4;
tot2 = 200*5;
tot3 = c*6;
tot = tot1 + tot2 + tot3;
alert(tot);
}
else
{
tot1 = 200*4;
tot2 = b*5;
tot3 = c*6;
tot = tot1 + tot2 + tot3;
alert(tot);
}
}
else
{
tot = a*4;
alert(tot);
}
}
</script>
</code></pre>
<p>Please help me friends..:)</p>
|
javascript jquery
|
[3, 5]
|
1,345,558 | 1,345,559 |
Is there a better way to redirect and pass parameter
|
<p>I have this table</p>
<pre><code><table id="tableDg" border=1>
<tbody>
<tr>
<td ><input type="hidden" id="path" readonly="true" value="{path}">{path}</input></td>
<td><input type="checkbox" class = "chkbCsm" ></input></td>
<td ><input type="hidden" id="nameText" readonly="true" value="{name}"><a href="#" class="aDg">{name}</a></input></td>
<td ><input type="hidden" id="nameText" readonly="true" value="{host}">{host}</input> </td>
</tr>
</tbody>
</table>
</code></pre>
<p>After reading post from <strong>Felix Kling</strong>
My jQuery </p>
<pre><code>$('#tableDg tbody tr td a.aDg').live('click', function(){
path=$('input', $(this).parent().prev().prev()).val();
window.location.href = "/simon/infopage.html";
var url_action="/getData";
var client;
var dataString;
if (window.XMLHttpRequest){
client=new XMLHttpRequest();
} else {
client=new ActiveXObject("Microsoft.XMLHTTP");
}
client.onreadystatechange=function(){
if(client.readyState==4&&client.status==200)
{
//here i will get back path in infopage.html
}
};
dataString="request=getconfigdetails&path="+path;
client.open("POST",url_action,true);
client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
client.send(dataString);
});
</code></pre>
<p>Is this how i should get <code>path</code> from my previous page to <code>infopage.html</code></p>
|
javascript jquery
|
[3, 5]
|
2,620,175 | 2,620,176 |
how to send a value from a HTML dropdown box to a JQuery function
|
<p>I'm very new to JQuery and don't have much experience with javascript at all, and after hours of trying to figure this out i give up. I know how to do it in PHP, but there's something I'm missing when I try it in JQuery.</p>
<p>I have a html-file that generates a dorpdown box that looks something like tihs:</p>
<pre><code><form action="" method="GET">
<select id="countiesList" name="counties">
<option value="all" selected="selected">All Counties</option>
<option value="county1">County 1</option>
<option value="county2">County 2</option>
...
</select>
</from>
</code></pre>
<ol>
<li>How do I get the selected value from the dropdownbox in to a JQuery function?
Do I have to refer to the function I want to use in the form?</li>
<li>Should I have a submit button? (I'd prefer not to)</li>
</ol>
<p>--edited--
My point is that I want to find out which of the options the user selects, so that I can use it in another function.</p>
<p>Thanks a lot!</p>
|
javascript jquery
|
[3, 5]
|
3,524,505 | 3,524,506 |
java.io.IOException: Read-only file system
|
<pre><code>File mediaDir = new File("media");
if (!mediaDir.exists()){
mediaDir.createNewFile();
mediaDir.mkdir();
}
File f = new File("/data/data/com.test.image/files/media/Voucher.jpg");
f.createNewFile();
FileOutputStream fos = new FileOutputStream(f);
fos.write(b);
fos.close();
</code></pre>
<p>Try to write a file in phone internal memory but it throw an error: <strong>java.io.IOException: Read-only file system</strong></p>
|
java android
|
[1, 4]
|
4,236,295 | 4,236,296 |
Split causes "Object doesn't support this property or method" exception
|
<p>call to <code>split</code> on a variable causes a <em>"Object doesn't support this property or method"</em> exception and I don't know why.
Here's my code:</p>
<pre><code>function getKontaktPersonen(kontaktSelectBox) {
var kontaktPersonen = [];
var id_and_name = kontaktSelectBox.attr('id');
var id_part = getID_PartFromName(id_and_name);
var textboxname;
var selectboxname;
if (kontaktSelectBox.attr('class') == 'kontaktSelectBox') {
textboxname = "TextBoxKunde" + id_part;
selectboxname = "SelectBoxKontaktPerson" + id_part;
} else if (kontaktSelectBox.attr('class') == 'NewkontaktSelectBox') {
textboxname = "NewTextBoxKunde" + id_part;
selectboxname = "NewSelectBoxKontaktPerson" + id_part;
} else {
return false;
}
var kundeBox = $('#' + textboxname);
var kundeBoxVal = kundeBox.val();
if (kundeBoxVal != '' && kundeBoxVal != null) {
var adr_id = kundeBoxVal.split(';')[1];
//here comes an ajax call
//[...]
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,764,188 | 2,764,189 |
ASP.net attachment then refresh page
|
<p>I am working on a c# project using ASP .net.</p>
<p>I have a list of reports with a hyperlink for each, which calls the web server, retrieves
a PDF and then returns the PDF for the user to save or open:</p>
<p>ASPX page:</p>
<pre><code><table>
<tr>
<td>
<a href="#" onclick="SubmitFormToOpenReport();">Open Report 1</a>
<td>
</tr>
...
</table>
</code></pre>
<p>ASP.Net:</p>
<pre><code>context.Response.Clear();
context.Response.AddHeader("content-disposition", "attachment;filename=report.pdf");
context.Response.Charset = "";
context.Response.ContentType = "application/pdf";
context.Response.BinaryWrite(myReport);
context.Response.Flush();
</code></pre>
<p>This works as expected, however I would like it to also refresh the page with an updated list. </p>
<p>I am having trouble as the single request/response is returning the report.</p>
<p>Is there a way to refresh the page as well? </p>
<p>While there is a correct response, feel free to include answers which details alternative solutions/ideas for doing this.</p>
|
c# asp.net
|
[0, 9]
|
1,104,360 | 1,104,361 |
Deleting Gridview rows using Javascript
|
<p>I have a javascript function to clear my form which includes a gridview, I previously tried another way to delete the rows without postback but somehow when I tried to add a new row, all the previous bounce back. Maybe I am using viewstate to maintain my gridview, not too sure but below is what I am doing which works well but somehow it only deletes one row, I guess probably when the postback occurs, the loop got wiped out. Any advice? I need the loop to delete all my gridview rows. Thanks! </p>
<pre><code> for (i = 0; i < camGv.rows.length; i++) {
window.__doPostBack('ctl00$cphBody$gvCamVoucher', 'Delete$0');
}
</code></pre>
|
javascript asp.net
|
[3, 9]
|
3,051,673 | 3,051,674 |
Unable To Access Label Text in Code Behind file when setting it through Javascript
|
<p>I have a label control in my Page</p>
<pre><code><asp:Label ID="EmpType" runat="server" Text=" " ></asp:Label>
</code></pre>
<p>I am setting its value through Javascript using the following code</p>
<pre><code>var lblEmpType = document.getElementById('<%=EmpType.ClientID %>');
lblEmpType.innerText = "Hi";
</code></pre>
<p>The value is getting displayed in the Page correctly but when i try to access "EmpType.Text" from code behind file, the value is " " ... I want to access the value of the label which i have set through javascript..</p>
|
javascript asp.net
|
[3, 9]
|
657,596 | 657,597 |
Having trouble reading string in if statement
|
<p>I am able to covert an integer array to a string.</p>
<pre><code> if (tempArray1[6] == true) {
num[0] = 1;
}
if (tempArray2[6] == true) {
num[1] = 1;
}
if (tempArray3[6] == true) {
num[2] = 1;
}
if (tempArray4[6] == true) {
num[3] = 1;
}
Number = Arrays.toString(num).replace(",", "");
Log.e("NUMBER", "number is :" + Number);
</code></pre>
<p>The outcome of the Log statement reads </p>
<p>11-07 10:03:17.577: ERROR/NUMBER(990): number is :[1 1 0 0]</p>
<p>Now i try to use an if statement to check for the possible outcome:</p>
<pre><code> if (Number == "1 1 0 0") {
Log.e("NOTIFY", "1100");
notificationMessage = "Input Wire 1 and 2";
}
</code></pre>
<p>But for some reason it never find this if statement to be true, even though log says that Number is 1100. Can someone please help me in being able to read the value of Number(string) in the if statement. </p>
|
java android
|
[1, 4]
|
1,227,245 | 1,227,246 |
javascript/jQuery Array concatenation?
|
<p>I have some simple jQuery code:</p>
<pre><code>var response = Array()
$('.task-list').each(function() {
response.concat(response,$('#' + this.id).sortable('toArray'));
}
);
console.log(response);
</code></pre>
<p>The problem I'm having is that I think I'm using concat improperly- the result is an empty array. When I use array push, it works correctly.</p>
|
javascript jquery
|
[3, 5]
|
2,455,535 | 2,455,536 |
DropDownList inaccessible
|
<p>I have a drop down list in my TopicTreeSearchControl, on my page, but from the actually page where the control sits, I get an error:</p>
<pre><code>'TopicSearchTree.ddlDatasources' is inaccessible due to its protection level
</code></pre>
<p>I am trying to do this from my page:</p>
<pre><code>protected override void Render(HtmlTextWriter writer)
{
Page.ClientScript.RegisterForEventValidation(TopicSearchTreeControl.ddlDatasources.UniqueID);
Page.ClientScript.RegisterForEventValidation(TopicSearchTreeControl.ddlYears.UniqueID);
base.Render(writer);
}
</code></pre>
<p>How do I access this?</p>
|
c# asp.net
|
[0, 9]
|
5,695,367 | 5,695,368 |
Use next and prev() in jquery
|
<pre><code><label for="a1">First:</label>
<input id="a1" class="first" type="text" name="a1" value="123">
<label for="b1">Second:</label>
<input id="b1" class="second" type="text" name="b1"> <br />
<label for="a2">First:</label>
<input id="a2" class="first" type="text" name="a2"value="3424">
<label for="b2">Second:</label>
<input id="b2" class="second" type="text" name="b2"> <br />
<label for="a3">First:</label>
<input id="a3" class="first" type="text" name="a3"value="1235">
<label for="b3">Second:</label>
<input id="b3" class="second" type="text" name="b3"> <br />
$('.second').click(function(){
var get_first = // ???
$(this).val(get_first);
})
</code></pre>
<p>i would like for example - if i click on input b3 then in this value now is value from a3. how can i make it with next and prev in one class?</p>
<p><a href="http://jsfiddle.net/Bgkrz/" rel="nofollow">http://jsfiddle.net/Bgkrz/</a></p>
|
javascript jquery
|
[3, 5]
|
4,771,694 | 4,771,695 |
Why this works out of UpdatePanel but not inside UpdatePanel?
|
<p>I have copy and paste this Alert Class:
<a href="http://madskristensen.net/post/JavaScript-AlertShow%28e2809dmessagee2809d%29-from-ASPNET-code-behind.aspx" rel="nofollow">http://madskristensen.net/post/JavaScript-AlertShow%28e2809dmessagee2809d%29-from-ASPNET-code-behind.aspx</a></p>
<p>It works except with a button inside an update panel but it shows no error. The asp code inside is executed but nothing shows up on client side. </p>
|
c# asp.net
|
[0, 9]
|
6,032,489 | 6,032,490 |
How to find the position of the certain element inside a div?
|
<p>I am trying to find the image position inside my div</p>
<p>my Html</p>
<pre><code><div>
<p>test</p>
<img src='test1.jpg'/>
<p>test</p>
<p>test</p>
<img src='test2.jpg'/>
<p>test</p>
<img src='test2.jpg'/> --the user clicks this image and I want to know the time it appears. In this case, 2 is what I need.
<p>test</p>
<img src='test2.jpg'/>
<p>test</p>
</div>
</code></pre>
<p>I have</p>
<pre><code>var imagePosition=0;
$('img').click(function(){
var imgSource=$(this).attr('src');
$(this).closest('div').find('img').each(function(){
if($(this).attr('src')==imgSource){
imagePosition++;
}
})
})
</code></pre>
<p>I can find out how many time the same images appear but I can't tell which image the user clicks and it's position. Are there anyways to do this? Thanks so much!</p>
|
javascript jquery
|
[3, 5]
|
2,401,718 | 2,401,719 |
php timer at server side
|
<p>I am using php any mysql. I would like to create a timer that operates in the server side, and when time reaches a certain value (e.g. 06:00:00), it can trigger the running of another file (such as, update data of a table).</p>
<p>Actually, what kind of technique I shall use apart from php? </p>
<p>Thankyou...</p>
|
php javascript
|
[2, 3]
|
4,480,609 | 4,480,610 |
How to tweak the content in the drop down list in asp.net
|
<p>I have a drop down column and the drop down contain a value "accidents" .Now I want to make the value to read as upper case "Accidents" and there are many as such in the grid .One way is to update the current value to uppercase but as these values are being used in the application where they want the wording to be in the lower case .How can these be handled through code..please advise?</p>
|
c# asp.net
|
[0, 9]
|
4,523,506 | 4,523,507 |
jquery table select and data retrieval
|
<p>I am using a html table that contains available times for scheduling. I want the user to be able to click on a time and from that be able to get the column header, which is the staff persons name, and the value of the cell - the time. I than want to change the contents of the cell to 'NA' and set the cell background to some color. I have been playing with this for awhile with no luck. I am new to javascripts and jquery. Any help would be greatly appreciated.</p>
|
javascript jquery
|
[3, 5]
|
2,012,723 | 2,012,724 |
Jquery attr not working on IE 9?
|
<p>Am trying to add an attr for the id and onclick, its working on firefox and chrome but for some reason it isn't working on IE 9 .
Any alternative or something is wrong with me code?</p>
<pre><code>$(".extendedGridView tr td a").each(function (index)
{
if ($(this).html() == "Update")
{
$(this).attr('id', 'insertButton');
$(this).attr('onclick', "return Validate('extendedGridView')");
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,118,639 | 3,118,640 |
Add item in order to a list
|
<p>What is the best way to add an item to an ordered list?</p>
<p>I want that when an item changes the value the value of that control is placed on a list.</p>
<p>Example</p>
<p>-radiobutton value = radiobuttonvalue;<br>
-checkbox value = checkboxvalue;<br>
-textbox value = textboxvalue;<br></p>
<p>clicks: first on the checkbox than radiobutton and last textbox.</p>
<p>output:<br></p>
<pre><code><ul>
<li>radiobuttonvalue</li>
<li>checkboxvalue</li>
<li>textboxvalue</li>
</ul>
</code></pre>
<p>so i that it doen't matter in wich control is clicked first, the output is always in the same order.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,415,226 | 4,415,227 |
Beginner Button click event
|
<p>I am new to Android, i am writing a program where when a user clicks a button a <code>Alert Dialog</code> to appear. This alert dialog has 2 buttons, <code>Yes and No</code>. Upon clicking Yes/No, i need to <code>sysout</code> the response.</p>
<p>The code i have so far; Can someone help me add the Alert Dialog;</p>
<pre><code>public class HelloWorldProjectActivity extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.myFirstScreen);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if(v.getId()==(R.id.button1)){
System.out.println("first button clicked");
// I need a Alert Dialog to appear here, and that will have 2 buttons YES and NO, the users response should be printed to the console.
}
</code></pre>
<p>}</p>
|
java android
|
[1, 4]
|
699,192 | 699,193 |
Is dynamic is same as Object
|
<p>In "CLR via C#" book it's mentioned that dynamic keyword corresponding FCL type is System.Object. please clarify this .</p>
|
c# asp.net
|
[0, 9]
|
2,306,294 | 2,306,295 |
Capture image with camera in android and save with a custom name
|
<p>i have create an android application that will capture picture and save in sdcard folder,now i want to save the image with a custom name.</p>
<pre><code>import java.io.ByteArrayOutputStream;
import android.view.Menu;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
public class MainActivity extends Activity {
private static final int CAMERA_REQUEST = 1888;
private ImageView imageView;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.imageView = (ImageView) this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
photoButton.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
Intent cameraIntent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT,
MediaStore.Images.Media.EXTERNAL_CONTENT_URI.getPath());
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, "new-photo-name.jpg");
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == CAMERA_REQUEST && resultCode == RESULT_OK)
{
Bitmap photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
MediaStore.Images.Media.insertImage(getContentResolver(), photo,
null, null);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] b = baos.toByteArray();
}
}
</code></pre>
<p>here is the code which i have used for capturing the image and save them in the sd card folder,please help me to save the image with a specific name for eg:android.jpeg</p>
|
java android
|
[1, 4]
|
1,956,911 | 1,956,912 |
How to open a user control as popup using jQuery dialog
|
<p>I have Parts.aspx page,<br>
UserControl1.ascx,[ it contains a textbox and one button1 ]<br>
Add.ascx Controls [ it contains a textbox, button2, button 3 ]<br>
I have added UserControl1.ascx in parts.aspx page.</p>
<p>Now when I click button1 [usercontrol1.ascx] it should open like a popup Add.ascx on top of the page using JQuery Dialog.<br>
In Add.ascx user enters comments in the textbox and clicks Submit, after this it should close Add.ascx and the comments entered in Add.ascx page should appear in UserControl1.ascx textbox for <em>readonly</em>.</p>
|
jquery asp.net
|
[5, 9]
|
1,795,012 | 1,795,013 |
Gaining access to content inserted dynamically with ajax
|
<p>This is the fragment of code inserted with ajax:</p>
<pre><code><form>
<label for = "task-name">Name</label>
<input type = "text" id = "task-name" />
<label for = "task-description">Description</label>
<input type = "text" id = "task-description" />
<input type = "hidden" id = "task-col" />
<input type = "hidden" id = "task-row" />
<input type = "submit" id = "add-task" onclick="return false" value="Add" />
</form>
</code></pre>
<p>This is the JS code which insert the previous element in the DOM:</p>
<pre><code>$('html').on('click', '.task-pop', function(){
var pos = $(this).parent().parent().attr('class').split("-");
ajaxObj = getXmlHttpObject();
ajaxObj.onreadystatechange = function(){
if(ajaxObj.readyState == 4 && ajaxObj.status == 200){
$('#pop-hold').html(ajaxObj.responseText);
$('#task-col').val(pos[0]);
$('#task-row').val(pos[1]);
}
};
ajaxObj.open("GET","resources/component/newTask.jsp");
ajaxObj.send(null);
$('#pop-blk').css('display','block');
$('#pop').show("fast");
});
</code></pre>
<p>As you can see I'm trying to add some values to the hidden inputs <code>#task-row</code> and <code>#task-col</code> from the content added dynamically.</p>
<p>The page is properly displayed and no error is thrown but those two fields are never accessed. How can I solve this?</p>
|
javascript jquery
|
[3, 5]
|
2,567,652 | 2,567,653 |
Javascript toggle using div id
|
<p>Hello people i have problem with jquery toggling script..</p>
<pre><code><a class="clickMe">Text 1</a>
</br>
<div class="sri"> - This text will be toggled</div>
<a class="clickMe">Text 2</a>
</br>
<div class="sri"> - This text will be toggled 2</div>
$('a.clickMe').click(function () {
// find first of following DIV siblings
// with class "textBox" and toggle it
$(this).nextAll('div.sri:first').show();
$('div.sri:visible').not($(this).nextAll('div.sri:first')).toggle();
});
</code></pre>
<p>above script is working fine please check the <a href="http://jsfiddle.net/LTYa2/42/" rel="nofollow">demo</a></p>
<p>but now what i need to use <code><div id</code> in place of <code><div class</code> without changing the functionality of the script... i tried many ways but still having some issues...i may dont have to use <code><a class="clickMe"></code> is there is way to fix this?</p>
|
javascript jquery
|
[3, 5]
|
1,726,551 | 1,726,552 |
window.location.replace vs scrollTop
|
<p>I am running on Chrome with the following snippets:</p>
<pre><code><a name="example">&nbsp;</a>
</code></pre>
<p>The following code works correctly. It actually goes to #example as expected.</p>
<pre><code>window.location.replace('#example');
</code></pre>
<p>But the following does <strong>not</strong> work. It always go to the top of the page -- not to the <code>#example</code>.</p>
<pre><code>var target = $('a[name="example"]');
var offset = target.offset();
var top = offset.top;
console.log(top);
$('html, body').animate({scrollTop:top}, 'slow');
</code></pre>
<p>The <code>top</code> returns value 500+ something.
What am I missing?
Thanks in advance for your help.</p>
<p>UPDATE:</p>
<p>After removing the following CSS</p>
<pre><code>position: fixed;
</code></pre>
<p>The above jQuery code works!. But I need this page to be "position: fixed;".
How do I make the above jQuery code works with "position: fixed;"?</p>
|
javascript jquery
|
[3, 5]
|
2,772,422 | 2,772,423 |
~ 'MachineToApplication' beyond application level ~ What does this error means?
|
<p>What should i do when this error prompt my screen</p>
<p>In VS2008 Express Edition</p>
<ol>
<li>C:\Users\ami\Desktop\MyAddressBookasd\MyAddressBook\UpdateTheRecord.aspx: ASP.NET runtime error: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. </li>
</ol>
<p><img src="http://i.stack.imgur.com/ozVpu.jpg" alt="enter image description here"></p>
<p>In Web Browser</p>
<ol>
<li>Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. </li>
</ol>
<p>Parser Error Message: It is an error to use a section registered as Definition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.</p>
<p>Source Error: </p>
<p>Line 36: ASP.NET to identify an incoming user.
Line 37: -->
Line 38:
Line 39: section enables configuration</p>
<p><img src="http://i.stack.imgur.com/uxYtJ.jpg" alt="enter image description here"></p>
|
c# asp.net
|
[0, 9]
|
5,430,717 | 5,430,718 |
Uncaught handler: thread main exiting due to uncaught exception
|
<p>I am using this tutorial <a href="http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/" rel="nofollow">here</a>
and when I add this section of code directly into my OnCreate class I get the above error</p>
<pre><code>DataBaseHelper myDbHelper = new DataBaseHelper(null);
myDbHelper = new DataBaseHelper(this);
try {
myDbHelper.createDataBase();
} catch (IOException ioe) {
throw new Error("Unable to create database");
}
try {
myDbHelper.openDataBase();
} catch(SQLException sqle){
throw sqle;
}
</code></pre>
<p>I am still pretty new so any help and pointing in the right direction is most appreciated.</p>
|
java android
|
[1, 4]
|
5,955,534 | 5,955,535 |
Could this be done any easier? Java beginner question
|
<p>I need to create a series of objects, and it just looks plain ugly right now:</p>
<pre><code>CheckBox checkOne = (CheckBox) findViewById(R.id.checkOne);
CheckBox checkTwo = (CheckBox) findViewById(R.id.checkTwo;
CheckBox checkThree = (CheckBox) findViewById(R.id.checkThree);
CheckBox checkFour = (CheckBox) findViewById(R.id.checkFour);
CheckBox checkFive = (CheckBox) findViewById(R.id.checkFive);
</code></pre>
<p>I'm on an intermediate level when it comes to Java, so what I wanted to do was to do a for loop and then use variable variables. Alas, Java does not support this. Is there any, less recursive, way to do this?</p>
|
java android
|
[1, 4]
|
640,094 | 640,095 |
On click of TAB the focus should be on the next textbox
|
<p>I have two textboxes and when TAB is pressed from one textbox it goes to another place instead of to the next textbox.</p>
<p>My code is:</p>
<pre><code> $(function () {
$("input[id$=txt1]").bind('keydown',
function (e) {
if (e.which == 9) {
// alert("hello");
$("input[id$=txt2]").focus();
}
}
);
});
</code></pre>
<p>When I press tab for txt1 it should go to txt2 but it doesn't. </p>
<p>Any help?</p>
|
javascript jquery
|
[3, 5]
|
4,131,356 | 4,131,357 |
Similar to Jad file in J2ME & BlackBerry, exist in Android?
|
<p>Similar to jad entries in J2ME,
is there any such provision in android?</p>
|
java android
|
[1, 4]
|
1,581,173 | 1,581,174 |
How to create a loop from a string based on a delimiter
|
<p>I have a string like this:</p>
<pre><code>var string = ' [United States] [Canada] [India] ';
</code></pre>
<p>I want to do a for loop and add each of the countries into an array in Javascript or Jquery, something like this:</p>
<pre><code>var countryArray = new Array();
for ( each country in string AS country) {
countryArray.push(country);
}
</code></pre>
<p>I'm not sure how I would make a foreach loop out of a string like that.</p>
|
javascript jquery
|
[3, 5]
|
1,144,546 | 1,144,547 |
Getting mouse events to function on dynamically loaded elements
|
<p>I have a simple mouseover event that I am trying to work on elements that are loaded with ajax. For example I have a div that when you mouseover hide/show another div. When I load these divs through ajax they no longer work. For example :</p>
<pre><code><div class="block">
<div class="something">MOUSEOVER</div>
<div class="else" style="display: none" >HI</div>
</div>
$(document).ready(function(){
//using on hoping to catch the mouse events
$('.block').on('mouseenter',function(){
$(this).children('.else').fadeIn('fast');
});
$('.block').on('mouseleave',function(){
$(this).children('.else').fadeOut('fast');
});
});
</code></pre>
<p>This works fine straight up like <a href="http://jsfiddle.net/RwZWP/" rel="nofollow">this</a> : </p>
<p>But when I load those elements from another page :</p>
<pre><code>$j('#trigger').load( url + " .block");
</code></pre>
<p>The mouse events are no longer recognized. I thought this is what <code>live</code>, <code>on</code>, <code>delegate</code> were for. Can someone help me figure this out please.</p>
|
javascript jquery
|
[3, 5]
|
3,032,594 | 3,032,595 |
confirm box using javascript
|
<p>how to get confirmation before a export button is cliked.if yes then then export function has to be done if no it should not be done</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
407,738 | 407,739 |
Asp.net webparts or portlet like functionality
|
<p>What is the best way to let other parties use your website as their own content using their own style ?</p>
<p>We have build a small website for a customer, asp.net, .net framework 3.0. Now the customer wants other parties to be aple to use our website in their own websites while maintaining the styling of the costumers website. </p>
<p>I have done nothing like this before and don't even know what to google, so any help is appriciated.</p>
<ul>
<li>I know you can do this with sharepoint, but to use sharepoint for such a small site seems like a lot of overkill</li>
<li>it sounds that portlets is a good name for what they want. but googling portlets draws me in the world of java and doesn't give me a lot of info on what the other parties would have to do to make it work.</li>
<li>a simple Iframe would probably take me a long way, but how can you get the styling done within an Iframe</li>
<li>webparts also sound interesting , but they seem more for in project sharing then letting people use them in their own site. </li>
</ul>
<p>It is a small website and the logic and backend communication is pretty good contained, so a complete rework of the frond-end is not a big problem.</p>
<p>Once again, any help is appreciated !</p>
|
c# asp.net
|
[0, 9]
|
2,025,736 | 2,025,737 |
Accessing each CalendarDay in Calendar Control without using the DayRender Event
|
<p>I need to manipulate the appearance of the an ASP.NET calendar control. I have data that I need to display on the calendar control but I don't want to access the data from within the DayRender event. How do I access the CalendarDay object that represents each day in the calendar without being within the DayRender event?</p>
|
c# asp.net
|
[0, 9]
|
4,711,163 | 4,711,164 |
using jquery to load data from mysql database
|
<p>I'm currently using jquery's ajax feature or whatever they call it. To load data from mysql database. Its working fine, but one of the built in features of this one is to load all the data which is on the database when you press on backspace and there's no character left on the text box.</p>
<p>Here's my query:</p>
<pre><code>SELECT * FROM prod_table WHERE QTYHAND>0 AND PRODUCT LIKE '$prod%' OR P_DESC LIKE '$desc%' OR CATEGORY LIKE '$cat%'
</code></pre>
<p>As you can see I only want to load the products which has greater than 0 quantity on hand.</p>
<p>I'm using this code to communicate to the php file which has the query on it:</p>
<pre><code>$('#inp').keyup(function(){
var inpval=$('#inp').val();
$.ajax({
type: 'POST',
data: ({p : inpval}),
url: 'querys.php',
success: function(data) {
$('.result').html(data);
}
});
});
</code></pre>
<p>Is it possible to also filter the data that it outputs so that when I press on backspace and there's no character left. The only products that's going to display are those with greater than 0 quantity?</p>
|
php jquery
|
[2, 5]
|
1,447,224 | 1,447,225 |
Generating event on .cs page by double click on the design view of .aspx page
|
<p>I am developing a web application in asp.net and c#, now in a particular aspx page whenever I doubleClick(design view) on a button or on a drop down list, instead of going to </p>
<p><code>public void btn_click</code> event or <code>DropDown_SelectedIndexChanged</code> event, the cursor points to protected void Page_Load only. Strange!! any remedy?</p>
|
c# asp.net
|
[0, 9]
|
4,635,801 | 4,635,802 |
Better way than setInterval?
|
<p>I have the current function below, but feel like there is a much better way to write the same thing. I am looking for some insight on the most optimized way to write the same function below and why.</p>
<p>Note this is all inside of <code>$(function(){});</code></p>
<pre><code>m = function(){
$("#id").animate({marginRight : 0}, 'slow', function(){
$("#id").animate({marginRight : "15px"}, 'slow');
})
}
setInterval(m, 700)
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,688,154 | 4,688,155 |
jQuery click brings me to top of page. But I want to stay where I am
|
<p>I have a simple click and show, click and hide button, but when I click it, the page anchors at the top of the page. Is there anyway to prevent this? So that when I click the button, I stay at the same place in the browser?</p>
<p>My code is..</p>
<pre><code>$('#reportThis').hide();
$('#flagThis').click(function () {
$('#reportThis').show("slow");
});
$('#submitFlag').click(function () {
$('#reportThis').hide("slow");
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,988,588 | 3,988,589 |
ASP.NET C# - How to retain value after Response.Redirect
|
<p>I'm working in ASP.NET c# application.
I came to a part where I need to retain some value after response.redirect to the same page <strong>without using additional QueryString or Session</strong>, because Session more or less may burden the server's performance even just a small value.</p>
<p>Below is my code fragment:</p>
<pre><code> protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
string id = ddl.SelectedValue;
string id2 = ddl2.SelectedValue;
Response.Redirect("http://sharepoint2007/sites/home/Lists/CustomList/DispForm.aspx?ID=" + id);
}
</code></pre>
<p>I wanted to retain the value id2 after the Response.Redirect, I've tried ViewState but seem like after the redirect, it treat the page as new page and ViewState value gone.</p>
<p><strong>Update:</strong></p>
<p>My intention to retain the value after redirect is wanted to bind back the dropdownlist selected value.</p>
<p>Please help.</p>
<p>Thank you in advanced.</p>
|
c# asp.net
|
[0, 9]
|
5,328,107 | 5,328,108 |
Why I can't access variables from inside some functions (JavaScript)?
|
<pre><code>var myvar = "my value";
(function() {
alert(myvar); // undefined
})();
</code></pre>
<p>or</p>
<pre><code> var myvar = "my value";
$.post( url,
function( data ) {
alert(myvar); // undefined
});
</code></pre>
<p>and how can I solve this issue without storing this value in a hidden input or div or other html containers ??</p>
|
javascript jquery
|
[3, 5]
|
1,336,552 | 1,336,553 |
jQuery methods on original javascript object?
|
<p>Did jQuery add any sort of new functionality to internal JS object like the "anchor" object?</p>
<p>I know you can select via <code>$("a")</code>, but what happens if i already have an object selected?</p>
|
javascript jquery
|
[3, 5]
|
5,838,083 | 5,838,084 |
hasClass doesn't work in my js code?
|
<p>I want to use <code>hasClass</code> in the following code, but that doesn't work for me, please see my demo in jsfiddle and tell me, what do I do wrong?</p>
<pre><code><span>
<input type="text" name="relation" class="IdRelation">
</span>
if ($('span').hasClass('IdRelation')) {
alert("ok");
}
</code></pre>
<p><a href="http://jsfiddle.net/6Bwkv/" rel="nofollow">DEMO</a></p>
|
javascript jquery
|
[3, 5]
|
2,280,934 | 2,280,935 |
Javascript Switch statement not working as expected with string
|
<p>I'm trying to use the following switch statement in an ajax success callback:</p>
<pre><code>success: function(datain) {
switch (datain)
{
case "ERROR. No ID. Try again":
$(".errors").append('There was an error.');
break;
case "ERROR. Wrong captcha. Try again":
$(".errors").append('There was an error.');
break;
}
}
</code></pre>
<p>datain is a string (<code>typeof datain</code> returns <code>string</code>) and it does indeed contain the same text, capitalization and punctuation as the case so why would it not match either of the cases? </p>
<p><code>console.log(datain)</code> and <code>console.log("ERROR. No ID. Try again")</code> match exactly and both return a <code>typeof</code> of <code>string</code> so why does my case never get matched?</p>
<hr>
<p><strong>Solution and cause</strong></p>
<p>The solution is offered by palswim below <code>$.trim(datain)</code>. The cause was visible in Firebug and it was the fact that the string had a newline at the end while my switch case did not... so I was getting "foo\n" and trying to match "foo". Given that js uses <code>===</code> in the switch this, naturally (now that I see it), is why it failed.</p>
|
javascript jquery
|
[3, 5]
|
6,009,301 | 6,009,302 |
How do you sort letters in JavaScript, with capital and lowercase letters combined?
|
<p>I'm working on a JavaScript (jQuery's OK too if this needs it, but I doubt it will) function to alphabetize a string of letters. Let's say the string that I want to sort is: "ACBacb".</p>
<p>My code as of now is this:</p>
<pre><code>var string='ACBacb';
alert(string.split('').sort().join(''));
</code></pre>
<p>This returns ABCabc. I can see why that happens, but that is not the format that I am looking for. Is there a way that I can sort it by putting the same letters next to each other, capital letter first? So when I put in ACBacb, I get AaBbCc?</p>
|
javascript jquery
|
[3, 5]
|
5,620,706 | 5,620,707 |
Calling Javascript Function in C# not working properly
|
<p>I wanna call a javascript function in c sharp code.
i wanna hide the specific Li tag whose id is c sharp variable"li_name".
For this i am calling a javascript function. </p>
<p>Cs Code:</p>
<pre><code> li_name = DSRolePermission.Tables[0].Rows[k]["MENUNAME"].ToString();
StringBuilder script = new StringBuilder();
script.Append("<script type=\"text/javascript\">");
script.Append("li_visibility('" + li_name + "')");
script.Append("</script>");
Page.ClientScript.RegisterClientScriptBlock(typeof(object), "JavaScriptBlock", script.ToString());
</code></pre>
<p>JS code:</p>
<pre><code> <script type="text/javascript">
function li_visibility('<%=li_name %>') {
document.getElementById('<%=li_name %>').style.display = 'hidden';
}
</script>
</code></pre>
<p>But this code is not working properly.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,126,172 | 5,126,173 |
How to find server control using jquery?
|
<p>How to find server control using jquery
e.g</p>
<pre><code>$(".tab1").find("<%=lblTab1Heading.ClientID%>"); throws exception thrown & not caught
</code></pre>
|
jquery asp.net
|
[5, 9]
|
3,739,925 | 3,739,926 |
Adjusting height of scrolling div Javascript
|
<p>I am combining two scripts together a scroller and a content fader. When I swap the content (fading), div's with alot of content make the scrolling div super long. I was reading on the plugin demo for content scrolling: <a href="http://manos.malihu.gr/jquery-custom-content-scroller" rel="nofollow">http://manos.malihu.gr/jquery-custom-content-scroller</a> that you can use $(selector).mCustomScrollbar("update"); when loading different content to make the div adjust accordingly.</p>
<p>Well that is where I am stumped. I know that code needs to go in my fading script somewhere but where is the question? Here is the fading script where would it go?</p>
<pre><code><script type='text/javascript'>//<![CDATA[
$(window).load(function(){
(function($) {
$.fn.Fader = function() {
this.each(function() {
$('.clickme').bind('click', function(e) {
e.preventDefault();
$( "#mediaswap div" ).fadeOut();
$( "#mediaswap div" + $(this).attr('name') ).fadeIn();
})
});
}
})(jQuery);
$(function() {
$('#mediaswap').Fader();
});
});//]]>
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,396,651 | 2,396,652 |
jQuery class count on a certain table column number
|
<p>I've been at this for a while and want to know the best way of achieving my goal if anyone has any ideas!</p>
<p>Example:</p>
<pre><code><table>
<tbody>
<tr>
<td>Hello</td>
<td>Hello (I want to check this column)</td>
</tr>
<tr>
<td>Hello 2</td>
<td class="active">Hello 2 (this column)</td>
</tr>
</tbody>
</table>
</code></pre>
<p>jQuery I've got so far (I'm traversing from a clicked element):</p>
<pre><code>var length = $(self).closest("tbody").find("tr").find("td.active").length;
</code></pre>
<p>Obviously this gets all the active classes of td, when I only want the second column. I've tried:</p>
<pre><code>var length = $(self).closest("tbody").find("tr").find("td:eq(1).active").length;
</code></pre>
<p>This does not work.</p>
<p>Any ideas?</p>
|
javascript jquery
|
[3, 5]
|
2,249,821 | 2,249,822 |
Can't loop through elements created by jquery
|
<p>I've added a bunch of links to a div like this:</p>
<pre><code>$('#links').append('<a href="http://example.com/">Example</a>');
</code></pre>
<p>But when I try to loop through them with <code>$('#links a').each</code> it only finds the links that are already there in the HTML.</p>
<p>What am I doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
1,678,410 | 1,678,411 |
Using selected options value before clicking submit
|
<pre><code><form id="form1" name="form1" method="post" action="">
<select name="apartment_type" id="abc" >
<option value="">Please Select Apartment type</option>
<option value="duplex">Duplex</option>
<option value="bongalow">Bongalow</option>
<option value="flats">Flats</option>
</select>
<?php
$ijk = $_POST['apartment_type'];
echo $ijk; // This doesn't appear until I submit the form
?>
<input type="submit" name="button"/>
</form>
</code></pre>
<p>I have a little problem here for this application am building for a real Estate firm. Is there a way I can get the <code>$ijk</code> variable out before I submit the form? I included this JavaScript function:</p>
<pre><code>$(document).ready(function() {
var type
$('#abc').change(function() {
var type = $('#abc').attr('value');
alert (type);
}
}
</code></pre>
<p>The selected option is shown, but i cant seem to find a way around it with my PHP code </p>
|
php javascript
|
[2, 3]
|
275,597 | 275,598 |
Inserting 1 or 0 in Bit field in sqlDatabase based on Checkbox checked in GridView
|
<p>I have a gridview which has a Checkbox Template Field, I am using C# code and basically when the user checks all the Checkboxes in the datagrid view I want to add a 1 or 0 into an SQL database with a datatype field Bit based on the checkbox being checked or not. Here is my code so far;</p>
<pre><code>protected void SaveRegisterButton_Click(object sender, EventArgs e)
{
SqlConnection connection;
SqlCommand command;
int numRowsAdded;
int id;
//Boolean AttendanceChecked;
foreach (GridViewRow row in GridView2.Rows)
{
if (((CheckBox)row.FindControl("AttendanceCheckBox")).Checked)
{
try
{
// Connecting to the database using the connection string in the web.config file
connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["RegisterConnectionString"].ConnectionString);
// Create an INSERT Sql statement
// To prevent an Sql injection attack, we add parameters with names starting with an @ symbol
command = new SqlCommand("INSERT INTO Attendance(Present, StudentID, LessonID) VALUES(@AttendanceChecked, @StudentID, @LessonID)",
// Replace the parameters with the actual values read from the form
//command.Parameters.AddWithValue("@AttendanceChecked", SqlDbType.Bit).Value = AttendanceChecked;
//command.Parameters.AddWithValue("@AttendanceChecked", CheckBox("Attend
//com.Parameters.Add("@Approved", SqlDbType.Bit).Value = status;
</code></pre>
<p>I am struggling to implement this part of my project and any help would be much appreciated! Thanks in advance...</p>
|
c# asp.net
|
[0, 9]
|
1,391,392 | 1,391,393 |
Im trying to create an excel file....but while running on the server the following error comes
|
<p>Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. </p>
<p>To free disk space, delete files you no longer need from the disk you are saving to.</p>
<p>any idea why???</p>
|
c# asp.net
|
[0, 9]
|
5,794,276 | 5,794,277 |
Only show parts of image under a div using jquery
|
<p>I'm displaying a background picture with some semi-opaque div over it, so that it appears somewhat darker than it actually is. On top if it, I have a number of smaller, draggable divs. </p>
<p>I'd like the image to be completely visible, or revealed under these divs. These smaller divs should be like looking through windows to the below image.</p>
<p>One way to do it, is to set the background of each "window div" be a version of the larger image, and adjust the position to compensate for the div location. This works okay, but is kind of slow/jerky and very clunky.</p>
<p>Is there a better way?
Thanks!</p>
|
javascript jquery
|
[3, 5]
|
652,401 | 652,402 |
add incrementing class to images inside a div
|
<p>Okay I dont think anyone has covered this yet.</p>
<p>I have a div with x amount of images inside it. I need to add the class 00x to each image where the x starts at 1 and goes up everytime for each image. I have tried doing this with a for in statement however cant seem to make it work. I am using the jquery library so feel free to suggest jQuery related fixs. Here is my html:</p>
<pre><code><div id="fixed">
<img src="/prodimages/Ad060-2.jpg" />
<img src="/prodimages/Ad060-2.jpg" />
<img src="/prodimages/Ad060-2.jpg" />
</div>
</code></pre>
<p>so I need it to select all images inside #fixed and then add the class 00 + i where i++ for each image. I need something like a php foreach. I dont really understand how for in works.</p>
<p>Please advise. :)</p>
|
javascript jquery
|
[3, 5]
|
672,565 | 672,566 |
how to refresh my index page after form submission?
|
<p>I am having a dynamic content in my jsp pages that has to be refreshed once my form is submitted.Form submission is not done via ajax.I have tried with data-cache=never,rel=external. They ddnt work for me.</p>
|
javascript jquery
|
[3, 5]
|
4,806,133 | 4,806,134 |
Should I continue learning a language if in the meanwhile I became interested in another language/platform?
|
<p>I started learning Java a couple of months ago. I also wanted to become more exposed to linux so I installed ubuntu and started working with Java since then. In the meanwhile however I became more interested in C# and in learning the Windows platform. At this point I'm asking myself if I should stop learning Java and move to the .NET world. I don't hate or dislike Java by the way, I am just more curious about windows/.NET at this point in time. </p>
<p>My question is, should I remain with Java or go with C#/.NET? What is your advice? </p>
|
java c#
|
[1, 0]
|
4,405,517 | 4,405,518 |
jQuery selector not working on callback function
|
<p>I have my code like this</p>
<pre><code>$.post('JSP/Commands/Search.jsp', $("#search_field").serialize(),
function(id) {
$('#div_to_load').load('JSP/Details.jsp');
$("#headCollapsed_" + id).trigger('click');
});
</code></pre>
<p>I have checked that the function is returning the correct id response, however <code>$("#headCollapsed_" + id)</code> is not being selected. When i check</p>
<pre><code>alert( $("#headCollapsed_" + id).length > 0 );
</code></pre>
<p>returns <code>true</code>. The div is however present when i'm viewing it in my browser. </p>
<p>Clicking on the element should <code>slideToggle()</code> another div which is already present on the DOM as well.</p>
<p>What could be wrong with this?</p>
|
javascript jquery
|
[3, 5]
|
2,732,560 | 2,732,561 |
String.fromCharCode & CharacterSets
|
<p>I recently tried to mirror some input within input(text) fields.
Using</p>
<pre><code> String.fromCharCode(event.which)
</code></pre>
<p>for instance, translates all 'standard' characters correctly. Well it translates them all
to uppercase, but that you can easily catch by looking up the shift key aswell.</p>
<p>My Problem is, it can't translate characters like dots, commas, questionmarks etc.
First guess was that I have to define a character encoding set, but that does not seem to help. Maybe it'm completly off?</p>
<p>Kind Regards</p>
<p>--Andy</p>
|
javascript jquery
|
[3, 5]
|
3,548,481 | 3,548,482 |
Settings a listener to Shared Preference's dialog 'OK' button
|
<p>I have class Settings that extends PreferenceActivity,
in which user enter his Google account and the password. When the user presses 'add account' a dialog jumps with OK and CANCEL buttons.
Same occurs when pressing add password, I want to define listener within PreferenceActivity
to the OK button in the password dialog, that when the OK button is pressed the listener automatically checks if the user has entered the password correctly.</p>
|
java android
|
[1, 4]
|
4,750,632 | 4,750,633 |
Embedding javascript object in dynamically created html
|
<p>I have a js function that recieves an array of items. The function itself creates html content dynamicly using a call to jquery html function. The problem is that I don't remember how to embed correctly the array inside the appended html. For example,</p>
<pre><code>var ErrorsNotifier = {
init: function(items) {
var template = '<div id="message">';
template += '<div id="id">some message.<br /><br />';
template += '<div class="errorsList">error desc</div></div>';
template += '<a href="#" class="goback" onclick="ErrorsNotifier.Back("+items+");"></a>';
template += '<a href="#" class="proceed" onclick="ErrorsNotifier.Next();"></a>';
template += '<input type="image" src="someimage" alt="" class="" onclick="window.open("someurl");"/></div>';
$("#content").html(template);
}
}
</code></pre>
<p>After the html will be rendered to the body, clicking on the anchor tag return the following error - <code>Uncaught SyntaxError: Unexpected identifier</code> </p>
<p>inspecting the anchor tag in the browser will show the following</p>
<pre><code>a href="#" class="goback" onclick="ErrorsNotifier.Back([object Object]);"
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,924,914 | 4,924,915 |
What is the proper way to make my List be read and modified throughout my entire Android Java project?
|
<p>I have the following List:</p>
<pre><code>List<Map<String, String>> items = new ArrayList<Map<String, String>>();
</code></pre>
<p>It's populated with data on the load of my app. I need to use it throughout my entire app, on most Activities and Fragments, with data both being read and being modified.</p>
<p>What is the best and simplest way to make this global without too much complexity?</p>
<p>Note: For reasons that are too much to explain on Stack Overflow, this much be used a List and not as a custom Object with properties.</p>
|
java android
|
[1, 4]
|
2,159,273 | 2,159,274 |
How to know a browser is minimized in javascript
|
<p>Hi i have notification <code>div(divNotify)</code> with some information and a timer in masterpage</p>
<pre><code> Protected Sub Timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
Me.GetNotification_Stats()
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "Alert", "Show_NotifyDiv();", True)
Catch ex As Exception
Me.lblError.Visible = True
Me.lblError.InnerText = ex.Message
End Try
End Sub
</code></pre>
<p><code>divNotify</code> will display in some interval of time.<br>
here i need when the user will minimize the browser he will be notified by blinking browser and change color of browser</p>
<p>but first of all how do i know if the browser is minimized or not in javasript
here i am using jquery for show div tag</p>
<pre><code> function Show_NotifyDiv() {
$("#div_NotificationOuter").show(1000);
$("#div_NotificationOuter").animate({ bottom: '+=30px' }, 4000);
}
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
976,265 | 976,266 |
Does c++ have anything like List<string> in C#
|
<p>does c++ has antyhing like generic list in C# , something like List for storing array of strings .</p>
|
c# c++
|
[0, 6]
|
1,516,765 | 1,516,766 |
Adding new Columns to GridView with a new DataSource
|
<p>I have a gridview that is loaded from a DataSet, in which most of the fields are generated through templates.</p>
<p>One of them is an Image that changes according to the value that is returned from the dataset.
Here is an example:</p>
<pre><code><asp:TemplateField HeaderText="Attention">
<ItemTemplate>
<asp:Image ID="alertFlag" runat="server" ImageUrl='<%# Eval("alertFlag").ToString().Equals("True") ? "~/Images/Warning-32.png" : "" %>' />
</ItemTemplate>
</asp:TemplateField>
</code></pre>
<p>Now I have a dropdown list, in which, depending on what is chosen, a new request to the database is made, and new columns are added, but the previous ones must stay.</p>
<p>Should I create a new GridView or how should I add new the new columns, keep them hidden, and then show them when the proper event is fired. this includes loading new data from the database and binding to the gridview. And how would I add the condition above programatically?</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,491,252 | 4,491,253 |
adding html into a div without id
|
<p>i'm trying to add some html code with javascript and jQuery into a div without an id, but with a class</p>
<p>i'm trying to have it done like this, but without success...</p>
<p>flie.js :</p>
<pre><code>$(".myClassName").ready(function(){
$(this).innerHTML = "<img src=\"http://mywebsite.com/img.png\" /> <span>some text</span>";
});
</code></pre>
<p>i'm loading the .js file with this html code</p>
<p>.html file :</p>
<pre><code><div class="myClassName">
</div>
<script>
(function()
{
if (window['ImportFlag'] == undefined || window['ImportFlag'] == void 0) {
var myScript = document.createElement('script');
myScript.type = 'text/javascript';
myScript.src = 'file.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(myScript, s);}
window['ImportFlag'] = 1;
})();
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,415,236 | 1,415,237 |
resizing image using jquery
|
<p>html </p>
<pre><code><div id="inside"><div id="inside1"><img id="inner_images" src="1.jpg" alt=""/></div><span>photo details</span></div>
<div id="inside"><div id="inside1"><img id="inner_images" src="2.jpg" alt=""/></div><span>photo details</span></div>
</code></pre>
<p>this is the html code for two images , likewise i have to create a gallery with lot of images.</p>
<p>CSS</p>
<pre><code>#inner_images {display:block; margin-left:auto; margin-right:auto; margin-top:auto;}
#inside {overflow: hidden; display:inline; width: 265px; height:340px; border: #8c8585 `solid 1px; padding:0; spacing:0;}
#inside1 {width:250px; height:250px; border-bottom: #8c8585 solid 1px ; }
#details {width:250px; height:90px;}
</code></pre>
<p>and jquery is</p>
<pre><code>var max_h =250;
var max_w =250;
$(document).ready(function()
{
$('img#inner_images').load(function()
{
var w1=$(this).width();
var h1=$(this).height();
if(h1>w1)
{
w1=Math.ceil(w1/h1*max_h);
h1=max_h;
}
if(w1>h1)
{
h1=Math.ceil(h1/w1*max_w);
w1=max_w;
}
$(this).css({height:h1, width:w1});
});
});
</code></pre>
<p>the problem is that this code only resizes the first image and rest of the image is left as it is.</p>
<p>`</p>
|
javascript jquery
|
[3, 5]
|
3,955,361 | 3,955,362 |
attempting to check whether an image is on a page with jquery
|
<p>I have an image on my webpage as follows:</p>
<pre><code><img id="k4Tbx6luuHmP01dpI4BRZw==" src="/thumbnail/k4Tbx6luuHmP01dpI4BRZw==">
</code></pre>
<p>However, when I try</p>
<pre><code>var is_image_there = $("#k4Tbx6luuHmP01dpI4BRZw==").attr("src");
console.log(is_image_there);
</code></pre>
<p>Chrome console returns "undefined". What am I doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
3,517,045 | 3,517,046 |
Alternative method for Android push notification
|
<p>Is there an alternative to using Google C2DM for push notifications with Android? I ask because the app I'm working on will only run when the device is connected to a specific network. It's an app for members of this specific company and notifications will only come from that companies server. Since everything is "in-house" does it even make sense to push them to google just to have them come back to the same network? I've heard something about JMS. Does anyone know if that will work?</p>
|
java android
|
[1, 4]
|
2,411,577 | 2,411,578 |
relpace textarea in jquery
|
<p>I'm trying to Replace a %%%VERSION%%% text, the text is coming from an tinyMCE editor. </p>
<p>looks like this. </p>
<pre><code>$("#description textarea").val($("#description textarea").val().replace(/%%%VERSION%%%/g, STAT_VERSION_INFO));
</code></pre>
<p>The value of the textearea is:</p>
<pre><code><textarea rows="20" cols="117" name="description" id="description">Some code version info: %%%VERSION%%%</textarea>
</code></pre>
<p>But i can't make it replace anything. </p>
<p>Any idéas how to fix it, or maybe other solutions. </p>
|
javascript jquery
|
[3, 5]
|
5,391,991 | 5,391,992 |
XmlTextWriter path error?
|
<p>What is wrong with the following statement?</p>
<pre><code>XmlTextWriter writer = new XmlTextWriter(@"D:\project\data\" + System.DateTime.Today + @"\" + System.DateTime.Now + ".xml", null);
</code></pre>
<p>When I try the above statement it gives the following error</p>
<blockquote>
<p>The given path's format is not supported.</p>
<p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
<p>Exception Details: System.NotSupportedException: The given path's format is not supported.</p>
</blockquote>
|
c# asp.net
|
[0, 9]
|
3,888,853 | 3,888,854 |
Why won't jQuery's load event fire on dynamically inserted script elements?
|
<p>I'm dynamically inserting a script element using jQuery. The script loads as expected, but the load event does not fire.</p>
<pre><code>jQuery('<script/>').attr({
type : 'text/javascript',
src : 'http://platform.twitter.com/widgets.js'
}).appendTo('body').load(function(){
/* This alert does not fire: */
alert('I just loaded!');
});
</code></pre>
<p>If I use regular JavaScript to insert the element, the load event does fire and can be caught with jQuery.</p>
<pre><code>var e = document.createElement('script');
e.type = 'text/javascript';
e.src = 'http://platform.twitter.com/widgets.js';
document.body.appendChild(e);
jQuery(e).load(function(){
/* This alert does fire: */
alert('I just loaded!');
});
</code></pre>
<p>What am I doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
4,807,938 | 4,807,939 |
Java on iPhone 4
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1193524/can-we-run-java-applictions-on-iphone">Can we run Java applictions on iPhone?</a> </p>
</blockquote>
<p>im not sure this is the place for asking this but ill give it a go anyway.</p>
<p>i recently downloaded MobileTerminal on my iPhone 4.3.3 and it got me thinking.
iOS is basically a pretty version of linux.</p>
<p>what if i was to download the Java Binary files to my iphone and set the path enviroment to point to it? will i have java capabillities this way on my iphone? or will there something else that wont let me compile java?</p>
<p>i wanted to run this issue past here maybe someonw has any experience with it before i start messing around with my phone.</p>
<p>thanks :)</p>
|
java iphone
|
[1, 8]
|
2,176,453 | 2,176,454 |
Load external XML data file in a MOSS 2007 feature
|
<p>I am developping an ASP.NET application (SharePoint) and I have a feature that is creating and accessing folders. With the administrator account, no problem everything works well, but when I am connected with a different account of course it cannot create/access the folders. How can I "impersonate" the administrators rights ?</p>
<p>Thank you very much</p>
|
c# asp.net
|
[0, 9]
|
2,888,093 | 2,888,094 |
how to send table value to printer?
|
<p>I want to send table values to printer.That table contails more than 50 records.so there is scrollbar or pagination on that table.Below the printer there print button, if click the button those all values should go to printer.</p>
<pre><code>function print(){
window.print();
window.opener.document.location = window.opener.document.location.href;
window.close();
}
</code></pre>
<p>I used to code for print value.but it shows only the page, not in all table values .I ma using jsp,javascript.</p>
<p>I am looking for directdownload without css and open popup window, i need to do this work.</p>
<p>Any idea????</p>
|
javascript jquery
|
[3, 5]
|
2,442,455 | 2,442,456 |
Event after Create User - ASP.NET Membership
|
<p>I am going to use Create User Wizard in order to let a user create their account for this company web site. I'd like to add one more step after new account is created, but I can't find the way to do it. What I want to do is that verify the use as a current employee of this company. This is not open web site for everyone, so only current employee can create a user account in this site.
This is the step that I need to implement.</p>
<ol>
<li>Ask employee ID and Name to verify whether he or she is current employee or not.</li>
<li>If yes, the Create User Wizard step will start. I will show the Employee ID on top of this wizard.</li>
<li>When a user account is created successfully, I need to insert UserID from aspnet_Users table and Employee ID into additional table as a reference.</li>
</ol>
<p>I can't figure where I can do step 3 for coding.</p>
<p>I am guessing that I need to do it on "Create User" button event, But I also need to know whether a user account is successfully created or not.</p>
<p>Please, let me know.</p>
|
c# asp.net
|
[0, 9]
|
530,893 | 530,894 |
jQuery plugin which lets users draw rectangles in a div works in basic setup, but not when implemented in my page?
|
<p>I'm using this <a href="http://jsbin.com/azare/" rel="nofollow">Boxer plugin</a> to allow the user to draw rectangles in a div. I've got it working in <a href="http://jsfiddle.net/h8vnw/" rel="nofollow">this jsFiddle</a>.</p>
<p>But I can't get it working in <a href="http://jsfiddle.net/7WgdH/" rel="nofollow">this one</a>, which is how I would be using it. I think it may be because of the CSS styling? Can anyone tell why it doesn't work?</p>
<p>Thanks for reading.</p>
|
javascript jquery
|
[3, 5]
|
1,251,701 | 1,251,702 |
Reference two php files at once
|
<p>I noticed that on facebook, when you click on an image it opens up in their photo viewer. I understand that is done with javascript, but when you look at the url it says:</p>
<p><a href="http://www.facebook.com/photo.php?fbid=3230830261587&set=a.1664092454121.85323.1591534315&type=1&theater" rel="nofollow">http://www.facebook.com/photo.php?fbid=3230830261587&set=a.1664092454121.85323.1591534315&type=1&theater</a></p>
<p>But, you can still see your profile/or news feed (wherever you were when you clicked on the image) behind the photo viewer. How? It appears (upon observation of the url) that you have been redirected to facebook.com/photo.php. Is that the case? And how are you redirected back to www.facebook.com/(previous).php when you close the viewer?</p>
|
php javascript
|
[2, 3]
|
3,889,255 | 3,889,256 |
how can i check how many '.classname' items are?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5706106/count-elements-with-jquery">Count elements with jQuery</a> </p>
</blockquote>
<p>hi there,</p>
<p>i was considering, using jquery,</p>
<pre><code>var n = 0;
$('.className').each(function(){
n = n+1;
});
</code></pre>
<p>Any better solution in mind?</p>
<p>thanks!</p>
|
javascript jquery
|
[3, 5]
|
842,927 | 842,928 |
How not to refresh a page from JavaScript?
|
<p>I am working on a website using <code>asp.Net</code>, and it includes a page called from an <code>iframe</code>.
This page named Districting, has a javascript code in the aspx page.
I created a function, that is executed when "Done" button is clicked. This function tests if the conditions that the user made are true.
If yes, another page is loaded, if no, an alert appears, and nothing happens.
But actually, something is happening: the page is refreshing which is not what I want.
This is the button:</p>
<pre><code><button id="Button1" onclick="testing()">Done</button>
</code></pre>
<p>This is the function testing:</p>
<pre><code>function testing() {
if (conditions are true)
//Go to another page
else{
alert("Wrong decision");
//Stay in the current page without refreshing it
}
}
</code></pre>
<p>So all I need is to prevent the page from refreshing when clicking on "Done" button.</p>
<p>Thanks in advance:)</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,515,021 | 4,515,022 |
Show pictures on mouseover
|
<p>I have an ASP.NET page where I am showing products in a Gridview control. When users mouse over a Product name a window should appear and show that Product's picture in it (by getting product id and than find associated image for it.) </p>
<p>Is there an AJAX control or something like this??</p>
|
c# asp.net
|
[0, 9]
|
1,644,524 | 1,644,525 |
Given a paragraph of text, how to get everything from the start to the last whitespace?
|
<p>Given a block of text like so: </p>
<pre><code>"Hello world this is http://yahoo.com "
</code></pre>
<p>On keypress I'm looking at the text for links. I don't want to look for links in text while the user is still typing, example: </p>
<pre><code>"Hello world this is http://yahoo.co"
</code></pre>
<p>How can I get everything in the text var starting from the left, 0, all the way to the last white space, meaning I don't get a url while the user is typing it?</p>
<p>Thanks</p>
<p><strong>UPDATED</strong></p>
<p>Typing <code>Hello world this is http://yahoo.com</code> should return <code>Hello world this is http://yahoo.com</code> </p>
<p>Typing <code>Hello world this is http://yahoo.co</code> should return <code>Hello world this is</code> </p>
|
javascript jquery
|
[3, 5]
|
4,930,649 | 4,930,650 |
Something Wrong?
|
<p>When I run the following code:</p>
<pre><code><html><head>
<title>Code</title>
<script type="text/javascript">
var height = "<?= $height ?>";
var width = "<?= $width ?>";
if (self.parent.frames.length && self.parent.frames.length != 0)
self.parent.location = document.location;
window.resizeTo(width,height);
window.moveTo(0,0);
</script>
</head>
<body>
<?php
$url_path = $_GET['url'];
echo "<img src={$url_path} />";
list($width,$height) = getimagesize({$url_path})
?>
</body>
</html>
</code></pre>
<p>nothing happens. (obviously there is a form on a page which asks for an input of an image url..)</p>
<p>I need some help here, I am an absolute beginner to javascript and php, so help?</p>
|
php javascript
|
[2, 3]
|
729,057 | 729,058 |
Javascript/Jquery - Setting default value in function
|
<p>Using javascript/jquery is there a way to set a variable to a default value if no value is passed in the function? For example</p>
<pre><code>function someFunction(data1,data2)
{
}
</code></pre>
<p>If data1 or data 2 is empty it gives me an undefined value. In php I could do just this:</p>
<pre><code>function somefunction(data1 = '',data2 = '')
{
}
</code></pre>
<p>So if no variable is passed or data1 or data 2 it defaults to ''. In JS/Jquery do I have to check if there is a value and set it accordingly?</p>
<pre><code>function someFunction(data1,data2)
{
if(!data1) {
data1 = '';
}
if(!data2) {
data2 = ''
}
}
</code></pre>
<p>Just seems alot needs to be done to check if variable is empty or not to give it a default value.</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.