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,886,237
| 4,886,238
|
How to get the value of radio buttons via Jquery
|
<p>If I have the following radios:</p>
<pre><code><input name="color" id="color_blue" value="blue">Blue
<input name="color" id="color_red" value="red">Red
<input name="color" id="color_green" value="blue">Green
</code></pre>
<p>What's the easiest way to find out which radio the user selected? Preferably something like to:</p>
<pre><code>$("color").val();
</code></pre>
<p>Or something close to that.</p>
|
javascript jquery
|
[3, 5]
|
1,482,745
| 1,482,746
|
android load content for all tabs when app starts
|
<p>My app has a tabHost that handles 5 tabs that loads properly their activities. However, app starts with tab1 selected and tab2 and following ones are not loaded until user click into related tab! How could I previously load content to other tabs before its selection? Thank you</p>
|
java android
|
[1, 4]
|
1,473,287
| 1,473,288
|
jQuery tree menus won't expand!
|
<p>I'm using the <a href="http://wordpress.org/extend/plugins/cms-tree-page-view/" rel="nofollow">Page Tree View</a> plugin and I may have done something recently to install the latest version of JDK that screwed up my jquery in WordPress because now the menu items won't expand. They appear, and they even show the loading wheel, but nothing is executed.</p>
<p>Any tips for debugging?</p>
|
jquery javascript
|
[5, 3]
|
2,969,667
| 2,969,668
|
How to pass a url to a JavaScript function as a parameter?
|
<p>I just want to pass the base url to a javaScript function. Function call is like as follows </p>
<pre><code><img src="assets/images/c_arow_rite.jpg" onClick="nextMonth('.$bs_url.')"/>
</code></pre>
<p>It showing an error in the Error Console like </p>
<pre><code>Error: SyntaxError: identifier starts immediately after numeric literal
Source File: `http://mywebsite/rand/`
Line: 1, Column: 15
Source Code:
nextMonth(http%3A%2F%2F192.168.1.254%2Frand%2F)
</code></pre>
|
php javascript
|
[2, 3]
|
4,277,934
| 4,277,935
|
How to use remove.attr on data-position and then print?
|
<p>I'm trying to write a function that will remove the footer's data-postion fixed attribute, then print the page. I have this linked with an onclick event, but it has no effect to the page. </p>
<pre><code>function printpage(){
$('#footer').removeAttr('data-position');
javascript:window.print()
}
</code></pre>
<p>What am I doing wrong here?</p>
|
javascript jquery
|
[3, 5]
|
848,195
| 848,196
|
Get ClientID in Javascript
|
<p>I have a javascript file that Select a button using jQuery and check it for validation.the code is:</p>
<pre><code>$(document).ready(function () {
$('#<%= btn_Insert.ClientID %>').on("click", function (event) {
if (Validate() != true) {
event.preventDefault();
}
});
function Validate() {
return (1 == 1);
});
</code></pre>
<p>but I can' get <code>ClientID</code> for button and I get this Error:</p>
<blockquote>
<p>Object doesn't support this property or method</p>
</blockquote>
<p>where is my mistake?How I can get Client ID for a server side Button?</p>
<p>thanks</p>
<p><strong>EDIT 1)</strong></p>
<p>When I add script in <code>head</code> part of page it works but when I write it to a JS file and add reference to it in <code>head</code> part it does not work</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,460,577
| 5,460,578
|
Reading line from website
|
<p>I am making a little program thath will read data from website. String in the html file is already managed every info is divided with ; . Now i should read complete line here is example of this line:</p>
<pre><code>14:47;24.02.12;18.7°C;18.7°C;285;0.5m/s; 6:48;17:37; Warm ;36;1.8;0.0;
</code></pre>
<p>So first how should i read them with HTTP Get or is there anything other? And then i would like to save each info, they are seperated with ; into a variable. And how should i cut each info from this line.</p>
|
java android
|
[1, 4]
|
4,176,890
| 4,176,891
|
How to get substring without cutting words in between in Java?
|
<p>I have so many strings and i want to print them all one by one. problem is, i have limited width to print the string. so is there any way to know when the width ends and remaining string should come in next line. and words should not be cut.</p>
<p>Thanks in advance...</p>
|
java android
|
[1, 4]
|
1,924,120
| 1,924,121
|
jquery next button focus
|
<p>To improve navigation on one of the pages I am tyring to set a focus on a next available(enabled) button when leaving last data entry field. </p>
<pre><code>$('input[type=text], select, textarea').filter(':last').blur(function()
{
$('input[type=submit][type=button]:enabled:first').focus();
});
</code></pre>
<p>For some reason it only works when last data entry field is textbox. Something is wrong in the handler.</p>
|
asp.net jquery
|
[9, 5]
|
1,345,022
| 1,345,023
|
Java/Android API understanding
|
<p>I started working on Android applications and I find little difficult to understand this piece of code:</p>
<pre><code>LineNumberReader(new FileReader("/proc/tty/drivers"));
</code></pre>
<p>How can I know that the <em>LineNumberReader</em> function accepts <em>FileReader</em> as a new instance of the class? I went through the Java documentation for the <em>LineNumberReader</em> API, it doesn't mention anything regarding <em>FileReader</em> class. There is problem in Java API interpretation which I have to consider, Can any one of you please help me in understanding how an API should be used in Java?</p>
|
java android
|
[1, 4]
|
3,037,542
| 3,037,543
|
Redirecting new tab OR browser on button click.(Response.Redirect) in asp.net C#
|
<p>Can anybody suggest how we can open the page in new window or New Browser using Response.Redirect in c#.
I have used :
Response.Redirect("page1a.aspx");</p>
<p>but it's open in existing tab.</p>
|
c# asp.net
|
[0, 9]
|
813,933
| 813,934
|
Most effective way to auto detect/select language in a website?
|
<p>I need to implement an autodetect feature for a simple, plain html website I am working on.
It has two languages and the client wants it to automatically select the language.
This could be done either via the browser's language or geolocalization, both options are good.</p>
<p>Can someone point me to a good script or solution to do this? ive been searching for a while and cant seem to find anything...</p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
2,932,796
| 2,932,797
|
Sending SMS via Android Application without moving to Message Box Default Application
|
<p>I want to ask you:
1-How can I send SMS via my applicatin without moving the user to the Messages box
i just want to allow user to insert the text then he/she clicks on the send button
after that directly the text message should be sent to specific number that i write in the code?</p>
<p>I used this Code as shown below, it works well, but it moved me to the message box :(
any Suggestions ?</p>
<pre><code>MyButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
String str= MyEditText.getText().toString();
// For SMS
Uri smsUri = Uri.parse("I wrote my number here");
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("sms_body", "Besm Allah");
intent.setType("vnd.android-dir/mms-sms"); startActivity(intent);
}
});
</code></pre>
<p>====================== After Updating ================================</p>
<p><img src="http://i.stack.imgur.com/PUpae.jpg" alt="Why (SmsManger) word appears like this (with lines)"></p>
|
java android
|
[1, 4]
|
3,333,312
| 3,333,313
|
Changing a control's style based on validation (ASP.NET)
|
<p>I've got a very simple form with the following troubled snippet:</p>
<pre><code><asp:Panel class="normal" ID="Panel1" runat="server">
<strong><asp:Label ID="Panel1Error" class="error" Visible="false" runat="server"/></strong>
<label for="TextBox1"><em>*</em> Don't leave this blank</label>
<asp:TextBox ID="TextBox1" runat="server" />
<asp:RequiredFieldValidator ID="TextBox1RFV" runat="server"
ControlToValidate="TextBox1" ErrorMessage="This field cannot be blank."
Display="None" />
<--- other validators --->
</asp:Panel>
</code></pre>
<p>There are two things I want to do when the page fails validation:</p>
<ol>
<li><p>Change the style of Panel1 (to one which shows different colors to indicate an error). I was able to do this by calling Page.Validate in Page_Load, then iterating over Page.Validators, getting each validator's parent control, casting it to a Panel, then setting .CssClass Doesn't seem like a superb solution, but it got the job done - is there a better way?</p></li>
<li><p>I want to take whatever validation error(s) are thrown and put them in the Panel1Error label, as well as set it to visible. This is where I am a bit baffled. I thought at first I could possibly specify the Label in which a validator writes its ErrorMessage, but I had no such luck. If I just toss the validator inside the Label, its formatting messes up the entire layout of the page, regardless of whether I directly assign it the 'error' CSS class or just leave it in the Label.</p></li>
</ol>
<p>Just to clarify, in production, I would be doing this process for multiple Panels on a page, each with one form element, preventing me from calling the Panels explicitly and just saying Panel1.CssClass, etc.</p>
|
c# asp.net
|
[0, 9]
|
2,781,161
| 2,781,162
|
Android displaying different measurements (imperial and metric)
|
<p>I have an app where I need the user to specify measurements for height width and length. I would like them to be able to input any measurement that they want e.g. mm, cm, meters, inches, feet, fractions of inches. Does anyone know if Java has a built in mechanism for displaying feet inches etc as </p>
<pre><code>5' 10 3/4"
</code></pre>
<p>for example? </p>
<p>I'm not worried about converting the measurements just displaying the imperial measurements.</p>
<p>Thanks,
M</p>
|
java android
|
[1, 4]
|
4,454,888
| 4,454,889
|
Mass Email Scripting
|
<p>I have a rather complicated question. Not sure if this is even possible so here goes:</p>
<p>I send out masses of email at work for various occasions to a variety of different recipients. I was wondering if it was possible to automate this process. Basically, I want to be able to develop a program or script that can do this. It’s incredibly time consuming to copy and paste my email template while manually altering one specific element inside the body of the email.</p>
<p>For example, I have a list of 20 users that I need to email a template to each one. Each user will be different, and the item in the email body will vary as well. Is there any way to automate this so I don’t have to send the template to each individual user manually changing the item in the body? </p>
<p>Thanks, any help will do.</p>
|
c# php asp.net
|
[0, 2, 9]
|
52,763
| 52,764
|
How can I dynamically do write a value into a function call?
|
<pre><code><asp:LinkButton class="uibutton normal submit" ID="LinkButtonMAR"
OnClick="MarkClientNoteRead(<%# Eval("NoteID") %>)" runat="server">
Mark as Read</asp:LinkButton>
</code></pre>
<p>This is all within a repeater that will return a list of notes. I want to grab the NoteID and throw this into the <code>OnClick="MarkClientNoteRead()"</code> method call.</p>
<p>Is this possible?</p>
|
c# asp.net
|
[0, 9]
|
2,383,932
| 2,383,933
|
javascript show hide div
|
<p>how to do show and hide div in javascript and simillarly in c# pageload how to call div based on id value.can any one help on this ?</p>
<pre><code><ul>
<li><a href="#cat1">cat1</a></li>
<li><a href="#cat2">cat2</a></li>
<li><a href="#cat3">cat3</a></li>
</ul>
<div id="cat1">
<asp:UpdatePanel>
<asp:Panel>
<asp:ListView>
</asp:ListView>
</asp:Panel>
</asp:UpdatePanel>
</div>
<div id="cat2">
<asp:UpdatePanel>
<asp:Panel>
<asp:ListView>
</asp:ListView>
</asp:Panel>
</asp:UpdatePanel>
</div>
<div id="cat3">
<asp:UpdatePanel>
<asp:Panel>
<asp:ListView>
</asp:ListView>
</asp:Panel>
</asp:UpdatePanel>
</div>
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
2,443,485
| 2,443,486
|
check input of textboxes
|
<p>I am working with asp.net and I'm using textboxes for user input. I want to make sure that the user enters digits only. I don't want to use validation controls. If maybe somehow I could use the ASCII value of the text entered by the user to compare whether it's an alphabet or not using C#. I would really appreciate your help.</p>
|
c# asp.net
|
[0, 9]
|
1,461,485
| 1,461,486
|
Using jQuery, how do I repeat a function in different intervals?
|
<p>I need the function to repeat after 8 seconds the first time and then again after 30 seconds. I have used setTimeout but not sure if this is the way to go about it.
Thank you.</p>
|
javascript jquery
|
[3, 5]
|
2,587,231
| 2,587,232
|
Http Post With Body
|
<p>i have sent method in objective-c of sending http post and in the body i put a string:</p>
<pre><code>NSString *requestBody = [NSString stringWithFormat:@"mystring"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[requestBody dataUsingEncoding:NSUTF8StringEncoding]];
</code></pre>
<p>now in Android i want to do the same thing and i am looking for a way to set the body of http post.</p>
|
java android
|
[1, 4]
|
100,956
| 100,957
|
Getting Integer value from a String using javacsript/jquery
|
<p>These are the strings I have:</p>
<pre><code>"test123.00"
"yes50.00"
</code></pre>
<p>I want to add the 123.00 with 50.00.</p>
<p>How can I do this?</p>
<p>I used the command parseInt() but it displays NaN error in alert box.</p>
<p>This is the code:</p>
<pre><code> str1 = "test123.00";
str2 = "yes50.00";
total = parseInt(str1)+parseInt(str2);
alert(total);
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,192,483
| 5,192,484
|
Stuck for how to accomplish a task
|
<p>Here's what I'd like to do: we have a list of members who need to be redirected to a series of forms on URLs. We have around 5 forms and 200members. They would be greeted at a site, enter their First and Last name and then be redirected to the applicable form which we selected for them. Starting from scratch with this so any hints as to process would be hugely appreciated. Thanks in advance! </p>
|
java php
|
[1, 2]
|
4,469,184
| 4,469,185
|
How to find out when a download has completed in mobile when using PHP
|
<p>I am using a PHP header for downloading a JAR file and <a href="http://en.wikipedia.org/wiki/APK_%28file_format%29" rel="nofollow">APK</a> files in mobile. I can download the files successfully, but I want to show a popup when the download reaches 100%. How do I achieve this? </p>
<p>Is there any callback method for the download complete event?</p>
<pre><code>header('Content-Type: '.$mime);
header('Content-Length: '.$stat['size']);
header('Connection: close');
header('Content-disposition: attachment; filename='.$file_name);
readfile($path_to_file);
</code></pre>
|
php jquery
|
[2, 5]
|
222,492
| 222,493
|
How to determine the top element?
|
<p>I have a complex structure of many nested, absolutely positioned elements.</p>
<p>These elements may or may not have their z-index set.</p>
<p>They also may or may not have the same parent element.</p>
<p>I am wondering what is the best / simplest way to return which element is on 'top'. Something like the following...</p>
<blockquote>
<p>$(".panel").topMost()</p>
</blockquote>
<p>Thanks (in advance) for your help</p>
|
javascript jquery
|
[3, 5]
|
5,468,035
| 5,468,036
|
jquery each into js object
|
<p>im trying to create a final object with data in it, all of the elements are numbers except for one of them, and that one is to hold more objects. here is what i have so far.</p>
<pre><code>var data = '';
$(".item-element").each(function(e) {
var id = this.id;
var qty = parseInt($("#" + this.id + " .element-qty").text());
});
var sale_data = {
"id" : $('#sales_id').val(),
"cid" : $('#sales_custom').val(),
"status" : $('#sales_status').val(),
"data" : {
"services" : service_data,
"products" : product_data
},
"total" : Number($('#sale-total').text().substr(1)),
};
</code></pre>
<p>im trying to get product_data to hold the following type structure from the values of the id and qty in the each loop. the final data entry to look like this based on the each loop.</p>
<pre><code> "data" : {
"services" : service_data,
"products" : {
{id:qty},
{id:qty},
{id:qty}
}
},
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,198,183
| 4,198,184
|
Jquery slide down div after an item fades in
|
<p>this is my jquery code</p>
<pre><code> jQuery(document).ready(function(){
jQuery('.start_video').click(function(){
jQuery(this).fadeOut("slow", function(){
jQuery('#video').animate({ opacity: 'show' }, "slow");
jQuery('#video_stream').animate({slideDown: 'slow' }, "slow");
});
});
jQuery('.close_video').click(function(){
jQuery('#video').fadeOut("slow", function(){
jQuery('.start_video').fadeIn("slow");
});
});
});
</code></pre>
<p>Here is my html code
</p>
<pre><code><div id="video_stream">
<a href="#" class="start_video">Start Video</a>
<div id="video" class="hidden">
<a href="#" title="#" class="close_video">Close</a>
</div>
</div>
</div>
</code></pre>
<p>I have some standard CSS. When the start_video link is clicked, the start_video link fades out and after that, the video div fades in. Inside the video div is a close_video link. When that link is clicked, the video div fades out and the start_video link fades in. However, I want to also have the "video_stream" div that wraps everything to slide down as its height changes with the fading in of "video" and also slideUp when the height changes with the fadeOut of "video". </p>
<p>I was wondering how to do this. I tried adding in slideUp functions in Jquery but I think I was putting them in the wrong place. I also tried the .animate() function using the slideUps but that did not work. I want it to be a smooth slideDown while the "Video" div is fading in and vice versa.</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
3,990,158
| 3,990,159
|
How can I use keyboard keys to scroll between elements on same page?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/2168739/using-arrow-keys-with-jquery-scrollto">Using arrow keys with jQuery scrollTo</a> </p>
</blockquote>
<p>Is it possible to scroll between similar elements on the same page using jQuery?</p>
<p>e.g. When I press N the page scroll to next div... and so on.. when I press the P the page scroll to previous div.. just as example.</p>
<p>Is it possible with or without a plugin? Can anyone show me a very little sample so I can follow.</p>
<p>Thank you.</p>
|
javascript jquery
|
[3, 5]
|
2,690,781
| 2,690,782
|
I can not divide two numbers correctly
|
<pre><code>int percent = (score/numberOfQuestions)*100;
progressText.setText(score+"/"+numberOfQuestions+" "+percent+"%");
</code></pre>
<p>returns 0% no matter what I tired. I tried casting it to int, double, float</p>
<p>Why does it return 0% for a number like score=5 numberOfQuestions=8?</p>
|
java android
|
[1, 4]
|
4,529,083
| 4,529,084
|
Creating web controls inside a content placeholder programmattically
|
<p>I've got a master page and a content page. How can I add controls to the master page's content placeholders programattically?</p>
|
c# asp.net
|
[0, 9]
|
334,455
| 334,456
|
javascript sliding div left/right
|
<p>Hy guys! I want to make a slide toggle effect of a div. Below is the code in my html file. My div is 500px wide by 50px height. I want to make it slide left/right over the screen when pressed on the first image inside the div. This is a toolbox that contains a couple of icons inside. The first image at the left - left.jpg should be a swop image(some kind of button - this is an arrow pointing left and after moving the div this arrow should point right - I mean the picture should be changed). I looked over the web and saw different examples with jQuery but could not find the exact solution for my needs. I know this is a great community and hope that somebody will help to deal with this! Thank you in advance!!!</p>
<pre><code><script>
$(function(){
$("#clicky").click(function(){
$("#slide").animate({marginLeft:'500px'},'slow');
});
});
</script>
<div id="slide">
<img id="clicky" src="left.jpg" width="15" height="15" />
Div Content here...</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,189,939
| 2,189,940
|
Is it possible to listen to a "style change" event?
|
<p>Is it possible to create an event listener in jQuery that can be bound to any style changes? For example, if I want to "do" something when an element changes dimensions, or any other changes in the style attribute I could do:</p>
<pre><code>$('div').bind('style', function() {
console.log($(this).css('height'));
});
$('div').height(100); // yields '100'
</code></pre>
<p>It would be really useful.</p>
<p>Any ideas?</p>
<p><strong>UPDATE</strong></p>
<p>Sorry for answering this myself, but I wrote a neat solution that might fit someone else:</p>
<pre><code>(function() {
var ev = new $.Event('style'),
orig = $.fn.css;
$.fn.css = function() {
orig.apply(this, arguments);
$(this).trigger(ev);
}
})();
</code></pre>
<p>This will temporary override the internal prototype.css method and the redefine it with a trigger at the end. So it works like this:</p>
<pre><code>$('p').bind('style', function(e) {
console.log( $(this).attr('style') );
});
$('p').width(100);
$('p').css('color','red');
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,168,632
| 1,168,633
|
Dynamically create controls in aspx?
|
<p>I try several ways to create a few control in an .aspx page's code-behind. I have these problems: </p>
<p>1) name of each component<br>
2) place of these components<br>
3) access to these components in method event or totally in code behind</p>
<p>I want to create a few <code><asp:textbox></code> and put them in table rows. I'd like to then get value of these textboxes and do somthing with them.</p>
|
c# asp.net
|
[0, 9]
|
2,873,962
| 2,873,963
|
How to call jar files from PHP?
|
<p>I know this question is not new but I am posting this after going through enough googling around.</p>
<p>I have a jar file which I don't control. I mean I have not written the Java class in there and all I know is that there is a class named "hist" in it which takes two arrays and gives out the output. Now I have to use PHP to call this class "hist" in the jar file named "histvol.jar". I have installed the PHP/Java Bridge and it is installed correctly.<br>
But I don't understand how to call this jar file in PHP and where to place this jar file.</p>
<p>This is what I did:</p>
<ol>
<li>Installed tomcat and php-javabridge</li>
<li>Placed the jarfile "histvol.jar" under Tomcat/webapps/JavaBridgeTemplate621/webinf/lib/</li>
<li>Went to xampp/htdocs and created a file named testjava.php</li>
</ol>
<p></p>
<pre><code><?php
require_once("http://localhost:8080/JavaBridgeTemplate621/java/Java.inc");
$System = java("java.lang.System");
$myclass=java("histvol");
echo $System->getProperties();
?>
</code></pre>
<p><code>Class not found</code> exception is expected because I am not calling it anywhere in PHP, but how do I call it?<br>
I am lost, please help (I don't know a word of Java).</p>
|
java php
|
[1, 2]
|
1,604,173
| 1,604,174
|
Expected ')' error when document.write with runat=server
|
<p>I have a page that requires a JavaScript function:</p>
<pre><code>document.write('<head id='Head1' runat='server'/>');
</code></pre>
<p>But, when viewing the page in IE, I keep getting the "done but with errors..." message and when looking, I can see exactly what the problem is. When I 'View Source' I see this:</p>
<pre><code>document.write("<head id="Head1"><link href="/myPage/WebResource.axd?..." type="text/css" rel="stylesheet" /><title>
test
</title></head>");
</code></pre>
<p>It looks like something is putting a carriage return after <code>"<title>"</code> and after the title of the page. Therefore, the ')' is not on the same line as open-parenthesis giving me the error. Any idea how to get this to stop happening? I, personally, couldn't care less that the message is showing in IE, but not my call.</p>
|
javascript asp.net
|
[3, 9]
|
3,422,305
| 3,422,306
|
How to get the eq() of $(this)?
|
<p>Here's my code:</p>
<pre><code>$('div.menu > ul > li > a').click(function(e) {
alert($(this).eq());
e.preventDefault();
});
<div class="menu">
<ul>
<li><a href="">Animals</a></li>
<li><a href="">Cars</a></li>
<li><a href="">Sports</a></li>
</ul>
</div><!-- menu -->
</code></pre>
<p>My attempt alerts an object object error. If should instead return the numeric place of the link being clicked. For example if you click animals it should alert 1 (not sure if the eq count starts at 0 like arrays in which case it should alert that) and if you click sports it should alert 3 and so on...</p>
|
javascript jquery
|
[3, 5]
|
293,280
| 293,281
|
How do I implement this pop up box that displays when hovered over "Shopping Cart" link in this website
|
<p>I want exactly like this...not a simple box but the one with shadow borders like this one..I have been googling but all I came across is Slide down boxes and tool tips..that's not what I want..How do I implement the one in this website..oh and this box's got HTML stuff in it...like buttons and all</p>
<p>Is there any way I can see the code of this in that website ?</p>
|
javascript asp.net jquery
|
[3, 9, 5]
|
1,261,551
| 1,261,552
|
Shell form does not validate
|
<p>Why in this code after click on button get error: <a href="http://jsfiddle.net/FyUgH/" rel="nofollow">http://jsfiddle.net/FyUgH/</a></p>
<blockquote>
<p>{"error": "Shell form does not validate{'html_initial_name':
u'initial-js_lib', 'form': , 'html_name': 'js_lib', 'label': u'Js lib', 'field':
,
'help_text': '', 'name': 'js_lib'}"}</p>
</blockquote>
<pre><code><form action="#" method="POST">
<input type="text" name="name">
<button id="cli">Submit</button>
</form>
$('#cli').live('click',function(e){
e.preventDefault();
alert('oo')
if($('input[type="text"]').val()=='')alert('input is empty')
})
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,033,655
| 6,033,656
|
X/Y Detection and Submission onClick of a JavaScript Link?
|
<p>I have a page where people can battle one another on my game and, the attacks are JS Links, so.. to help catch cheaters I would like to make it so that on the click of the attack, it submits the X/Y coords of where they clicked on the link into the database.</p>
<p>Could someone help me?
Thank you!</p>
|
php javascript
|
[2, 3]
|
2,356,067
| 2,356,068
|
What is the difference between xxx.tostring() and (string)xxx?
|
<p>whats the difference in the two string methods below?</p>
<pre><code>string str1 = dr["RAGStatusCID"].ToString();
string str2 = (string)dr["Description"];
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,249,510
| 4,249,511
|
ASP.NET : Form posting via jQuery
|
<p>I have an ASP.NET page with 2 ASP.NET text boxes and one ASP.NET drop downlist I want toi use jQuery form posting instead of normal ASP.NET post back.Can anyone guide me how to do this ? How can i access the server side controls in the action page ? I dont want to pass everything via query string. Kindly guide me how to go ahead ? Thanks in advance</p>
|
asp.net jquery
|
[9, 5]
|
3,557,381
| 3,557,382
|
send data from Android app to local server
|
<p>i want to send data from android application to local server (PHP) but it doesn't work
this is my code (it is work with remote server ):</p>
<p>String path ="http://localhost/sd.php";
HttpClient client = new DefaultHttpClient();
HttpConnectionParams.setConnectionTimeout(client.getParams(), 100000);</p>
<p>HttpResponse response;</p>
<pre><code> JSONObject json = new JSONObject();
try {
HttpPost post = new HttpPost(path);
json.put("im", 999);
json.put("cTime", 12);
Log.i("jason Object", json.toString());
post.setHeader("json", json.toString());
StringEntity se = new StringEntity(json.toString());
se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"application/json"));
post.setEntity(se);
response = client.execute(post);
} catch (Exception e) {
Object n=e.getStackTrace();
Toast.makeText( getApplicationContext(),n.toString(),Toast.LENGTH_SHORT).show();
}
</code></pre>
<p>i thing the wrong in the address <a href="http://localhost/sd.php" rel="nofollow">http://localhost/sd.php</a>
pleas help me to find a solution to this problem </p>
|
php android
|
[2, 4]
|
3,710,516
| 3,710,517
|
Set a json object property to HTML
|
<p>I am trying something like</p>
<pre><code>var template = new Object();
template.DescriptionHTML ='*html content goes in here*'
</code></pre>
<p>This is why:</p>
<p>When the user clicks on a button a popup window opens where he/she can enter html text using a WYSIWYG editor. When they click submit, I want to pass the HTML content to the parent page using jQuery. Now this works if I am passing plain text from pop up to parent. But if I try to pass HTML it breaks. I don't want to escape the HTML characters because in the parent page I want to display the HTML content. How can this be done?</p>
<p>I am aware of alternatives such as posting back the parent page and getting the updated content. But I would appreciate if the responses can be limited to making the above scenario work.</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
2,817,933
| 2,817,934
|
handling more than one divisions in javascript
|
<p>In my program I have 3 divisions with class 'information', 'interest' and 'wall'.
I want this divisions to change their color when a a user clicks on it.
Initially all 3 division classes have same color <code>#dcdcdc</code>.
When user clicks on 1 of them I want to change its color to <code>#999</code>, but color of other divisions must remain <code>#dcdcdc</code>.</p>
<p>This much part is working correctly but when i click on 2nd division, the previous doesn't change its color back to <code>#dcdcdc</code>. </p>
<p>JavaScript part.</p>
<pre><code>$(document).ready(function(){
$('#pro_head > div').click
(
function()
{
$(this).css("background-color", "#999");
$(this).css("font-weight", "bold");
},
);
});
</code></pre>
<p>HTML part:</p>
<pre><code><div pro_head>
<div class="information"></div>
<div class="interest"></div>
<div class="wall"></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,692,610
| 4,692,611
|
how to update Sr. No. COLUMN after removing a TR from TABLE
|
<p>i have a table like </p>
<pre><code><table>
<tr>
<td>Sr. No.</td>
<td> Name</td>
<td>$nbsp;</td>
</tr>
<tr>
<td>1</td>
<td>abc</td>
<td>remove button</td>
</tr>
<tr>
<td>2</td>
<td>xyz</td>
<td>remove button</td>
</tr>
<tr>
<td>3</td>
<td>def</td>
<td>remove button</td>
</tr>
</code></pre>
<p></p>
<p>onclick of ' remove button ' i send ajax request & after successful response i remove the respective TR using $('#id_of_tr').remove();.</p>
<p>till here everything goes fine but now i want to update Sr. No.s of each row. Because Initially order is 1 2 3 , when i remove second row then it becames 1 3 which i want to update it to 1 2.</p>
<p>I hope this would help. </p>
|
javascript jquery
|
[3, 5]
|
1,928,028
| 1,928,029
|
Keep the content after postback
|
<p>I have a ASPX page, on this page there are two dropdown list, one button and one gridview. When the pages is loaded,these two dropdown would bind data from sql server. Then you select items from these two dropdown list, then click Button A to get data from sql server based on these two dropdown list, rendering the data using gridview.
There is another Button, Button B. Then I click the Button B to do something, like send mail. But the page becomes the first time it's loaded, the content disappeared after postback. How can I keep the content after I click the Button B?</p>
<pre><code>void SendInvitationMail_Click(object sender, EventArgs e)
{
send mail here
}
void QueryButton_Click(object sender, EventArgs e)
{
try
{
SPSecurity.RunWithElevatedPrivileges(delegate() {
try
{
My SQL here to get data from sql server and bind the data to gridview
gridview.Databind()
}
catch(Exception ex)
{
HandleException(ex);
}
});
}
catch (Exception ex)
{
HandleException(ex);
}
}
</code></pre>
<p>After I click the Query Button, it would get bind the data to gridview, then I click the Send Mail button. I want to keep all the result even I click the Send Mail button.
Best Regards, </p>
|
c# asp.net
|
[0, 9]
|
5,611,681
| 5,611,682
|
Send two request simultaneously 1st request with C# WebClient and 2nd request with Ajax
|
<p>hey guys,
i have a page in asp.net c#, in that im doin' some video upload functionality, so my video upload code is in <code>Page_Load()</code> method and i'm using <code>WebClient</code> to upload a video file.
and i have a <code>animated gif</code> image on page</p>
<p>Now the problem is when <code>Page_Load()</code> method is called my files getting uploaded using WebClient, while that time the Page is not yet render, so i get a blank page.. i want that <code>gif</code> image get animated while uploading is goin' on... </p>
<p><strong>Note:</strong> i have to use <code>WebClient's UploadFile()</code> method only.</p>
<p>So i was thinking is there any way that i can run my Upload functionality in new thread and let the page be Rendered.. or can ajax be helpfull in this scenario ??</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
UploadFile();//this method actually calls an API which uses WebClient to upload file
}
</code></pre>
<p>Another problem is to get a track of upload, that API gives a <code>url</code> which sends json response saying how much percent upload completed, so i also what to send request to this upload tracking <code>url</code> while my Uploading is goin' on simultaneously..</p>
|
c# asp.net
|
[0, 9]
|
5,424,656
| 5,424,657
|
Could it be that line.containes() is missing a search-term in Android?
|
<p>Something strange happens on a text parser that I am writing an I thought maybe you experts can find what I am doing wrong.</p>
<p>The parser is searching for several search-terms in the text and copy the found results to an output parsed file on the SD card.</p>
<p>The code is:</p>
<pre><code>String line; // line reading buffer
…
Process process = Runtime.getRuntime().exec(commandLine.toArray(new String[0]));
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
…
while ((line = bufferedReader.readLine()) != null){
line = bufferedReader.readLine(); // reading the buffer
/*** parsing the buffer line by line ***/
if (line.contains("SearchTermA")){
// parsing the text in this line
}
if (line.contains("SearchTermB")){
// parsing the text in this line
}
// Check that we got to a cretin part in the file
if (line.contains("SearchTerm_text")){
textID = 1;
}
if (textID == 1){
if (line.contains("SearchTermC")){
// parsing the text in this line
}
}
</code></pre>
<p>Now, the issue is that at the beginning of the file (the file is very long) this works OK but sometimes along the way SearchTermB appears in the original text but is not deceted by the code. I tried stepping the code with Eclipse on the target android machin and I can clearly see that “line” contains SerchTermB but the debugger ignores this IF statement and continue to the next IF statement.</p>
<p>Could it be that line.containes() is missing a search-term? </p>
<p>Please help in finding what am I doing wrong since this prevents me from sleeping at night…..</p>
<p>Thanks,</p>
|
java android
|
[1, 4]
|
3,239,644
| 3,239,645
|
Android Search Dialog soft keyboard stays open for too long
|
<p>I'm trying to use Android's built-in <a href="http://developer.android.com/guide/topics/search/search-dialog.html" rel="nofollow">Search Dialog</a>, and it's working fine except when I try to use it with a <a href="http://developer.android.com/reference/android/app/ProgressDialog.html" rel="nofollow">ProgressDialog</a>. The basic chain of events it his:</p>
<ol>
<li>User press the search button, enters a query and submits it.</li>
<li>The SearchManager calls the search Activity's onCreate method.</li>
<li>In the onCreate method, I call an AsyncTask that runs a query and shows a ProgressDialog in the onPreExecute method and hides it in the onPostExecute method.</li>
</ol>
<p>This all happens fine except as soon as I submit the query the screen looks like this:</p>
<p><img src="http://i.stack.imgur.com/Qwvkh.png" alt="enter image description here"></p>
<p>... which is pretty ugly. How can I prevent this from happening? </p>
<p><a href="http://code.google.com/p/mediawikiprovider/source/browse/#hg%2Fsrc%2Forg%2Fcdmckay%2Fandroid%2Fprovider%2Fdemo" rel="nofollow">You can find the source code for the project at Google Code.</a></p>
|
java android
|
[1, 4]
|
1,405,198
| 1,405,199
|
Unbinding certain links but not all of them
|
<p>I am trying to unbind a link from all functions. When I do:</p>
<pre><code>$('a').unbind();
</code></pre>
<p>It works perfectly. But obviously this is not what I want - I only want one specific link to not be manipulated by any functions. So I tried selecting the specific link:</p>
<pre><code>$('.page1->index').unbind();
</code></pre>
<p>But this did not work, the function was still manipulating the link. I also tried</p>
<pre><code> $('a.page1->index').unbind();
</code></pre>
<p>But that did not work either. I feel like my second approach should work. Is there something I'm missing?</p>
<p>HTML:</p>
<pre><code><a id ="page1->index" href="#play1" data-role="button" data-icon="back" data-iconpos="notext" data-transition="fade" data-direction="reverse"></a>
</code></pre>
|
javascript jquery
|
[3, 5]
|
185,604
| 185,605
|
ASP.net vs PHP (What to choose)
|
<p>I have been assigned a task to develop a new web application. Its a kind of social web applications, for the sake of understanding you can say its similar to facebook. Now before start developing such huge application i have few questions to ask:</p>
<ul>
<li>First, Does the tool and programing language
affects the performance of web
application?</li>
</ul>
<p>e.g I made two web pages both have same contents over it, the only difference is that one page is made in ASP.net(with C#) and other is made in PHP, now which page opens more fast at user end?
The only purpose of asking this question is that i want to choose one language which is more faster from end user prospective</p>
<ul>
<li>Same is the case with database do i
need to choose some specific database
or i can use any database of my choice,
currently i am considering:</li>
</ul>
<p>1.MS SQL Server<br>
2.MY SQL and<br>
3.Postgres</p>
|
php asp.net
|
[2, 9]
|
5,000,594
| 5,000,595
|
How to register for SMS database changes?
|
<p>How can I register for SMS database changes?</p>
<p>I tried:</p>
<pre><code>mCursor = mActivity.getContentResolver().query(Sms.CONTENT_URI, new String[] {
Sms.ADDRESS
}, null, null, null);
mCursor.registerDataSetObserver(mydataSetObserver);
</code></pre>
<p>where mydataSetObserver is implemented like this:</p>
<pre><code> private class MyDataSetObserver extends DataSetObserver {
public void onChanged() {
System.out.println ("1");
}
public void onInvalidated() {
System.out.println ("2");
}
}
</code></pre>
<p>But when I tried sending a SMS message in the emulator,
MyDataSetObserver never get called.</p>
<p>Can you please tell me why?</p>
<p>Thank you.</p>
|
java android
|
[1, 4]
|
3,494,785
| 3,494,786
|
PHP transfer files from server to server in LAN
|
<p>So, I have 5-6 pages of requirements. I'm trying to build this application in PHP based on the requirements.</p>
<p>I want to transfer files from one server to the other server in LAN, and then send a shell command to the other server to find out if the file has been transferred successfully.</p>
<p>In php, I can transfer files using FTP, and send shell commands using SSH.</p>
<p>Using the methods above, I will need to open connection to the server first, but I don't know the ftp server name, domain name, ip address, or anything like that.</p>
<p>I only know the the server ID (I'm not sure what this ID is, but I guess it is like the computer's name).
An example of the server ID is: "c23bap234"</p>
<p>How do I open a connection with just that server ID? These servers are in the same building, have LAN connection, don't have connection to the outside world. These machines have PHP, Apache, ... installed.</p>
<p>If my post doesn't make sense to you, it's because I'm a learner. I hope someone can help me on this.
Thanks in advance.</p>
|
java php
|
[1, 2]
|
3,921,094
| 3,921,095
|
Why is my JavaScript function not populating my array?
|
<p>The following block of code successfully returns array values (No. 1 130879253000, 34756)</p>
<pre><code> function getCsv(file_name){
var array_holder = [];
$.get(file_name, function(csv, state, xhr) {
// inconsistency
if (typeof csv != 'string') {
csv = xhr.responseText;
}
// parse the CSV trades
var header, comment = /^#/, x;
$.each(csv.split('\n'), function(i, line){
if (!comment.test(line)) {
if (!header) {
header = line;
}
else {
var point = line.split(';'),
date = point[0].split('-'),
time = point[1].split(':');
if (point.length > 1) {
x = Date.UTC(date[2], date[1] - 1, date[0], time[2], time[1], time[0]);
array_holder.push([
x, // time
parseFloat(point[2]) // close
]);
}
}
}
}); // each
alert('No. 1' + array_holder[0]);
});
return array_holder;
}
</code></pre>
<p>In the following section of code, I'm trying to call getCsv but I get No. 2 undefined</p>
<pre><code>$(function() {
var trades = getCsv('trades.csv');
var spreads = getCsv('spreads.csv');
alert('No. 2' + trades[0]);
}
</code></pre>
<p>Why are my arrays not getting populated? In the actual code I have the above two functions right next to each other in the order listed here. So the files are getting read correctly it's as if array_holder falls out of scope and gets garbage collected.</p>
|
javascript jquery
|
[3, 5]
|
2,310,631
| 2,310,632
|
Are there any Jquery datepickers or calendar that can have a day as a link to a new page?
|
<p>I tried modifying the Jquery ui datepicker, but it didnt work in Ie7 and chrome. </p>
<p>but since im not a javascript expert I need to find a premade solution, something that makes certain days links. </p>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
4,671,843
| 4,671,844
|
C++ Equivalent to a Scanner's .nextFloat() method?
|
<p>I'm starting to write C++ and I'm trying to read a text file that is formatted like this:</p>
<pre><code>32.0 12.43
503.2 3.212
</code></pre>
<p>etc.</p>
<p>In Java, I could use a <code>Scanner</code> with <code>.nextFloat()</code>, and put the contains into an <code>Array</code>. I am trying to achieve the same thing with C++. How is this done?</p>
|
java c++
|
[1, 6]
|
3,344,528
| 3,344,529
|
function that adds <SPAN>
|
<p>Good morning, I have a doubt.
I have a function that adds a click the User, the side of my input</p>
<p>Plus this gives an error. I wanted just once even if adicionace a person clicks the button several times the action. Do you have a scan after input if not add another </p>
<p>My code.</p>
<pre><code>//th = Name of the input that will add, at the low <SPAN>
if(d.length == 0){
$(th).after('<SPAN class="erro">'+txt+'</SPAN>');
this.focus();
return false;
}
</code></pre>
<p>I would be very grateful for the help. :)</p>
|
javascript jquery
|
[3, 5]
|
4,265,836
| 4,265,837
|
javascript if condition issue
|
<p>i have a variable CampaignType and it's value is 0.But in the alert(inside double star) it changes to 1.why so?
here is my javascript code snippet</p>
<pre><code> if (CampaignType != 2)
{
if (CampaignType = '1')
{
**alert(CampaignType);**
var CampaignAmount = (SelValue * CampaignPrice) / 100;
SelValue = SelValue - (CampaignAmount);
}
else if (CampaignType = '0')
{
SelValue = SelValue - CampaignPrice;
}
}
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,947,755
| 4,947,756
|
How does jQuery have the $ object constructor and the methods associated with the $?
|
<p>How is it that jQuery can do <code>$("#foo").addClass("bar")</code> and <code>$.ajax()</code>?</p>
<p>I'm creating a micro javascript framework and want to create a new instance of an object, such as <code>$("#hello")</code>. With this object there are associated methods, such as <code>addClass</code>, <code>css</code>, etc, just like with jQuery. So I could do something like</p>
<pre><code>$("#foo").addClass("remove").css("color", "red");
</code></pre>
<p>I have been successful in creating this. However, when I want to call a method from this object, such as <code>$.ajax</code>, the constructor function is overwritten, and I can call $.ajax, but not $("#foo").</p>
<p>Basically, how can jQuery do both?</p>
|
javascript jquery
|
[3, 5]
|
2,834,901
| 2,834,902
|
jQuery - How to make the input values ("email", "password") reappear when out of focus?
|
<p>When I click inside the input fields the values "Email" and "password" disappear which is what I want. But if the user doesn't enter his email/pass and clicks somewhere else, I want "Email" and "Password" to reappear. </p>
<p>jQuery:</p>
<pre><code>$('.login-user, .login-pass').focus(function() {
$(this).val("");
});
</code></pre>
<p>Html:</p>
<pre><code><input type="text" name="user" value="Email" tabindex="1" class="login-user" />
<input type="password" name="password" value="Password" tabindex="2" class="login-pass" />
</code></pre>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
373,502
| 373,503
|
Receiving username password in asp.net webform sent from android app
|
<p>I have successfully sent (username/password) and received (true/false) values from my android app to .php page.
Now i am trying to replace php page with aspx page
I am having problem while receiving data at Asp.net page (android app to asp.net page), so pls help me in this regard with asp.net page.</p>
<p>My android code is as follows:</p>
<pre><code> public void postLoginData() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://xyz/Default.aspx");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("formData1", x));
nameValuePairs.add(new BasicNameValuePair("formData2", y));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
result = inputStreamToString(response.getEntity().getContent()).toString();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
</code></pre>
|
android asp.net
|
[4, 9]
|
1,941,789
| 1,941,790
|
how to update output cache in asp.net?
|
<p>I am creating output cache programmatically. using-:</p>
<pre><code>this.CachePolicy.Duration = TimeSpan.FromSeconds(60);
</code></pre>
<p>i want to update my output cache in case of user open the page on other tab or window of the same browser.</p>
|
c# asp.net
|
[0, 9]
|
3,511,915
| 3,511,916
|
Single javascript function for multiple web pages
|
<p>I have around 40 aspx pages in my website.
I want to use a javascript function which needs to be called when any of the 40 pages is loaded.
something like </p>
<p>I could have this function in the "head" section of each of the 40 aspx pages and then call in the body onload event. But I would like to have this function at a single place.
This is an existing app so I cannot create a master page and have all the pages derive from it.</p>
<p>Any ideas?</p>
|
asp.net javascript
|
[9, 3]
|
3,970,502
| 3,970,503
|
Get propertyinfo value
|
<p>Im trying to get the value from a <code>PropertyInfo[]</code>, but i cant get it to work:</p>
<pre><code>foreach (var propertyInfo in foo.GetType().GetProperties())
{
var value = propertyInfo.GetValue(this, null);
}
</code></pre>
<p>Exception: <code>Object does not match target type.</code></p>
<p>Isnt this how its supposed to be done?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
2,317,661
| 2,317,662
|
check if a url has anything after the domain name
|
<p>im using asp.net c#.</p>
<p>I want to check if the current url has anything after the domain name.</p>
<p>e.g if the current url</p>
<p>www.example.com/</p>
<p>or</p>
<p>www.example.com</p>
<p>i want to set a bool to true.
if it has anything after i want to set it to false. e.g.</p>
<p>www.example.com/stuff </p>
<p>how can i do this?</p>
<p>should return false.</p>
|
c# asp.net
|
[0, 9]
|
1,644,781
| 1,644,782
|
Listing of Directory in a checkboxed tree srtucture
|
<p>Is it possible to create a tree-structured Directory listing having checkbox, so that we can select that directory and get that value back..</p>
<p>This needs to be done in c# web application.</p>
|
c# asp.net
|
[0, 9]
|
1,148,937
| 1,148,938
|
How to return variable datatypes from a method
|
<p>I have a method whose callers require different datatypes. I could repeat the requisite conversions a dozen times by putting them in each of the callers, but it seems much more efficient to do it once in the called method.</p>
<pre><code>public String myMethod(String myArg)
{
return DoSomething(myArg);
}
public Int32 myMethod(String myArg)
{
return Convert.ToInt32(DoSomething(myArg));
}
private String DoSomething(key)
{
return SomeList[key];
}
</code></pre>
<p>If I have multiple methods that pull data from SomeList and have to utilize different data types then in each I have to do a type conversion. Examples might be session variables or query or form requests or any other number of things. </p>
<p>In VB I could say</p>
<pre><code>Function myMethod(myArg as String) as Variant
myMethod=DoSomething(myArg)
End Function
</code></pre>
<p>Sorry if the original post was not very clear. I hope this makes more sense.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
5,097,499
| 5,097,500
|
dynamic variable in event bind
|
<p>I'm having a problem binding a dynamic event in jQuery. What I want to achieve is to have an event that acts on a variable that has previously been set. For example I have</p>
<pre><code>someFunc = function (form_id)
{
$("input").bind("focus", function ()
{
$("#"+form_id).css({"border":"1px solid red"});
});
}
someFunc("edit_form");
somefunc("add_form");
</code></pre>
<p>Now this is a large simplification of what I'm looking to do but the dynamic nature of a variable when binding is what I need. The problem here is that essentially I want jQuery to execute on whatever "form_id" was when the bind was applied but instead it will execute on whatever the "form_id" is when the focus is triggered.</p>
<p>I understand why this occurs, my question is how can I achieve the functionality I'm looking for. (Again form here is just an example, not an actual bit of functionality).</p>
<p><strong>Edit 1:</strong></p>
<p>This is probably a better example of what I'm trying to achieve:</p>
<pre><code>Dog.prototype = {
name: "Dog",
bind_function : function ()
{
name = this.name;
$(name+"_edit_form input[name='something']").bind("focus", function ()
{
console.log(name);
})
}
}
function Dog() {
this.breed = "Chihuaha";
}
Rover = new Dog();
Rover.bind_function();
Fido = new Dog();
Fido.bind_function();
</code></pre>
<p>Now I want focus to produce a console log of that particular dogs name, but at present it will just console log the last dog's name?</p>
|
javascript jquery
|
[3, 5]
|
2,934,533
| 2,934,534
|
jQuery: Is it possible to assign a DOM element to a variable for later use?
|
<p>I'm working on a project that is using jQuery, which I'm much more familiar with Mootools.</p>
<p>I'll start with my code first.</p>
<pre><code>var customNamespace = {
status: 'closed',
popup: $('#popup'),
showPopup: function() {
// ...
}
}
$(document).ready(function(){
console.log($('#popup'));
console.log(customNamespace.popup);
console.log($(customNamespace.popup));
$('#popup').fadeIn('slow');
(customNamespace.popup).fadeIn('slow');
$(customNamespace.popup).fadeIn('slow');
});
</code></pre>
<p>My goal is to not have jQuery traverse the DOM everytime I want to do something with the #popup div, so I wanted to save it to a variable to use it throughout my script.</p>
<p>When the page loads, the console prints out the object 3 times as I would expect, so I assumed that for each method, the fadeIn would just work. But it doesn't, only</p>
<pre><code>$('#popup').fadeIn('slow');
</code></pre>
<p>Actually fades in the div.</p>
<p>Even if I remove my namespace hash, and just save the object to a global variable, and do a </p>
<pre><code>var globalVariable = $('#popup');
.
.
.
globalVariable.fadeIn('slow');
</code></pre>
<p>Also does not work as I thought it would. Can jQuery do what I am trying to do?</p>
|
javascript jquery
|
[3, 5]
|
4,844,233
| 4,844,234
|
What imports do I need to make a jQuery popup dialog work?
|
<p>I am very confused :)</p>
<p>I have these 2 jQuery imports:</p>
<pre><code><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.16/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" />
</code></pre>
<p>and I think the bottom one is giving me errors on this page: <a href="http://www.problemio.com" rel="nofollow">http://www.problemio.com</a></p>
<p>The error is 404 not found. What should be the import so I can get the out of the box library to work that will enable me to create popup dialog boxes for the user?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
886,441
| 886,442
|
Problem in empty select - remove all options from select
|
<p>If I have select with id="select_test", how to delete all options inside but select stay on page, so I can load again some new options ? ( I get answer how to load, but I cannot empty, I tried like <code>$('#select_test').empty();</code></p>
<p>and </p>
<pre><code>$('#select_test').find('option').remove();
</code></pre>
<p>but it doesn't work ). Can someone say what I did wrong ?</p>
|
javascript jquery
|
[3, 5]
|
1,806,697
| 1,806,698
|
disable javascript from running on links
|
<p>I have a script that reloads an iframe whenever the browser screen is clicked (works perfectly). I was wondering how I would go about disabling the javascript from running on certain links?</p>
<p>Here is my current script:</p>
<pre><code>document.onclick= function(event) {
if (event===tichack) event= window.event;
var target= 'target' in event? event.target : event.srcElement;
document.getElementById("tichack").src = "http://link.com?"+(+new Date());
};
</code></pre>
<p>Example would be something like this i suppose? (obviously incorrect) but will give you a better idea of what I am trying to achieve, did allot of searching but have had no luck?:</p>
<pre><code>onclick="javascript:disabled=true;"
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,686,544
| 2,686,545
|
How change content value of pseudo :before element by Javascript
|
<p>I have the grap constructured by CSS, which is dynamically changes by JS. I show graph max value by pseudo element as:</p>
<pre><code>.graph:before {
content:""; //value that want set by JS
position:absolute;
top:0;
left:0;
}
</code></pre>
<p>That's why I need to set this value by JS. I tried <code>$(".graph:before").css("content", hh);</code> but it didn't help. How to get that value?</p>
|
javascript jquery
|
[3, 5]
|
3,844,609
| 3,844,610
|
Directing animation to correct place
|
<p>In my word game there is a grid with 3 letter words.</p>
<p>The aim of the game is to spell the words by clicking on the corresponding letters on the side.</p>
<p>When an area in the grid is highlighted it indicates to the user the word to spell. The user clicks the letters on the side of the grid and they should move to the highlighted area.</p>
<p>I have recently changed "drop-box" to a div in the following piece of code and now the animation takes the letter to the top corner of the grid before taking it to the correct position.</p>
<pre><code> var row = '<tr>';
var spaceAvailInRow = numLetters;
while (spaceAvailInRow) {
var word = getWordToFitIn(spaceAvailInRow, unusedShuffledWords);
guesses[word] = [];
spaceAvailInRow -= word.length;
for (var k = 0; k < word.length; ++k) {
row += '<td data-letter="' + word[k] + '" data-word="' + word + '"><div class="drop-box"></div></td>';
}
}
row += '</tr>';
tbl.append(row);
}
$(".container").append(tbl);
</code></pre>
<p>Can someone tell me why the animation has broke now I have changed this?</p>
<p>Fiddle: <a href="http://jsfiddle.net/7Y7A5/27/" rel="nofollow">http://jsfiddle.net/7Y7A5/27/</a></p>
|
javascript jquery
|
[3, 5]
|
1,878,202
| 1,878,203
|
how to figure out which inner anonymous class indicated by a class name?
|
<p>I used MAT tool in Eclipse to investigate a memory leak issue. I found that the leak was caused by an anonymous inner class instance in my app. The class name displayed in MAT is com.mycompany.myproduct.MyActivity$3. There are many anonymous inner classes defined in MyActivity.java. How do I know the which inner class com.mycompany.myproduct.MyActivity$3 indicates?</p>
<p>Thanks.</p>
|
java android
|
[1, 4]
|
2,364,808
| 2,364,809
|
What permissions do I need to run a shell command programmatically in Android?
|
<pre><code> try{
Process process;
process = Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(new
InputStreamReader(process.getInputStream()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
</code></pre>
|
java android
|
[1, 4]
|
3,165,783
| 3,165,784
|
How to send javascript array to server?
|
<p>I have an array of javascript obejcts. I want to send this array to server. I tried :</p>
<pre><code>JSON.stringify(jObectArray);
</code></pre>
<p>But at server side i am getting the empty array. How can i send it to server successfully ?</p>
|
javascript jquery
|
[3, 5]
|
4,135,802
| 4,135,803
|
A tricky javascript thing I'm wanting to do...pulling elements from a list and hiding the rest
|
<p>As usual, I want to do more than I know how to do yet :-D</p>
<p>Here's what I'm working on...I'm writing up a Bio.</p>
<p>But within the bio, I want a "long bio" and a "short bio" button. </p>
<p>The long bio will obviously display the whole bio, but the short bio would grab elements in the list and make them bold and contract the div to now only contain those list elements.</p>
<p>I know it soulds tricky (and may be a little too 'flashy') but I'm hoping to do it in a classy way. </p>
<p>I can accomplish a lot of what I want to do with the animatedcollapse script, but not exactly because that would just hide the big list and make a separate div of the small list visible. </p>
<p>Here' what I'm trying to accomplish:</p>
<pre><code><div id="bioWrap">
<h2>Bio</h2>
<p>Below is the bio you can read...<a href="" onclick="toggle The Long Bio And make the long bio and short bio buttons visable">read more</a></p>
<div id="bioTrigger">
<input type="button value="long"><input type="button value="short">
<ul>
<li> This would be text within the long bio</li>
<li> This would be text within the long bio</li>
<li id="This would remain in the li when short button is clicked"> This would be text within the long bio</li>
<li> This would be text within the long bio</li>
<li id="This would remain in the li when short button is clicked"> This would be text within the long bio</li>
<li> This would be text within the long bio</li>
</ul>
</div>
</div>
</code></pre>
<p>I do have jquery on this project if that helps...</p>
|
javascript jquery
|
[3, 5]
|
5,267,257
| 5,267,258
|
jQuery conflicts of many scripts
|
<p>I am asking my question after I have tried many ways to solve it but i couldn't.
I have conflicts with jQuery scripts in my site. The other I have changed the $ to jQuery and they worked but this script didn't work for me.</p>
<p>This code below works only the second script but the first script no.</p>
<pre><code><script defer="defer">
jquery.noConflict();
(function ($) {
$("#insured_list").tablesorterPager({
container: jquery("#pager")
});
})(jQuery);
</script>
<script defer="defer">
(function ($) {
$("#insured_list").tablesorter({
widthFixed: true,
widgets: ['zebra']
})
})(jQuery);
</script>
</code></pre>
<p>before it was like that</p>
<pre><code><script defer="defer">
$(document).ready(function()
$("#insured_list").tablesorterPager({container: jquery("#pager")});
.tablesorter({widthFixed: true, widgets: ['zebra']})
});
</code></pre>
<p>and neither worked, no page script no sorter.
I tried noconflict but it didnt seem to work.</p>
|
php jquery
|
[2, 5]
|
768,085
| 768,086
|
Messaging system jquery sends jQuery514109241_1210239812938 when I put :)) in the message
|
<p>When I put ":))" in my textarea and send via ajax, it inputs into the database a value like
"jQuery172039628539560362697_1345324072488", how can I stop this? Should I parse my text in some way in javascript first to make it recognize it's text, and not part of the javascript coding?</p>
<p>This is how i get my text</p>
<pre><code>var message = $("textarea.message_thread").val();
var dataString = 'id=' + id + '&message=' + message;
// make ajax call
</code></pre>
<p>sending with</p>
<pre><code>$.ajax(
{
type: "POST",
url: "/inbox/instsend",
data: dataString,
dataType: 'json',
success: function(results) {}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,851,034
| 4,851,035
|
What would be the jquery equivalent of 'Dive into python'?
|
<p>I need to , well, dive into client side programming. Is there an equivalent to 'Dive into python' for jquery?</p>
<p>I see that jquery 1.4 has been released. Does this change anything w.r.t answers?</p>
|
javascript jquery python
|
[3, 5, 7]
|
4,348,033
| 4,348,034
|
How can i know if all <img> loaded in div using jQuery
|
<p>How can i know if all loaded in div using jQuery</p>
<p>i want to do this after load all img in #slider div</p>
<pre><code>var imgHeight = $("#slider img").height();
alert(imgHeight);
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,583,920
| 1,583,921
|
How to hide second option in condition of first selection with JS / JQ?
|
<p>I got following problem and dont know how to solve it. :(</p>
<p>I want to disable / gray out options in relation to a color-selection.
Every option has a unique value.</p>
<p>For example:</p>
<ul>
<li>shirt (green) is only available in XS.</li>
<li>shirt (blue) is available in S and M.</li>
<li>shirt (yellow) is not available in L and XL.</li>
</ul>
<p>Is it possible with something like "if" or an array function?!?!
Is there a code snipped on fiddle?</p>
<p>Thanks for any help and sorry for my non-existing JS knowledge!</p>
<pre><code><form id="test" name="test" method="post" action="">
<label for="test"></label>
<select name="color" id="color">
<option value="1">---Select color---</option>
<option value="2">T-Shirt - green</option>
<option value="3">T-Shirt - blue</option>
<option value="4">T-Shirt - yellow</option>
</select>
<br />
<select name="size" id="size">
<option value="5">---Select size---</option>
<option value="6">XS</option>
<option value="7">S</option>
<option value="8">M</option>
<option value="9">L</option>
<option value="10">XL</option>
</select>
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,267,704
| 3,267,705
|
Javascript doesn't work when textbox name contains square brackets
|
<p>I've got this script for calculating square area, which works perfect:</p>
<pre><code><script language="javascript" type="text/javascript">
function startCalc(){
interval = setInterval("calc()",1);
}
function calc(){
one = document.autoSumForm.firstBox.value;
two = document.autoSumForm.secondBox.value;
document.autoSumForm.Area.value = (one * 1) * (two * 1);
}
function stopCalc(){
clearInterval(interval);
}
</script>
<form name="autoSumForm">
<input size="3" type=text name="firstBox" value="" onFocus="startCalc();" onBlur="stopCalc();">
<input size="3" type=text name="secondBox" value="" onFocus="startCalc();" onBlur="stopCalc();">
<input size="4" type=text name="Area" readonly="true">
</form>
</code></pre>
<p>But my problem is that I need the name of the third box to be <em><code>Area[<?php echo $area['area_id']; ?>]</code></em></p>
<p>But I can't get the javascript to work, when I use brackets in the name.</p>
|
php javascript
|
[2, 3]
|
1,627,717
| 1,627,718
|
Tap event firing X times a second in jquery
|
<p>I'm trying to make touch controls for a little game I'm writting with the help of jquery. But i just can't figure out how to write a function that basicly does the same thing that happens when you keep a key pressed.
Could you please help me?</p>
<p>PS. its not originaly my code <a href="http://remysharp.com/demo/mousehold.js" rel="nofollow">source</a></p>
<pre><code>jQuery.fn.mousehold = function(timeout, f) {
if (timeout && typeof timeout == 'function') {
f = timeout;
timeout = 100;
}
if (f && typeof f == 'function') {
var timer = 0;
var fireStep = 0;
return this.each(function() {
jQuery(this).mousedown(function() {
fireStep = 1;
var ctr = 0;
var t = this;
timer = setInterval(function() {
ctr++;
f.call(t, ctr);
fireStep = 2;
}, timeout);
})
clearMousehold = function() {
clearInterval(timer);
if (fireStep == 1) f.call(this, 1);
fireStep = 0;
}
jQuery(this).mouseout(clearMousehold);
jQuery(this).mouseup(clearMousehold);
})
}
}
$.fn.extend({
disableSelection: function() {
this.each(function() {
this.onselectstart = function() {
return false;
};
this.unselectable = "on";
$(this).css('-moz-user-select', 'none');
$(this).css('-webkit-user-select', 'none');
});
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,368,669
| 2,368,670
|
"hasClass" with javascript? or site with jquery to javascript translation?
|
<p>How do you do jQuery's <code>hasClass</code> with plain ol' javascript? E.g., <code><body class="thatClass" /></code> What's the javascript way to ask if <code>body</code> has "thatClass"?</p>
<p><em>Also, anyone know of a site that explains that gives javascript versions of many jQuery functions? I often find myself looking for answers to similar questions.</em></p>
|
javascript jquery
|
[3, 5]
|
2,390,512
| 2,390,513
|
how to calculate page rendering time with or without any javascript or with multple javascript seperately
|
<p>how to calculate page rendering time with or without any javascript or with multiple JavaScript separately?</p>
<p>I want to know how much page will go slow if i use any javascript/jquery with plugin/ multiple javascript/jquery plugin files etc.?</p>
<p>javascript code in any form inline, in-page code, external file.</p>
|
javascript jquery
|
[3, 5]
|
5,189,019
| 5,189,020
|
jwysiwyg to php
|
<p>I am using this jQuery based jWysiwyg.<br>
<a href="http://code.google.com/p/jwysiwyg" rel="nofollow">http://code.google.com/p/jwysiwyg</a></p>
<p>How do I pass the value of <code>$('#wysiwyg').val()</code> to php script. For example to show the value of jwysiwyg in an alert box, I am using</p>
<pre><code><form name="form1" method="post" action="sendmail.php">
<textarea name="wysiwyg" id="wysiwyg" rows="5" cols="103"></textarea>
<input type="submit" name="Submit" value="Login"></input>
<input type="button" value="Alert HTML" onclick="alert($('#wysiwyg').val());" />
</form>
</code></pre>
<p>What I need is how to pass value of jwysiwyg's value in submit control and how do I call "logout.php" on pressing of a button?</p>
|
php jquery
|
[2, 5]
|
2,788,102
| 2,788,103
|
PHP Session,Loggin Var, and Javascript
|
<p>I am trying to figure out how to do this some the php file only loads once on loggin.</p>
<p>How could I do this?</p>
<p>Example: (that I came up with but not sure what to use).
Let say A=1 when the site loads up. I log in and (if Global User is logged in and A=1 call or include welcome.php). </p>
<p>When the file is loaded the A=1 turns into variable of A=2 so that when I load the pages the welcome.php in this case will not load again.</p>
<p>On my logout page I need to set this value of A to be cleared of this session so A can be called to be 1 again after logout.</p>
<p>So, basically the file will only load once even if the pages are refreshed until user log out.
One more thing this is all done in smarty php using .tpl files.</p>
|
php javascript
|
[2, 3]
|
3,937,635
| 3,937,636
|
Visual Web Developer Express with SP1 crashing when switching to design mode
|
<p>I've just recently upgraded to using Visual Studio express editions with service pack 1. Previously I was using the express editions minus the service pack. The IDE for C++ and C# run fine for me but when running the Visual Web Developer IDE I get a crash when trying to switch to design mode on any page I attempt it on.</p>
<p>I have been able to track down the particular line and module this crash is occurring in. Its from the file afxcrit.cpp from the DLL fpacutl.dll. The relevant function where the crash is occurring is as follows...</p>
<pre><code>void AFXAPI AfxLockGlobals(int nLockType)
{
ENSURE((UINT)nLockType < CRIT_MAX);
// intialize global state, if necessary
if (!_afxCriticalInit)
{
AfxCriticalInit();
ASSERT(_afxCriticalInit);
}
// initialize specific resource if necessary
if (!_afxLockInit[nLockType])
{
EnterCriticalSection(&_afxLockInitLock);
if (!_afxLockInit[nLockType])
{
InitializeCriticalSection(&_afxResourceLock[nLockType]);
VERIFY(++_afxLockInit[nLockType]);
}
LeaveCriticalSection(&_afxLockInitLock);
}
// lock specific resource
EnterCriticalSection(&_afxResourceLock[nLockType]); // <--- CRASH HERE !!!
#ifdef _DEBUG
ASSERT(++_afxResourceLocked[nLockType] > 0);
#endif
}
</code></pre>
<p>Any help/thoughts is greatly appreciated.</p>
|
c# asp.net
|
[0, 9]
|
3,412,625
| 3,412,626
|
Explicit or implicit looping?
|
<p>Why or when is "explicit" preferred when implicit solutions often are more readable and less code? It says "explicit is better than implicit" when for example an implicit loop is better than an explicit loop isn't it? </p>
<pre><code>for every in all:
every.updated = True
</code></pre>
<p>The above looks implicit to me and better than an explicit counter since a counter is another thing that can go wrong and why not leave to the compiler or other environment instead of requirement an explicit counter variable:</p>
<pre><code> for(int i=0, i<a.length, i++)
...
</code></pre>
<p>And there are languages where all looping is "implicit" - what does it mean and when is it preferred? And not explicitly setting a value to <code>null</code>or <code>None</code> or likewise seems better to me and I want to rewrite code when I "solve" a requirement by explicitly setting <code>return null</code> or <code>String name = null</code> since I think being explicit about what should be null and None should have a more clear solution such as only use a variable if it's needed and if I write return null somewhere I'm probably doing it wrong. When I was writing Java I found myself writing <code>return null</code> and declaring values as null at some places and I didn't like it and could rewrite it even though the case where I put <code>return null</code> was reached only in case of error. </p>
<p>I asked the guru at work whether we ever should declare a variable to null, isn't defaults much better?</p>
<p>I'd be glad to know your thoughts about this. An example where it <em>is</em> better to be explicit I can think of is declaring a list and explicitly declaring what type is in the list is better than just a list of objects e.g. it's preferred to declare <code>ArrayList<ArrayList></code> instead of just an ArrayList if we know that it's a list of lists. </p>
|
java python
|
[1, 7]
|
3,956,871
| 3,956,872
|
How to load user control at run time, in a aspx page?
|
<p>I have got 5 user controls placed in some Control folder, at run time on basis of some ID I want to load user control from the Control folder to the aspx page.
Could any body tell how should I pass that ID to fix which user control to load in some div at run time.</p>
|
c# asp.net
|
[0, 9]
|
637,153
| 637,154
|
Javascript error in asp.net
|
<p>I have a calendar control that is hosted on an iframe. I get a javascript error when I click on a date on the calendar. <strong>window.top.document.getElementById(..) is null or not an object</strong> </p>
<p>The iframe is hosted on another page ConfigSettings.aspx </p>
<p>The code in the calendar control code behind is: </p>
<pre><code>Dim sjscript As String = "<script language=""javascript"" type=""text/javascript"">"
sjscript &= "window.top.document.getElementById('" & HttpContext.Current.Request.QueryString("DateTextID") & "').value = '" & Calendar1.SelectedDate & "';"
sjscript &= "window.top.document.getElementById('" & HttpContext.Current.Request.QueryString("DateTextID") & "1').style.display = 'none';"
sjscript = sjscript & "</script" & ">"
Literal1.Text = sjscript
</code></pre>
<p>The html code is: </p>
<pre><code><input type="text" class="TextBox" id="ToDate" runat="server"/>
<a href="javascript:ShowCalendar('ToDate1')"><img src="images/Calendar.jpg" border="0" /></a>
<iframe src="Calendar.aspx?DateTextID=ToDate" style="display:none; width:200px; height:100px" name="ToDate1" id="ToDate1"></iframe>
<asp:Label runat="server" ID="lblEndTime" Text="End Time:"></asp:Label>
</code></pre>
<p>What would be causing the error?</p>
|
javascript asp.net
|
[3, 9]
|
5,396,843
| 5,396,844
|
Determine browser with jQuery and add style to an element
|
<p>I know it sounds nasty, but I really came only to find a solution if possible, since I need to fix it fast. Using CSS is not working since it's a bit of hack, and my elements only recognize <code>style="margin-left: 50px;"</code> if I add this in HTML. </p>
<p>There was a simple solution by adding STYLE directly into HTML, but another problem I found is Mozilla or Opera is displaying things differently. For example in Chrome <code>margin-left: 50px</code> is ok, but in Mozilla it must be set to <code>55px</code>.</p>
<p>So, I wonder if there is a Javascript that finds which web browser version someone is using and add a different number at <code>style="margin-left: --px;"</code></p>
|
php javascript jquery
|
[2, 3, 5]
|
5,557,146
| 5,557,147
|
tool tips for creating on tab menu
|
<p>hi
in my application i have tab menu which i done using css.
when ever user moves the cursor on the tab he should been given an tooltip for that tab. is it ther any solution i can solve using JQuery or any other concept.</p>
<p>thank you </p>
|
c# asp.net jquery
|
[0, 9, 5]
|
4,764,817
| 4,764,818
|
Android Licensing Verification Library using the ServerManagedPolicy
|
<p>i use some code from web in that way i am code i coded public key from google account or publisher account when i run the application in emulator have error dontallow() method is runing anyone help me</p>
|
java android
|
[1, 4]
|
2,865,749
| 2,865,750
|
Global variable not set value in $.getJSON properly
|
<p>I have declared global variable named counter=0 on my index.html page inside head section </p>
<pre><code><script>
var counter=0;
</script>
</code></pre>
<p>now in my one of function i am setting its value as</p>
<pre><code> function getCounter(param)
{
$.getJSON("somewebserviceURL&format=json&callback=?",
function(data)
{
$.each(data, function(i, item)
{
counter++;
});
});
//I am not able to get the latest value here & in upcoming functions which use this variable
alert(counter);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
770,371
| 770,372
|
Build URL from Form Fields with Javascript or jquery
|
<p>I have a quick question, I can't seem to find a suitable solution to anywhere else.
I'm trying to create a URL builder form with Javascript or jquery. Bascially, it will take the value of the two form fields, add them to a preset url and show it on a third field on submit. </p>
<p>The resulting URL might be <a href="http://www.mydomain.com/index.php?variable1=12&variable2=56">http://www.mydomain.com/index.php?variable1=12&variable2=56</a></p>
<p>Now, this isn't the "action" of the form and the app can't read a URL (to grab the variables) so it has to be done in page.</p>
<p>The resulting URL will be shown in the "url" named field.</p>
<p>Here's a sample of the form:</p>
<pre><code><form id="form1" name="form1" method="post" action="">
<p>
<label>Variable 1
<input type="text" name="variable1" id="variable1" />
</label>
</p>
<p>
<label>Variable 2
<input type="text" name="variable2" id="variable2" />
</label>
</p>
<p>
<label>URL
<input type="text" name="url" id="url" />
</label>
</p>
<p>
<input type="submit" name="button" id="button" value="Submit" />
</p>
</form>
</code></pre>
<p>Thanks in advance!
Troy</p>
|
javascript jquery
|
[3, 5]
|
1,723,047
| 1,723,048
|
How to create HTML Form in a new window
|
<p>I have the following function:</p>
<pre><code>// open a new window. Create and submit form
function createSubmitForm(response) {
var external = window.open('about:blank', 'external');
var doc = external.document;
var body = $('body', doc);
// create a new form element
var form = $("<form id='authForm'></form>");
// set the form's attributes and add to iframe
form.attr("action", response.action)
.attr("method", response.method);
form.appendTo(body);
// create form elements;
for (var i = 0, len = response.fields.length; i < len; i++) {
var field = response.fields[i];
if (field.name != "") {
$("<input type='hidden'/>")
.attr("name", field.name)
.attr("value", field.value)
.appendTo(form);
}
}
// submit the form
form.submit();
}
</code></pre>
<p>When I try to execute it, I get an <strong>"Unspecified Error"</strong> at <code>form.appendTo(body)</code>. </p>
<p>What could I be doing wrong here?</p>
|
javascript jquery
|
[3, 5]
|
925,087
| 925,088
|
How to pass the article id to the "View Article" Activity
|
<p>I'm a web developer in php. When I'm creating a view article page I was passing the id in GET
something like article.php?id=10.</p>
<p>But now in android if I have an activity which views the article, how to pass to it the article ID to select it's data from the database?</p>
<p>What is my best option?</p>
|
java android
|
[1, 4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.