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 |
---|---|---|---|---|---|
1,146,575 | 1,146,576 | Is there anyway to write android applications in PHP? | <p>Is there anyway to write android applications in PHP? </p>
<p>This page clearly mentions that Android apps should be written in Java. Just wondering if there is another way...</p>
<p><a href="http://developer.android.com/guide/topics/fundamentals.html">http://developer.android.com/guide/topics/fundamentals.html</a></p>
| php android | [2, 4] |
1,813,342 | 1,813,343 | Want to show Busy Loading message with percentage download when form will load using JQuery | <p>suppose my page content is huge so in my asp.net application i want to show busy icon with percentage downloading the content in client side. i saw many flash and sliver light site that they show busy icon and also they show percentage that means how much content has been loading in client machine. how could i achieve this using JQuery and when page content has been downloaded in client machine the busy icon goes out and actual page content will display.</p>
<p>please me with sample code to achieve it. thanks</p>
| asp.net jquery | [9, 5] |
5,727,662 | 5,727,663 | Using custom adapter? | <p>I want to use custom adapter to fill my list view with phone contact data.
I have xml with 2 text views for contact name and contact number.
Also I have xml with list view and 2 buttons which I need to use latter.
I want to extend Activity if is possible not ListActivity!?
I tried lots of things(BaseAdaper, SimpleCursorAdapter ...), but every time I get an error.
I would really appreciate some help, because I don't know what to do with it.</p>
<p>this is my code:</p>
<p>public class Imenik extends ListActivity{</p>
<pre><code>TextView ime, broj;
ListView myListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//setContentView(R.layout.imeniklista);
ime = (TextView) findViewById(R.id.tvImeImenik);
broj = (TextView) findViewById(R.id.tvSamoProba);
Cursor contactCursor = this.managedQuery(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
myListView = (ListView) findViewById(R.id.lvImenik);
this.setListAdapter(new MyContactAdaper(this, contactCursor));
}
private class MyContactAdaper extends CursorAdapter{
private Context myContext;
private Cursor myCursor;
private LayoutInflater myLayoutInflater;
public MyContactAdaper(Context context, Cursor cursor) {
super(context, cursor, true);
// TODO Auto-generated constructor stub
myLayoutInflater = LayoutInflater.from(context);
myContext = context;
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
// TODO Auto-generated method stub
ime.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
broj.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)));
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
// TODO Auto-generated method stub
final View view = myLayoutInflater.inflate(R.layout.imenik, parent, false);
return view;
}
}
</code></pre>
| java android | [1, 4] |
2,231,777 | 2,231,778 | Insert a html code on clicking a link using jquery method insertBefore | <p>I am developing a social website like facebook in php. I have a page for displaying the messages for the user with two links,that is <code>reply</code> and <code>delete</code> at the right bottom corner for every messages in the inbox. My issue is that when i click the reply link another html block should come where user can send the responses back to the sender.I have written the code like this</p>
<pre><code><div class="msgutil">
<a href="" id="reply" onclick="return post_reply()" >reply</a>//this method does'nt works
<a href="delete_message.php?msg_id=<?php echo $row_msg_id;?>">delete</a> //dont check this
</div><!--end msgutil-->
</code></pre>
<p>I have inserted the html document inside the post_reply() like this</p>
<pre><code> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script type="text/javascript">
function post_reply()
{
$("<form id="msgreply" name="msgreply" action="#"> <textarea name="replyfield" id="replyfield"></textarea> </form>").insertBefore("#reply");
return true;
}
</script>
</code></pre>
<p>I don't know why its not working.</p>
| javascript jquery | [3, 5] |
4,474,658 | 4,474,659 | Video Chat using Android | <p>Hey Friends,<br>
how can i develop a video chat app,i have a channel for video chat, i need to connect my app with that,how can it possible?</p>
| java android | [1, 4] |
5,647,278 | 5,647,279 | Initialize JQuery Datepicker with a blank value | <p>This code still sets the field to today's date</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
$('.date').datepicker({ dateFormat: "mm/dd/yy", changeMonth: true,
changeYear: true, yearRange: '1900:2020', defaultDate: ''
});
});
</script>
</code></pre>
<p>How do I universally configure the field to start as blank? </p>
| javascript jquery | [3, 5] |
5,485,549 | 5,485,550 | Extract text value from aspx via php | <p>Trying to get a text value either "yes" or "no" from an aspx page via my php product page.</p>
<p>from here..</p>
<p>after code= i need to insert the product model number $products_model</p>
<p>example..
<a href="http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=RN311014" rel="nofollow">http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code=RN311014</a></p>
<p>replace RN311014 with $products_model and then echo back the text result</p>
<p>hope someone can help..</p>
<p>thanks scott</p>
<p>i tryed this within my orginal code</p>
<pre><code><?php $contents = file_get_contents("http://www.madisonb2b.co.uk/stockenquiry.aspx?id=B8FxKDnJ%2bIdaPT1Nw5wo4r87qHuHcCQIPZzeUE%2fI36LIFOM%2bayBi2RSXHzIJS5Hj97JNSyYL80Q%3d&code={$products_model}", NULL, NULL, 0, 3); echo $contents;
</code></pre>
<blockquote>
<p>Blockquote</p>
</blockquote>
| php asp.net | [2, 9] |
799,761 | 799,762 | Tab within a text area without changing focus, jQuery | <p>Given a textarea, is there any way to use jQuery to enable the ability for people to use the "tab" key that actually ..inserts a tab, instead of jumping focus to the next form element on the page?</p>
<p>I've followed <a href="http://stackoverflow.com/questions/3362/capturing-tab-key-in-text-box">Capturing TAB key in text box</a> and while this does work, I'm looking to try and wrap this into a jQuery plugin to make a specific textbox tabbable. The problem is, I'm not entirely understanding how to apply the concept of these 'listeners' to objects that corrospond to jQuery.</p>
<p>Does anyone have some leads on where I could start? </p>
| javascript jquery | [3, 5] |
937,516 | 937,517 | Javascript onclick not passing utf 8 data | <p>I have an <code>onclick</code> function and I'm using it to pass some utf 8 data (in persian language) to receive it in a jQuery function, but it does not work.</p>
<p>I also added</p>
<pre><code><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</code></pre>
<p>and</p>
<pre><code><script type="text/javascript" charset="utf-8">
</code></pre>
<p>to my code. Can any body help me please?</p>
<pre><code>echo "<a id=\"details\" name=\"$id\" onclick=\"show_details({$id}, '{$title}', '{$content}');\">Details</a><br>"
function show_details(id, title, content) {
alert(content);
}
</code></pre>
| javascript jquery | [3, 5] |
1,999,310 | 1,999,311 | Easy modification to jQuery code to make use of more than one textbox | <p>How to change the following code to make use of all my 4 textboxes with id extra1, extra2,persons and tables?</p>
<pre><code>$(document).ready(function () {
$('#extra1').blur(function () {
if ($.trim(this.value) == "") {
$('#btnUpdate').attr("disabled", true);
}
else {
$('#btnUpdate').removeAttr("disabled");
}
});
});
</code></pre>
| javascript jquery | [3, 5] |
2,347,334 | 2,347,335 | How to call javascript postback codebehind with same submit button | <p>I have a asp.net application display file names with treeview structure on the page.
After the user click on the checkbox to select the download files on the treeview then they can click the submit button.
First, I need to retrieve the checked(selected) node path value.
Second, pass all the node path with folder/file names to client javascript to downloading the files to local machine. (we are using third party Softartisans XFile download which are using javascript function).</p>
<p>I was able to retrieve the nodepath value with onclick at codebehind, but have problem to pass the value to javascript function.</p>
<p>My question is "There is any way I can call javascript function and pass the values AFTER the postback. I have used ReisterArrayDeclaration, the codes as ..</p>
<pre><code>if (!IsPostBack)
{
dnlFile = getDownloadFile();
ClientScriptManager csm = Page.ClientScript;
csm.RegisterArrayDeclaration("dnlFile", dnlFile);
btnDownLink.Attributes.Add("OnClick", "btnFileDown_Click('" + dnlFile + "')");
}
protected void btnDownLoad_Click(object sender, EventArgs e)
{
TreeView tv = tvFileDown;
if (tv.CheckedNodes.Count > 0)
{
foreach (TreeNode node in tv.CheckedNodes)
{
string strFilePath = Server.MapPath(initFolderPath + node.ValuePath);
if (Directory.Exists(strFilePath))
{
lblSelectedNode.Text = node.ValuePath + ", ";
}
else
{
if (File.Exists(strFilePath))
{
dnFile.Add(node.ValuePath);
}
}
}
dnlFile = getDownloadFile();
}
}
private string getDownloadFile()
{
string downLoadFile = "";
if (dnFile.Count > 0)
{
for (var i = 0; i < dnFile.Count; i++)
{downLoadFile += dnFile[i].ToString() + ", ";}
}
lblFinalFilePath.Text = downLoadFile;
return downLoadFile;
}
</code></pre>
<p>Thans advance for your help!!</p>
| javascript asp.net | [3, 9] |
4,981,953 | 4,981,954 | Progress Bar using JQuery | <p>I want to show a progress bar in my page using JQuery. If i hardcoded the value as 10 means, in the progressbar " 10% Completed " should be displayed. How to do this..Please guide me...</p>
| javascript jquery | [3, 5] |
4,076,739 | 4,076,740 | Problem tracking what javascript is causing jQuery UI error in firebug | <p>So I am getting the following error in firebug regarding jQuery UI. It would be as simple if it was a matter of a process-of-elimination on the JS on the page, but there is allot of JS as well as some on the page and some on the site.master.</p>
<p><strong>ERROR</strong></p>
<pre><code>(this.uiDialogTitlebarCloseText = c("<span/>"))
.addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo
is not a function
</code></pre>
<p>Is there a way in Firebug to see what javascript is the initial caller?</p>
| javascript jquery asp.net | [3, 5, 9] |
908,140 | 908,141 | execute javascript before dom is loading | <p>I want to develop a handle javascript class that handle used frameworks, among other things.</p>
<p>For example:</p>
<pre><code>myClass.addFramework('jQuery'); // just an example
</code></pre>
<p>It works fine and my class add the framework - but if there any jQuery code in it, it wouldn't work, because the framework is loaded after the dom is ready, so a default jQuery snippet like <code>jQuery(document).ready(function(){});</code> can't work, because 'jQuery' isn't already defined.</p>
<p>Is there any solution to that I can script a 'fix' that before the rest of the dom is beginning to loading all my <code>addFramework</code> methods must be executed ?</p>
| javascript jquery | [3, 5] |
3,097,502 | 3,097,503 | Implementing button click from a custom list view | <p>I am using one class which extends ListActivity and One class extending BaseAdapter.
The Base Adapter uses getView function to inflate layout from xml.
The xml contains a text and a button to delete the row of list.
Please let me know how to handle the button click in the ListActivity class.
Send me a sample snapshot
Thanks</p>
| java android | [1, 4] |
5,572,655 | 5,572,656 | Javascript reload the page with hash value | <p>I am trying to refresh the page with this statement in external javascript file after some processes.</p>
<pre><code>window.location.href = window.location.href
</code></pre>
<p>It perfectly reload the page but I want to scroll to the specific location after reload.
So, I put this on the page.</p>
<pre><code><a name="uploadImgSection"></a>
</code></pre>
<p>And change the javascript to</p>
<pre><code>window.location.href = window.location.href + "#mypara";
</code></pre>
<p>This code doesn't reload/refresh the page either</p>
<pre><code>window.location.hash = "#uploadImgSection";
window.location.href = window.location.href;
</code></pre>
<p>When I do that, it doesn't reload the page at all. Is there any way I can reload the page with scroll bar position?</p>
| javascript jquery | [3, 5] |
5,415,377 | 5,415,378 | Finding words within a paragraph of text | <p>I have a <code><p></code> tag and within the tag, there is a paragraph of text. </p>
<pre><code><p>"Hello Lorem ipsum Hello dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex Hello ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecatHello cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Hello.</p>
</code></pre>
<p>Within the <code><p></code> tag, there is a chunk of text. Within the text, there are a few "<em>Hello</em>". I want to loop through the whole chunk of text inside the <code><p></code> tag and find <strong>all</strong> the "<em>Hello</em>" string and wrap those "<em>Hello</em>" strings that are found with an html tag.</p>
<p>Is there a way, through jQuery's selector, that I could loop through all the text within the <code><p></code> tag, find all the words that is exactly "Hello", wrap the word with a <code><strong class="test"></code> tag?</p>
| javascript jquery | [3, 5] |
4,136,066 | 4,136,067 | If you select an element in jQuery by ID is there still a speed improvement by giving it a context? | <p>Imagine this simplified markup:</p>
<pre><code><div id="header">
<!-- Other things.... -->
<div id="detail">
</div>
</div>
</code></pre>
<p>and assume you already have this code:</p>
<pre><code>var $hdr = $("#header");
</code></pre>
<p>Is there any speed difference for jQuery to lookup "detail" this way:</p>
<pre><code>var $detail = $("#detail", $hdr);
</code></pre>
<p>vs</p>
<pre><code>var $detail = $("#detail");
</code></pre>
<p>Since detail is being looked up by ID?</p>
| javascript jquery | [3, 5] |
2,180,576 | 2,180,577 | Javascript DIV positioning | <p>I am working on some JS to display a Twitter-eque error/success banner. I would like the banner to be visible at the top of the browser (FF, Chrome, Safari) for the duration of the time it is in view (including if the user decides to scroll somewhere else). I can't figure out the solution however.</p>
<p>Another issue I am having is with jQuery not appending a passed in message to the #alert div I am using for all of this.</p>
<pre><code>var alertBanner = function(msg){
var $alert = $('#alert');
if($alert.length) {
$('#alert').empty();
$(msg).appendTo('#alert');
var alerttimer = window.setTimeout(function () {
$alert.trigger('click');
}, 3000);
$alert.animate({height: $alert.css('line-height') || '50px'}, 200)
.click(function () {
window.clearTimeout(alerttimer);
$alert.animate({height: '0'}, 200);
});
}
}
</code></pre>
| javascript jquery | [3, 5] |
4,994,040 | 4,994,041 | Global variable getting me null | <p>I want to use Global variale in my project so I have simply take a class in which I can set and get any variable dat easily.</p>
<p><strong>like this::</strong></p>
<pre><code>public class Glob_variable {
String Path = new String();
/**********************************************/
public void setPath(String Path) {
this.Path = Path;
}
public String getPath() {
return Path;
}
/**********************************************/
}
</code></pre>
<p>But when I initialize it, I get a null exception.
I have initialized it by creating a object of Glob_variable class.</p>
<p><strong>like::</strong> </p>
<pre><code>Glob_variable g = new Glob_variable();
g.setPath("asdasd");
</code></pre>
<p>and when I call in second activity I got null variable when I trace.
I have call like:</p>
<pre><code>Glob_variable g = new Glob_variable();
g.getPath();
</code></pre>
<p>So can you tell me at the which point I have made a mistake?</p>
| java android | [1, 4] |
1,390,614 | 1,390,615 | Android Texting App change from "Media" | <p>I made a texting app for Android. When I tested it I found that if I try to go into silent mode (on a phone) the texting app will still go off, because it is set to a "media" and not a "ringtone" volume type. </p>
<p>Is there any way to change this so when I silence my phone, my app will also be silenced? I don't want the user to have to try and fix it.</p>
<p><strong>Update:</strong> Sorry for any confusion. This has been a side project I did a while ago and I am just coming back to it now. </p>
<p>The project is a voice to text/ text to voice converter so all commands in the project can be done through voice. The app will "talk" to you through each step of the program. I want to have the ability so silence all "talking" that the app does to you the user if the phone is on silence. Here is how I handle voice feedback:</p>
<pre><code>import android.speech.tts.TextToSpeech;
public class VoiceFeedback implements SMSFeedback{
private TextToSpeech tts;
private String text;
public VoiceFeedback(TextToSpeech tts, String text){
this.tts = tts;
this.text = text;
}
public void play(){
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
}
}
</code></pre>
<p>I guess the real question I should be asking is:</p>
<p><em>Is there a way to tell if the phone is silenced so that I can edit the code to not include voice feedback when there is?</em></p>
<p>Thanks! </p>
| java android | [1, 4] |
2,729,541 | 2,729,542 | Pass variable from jQuery to PHP | <p>I created a script to read a hash (www.website.com/#hash) and pass the hash in to php.
The <code>alert(hash)</code> pops up with the hash value, but the hash is not being echoed out in the post variable. Any idea why?</p>
<p><strong>jQuery page</strong></p>
<pre><code><script>
var hash = location.hash;
$.post("community.php", {
hash: hash
});
alert(hash);
</script>
</code></pre>
<p><strong>Community.php page</strong></p>
<pre><code><?php echo $_POST['hash']; ?>
</code></pre>
<p><br /><br /></p>
<blockquote>
<p><strong>Edits</strong> - $_GET below was originally $_POST above.</p>
</blockquote>
<p>I have a foreach that is looping through postings (posting IDs) in a function. I need to pass the HASH into the function and compare it to the posting IDs everytime. Only problem is, the $_GET['hash'] will not show up inside the function.</p>
<pre><code>function something() {
echo $_GET['hash'];
}
</code></pre>
| php javascript jquery | [2, 3, 5] |
2,950,695 | 2,950,696 | javascript working in firefox or crome not ie | <p>I have the following lines of code in my .js file</p>
<pre><code>$(triggers.restart).live('click', function (e) {
e.preventDefault();
plugin.method.startQuiz(this);
});
</code></pre>
<p>The code is working fine in firefox or chrome but not in ie. Any points??</p>
<p>Thanks in advance...</p>
| javascript jquery | [3, 5] |
2,876,873 | 2,876,874 | Android:how to iterate an ArrayList<String> in different thread | <p>I need to iterate an ArrayList of String in a different thread, I don't need to add or delete items, just to iterate.</p>
<p>How can I do it?</p>
| java android | [1, 4] |
4,847,400 | 4,847,401 | Get HTML in the body after a certain div | <p>I have this:</p>
<pre><code><body>
<div id="someJunk">
Content
</div>
<svg class=.....>
<svg class=.....>
</body>
</code></pre>
<p>I need to get the svg's, either as a string or a list. How would I got about doing that?</p>
| javascript jquery | [3, 5] |
3,920,560 | 3,920,561 | How to get the document height using C#? | <p>I am using ASP.NET and C#.I can able to get the document height using javascript with this.</p>
<pre><code>var h = document.documentElement.offsetHeight;
</code></pre>
<p>Now i need this value during pageload. But the javascript will be start exicuting after pageload. So now i need to get it using server side code(C#).</p>
<p>Is it possible?</p>
<p>EDIT:</p>
<p>In pageload i am planning to set the height for all the tags based on the document height.
So that the page will fit for all resolution.</p>
| c# asp.net | [0, 9] |
1,679,731 | 1,679,732 | how to check if input type button is pressed in php? | <p>the isset function can be used to check if input type submit is pressed but is there any way to check if the input type button is pressed?in my code the button does nothing but call a function on onclick event which then refreshes the page and makes a database entry inside php...and i want it to make the entry only after the button is pressed...and i cant use the sumbit type for other reasons...following is some code</p>
<pre><code> function send(){
var events=document.getElementById("event").value;
location.href="calm.php?day=" + xx + "&month=" + yy + "&year=" + zz + "&events=" + events;
}
<input name="Button" type="button" id="submit" onclick="send(this.form)" value="Button" />
<?php
session_start();
include_once "connect_to_mysql.php";
$day = $_GET['day'];
$month = $_GET['month'];
$year = $_GET['year'];
$events = $_GET['events'];
$userid = $_SESSION['id'];
if (isset($_POST['button']))
{ $sql = mysql_query("INSERT INTO events (userid,month,day,year,events)
VALUES('$userid','$month','$day', '$year','$events')")
or die (mysql_error());}
</code></pre>
<p>?></p>
| php javascript | [2, 3] |
2,131,382 | 2,131,383 | return false in firefox causing ajax timing issue i'm thinking | <p>I have a simple ajax page that adds 2 numbers.</p>
<p>When I run in IE, the async callback works.</p>
<p>When I run in Firefox it doesn't work.</p>
<p>I get the correct return value in Firebug but lblSum remains blank in Firefox.</p>
<p>It has something to do with the <strong>return false</strong> at the end of the btnAdd click handler.</p>
<p>There is a server-side handler in case Javascript is disabled, so in the Javascript I add a return false.</p>
<pre><code><script type="text/javascript">
var pageWebForm1 = {
txt1: document.getElementById('TextBox1'),
txt2: document.getElementById('TextBox2'),
lblSum: document.getElementById('LblSum'),
btnAdd: document.getElementById('BtnAdd'),
init: function() {
this.btnAdd.onclick = function() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
xhrCallback(xhr.responseText);
}
}
xhr.open("POST", "Handler.ashx", true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.send("x=" + pageWebForm1.txt1.value + "&" + "y=" + pageWebForm1.txt2.value);
return false;
}
}
}
pageWebForm1.init();
function xhrCallback(retval) {
pageWebForm1.lblSum.innerText = retval;
}
</script>
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
4,190,891 | 4,190,892 | Is it possible to progressively enhance image quality while zooming in safari mobile | <p>Is there any JavaScript/jQuery plugin that can take large images and enhance the quality while zooming? something like google earth/maps?<br></p>
<p>I want to use it in mobile browser, but a desktop solution will do too</p>
| javascript jquery iphone | [3, 5, 8] |
2,182,845 | 2,182,846 | settimeout in IE | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5651668/set-time-out-in-javascript">set time out in JavaScript</a> </p>
</blockquote>
<pre><code>if (document.getElementById("safeForm4d").submitted.value == "false") {
document.getElementById("safeForm4d").submitted.value = "true";
setTimeout(function() {
'document.getElementById("safeForm4d").submit()'
}, 3000);
} else {
document.getElementById("toHide").style.display="none";
}
</code></pre>
<p>It is working fine in FF and other except IE. In IE it wait for 3 seconds then animation stops and goes for page processing ie trying to access next page after 3 seconds.</p>
<p>Suppose If i make timeout is 100000 seconds( ie 1 min), animation or dynamic page loading is happening for 1 min. After 1 min next page processing request and goes to new page.</p>
<p>My requirement is dynamic action or animation should happen till the next page displays and waiting period should be dynamic ie it should clear time if next page is already processed.</p>
| javascript jquery | [3, 5] |
1,605,220 | 1,605,221 | Please confirm what .class does in java | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3295163/in-java-what-does-a-reference-to-class-class-do">In Java, what does a reference to Class.class do?</a> </p>
</blockquote>
<p>Firstly apologies for asking this question here. I know it's a simple question and can probably be answered quite quickly and easily. However searching for Java .class is such a loaded search term it brings up nothing useful.</p>
<p>Having said that, I just started learning Java and I just came across something like this:</p>
<pre><code>Intent i = new Intent(this, ReminderManageActivity.class);
</code></pre>
<p>I am not sure, but I think ReminderManageActivity.class is an attribute that gives a string of the name of the class? Is that correct?</p>
| java android | [1, 4] |
4,188,471 | 4,188,472 | slideToggle() and Table tag with unknown height | <p>I am trying to <code>slideToggle()</code> a <code>table</code> with no set height. Is this possible?</p>
<pre><code><div class="container">
<h3>Title</h3>
<p class="expand-close"><a href="">Expand/Close</a></p>
<table>
<tbody>
<tr>
<td>Head 1</td>
<td>Stuff</td>
</tr>
<tr>
<td>Head 2</td>
<td>More stuff</td>
</tr>
</tbody>
</table>
</div>
</code></pre>
<p>And my jQuery:</p>
<pre><code>$("p.expand-close").parent().click(function (event) {
$(this).parent().find("table").slideToggle(400);
event.preventDefault();
});
</code></pre>
<p>And the CSS:</p>
<blockquote>
<p>table {display: none;}</p>
</blockquote>
<p>There's no slide animation which I am assuming is because no height is set on the <code>table</code>? If so, is there a way to do the slide animation?</p>
<p>Here's a fiddle:</p>
<p><a href="http://jsfiddle.net/BRuvf/" rel="nofollow">http://jsfiddle.net/BRuvf/</a></p>
| javascript jquery | [3, 5] |
4,569,556 | 4,569,557 | Create master checkbox outside {foreach} tag | <p>I have <strong>dynamic page</strong> under <code>{foreach}</code> tag something like this.</p>
<pre><code><div id="c1">
{foreach}
<input type="checkbox" name="checkbox" id="{$num}" checked/>
{/foreach}
</div>
</code></pre>
<p>which in return <strong>prints</strong> something like this.</p>
<pre><code><div id="c1">
<input type="checkbox" name="checkbox1" id="1" checked/>
<input type="checkbox" name="checkbox2" id="2" checked/>
<input type="checkbox" name="checkbox3" id="3" checked/>
</div>
</code></pre>
<p>What I want is to <strong>hide</strong> <code><div id="c1"></code> & <strong>show only one checkbox outside</strong>
<code><div id="c1"></code> </p>
<p><strong>controlling all checkboxes which are inside</strong> <code><div id="c1"></code></p>
<p>How can I achieve this ?</p>
<p><strong>Thanks.</strong></p>
<ul>
<li>Mandar</li>
</ul>
| php javascript jquery | [2, 3, 5] |
2,950,073 | 2,950,074 | .animate infinite loop | <p>I am interested in a solution for jQuery <code>.animate</code> infinite loop break method.</p>
<pre class="lang-js prettyprint-override"><code>$(element).mouseover(function() {
$(this).animate({ opacity: 1 }, duration, customFunc);
}).mouseout(function() {
});
</code></pre>
<p>And question now is how to break this loop? e.g within a <code>mouseout</code> event? </p>
<p>I can do it easily with <code>setInterval</code> and <code>clearInterval</code> but is there a way to it with <strong><code>.animate</code></strong> function?</p>
| javascript jquery | [3, 5] |
599,533 | 599,534 | Get Selected Value for drop down list | <p>I have filled my drop down list on client side using jQuery script.</p>
<p>However, on post back the selected values of drop down list does NOT get maintained.</p>
<p>How can i set the selected value to drop down list on server side Or is it possible on client side...</p>
<p>I am creating my drop down list dynamically and my drop down list is a server side control.</p>
| javascript asp.net | [3, 9] |
3,846,600 | 3,846,601 | Javascript: How to check boolean value from code-behind in ASP.NET | <p>I have a boolean property in code-behind ASP.NET, now I want to use it in Javascript of mark-up file, but Javascript do not understand True, or False. SO now, I'm using this:</p>
<pre><code>if ( '<%=IsTabVisible%>' == 'True'){
///
}
</code></pre>
<p>It works, but quite ugly. Is there a better way to do this?</p>
<p>Thank you</p>
| javascript asp.net | [3, 9] |
795,598 | 795,599 | Javascript: How to get the ClientID of the button that was clicked? | <p>Here's the button.</p>
<pre><code><asp:Button ID="_btnSearch" Text="Search" onclientclick="return CheckForEmptySearchBox(this.ClientID)" />
</code></pre>
<p>And here's the Javascript function</p>
<pre><code><script type = "text/javascript">
function CheckForEmptySearchBox(id) {
alert("The ID of the button is: " + id)
return false;
}
</script>
</code></pre>
<p>I'm getting a alert box, saying "The ID of the button is: <strong>undefined</strong>"</p>
<p>Thanks for helping</p>
| javascript asp.net | [3, 9] |
4,213,776 | 4,213,777 | Finding max/min date in multidimensional JavaScript object | <p>What's the easiest way to find the earliest start date and latest end date from the object below?</p>
<p>(Sorry - I realize there are a lot of similar questions already out there, but my JS skills are poor and I haven't been able to apply any of the solutions to my own data. So with that said, a code example would definitely help me out in any answers - thanks!!)</p>
<pre><code>var ganttData = [
{
"id": 123456,
"name": "Sample Project",
"start": new Date(2010,11,6),
"end": new Date(2011,0,6),
"status": "Not Started",
"phase": [
{
"id": 123457,
"name": "Sample Phase",
"start": new Date(2010,11,6),
"end": new Date(2010,11,13),
"status": "Not Started",
"task": [
{
"id": 123458,
"name": "Sample Task",
"start": new Date(2010,11,6),
"end": new Date(2010,11,8),
"status": "Not Started"
}
]
},
{
"id": 123459,
"name": "Another Phase",
"start": new Date(2010,11,13),
"end": new Date(2011,0,20),
"status": "Not Started"
}
]
}
]
</code></pre>
| javascript jquery | [3, 5] |
4,325,540 | 4,325,541 | Is it possible to do conditional statements in the CssClass property? | <p>I'm using a repeater control. One of my item attributes is a boolean. I know I can do a conditional statement in the Text property, such as:</p>
<pre><code>Text='<%# Item.Boolean ? "Text 1" : "Text 2" %>
</code></pre>
<p>However, what if I want the same text but a different CSS style depending on the boolean?</p>
<p>Is code like the following possible?</p>
<pre><code>CssClass=<%# Item.Boolean ? "CssClass1" : "CssClass2" %>
</code></pre>
| c# asp.net | [0, 9] |
5,247,018 | 5,247,019 | how to popup modal before window close? | <p>I am using a fancybox jquery plugin, what i need is to make sure before the website close a modal popup up and get us the details for submission to a form. </p>
<p>Please let us know how to make sure that before close a website a modal box fires up.</p>
<p>Have tried using unload method. It works when you use return but in return you can not use a form.</p>
<p>Please help!</p>
| javascript jquery | [3, 5] |
721,695 | 721,696 | Jquery post a Array | <p>I am having a Array which is generated by my Javascript in run time.
once that array is full with all the values I want to send it using POST to the server.
How can I do that ...</p>
<p>Pseudo code:</p>
<pre><code> for(i=0;i<result.data.length;i++)
{
result.data[i].id
}
$.post("receiver.php", { xxxxx }, function(data){ console.log(data);});
</code></pre>
<p>How can I get that xxxx updated in the post</p>
<p>I checked the documentation in jquery but they are expecting to give all the values in POST.I do not want to do that.
Also, I want to send post only once so that traffic will be less.</p>
| javascript jquery | [3, 5] |
1,531,967 | 1,531,968 | How can a new object of Activity for each notification? | <p>I have code for creating notification:</p>
<pre><code> NotificationManager notifyMngr=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification=new Notification(mId, "New alert!", System.currentTimeMillis());
Intent alert = new Intent(this, AlertInfoActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, alert, 0);
notification.setLatestEventInfo(this, data.get("name"), data.get("post_date"), contentIntent);
notifyMngr.notify((int) System.currentTimeMillis(), notification);
</code></pre>
<p>I need to create a few notifications, and each notification must execute a new object of AlertInfoActivity by click. But this code executes 1 object of Activity always. How can I do my task? </p>
| java android | [1, 4] |
5,425,769 | 5,425,770 | jquery detach(): [object Object] has no method 'replace' | <p><em>Uncaught TypeError: Object [object Object] has no method 'replace'</em> to be precise. The code:</p>
<pre><code>var controls = $('#head_hidden').children().eq(0);
var item_mouse_over = function() {
$(this).append(controls);
}
var item_mouse_leave = function() {
$(this).detach(controls); //this is the problematic strig
}
$('.item').mouseover(item_mouse_over);
$('.item').mouseleave(item_mouse_leave);
</code></pre>
<p>Here is <a href="http://jsfiddle.net/scythargon/nmWcj/" rel="nofollow">jsfiddle</a> explanation. With item_mouse_over() I add "controls" to element, but with item_mouse_leave() I could not remove them:(</p>
| javascript jquery | [3, 5] |
177,657 | 177,658 | null object reference in master pages | <p>I have some controls inside my master page, and i want to acces them from its related c# clas..</p>
<p>For instance i have:</p>
<pre><code><asp:DropDownList ID="ddlSearch" runat="server"
onselectedindexchanged="ddlSearch_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList>
</code></pre>
<p>and i can acces it when writing code, so "it sees its properties ok".</p>
<p>But at runtime i received </p>
<blockquote>
<p>Object reference not set to an instance of an object.</p>
</blockquote>
<p>Do u know why?</p>
<p>I also tried to find it like:</p>
<pre><code>ContentPlaceHolder mpContentPlaceHolder =
(ContentPlaceHolder)this.FindControl("ContentHead");
if (mpContentPlaceHolder != null)
{
DropDownList ddlSearch =
(DropDownList)mpContentPlaceHolder.FindControl("ddlSearch");
if (!Page.IsPostBack)
utils.fillDDLSearch(ddlSearch);
}
</code></pre>
<p>but it gives null too....which is really strange...</p>
<p>I tried with another object (an asp Image control, but exactly the same problem.
All it's ok at compiling time but gives null at runtime ALTHOUGH IT correctly finds out the content place holder.</p>
<p>Does anybody know the problem?</p>
<p><strong>The error:</strong></p>
<p><hr></p>
<p>Object reference not set to an instance of an object.
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.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</p>
<p><hr></p>
| c# asp.net | [0, 9] |
5,358,754 | 5,358,755 | Storing HTML 5 LocalStorage using PHP serverside | <p>I've created an account verification system where a user clicks a link in their emailbox which will trigger activate.php, a script which will do some stuff backend in a MySQL db and then present the user with their account. Currently, I'm doing this with a header change:</p>
<pre><code>header( www.mydomain.com/useraccount.html);
</code></pre>
<p><strong>The problem:</strong> I need certain local storage variable to be set, such as sessionStorage.email and sessionStorage.accountID. I can't be sure that these things are currently set because the user could have closed their browser, clicked activate.php after 20 min. and opened a new session. Therefore I'm wondering how to set HTML 5 local storage variables using PHP. Is this possible? Thanks in advance!</p>
| php javascript | [2, 3] |
1,782,095 | 1,782,096 | How to stretch the image in ImageView? | <p>I have an <code>ImageView</code> and I need to load <code>jpg</code> image from SD card into this view. I have following code:</p>
<pre><code>mImageView.setImageBitmap(SDCardUtilities.getBitmapFromSDCard(item));
</code></pre>
<p><code>getBitmapFromSDCard</code> is my function that only make <code>Bitmap</code> from file on sdcard. But often an image is small and doesn't fill the <code>ImageView</code> fully. How can I stretch the image that it will be fill whole <code>ImageView</code>? </p>
| java android | [1, 4] |
1,533,216 | 1,533,217 | ASP.NET Deleting files on the file system? | <p>As part of some code logic, the component downloads the user uploaded files to a specific directory.</p>
<p>I am using </p>
<pre><code>System.IO.File.Delete(file1);
System.IO.File.Delete(file2);
</code></pre>
<p>to delete the files. I don't think the local system account IUSR account has permissions to do that. </p>
<p>What are the best practices to handle deletion of files in ASP.NET?</p>
| c# asp.net | [0, 9] |
2,865,805 | 2,865,806 | How to access element id and other attributes using jQuery? | <p>I have JavaScript method which acts when a particular class (mcb) of forms are submitted:</p>
<pre><code>function BindCloseMessage() {
$(".mcb").submit(function(event) {
alert("closing..."); //Here I want to get the id of form
event.preventDefault();
});
}
</code></pre>
<p>In place of alert call, I need to access the id of form whose submit is called. How can I do it? Even better will be the tip for accessing any attribute...</p>
<p>Thanks</p>
| javascript jquery | [3, 5] |
5,981,090 | 5,981,091 | Javascript/jQuery height calculation | <p>Im looking for a way, in javascript, to calculate the size of the browser <code>(px)</code> then calculate the size of a <code><div></code> taking away <code>50px</code> from that full screen size:</p>
<p>E.g.</p>
<pre><code>Browser screen size: 800px (Height)
Existing <div> that is always 50px (Height)
Leaves 750px (Height) for the remaining <div> to fill the page.
</code></pre>
<p>Then take that <code>750px</code> and apply it as inline style:</p>
<pre><code><div style="height: 50px">
<img src="banner.png" />
</div>
<div style="height: x">
This fills the remainder of the page
</div>
</code></pre>
| javascript jquery | [3, 5] |
1,711,151 | 1,711,152 | How can I add a "selected" class to just one row of a table when a row is clicked? | <p>I am using the following code:</p>
<pre><code>$("#dataTable tbody").on("click", "tr", function (event) {
if (!$(this).hasClass('row_selected')) {
$(oTable.fnSettings().aoData).each(function () {
$(this.nTr).removeClass('row_selected');
});
$(this).addClass('row_selected');
gridClickHandler($(this));
}
});
</code></pre>
<p>When a row is clicked then if the row is already selected nothing happens. If not then all the rows have the class removed and the current row has the row_selected class added. </p>
<p>However this is slow as my tables have many rows. It does not look good with the current delay. What I thought of was moving the addClass to the start. But if I do that the the .each loop removes it. </p>
<p>Is there a way I could make this work more efficiently (faster response)? </p>
<pre><code><table id-"dataTable">
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>
</code></pre>
| javascript jquery | [3, 5] |
2,973,144 | 2,973,145 | Getting value of Radio buttons with Master Pages | <p>I have an aspx page that uses a master page. On this page I have a group of radio buttons. I need to get at the checked property for each of the elements in the radio button group in javascript. Before the page was converted to use a master page, the following javascript code worked just fine:</p>
<pre><code>if((!f.rblRegUseVehicles[0].checked) && (!f.rblRegUseVehicles[1].checked))
{
isValid = "false";
}
</code></pre>
<p>f is the reference to the form. This worked just fine.</p>
<p>When the page was chanded to use a Master Page, I changed the javascript to the following:</p>
<pre><code>if((!f.<%=rblRegUseVehicles.ClientID%>[0].checked) && (!f.<%=rblRegUseVehicles.ClientID%>[1].checked))
{
isValid = "false";
}
</code></pre>
<p>Now, the javascript is failing because it can't find the element. In the "View Source" I have elements with the name:</p>
<pre><code><input id="ctl00_cphContent_rblRegUseVehicles_0" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="Yes" />
<input id="ctl00_cphContent_rblRegUseVehicles_1" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="No" />
</code></pre>
<p>The only code that works is</p>
<pre><code>document.<%=Form.ClientID%>.<%=rblRegUseVehicles.ClientID%>_0.checked
</code></pre>
<p>I want the javascript to reference the array like before the page was converted to use a Master Page. How can I do that?</p>
| asp.net javascript | [9, 3] |
4,250,894 | 4,250,895 | How to test android method with J2SE | <p>I have some dynamically generated Android classes. I need to test some of the methods of those classes (these methods have nothing to do with UI). I hope to integrate this feature into an existing J2SE project. Is this possible to run it on standard VM? If I have to use Dalvik VM, is there any command line interface so that I don't need to start the Android emulator?</p>
| java android | [1, 4] |
1,366,153 | 1,366,154 | Resetting a form with JavaScript | <p>i am resetting my form with the following:</p>
<pre><code><script type="text/javascript">
window.onload = function () {
document.getElementsByName("email_address")[0].value = "";
document.getElementsByName("remove")[0].value = "off";
}
</script>
</code></pre>
<p>the problem is that the checkbox "remove" seems to get reset before the server side script can run. So in effect what ever the user selected on the checkbox is overridden and set to off before the php script can be run. Yet, the input box "email_address" is fine...</p>
<p>the test...</p>
<pre><code>//this is already set to OFF by the time we get here....even if the user may have ticked the checkbox to ON
echo $HTTP_GET_VARS['remove'];
//this is fine, the email_address input is read and not reset...
echo $HTTP_GET_VARS['email_address'];
</code></pre>
<p>can any one explain this?
I obviously want the form to be reset AFTER my server side script is done processing , yet for some reason it resets the checkbox early, yet the input box is ok...</p>
<p>thank you!</p>
| php javascript | [2, 3] |
539,553 | 539,554 | Global variable not recognized after remove and append of an element | <p>I have a global variable <code>var $test = $('#test');</code> where <code>#test</code> id of div that initially exist in DOM. If i remove the div with <code>remove()</code> and append it again then the global variable $test no longer recognizes the the newly appended div with id <code>#test</code>. What am i doing wrong. Why does this happen?</p>
<p><strong>Check <a href="http://jsfiddle.net/mr3C4/" rel="nofollow">http://jsfiddle.net/mr3C4/</a></strong></p>
| javascript jquery | [3, 5] |
2,672,413 | 2,672,414 | upload and send a file | <p>Hey guys,
I created this system of instant messaging now i want to upload and send a file to another user.
I am using php and javascript.
How to do so?
Ok imagine that i am a user chatting for instance with you, now i want to send you a file how can i do it using php.
I understand that it is two steps upload the file and then send? Is that right?</p>
| php javascript | [2, 3] |
4,611,374 | 4,611,375 | Scoop.it API access in C# | <p>I'm trying to access the Scoop.it API via C# to retrieve posts in topics. It's pretty much straight forward, in PHP, how are objects managed in C# and how to you access the properties?</p>
<p>Here's the php code which i'd like to get a C# equivalent of:</p>
<pre><code>$topic = $scoop->topic(24001);
foreach($topic->curatedPosts as $post)
{
echo $post->title;
}
</code></pre>
| c# php | [0, 2] |
3,626,649 | 3,626,650 | Select an element if ID partially matches | <p>I have the following HTML:</p>
<pre><code><header>
<nav>
<ul>
<li id="menu-item-1"><a href="javascript:void(0)">Lien 1</a></li>
<li id="menu-item-2"><a href="javascript:void(0)">Lien 2</a></li>
<li id="menu-item-3"><a href="javascript:void(0)">Lien 3</a></li>
</ul>
</nav>
</header>
<article id="content">
<div id="post-1" class="page">
<p>content post 1</p>
</div>
<div id="post-2" class="page">
<p>content post 2</p>
</div>
<div id="post-3" class="page">
<p>content post 3</p>
</div>
</article>
</code></pre>
<p>The idea is the following: if the number after <strong>menu-item-</strong> matches the number after <strong>post-</strong> then do something.</p>
<p>How do I do that?</p>
<p>The final goal is to display each div when i click on the corresponding menu link</p>
<pre><code>menu-item-1 -> display post-1
menu-item-2 -> display post-2
menu-item-3 -> display post-3
</code></pre>
<p>Thanks !</p>
| javascript jquery | [3, 5] |
1,803,883 | 1,803,884 | How do I use scrollTop when trying to figure out sidebar position? | <p>I posted this <a href="http://stackoverflow.com/questions/6539926/how-do-i-get-the-sidebar-to-move-up">question</a> yesterday and the answer I go mentioned that I should check if scrollTop is higher than your header height. My question is how do I do this with query. How do I do this when different people have different screen sizes</p>
| javascript jquery | [3, 5] |
5,046,644 | 5,046,645 | Pressed event for children within a tablerow | <p>I've got an imageview and textview within a tablerow. Whenever I press down on the tablerow I want the imageview src to swap to the same image of a different color. I also want the textview to change textcolor. I've been able to accomplish this within a listview using selectors. No luck with tables though. I can make the tablerow clickable and change the backgroundcolor of it through a selector when the <code>android:state_pressed</code> event fires...but the children within that tablerow don't receive it. I've got the src of the image and the textcolor of the textview both pointing towards @drawable selectors. None of the following return true when I'm pressing on the table row: <code>android:state_focused</code>, <code>android:state_pressed</code>, and <code>android_selected</code>. I did a test where I made the textview clickable. When I did that if I clicked on the textview itself it changed colors. So my selector seems to be coded correctly. I don't want the textview to be clickable though. I just want the events of the row to be inherited by the children.</p>
<p>I appreciate any help I can get...or working examples.</p>
<p>Thanks.</p>
| java android | [1, 4] |
483,464 | 483,465 | Is there any example for jquery slideshow with zoom in, zoom out effect | <p>I have an image slideshow and I want to make a Zoom in, Zoom out effect in that. Now I am using jQuery Cycle plugin. Does anybody have any suggestions on how to do this? Your help would be really appreciated.</p>
| javascript jquery | [3, 5] |
906,020 | 906,021 | Blocking javascript events on h:outputText where escape=true | <p>I work for a website which is sort of a social network, and people can send messages to anyone. There was a guy who sent a </p>
<blockquote>
<p><code><script>alert('bah');</script></code></p>
</blockquote>
<p>And it created a javascript:alert..</p>
<p>How can I prevent this to happen? </p>
<blockquote>
<p>I've made a method that gets the text typed and if it's typed < it
transforms into <code>"&#60;"</code> and > to <code>"&#62;"</code></p>
</blockquote>
<p>But even doing this, the code above still worked. Is there anything else that I could do to prevent it to happen again?</p>
| javascript jquery | [3, 5] |
5,599,091 | 5,599,092 | Detecting NON mobile browsers | <p>So I'd like to redirect mobile users to a different page. But instead of trying to detect any number of mobile browsers, I'd just like to see if the user is using IE, Firefox, Safari, Chrome, or Opera; all other users go to the mobile site.</p>
<p>My biggest problem is detecting regular Safari from mobile Safari.</p>
<p>Any good way to do this?</p>
| c# asp.net | [0, 9] |
4,499,912 | 4,499,913 | How To: Stackoverflow / Twitter JS dialogue box | <p>I am trying to build a text-bar above the website like <a href="http://techdows.com/wp-content/uploads/2010/12/older-verison-of-twitter.png" rel="nofollow">Twitter or SO does.</a> Any advice on how to build this would be great. I do not know what you call this feature, but maybe there is a jQuery plugin to do it?</p>
<p>The functionality I'm thinking of is "message" [x] to close the alert.</p>
<p>Thanks for your help!</p>
| javascript jquery | [3, 5] |
2,118,021 | 2,118,022 | include button into .cs file | <p>I'm trying to read a text file containing the name of the image, and display it opon pageload.</p>
<p>Let's say that the content in the text file is </p>
<pre><code>Australia Picture101
Singapore Picture201
</code></pre>
<p>Following is the code i tried and it does not display the image.</p>
<pre><code>tableString += "<table class='content_background' cellpadding='0' cellspacing='0'>";
foreach (string line in lines)
{
string[] country = line.Split(token2);
string[] image = country[1].Split(token);
string row = "<tr><td class='left_content'>" + country[0] + "</td>" +"<td><table><tr>";
tableString += row;
for (int i = 0; i < image.Length; i++)
{
---> string row2 = "<td class='right_content'> <asp:ImageButton ImageUrl='~/img/missing children pictures/" + "image[i]" + ".jpg'/>" + "</td>";
tableString += row2;
}
tableString += "</tr></table></td>";
}
tableString += "</tr></table>";
container.InnerHtml = tableString;
</code></pre>
<p>Is there any other way to do this ? Thanks in advance. </p>
<p>the screen shot is as follow
<img src="http://i.stack.imgur.com/L0Y4V.png" alt="screen shot"></p>
| c# asp.net | [0, 9] |
5,688,787 | 5,688,788 | a relationship between C++ / C# and PHP | <p>I couldn't find any document about a relationship between C++ / C# and PHP.
Can someone share example page or codes ( like echo, functions etc ) ?
thank you</p>
<p>--- edit --
I want to use C++ or C# in PHP</p>
| c# php c++ | [0, 2, 6] |
2,030,139 | 2,030,140 | How to insert additional text using jquery or javascript | <p>I want to know is it possible to insert additional text in HTML elements using jquery or javascript?</p>
<p>If there is already a text "Down" in paragraph elements, then I just want to append text "full", so that it would be "Down full". Is this possible? Which method should I use? </p>
| javascript jquery | [3, 5] |
826,767 | 826,768 | How do I request a resource (relative path) from the current server? | <p>If I have a relative path that I need to get from the current server. The following does not work because it is not a valid URI.</p>
<pre><code>var request = WebRequest.Create("\path_to_resource")
</code></pre>
<p>I believe that the easiest way would be to put the path in the web.config, however this is easily broken by forgetting to update the config when the application is moved to another server. Is there a better way than?</p>
<pre><code>var request = WebRequest.Create(ConfigurationManager.AppSettings["root"] + "\path_to_resource");
</code></pre>
| c# asp.net | [0, 9] |
5,209,036 | 5,209,037 | Why is typeof my variable an object, and not a number | <p>I have a table which has a couple cells that contain simple numbers (IE: 1.00, 1000.00, 10000.00). I'm trying to format the cell contents using the 'format' function below. I have had success with this function in a different area of my code, but for whatever reason (the reason why I'm here) when I try to feed the contents of the table cells in, it doesn't work as I expected. </p>
<p>The problem is that the typeof my cell contents is 'object' and not 'number', so it skates right by the if statement and just returns my original value back to me. Is there a way I can coerce the data to be typeof number? I thought <code>var n = new Number(cellText);</code> would do the trick, however, the typeof comes back as object. Confused. </p>
<p>In globalize.js: </p>
<pre><code>Globalize.format = function( value, format, cultureSelector ) {
culture = this.findClosestCulture( cultureSelector );
if ( value instanceof Date ) {
value = formatDate( value, format, culture );
}
else if ( typeof value === "number" ) {
value = formatNumber( value, format, culture );
}
return value;
};
</code></pre>
<p>In my page: </p>
<pre><code>$(document).ready(function () {
$('td[globalize="true"]').each(function () {
var $this = $(this);
var cellText = $this.text();
if (cellText != null) {
var n = new Number(cellText);
var v = Globalize.formatNumber(n, _gloNum[0]);
$this.text(v);
}
})
});
</code></pre>
| javascript jquery | [3, 5] |
4,679,965 | 4,679,966 | Javascript error in IE | <pre><code>function OnSuccessPM(results) {
$("#ChatBox").html("");
for (var i = 0; i < results.length; i++) {
$("#ChatBox").append(results[i].username + " : " + results[i].message + ". <br />");
}
var objDiv = document.getElementById("ChatBox");
objDiv.scrollTop = objDiv.scrollHeight;
return false;
}
MetamorphismApp.ChatService.GetPublicMessages(OnSuccessPM, OnFailurePM);
[WebMethod(EnableSession = true)]
public List<Message> GetPublicMessages()
{
List<Message> getMsgsList = (List<Message>)HttpContext.Current.Application["Messages"];
return getMsgsList;
}
</code></pre>
<p>I get the following error in IE:</p>
<blockquote>
<p>length is null or not an object.</p>
</blockquote>
<p>What is the solution?</p>
| javascript jquery | [3, 5] |
5,724,086 | 5,724,087 | it is not displaying the messages correctly | <p>I have a javscript function below which displays a message depending on on the result:</p>
<pre><code> function stopImageUpload(success){
var result = '';
if (success == 1){
result = '<span class="msg">The file was uploaded successfully!<\/span><br/><br/>';
}
else {
result = '<span class="emsg">There was an error during file upload!<\/span><br/><br/>';
}
return true;
}
</code></pre>
<p>The code below always displays the message "The file was uploaded successfully!"</p>
<pre><code> <?php
$destination_path = str_replace("//", "/", $_SERVER['DOCUMENT_ROOT']."/")."ImageFiles";
$result = 0;
$target_path = $destination_path . basename( $_FILES['fileImage']['name']);
if(move_uploaded_file($_FILES['fileImage']['tmp_name'], $target_path)) {
$result = 1;
}
sleep(1);
?>
<script type='text/javascript' language='javascript'>
window.top.window.stopImageUpload(1);
</script>
</code></pre>
<p>But if I change the last line to this below then it always displays the message "There was an error during file upload!". Why is this and how can it be fixed so it displays the right message depending on the result?</p>
<pre><code><script language="javascript" type="text/javascript">
window.top.window.stopImageUpload(<?php echo $result; ?>);
</script>
</code></pre>
| php javascript jquery | [2, 3, 5] |
3,399,197 | 3,399,198 | Bind('pageinit') fails to call method | <p>I'm trying to bind a page initialize event from, afaik, jquerymobile, to a method so I can set my header, this is done, because later I wish to set it dynamically.
But my event doesn't even trigger :'-(
Any help would be appreciated.</p>
<pre><code>$('#mapmode').bind('pageinit', function(event) {
initPageHeader();
});
function initPageHeader(){
alert('oldhtml');
var oldhtml=document.getElementById('header').innerHTML;
document.getElementById('header').innerHTML="";
var html = oldthml + '<a href="#" data-rel="back" data-role="button" ><img'+
' align="middle"src="../images/back.png" alt="back" vspace="2"/></a><h1>'+
'<img align="middle"src="../images/main_header.png" alt="logo" vspace="2"/>'+
'</h1><a href="#first" data-role="button" data-inline="true">'+
'<img align="middle"src="../images/home.png" '+
'alt="picture to take you to the first page"/></a>'
document.getElementById('header').innerHTML=html;
}
</code></pre>
| javascript jquery | [3, 5] |
3,962,800 | 3,962,801 | Dynamically adding js to asp.net file | <p>In my Page_Load I identify the page header block from my master page and add javascript from an XML file to that part of the page.</p>
<p>It doesn't seem to be loading in time. If I explicitly put the script reference on the page, it works. But not when I load through the page_load event.</p>
<p>Should it be loaded sooner?</p>
| c# javascript asp.net | [0, 3, 9] |
765,268 | 765,269 | Move li elements with certain class into and div | <p>I am trying to use the .append function in jquery.
I have a div with li elements in it. They have different classes, lets say odds and evens.
I would like the li's with the class "odd" moved into another div with li's in it.
How can I do this?
Here is my setup:
<strong>Edit</strong>. This was in valid markup, I just didn't put all in. Fixed now for others. </p>
<pre><code><div id="col1">
<ul>
<li class="odd"></li>
<li class="even"></li>
<li class="odd"></li>
<li class="even"></li></ul>
</div>
<div id="col2">
<ul>
<li></li>
</ul>
</div>
</code></pre>
<p><strong>So then the output is:</strong> </p>
<pre><code><div id="col1">
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
<li class="even"></li>
</div>
<div id="col2">
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
<li class="odd"></li>
</div>
</code></pre>
| javascript jquery | [3, 5] |
867,791 | 867,792 | How can I access ListViewDataItem from an ItemTemplate without using code behind? | <p>I'm trying to access <code>ListViewDataItem</code> from inside an <code>ItemTemplate</code> in an ASP.NET C# page that does not have code behind.</p>
<p>the page is very simple and does not have any code on it. it is dynamicaly binds to a datasource on page and shows a list of data. </p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
3,877,409 | 3,877,410 | jquery keep live filter in line with fast keystrokes | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4220126/run-javascript-function-when-user-finishes-typing-instead-of-on-key-up">Run javascript function when user finishes typing instead of on key up?</a> </p>
</blockquote>
<p>I wrote a quick live filter that will filter a long list of about ten thousand items. The children of each item have a host of meta data related to them. Descriptions, related documents, usefors, etc. I bring in a letter at a time and filter the page from there. If someone types too quickly the page may not keep up. I might receive then multiple IDS of tag-C if I were to type 'Cam' to quickly. </p>
<p><strong>My question</strong> asks is there a way to limit the function call until keystrokes have stopped. Almost a hoverIntent of keystrokes. </p>
<p>Here is a quick fiddle I whipped up showing about what I am after, <a href="http://jsfiddle.net/kb8Hw/" rel="nofollow">http://jsfiddle.net/kb8Hw/</a>
But my code is a bit more complex. I have a longer list, limit it to a single letter at a time, and normalize the search string a bit more. Essentially each time <code>this.value[0]</code> changes it returns to the server and grabs a new set of tags. From there I filter whats on the page using jquery. </p>
| javascript jquery | [3, 5] |
4,199,694 | 4,199,695 | Android get Facebook friends with app downloaded FQL Query | <p>I am trying to get the user's friends who have the app downloaded, I am using the following code</p>
<pre><code> String query = "SELECT uid FROM user WHERE is_app_user=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 =" + fbId + ")";
Bundle params = new Bundle();
params.putString("method", "fql.query");
params.putString("query", query);
mAsyncFacebookRunner.request(null, params, new FQLListener());
</code></pre>
<p>The code above makes a successful call.
I am having trouble with getting what the call returns, which looks like this (A JSONArray)</p>
<pre><code> [{"uid":555555555},{"uid":000000000},{"uid":111111111},{"uid":222222222},{"uid":333333333}]
</code></pre>
<p>How do I put this information into something like an ArrayList?</p>
<p>Here is the RequestListener I am using.</p>
<pre><code> private class FQLListener implements RequestListener
{
@Override
public void onComplete(String response, Object state)
{
//get info here
}
}
</code></pre>
| java android | [1, 4] |
2,369,191 | 2,369,192 | Plupload - how to open more than one time and refresh the list? | <p><strong>js:</strong></p>
<pre><code>$(".butAnexarDoc").live("click", function(){
$("#anexarArquivos").plupload({
// General settings
runtimes : 'html5,html4',
url : 'js/plupload/examples/upload.php',
max_file_size : '1000mb',
max_file_count : 20, // user can add no more then 20 files at a time
chunk_size : '1mb',
unique_names : false,
multiple_queues : true
});
});
</code></pre>
<p>ok, first time work perfect, but if i click in a diferent place to open again, the list its not been reloaded.</p>
<p>its always the same, to reload the list i need to refresh the page.</p>
<p>how can i fix this ?</p>
| javascript jquery | [3, 5] |
4,834,645 | 4,834,646 | Can I simplify multiple if - else statements? | <p>I have the following code in javascript?</p>
<pre><code>if ($(form).data('action') == "Edit") {
xx
} else if ($(form).data('action') == "Create"){
xy
} else if ($(form).data('action') == "Delete"){
xz
}
</code></pre>
<p>Is it possible for me to simplify this and also have some default path?</p>
| javascript jquery | [3, 5] |
1,758,092 | 1,758,093 | 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] |
5,737,494 | 5,737,495 | Problem in updating database table in asp.net using c# | <p>I want to update Basic table in my database but it doesn't generate any effect in table.<br>
I am using following statement</p>
<pre><code>sql ="UPDATE Basic SET Current_city='"+ TextBox1.Text +"',Home_Town='"+ TextBox2.Text +"';
SqlCommand cmd = new SqlCommand(sql, con);
cmd.ExecuteNonQuery();
</code></pre>
| c# asp.net | [0, 9] |
5,759,511 | 5,759,512 | Incrementing to next id in javascript | <p>I have an image I click which brings me to a page with some info and two buttons which are previous and next. </p>
<p>My code keeps going back to the same slide. How would I increment my "id" attribute to add +1 on my id attribute every time I click the next button or -1 for previous?</p>
<p>Here is my code</p>
<pre><code> $(".portfolioLink").click(function(){
// Hide slide and portfolio piece info
$(".inner-content.portfolio").show();
// Reset slides timer and pagination
clearInterval($('#slides').data('interval'));
$("ul.pagination li").removeClass("current");
var slideID = $(this).parent().next().attr("id");
$("#next").click(function() {
slideswitch(slideID);
});
}
</code></pre>
| javascript jquery | [3, 5] |
4,245,419 | 4,245,420 | How to add a text area | <p>I am trying to add an additional text area so I need to duplicate part of this code but I am not sure which part.
Can anyone please help?</p>
<pre><code>function mode_add_message()
{
jQuery("#editor").hide();
jQuery("#cropper").hide();
jQuery("#crop_preview_container").hide();
jQuery("#pxn8_canvas").show();
jQuery("#messages").empty();
jQuery("#edit_and_crop").show();
jQuery("#add_text").show("slow");
gAddTextOpNumber = PXN8.opNumber;
if (gCardDB[gActiveCard].text_placeholders){
var placeholders = gCardDB[gActiveCard].text_placeholders;
for (var i = 0;i < placeholders.length; i++){
var text = placeholders[i];
var html = "";
if (text.multiline){
html = "<li><textarea name=\"text_" + i + "\" id=\"text_" + i + "\">Message # " + (i+1) + " Here</textarea></li>";
}else{
html = "<li><input class=\"text\" type=\"text\" name=\"text_" + i + "\" id=\"text_" + i + "\" value=\"Message # " + (i+1) + " here\"></li>";
}
jQuery(html).appendTo("#messages");
}
}else{
end_cardmaker();
}
}
//
// There can be multiple text inputs/textareas so each must be added.
</code></pre>
<p>This is the URL: <a href="http://pixenate.com/pixenate/themes/cardmaker/index.php" rel="nofollow">http://pixenate.com/pixenate/themes/cardmaker/index.php</a></p>
| javascript jquery | [3, 5] |
634,071 | 634,072 | How to get position of button in GridView where to place it using tag? | <p>I want to know position, where the button located in GridView using tag, and after getting the position, get letter from that button using position.
Here is the code</p>
<pre><code>public View getView(final int position, View convertView, ViewGroup arg2) {
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.buttonlist, null);
}
final Button btn= (Button)v.findViewById(R.id.letterbtn);
btn.setText(word[position]+"");
btn.setOnClickListener(new OnClickListener(){
public void onClick(View v)
{
btn.setTag(btn);
String tag=btn.getTag().toString();
btn.setVisibility(View.GONE);
}
});
return v;
}
</code></pre>
| java android | [1, 4] |
4,300,968 | 4,300,969 | Testing Graphical Users Interfaces | <p>So I have a fancy GUI in jQuery, which has gotten relatively complex. I would like to write tests for it, e.g. using <code>assert()</code>. However, it seems that writing such tests is difficult because GUIs don't manipulate data or make computations: they are just superficial interfaces to please the user.</p>
<p>So how does one generally write tests for GUIs?</p>
| javascript jquery | [3, 5] |
3,956,432 | 3,956,433 | looking for a cross browser solution to highlight tabs | <p>I'm looking for a cross browser compatible solution to highlight tabs. On page load the first tab should highlight and on click of the other tabs, the first tab would unhighlight and the selected tab would highlight. Can't get this functionality working in same fashion in IE and Firefox at the same time. Any inputs on that?</p>
<p>Note: The below code works but when I click on any other link on the page, the focus on the tabs is lost and hence the currently selected tab is not highlighted.</p>
<p>JS</p>
<pre><code>$(document).ready(function () {
activate('focusmeplease');
$('#tabs ul li:first').addClass('active');
$('#tabs ul li a').click(function () {
$('#tabs ul li').removeClass('active');
$(this).parent().addClass('active');
});
});
function activate(link) {
if (document.getElementById) document.getElementById(link).focus();
else if (document.all) document.all(link).focus();
}
</code></pre>
<p>HTML</p>
<pre><code><div id="tabs">
<ul>
<li class="clas" onclick="javascript: addPlayer('tab-1','1649028604001');">
<a href="javascript:void(0);" id="focusmeplease">First tab</a>
</li>
<li class="clas" onclick="javascript: addPlayer('tab-1','1651558610001');">
<a href="javascript:void(0);">Second tab</a>
</li>
</ul>
<div id="tab-1"></div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
5,905,364 | 5,905,365 | wait until certain code is run | <p>This is a continuation from this post - <a href="http://stackoverflow.com/questions/13946058/visible-selector-issue">:visible selector issue</a></p>
<p>Anyway, I was wondering if there is a way to detect if a particular code segment is run until it is completed before running a new line of code.</p>
<p>For example,</p>
<pre><code>if(filterVal == 'all') {
jQuery('ul#portfolio li.hidden').fadeIn('slow').removeClass('hidden');
} else {
jQuery('ul#portfolio li').each(function() {
if(!jQuery(this).hasClass(filterVal)) {
jQuery(this).fadeOut('normal').addClass('hidden');
} else {
jQuery(this).fadeIn('slow').removeClass('hidden');
}
});
}
</code></pre>
<p>What I want to do is make sure that all the list-item elements are successfully fadeIn(display:block) and fadeOut(display:none) successfully before triggering the jPages function to create pagination.</p>
| javascript jquery | [3, 5] |
618,482 | 618,483 | EditText cropping characters while editing | <p>I'm working on an application for Samsung Galaxy 5 with Android 2.2-update1 that has various EditText fields and I noticed that all EditText fields below the middle of the screen is not repainted correctly when the user is typing: all the characters appear chopped, leaving their half top plain white. I've tested this on other devices and this problem does not happen on them.
Any clues on why this happen and/or any workaround for this for the Galaxy 5?</p>
<p>EDIT: This issue happens with the API Demos that comes with the Android SDK. To reproduce this error execute the demo and then follow: App-> Search-> Invoke Search -> click on App Data and start writing, only the lower half of each character will be rendered on screen.</p>
<p>Thanks!</p>
| java android | [1, 4] |
1,486,727 | 1,486,728 | Display PHP data in Jquery AJAX | <p>I have a php page where I display few images with radio buttons. On start two images are pre selected and I merge those and show the combinations. But user can choose a different image and click on MergeImages button, which should display the combination of two images selected.</p>
<p>I am doing this in one php file, where I pass the selected contents via POST to the same file through AJAX.</p>
<pre><code>$.ajax({
url: 'CreateImage.php',
type: 'POST',
data: {imagename : newImageName},
success: function(data) {
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}
});
</code></pre>
<p>I am getting a success and now I would like to display the data so that I can see the newly created images. How do I do this?</p>
| php jquery | [2, 5] |
3,623,998 | 3,623,999 | find missing range from array of ranges | <p>I am having array of my class that having Minvalue and Maxvalue property.</p>
<p>Suppose in my array i am having three elements</p>
<pre><code>First MinValue=0 and MaxValue=25
Second MinValue=26 and MaxValue=50
Third MinValue=75 and MaxValue=100
</code></pre>
<p>Minvalue and Maxvalue can be between 0 to 100.</p>
<p>Now I want to find the missing range from above array having three objects.</p>
<p>The missing range in above array is 51 to 75</p>
<p>There can be more than one missing value at that time i want to find the range having min MinValue.</p>
<p>I want to write code in javascript.</p>
<p>Please help me to solve this.</p>
| javascript jquery | [3, 5] |
964,129 | 964,130 | "Replace YouTube Link with iframe Youtube video Player" Using ASP.NET+C# | <p>I run a forum and I want to automatically replace any link to a YouTube video with a iframe youtube video player using ASP.NET+C#.</p>
<p>How to replace this Link</p>
<p><a href="http://youtu.be/uN-A8eHte1g" rel="nofollow">http://youtu.be/uN-A8eHte1g</a></p>
<p>with</p>
<pre><code><iframe class="youtube-player" frameborder="0" height="250" src="http://www.youtube.com/embed/uN-A8eHte1g?rel=0&amp;wmode=Opaque" title="YouTube video player" type="text/html" width="100%"></iframe>
</code></pre>
<p>I can't really find anything like this on the ineternet.</p>
<p>Hope someone could help me this. Thanks in advance!</p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,520,312 | 5,520,313 | Best way to forward user to another page? | <p>I have items displayed that has a countdown timer, and there are "coming soon" items which are to be displayed as well once the previous items' time has ended. My problem now is, I need to redirect the coming soon items' page to the order form page once they are available for buying.</p>
<p>What I am thinking is, redirect the user to the order page if they refresh the item's page? How to do that? I think it's not advisable to use </p>
<pre><code>meta refresh
</code></pre>
<p>right?</p>
| php javascript | [2, 3] |
2,159,335 | 2,159,336 | Vertical display of Header Text in Grid View ASP .NET | <p>Is there a way to display the headerText of the Grid View vertically?</p>
<p><a href="http://img371.imageshack.us/img371/4813/testyk6.jpg" rel="nofollow">http://img371.imageshack.us/img371/4813/testyk6.jpg</a></p>
<p>I hope the above link works</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
2,197,353 | 2,197,354 | Custom control that detects first child which will be rendered as a html input field | <p>Im trying to develop a custom control that automatically detects the first child control which will be rendered as an input-tag. I'm doing this because I want to know if I should render my associated title as a label or a span element in the HTML (a bit like the <code>asp:Label</code> works when an <code>AssociatedControlID</code> is given).</p>
<p>I found that most of the <code>HtmlControls</code> that will be rendered as an input field derives from the base class <code>HtmlInputControl</code>. But I didn't find any class alike for the controls in the <code>System.Web.UI.WebControls</code> namespace.</p>
<p>So my question is, am I stuck with digging up the protected property "TagKey" with reflection like this:</p>
<pre><code>var property = control.GetType()
.GetProperty("TagKey", BindingFlags.NonPublic | BindingFlags.Instance);
var tag = (HtmlTextWriterTag)property.GetValue(control, null);
</code></pre>
<p>or have I missed something?</p>
| c# asp.net | [0, 9] |
5,935,615 | 5,935,616 | PHP & JQuery Question | <p>I was wondering lets say I have a form that you can save and preview changes before you save the changes, what will be the best way to preview the changes in a different page, the same page or a lightbox? Can you give me some live examples if possible?</p>
| php jquery | [2, 5] |
5,728,098 | 5,728,099 | Resources for C++ programmer to learn JS | <p>I am proficient in C++, I dont know Java Script and want to learn JS, What should be the way/process for me? I know basic html, CSS.</p>
| javascript c++ | [3, 6] |
5,013,017 | 5,013,018 | How to dynamically create label on run time in asp.net c# to a particular place on web page | <p>I am creating a web page and in that I want to show data on label. The data will be shown through a SQL connection. I know how to create labels but I don't know how to create them to a particular place of web page. </p>
<p>Thanks,</p>
<p>Jay</p>
| c# asp.net | [0, 9] |
4,089,093 | 4,089,094 | How I can add and remove the attribute "readonly"? | <pre><code>$(document).ready(function() {
//Check City Value
var city_value = parseInt($("#city").val());
if( city_value == 0) {
$("#state").attr("readonly", true);
//$("#rate").attr("readonly", "readonly");
} else {
$("#state").removeAttr("readonly");
//document.getElementById("state").removeAttribute("readonly",0);
//get_states(city_value);
}
/***
//Check State Value
var state_value = parseInt($('#state').val());
if( state_value == 0) {
$('#rate').attr('readonly', true);
} else {
$('#rate').attr('readonly', false);
}
***/
});
</code></pre>
<p>Here is my sample codes.</p>
<pre><code><td><select name="city" id="city">
<option value="0">PLEASE_SELECT_TEXT</option>
<option value="Antalya">Antalya</option>
<option value="Bodrum">Bodrum</option>
<option value="Istanbul">Istanbul</option>
</select>&nbsp;</td>
<td><div id="states"><input type="text" name="state" value="FORCE_FOR_SELECT" readOnly id="state"></div></td>
</code></pre>
<p>I've also added doctype:</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</code></pre>
| javascript jquery | [3, 5] |
223,127 | 223,128 | Disabled link button still submitting in asp.net webform | <p>I'm trying to disable a link button to prevent the user from submitting several times.</p>
<p>I've seen many questions like this here on SO, most people suggest the following javascript:</p>
<p><code>button.disabled = true</code> or <code>button.disabled = 'disabled'</code></p>
<p>Which indeed disables the button (the button is greyed out), but the problem is that it's still clickable, and still submits!!</p>
<p>Here is my stripped down code:</p>
<p><code>function ValidateButton(button){<br>
// some other code<br>
button.disabled = true;<br>
button.value = 'Processing...';<br>
}</code></p>
<p><code><asp:LinkButton Text="Submit" ID="btnSubmit" runat="server" onclick="btnSubmitRow_Click" OnClientClick="return ValidateButton(this);"/></code></p>
<ol>
<li>Why is the button still clickable, and submits after being disabled ?</li>
<li>The button text is still "Submit" not "Processing...', why?</li>
</ol>
| javascript asp.net | [3, 9] |
1,107,654 | 1,107,655 | PHP value inside JavaScript | <p>The following code works fine, the function <code>load()</code> sends the selected radio button info to the PHP page and display the returned:</p>
<pre><code><head>
<script>
$(document).ready(function(){
$('#myButtons input:radio').change(function() {
var buttonValue = $("#myButtons input:radio:checked").val();
$("#myDiv").load('myPHPfile.php', {selectedButtonValue : buttonValue});
});
});
</script>
</head>
<body>
<div id="myButtons">
<input type="radio" name="category" value="10" />ButtonA
<input type="radio" name="category" value="20" />ButtonB
<input type="radio" name="category" value="30" />ButtonC
</div>
<div id="myDiv">Click the button to load results</div>
</body>
</code></pre>
<p>myPHPfile.php</p>
<pre><code><?php
if( $_REQUEST["selectedButtonValue"] )
{
$buttonPHP = $_REQUEST['selectedButtonValue'];
echo "Value button is ". $buttonPHP;
}
?>
</code></pre>
<p>I need an alert box message of the returned PHP value, inside the script, as follows:</p>
<pre><code>;
$("#myDiv").load('myPHPfile.php', {selectedButtonValue : buttonValue});
alert(<?php $buttonPHP ?>);
;
</code></pre>
<p>Would it be possible to write the PHP value inside JavaScript?</p>
| php javascript jquery | [2, 3, 5] |
5,700,732 | 5,700,733 | Can I restrict a ViewFlipper from flipping until an AsyncTask has been performed? | <p>My application has a <code>ViewFlipper</code> with <code>3 ViewGroups</code> in it. Each <code>ViewGroup interaction</code> is dependent on data from a database. I'm using an AsyncTask to read from a database and return a Cursor when it's done. Before the AsyncTask is executed, I just want to display a single View in the <code>ViewFlipper</code> saying "Loading data, please wait.", is this possible somehow?</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.