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 |
---|---|---|---|---|---|
2,756,381 | 2,756,382 |
jQuery fadeout woes
|
<p>Using the <code>keyup</code> on jQuery, is there a way to check a what textfield <strong>currently</strong> has in it's box?</p>
<p>I mean if the textbox currently <strong>does not</strong> have the word 'apples' then <strong>do</strong> a jQuery function, then if it <strong>does</strong> have the word apples... then do <strong>not</strong> do the jQuery function that happens when 'apples' is not typed.</p>
<p>I hope that made sense. I tried using <code>CASES</code> and <code>keyup</code> but I couldn't get it to work.</p>
<p>Is this possible?</p>
|
javascript jquery
|
[3, 5]
|
3,522,950 | 3,522,951 |
How to load a javascript file and run a javascript method in java?
|
<p>I'm using <a href="https://github.com/chjj/marked" rel="nofollow">marked</a> on the client side to render markdown code to html.</p>
<p>But now I need to do the same thing on the server side which is Java. In order to get the exact same html code, I have to use marked other than other java markdown libraries.</p>
<p>How can I load the "marked.js" file in java and run the javascript code?</p>
<pre><code>marked.parser(marked.lexer("**hello,world**"));
</code></pre>
|
java javascript
|
[1, 3]
|
4,337,657 | 4,337,658 |
Android Keyboard does not work with webpage that contains Javascript
|
<p>I have created an application that links to another site, this site has a form (and some javascript in the background)</p>
<p>Due to whatever javascript the page has on any Android 2.2-2.3 device tapping on an Input field does not bring up the soft keyboard and when you force it up you are unable to input anything at all.</p>
<p>My ICS device works perfectly fine with the site (I'm guessing due to the updated mobile browser)</p>
<p>Is there any code I can add to my project that will allow the older 2.2 and 2.3 devices to properly run the javascript or be able to handle the websites input fields correctly?</p>
<p>Here is the site I'm having the issues with: <a href="http://fhsdschools.revtrak.net/tek9.asp?pg=products&grp=1" rel="nofollow">http://fhsdschools.revtrak.net/tek9.asp?pg=products&grp=1</a></p>
|
javascript android
|
[3, 4]
|
2,212,006 | 2,212,007 |
jQuery trim and remove on parent break child events
|
<p>Note: I have a workaround to this problem, but I'd prefer to comma-separate the values as I describe below rather than separating them with spaces (which is what my workaround does).</p>
<p>I have an ASP.NET website that allows instructors to choose from a DropDownList of preset comments and apply these comments to students in their classes. I display the students and comments inside a GridView, and use a Label to display any comments that already exist in the database (removing them from the DropDownList in the process). When an instructor selects one of these comments and clicks a button, my jQuery function:</p>
<ol>
<li>Pulls the selected value and text out of the option (provided it isn't the default option).</li>
<li>Checks Label.children().length, and appends a ", " to the text if it's greater than zero.</li>
<li>Creates a <code><span></code> tag with a hidden field containing the value and text.</li>
<li>Appends the text inside the span.</li>
<li>Closes the span.</li>
<li>Attaches an onclick event to the span.</li>
<li>Removes the original option from the DropDownList.</li>
</ol>
<p>The span tag's onclick event does the reverse of what I describe above -- it pulls the value and text out and re-creates the option inside the drop-down menu. Additionally, it replaces strings like ", , " with ", " in the parent Label. I've found that when I replace these strings (which lie outside the spans I've attached the onclick events to) that the onclick events go away.</p>
<p>I'm familiar with .live(), but because each row in this GridView contains a unique reference to the particular student and class currently in use, I can't know the values that each row needs to pass into the funciton ahead of time. Is there any solution to this problem other than my described workaround or re-attaching the onclick event?</p>
|
javascript jquery
|
[3, 5]
|
3,101,884 | 3,101,885 |
Formatting text in dynamicaly created textboxes
|
<p>I have jquery that generates textareas with different id's. Now i need to make some buttons that will format text inside that textareas. For example: when user clicks in certain textarea, enter text, and click "bold" button, only text inside of that textarea will become bold (in other will be normal). I did manage to make something like this with JS, but it was too primitive (text was formated in all of textboxes) :(
Here is some sample code for this:</p>
<pre><code><button id="bold">B</button>
<textarea id="ta_1">Some test text</textarea>
<textarea id="ta_2">Some test text</textarea>
</code></pre>
<p>What i want to say: one button, multiply text boxes. Entering text in ta_1 and clicking bold, should bold only text in that txtarea. Additional info: all id's starting with same word, just different number at the end.</p>
<p>I feel there is some simple solution, just cant figure it out :D</p>
|
javascript jquery
|
[3, 5]
|
3,636,709 | 3,636,710 |
JQuery to load external pages in DIV
|
<p>I am using jquery to load external pages in index.html Menu links have function -
About</p>
<pre><code>function about() {jQuery('#container').load('about.html');}
</code></pre>
<p>I am using jquery function on each child page to get the data from xml. Apparently, wen I call the jquery just once on index.html and use same for child it works differently. When I single click it empty the <code>#container</code> but doesnt external file data. But when I double click on menu tab then i see the data. I am really lost and need help to figure out as wat m doing wrong.
hashworld.com.au/test/test.html I have uploaded code here please have a look</p>
|
javascript jquery
|
[3, 5]
|
2,422,674 | 2,422,675 |
Use Jquery to Insert PHP content
|
<p>I want to use jQuery to include some PHP at a certain point in the page. When jQuery finds the class <code>#site-index .sitetopic</code> I want to append the content from a PHP file called images.php.</p>
<p>I presume I can use <code>include or file_get_contents</code></p>
<p>Something like:</p>
<pre><code>OnLoad.find('#site-index .sitetopic')
InsertPHP
</code></pre>
|
php jquery
|
[2, 5]
|
2,571,041 | 2,571,042 |
What's the benefit of inline function calls?
|
<p>I saw this code (explicly it's in jQuery, with modification)</p>
<pre><code>(function(window,undefined){
var jQuery=(function(){
var jQuery=something;
jQuery.xxx=xxx;
//...
return jQuery;
})();
//...
window.jQuery=window.$=jQuery;
})(window);
</code></pre>
<p>While I understand wrapping code in a inline function call can clearly define the variable scope, I don't understand the benefits of</p>
<ol>
<li>passing <code>window</code> with a parameter instead of using it directly,</li>
<li>getting an instance of <code>undefined</code> by a undefined parameter, and also</li>
<li>defining <code>jQuery</code> by the return value of another inline function call.
Can somebody explain a bit?</li>
</ol>
<hr>
<p><strong>EDIT</strong> write #3 more clearly:</p>
<p>What I understand is that the code defines <code>jQuery</code> inside another function then return it.</p>
<pre><code>//(function(window,undefined){
var jQuery=(function(){
// Inside this function defines jQuery and return it?
var jQuery=function(selector,context){
return new jQuery(selector,context); //simplified
};
jQuery.xxx=xxx;
//...
return jQuery;
})(); // This executes the inline function and assign `jQuery` with the return value???
//... })(window);
</code></pre>
<p>This is more like the following:</p>
<pre><code>function define_jQuery(){
// Inside this function defines jQuery and return it?
var jQuery=function(selector,context){
return new jQuery(selector,context); //simplified
};
jQuery.xxx=xxx;
//...
return jQuery;
}
//(function(window,undefined){
var jQuery=define_jQuery(); // This executes the inline function and assign `jQuery` with the return value???
//... })(window);
</code></pre>
<p>Wouldn't it be more simpler to do:</p>
<pre><code>//(function(window,undefined){
var jQuery=function(selector,context){
return new jQuery(selector,context); //simplified
};
jQuery.xxx=xxx;
//...
//... })(window);
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,529,737 | 3,529,738 |
How good is Kivy for android?
|
<p>Very little is written about kivy, can you please tell me how good is kivy cross platform framework for Android? </p>
|
android python
|
[4, 7]
|
2,047,094 | 2,047,095 |
place cursor at the end of text in asp.net textbox using tab key
|
<p>I have a asp.net textbox which contains some predefined text by default.
when i move from one textbox to another using tabkey the cursor should place at the end of text. is it possible using jQuery or javascript ?
thank you</p>
|
c# asp.net
|
[0, 9]
|
4,925,628 | 4,925,629 |
How can I rewrite jQuery without guard clause?
|
<p>How can I rewrite this jQuery to be more terse and without the guard clause?</p>
<pre><code>var myTextBox = $('#myTextBox');
if (myTextBox )
myTextBox.val("");
</code></pre>
<p>The guard clause is there simply to ensure that the element exists on the page before trying to set it's value but the code seems bloated and most of it unnecessary.
What's the preferred solution to this?</p>
|
javascript jquery
|
[3, 5]
|
4,393,062 | 4,393,063 |
how to bypass mozilla confirm alert box
|
<p>When i try to go to last visited page on my website in mozilla i get this message "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier". Can anyone tell me how to bypass this. This is so frustrating. i have used php on my website</p>
|
php javascript
|
[2, 3]
|
5,605,511 | 5,605,512 |
jQuery sends to e, which I can then use e.currentTarget to grab the element on the page. How do I then use it?
|
<p>a jQuery event passes me e.</p>
<p>I can then use: e.currentTarget which gives me the element </p>
<pre><code><input type="checkbox" class="list_completed_checkbox" id="list_item_completed_checkbox_81">
</code></pre>
<p>But if I try doing e.currentTarget.fadeOut(); I get an error:</p>
<pre><code>68Uncaught TypeError: Object #<HTMLInputElement> has no method 'fadeOut
</code></pre>
<p>How can I use the element w jQuery? Thanks</p>
|
javascript jquery
|
[3, 5]
|
2,781,275 | 2,781,276 |
Picking an element within a DIV with JQuery
|
<p>I have an HTML page with a variety of divs on it. For instance, something like this:</p>
<pre><code><div id="myDiv1">
<input id="myInput1" type="text" />
<input id="myInput2" type="text" />
<input id="myButton" type="button" value="Button" />
</div>
<div id="myDiv2">
<!-- My Content -->
</div>
</code></pre>
<p>How do I use JQuery to:</p>
<ol>
<li>Get ALL input fields of type text within myDiv1</li>
<li>Get a single input field inside of a div</li>
</ol>
<p>Traditionally, I would use the following:</p>
<pre><code>var textFields = $(":text");
var myInput = $("#myInput1");
</code></pre>
<p>However, I would really like to understand how to search within a single DIV element.</p>
<p>Thank you so much!</p>
|
javascript jquery
|
[3, 5]
|
1,157,227 | 1,157,228 |
Category in which Programing languages like Perl, JavaScript ,C++ and Java fits the best
|
<p>I am making my CV these days and due to that i very basic question came in my mind ,
i have good enough experience with Java and C++, while i am learning and working on Java script , PHP, Mysql, HTML and XML these days..
My question is how can i categorize these languages with best heading Like Object Oriented Programming language for C++ and Java . Scripting language for PHP and Java script and so on , whats the best heading ??</p>
|
java php
|
[1, 2]
|
2,289,955 | 2,289,956 |
What's proper jQuery plugin practice?
|
<p>Don't be afraid to use any technical jargon or low-level explanations for things, please. I'm savvy enough with computer architecture and low-level programming languages to comprehend any optimizations or memory management techniques, as well as complex structures (classes, member variables, etc.)</p>
<p>My primary focus of code is web-based applications. I work with PHP a lot and I've been learning CSS quickly. Javascript is currently my bottleneck, however. I know enough Javascript to do just about anything sans frameworks (DOM manipulation, AJAX queries, etc.). I also know that I can make my code run quicker, optimize it for specific cases, and I can shrink the over-all size of my code (no external script to include) by manually coding everything. However for ease of reading by other programmers and for speed of coding I'm trying to learn at least one Javascript framework.</p>
<p>After reading through the documentation on a number of frameworks and looking at some tutorials, I preferred jQuery. It allowed for very powerful iterative code in a single line and it had a very small chance of global variable namespace collision. From what I could tell, the ONLY global variable declared is the $ variable and everything else happens within this namespace, and there were even ways to access the namespace without this variable if you wanted to have two frameworks side-by-side. It also had a very small file to include (24 kilobytes gzipped) which means less server load.</p>
<p>My question is what are good practices in creating a jQuery plugin? If I were to start coding websites in jQuery, how should I go about it for the best interoperability and design? I want to ensure that my code can run along-side any other jQuery without interference, it's possible to build plugins off of my code, and I minimize use of the jQuery namespace so that I don't steal variables that might be used by another script.</p>
|
javascript jquery
|
[3, 5]
|
3,655,930 | 3,655,931 |
use php command line
|
<p>Like the way we can use python in command line from its command line interpreter in order to test whether small code snippets are fine or not, how can I do the same with PHP (or can I)?</p>
<pre><code>ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "abc"
abc
>>>
C:\wamp\bin\php\php5.3.4>php -a
Interactive mode enabled
</code></pre>
<p>doesn't give me php prompt</p>
<p>can someone show an example on how do have an interactive shell in php. </p>
|
php python
|
[2, 7]
|
5,521,493 | 5,521,494 |
$(this) is not working
|
<p>I am using <a href="http://www.eyecon.ro/colorpicker/#about">ColorPicker Plugin.</a> I initialized the plugin with following code :</p>
<pre><code>$(".colorpic").ColorPicker({
color: '#0000ff',
onShow: function (colpkr) {
$(colpkr).fadeIn(500);
return false;
},
onHide: function (colpkr) {
$(colpkr).fadeOut(500);
return false;
},
onChange: function (hsb, hex, rgb) {
$(this).css('backgroundColor', '#' + hex); <= $(this) not working
}
});
</code></pre>
<p>Now my problem is that <code>$(this)</code> is not working in <code>onchange</code> event. Help me out please?</p>
|
javascript jquery
|
[3, 5]
|
5,778,756 | 5,778,757 |
How to change background on every 5s
|
<p>I have image <code>background.jpg</code> as the background. Every 10s, how to load a new background <code>background_n.jpg</code> which stays for 100ms and then back to <code>background.jpg</code> and so on?</p>
|
javascript jquery
|
[3, 5]
|
2,293,576 | 2,293,577 |
Jquery function to compare date with current date
|
<p>i am entering date of birth in form by entering date in separate text box ,selecting year from drop down and entering year in text box. Now i want to check that entered date must not be greater that current date in jquery. Please help how? </p>
<pre><code>var CurrentMonth = date.getDate() + '/' + date.getMonth() + '/' + date.getFullYear();
var SelectedDate = $('[id$=spDate]').val() + '/' + $('[id$=drpMonth]').val() + '/' + $('[id$=txtYear]').val();
if (CurrentDate > SelectedDate) {
return false;
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,842,809 | 3,842,810 |
JQuery popup issue in IE
|
<p>IE shows scrollbars when JQuery Dialog pops up. FF doesnt show scrollbars. Whats wrong with IE CSS?</p>
<pre><code><div id="disablebg" style="display: none;overflow:hidden;">
<uc1:CreateInqGeneral ID="CreateInqGeneral1" runat="server" />
</div>
function ShowDialog() {
$("#disablebg").dialog({
resizable: false,
modal: true,
width: "550px"
});
}
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,868,413 | 2,868,414 |
Why isn't file_put_contents overwriting?
|
<p>I have a page with a WYSIWYG editor the user can use. After editing, they can press a button, and the javascript should POST the current page to a save.php file and refresh the page with new information. </p>
<p>There are two problems. The first is that initially the page doesn't load with the updated file. The user has to refresh the page to see it updated (maybe it just takes an extra second to write the file?). The second problem, is that after the first time the temporary file was created, it cannot be overwritten, so the page never updates after the first refresh. Here are the snippets I'm working with:</p>
<p>Javascript function on the WYSIWYG editor page (editor.php):</p>
<pre><code>function refresh(html,username,info)
{
$.post("save.php", { html: html, username: username } );
window.location = 'editor.php?info=' + info;
}
</code></pre>
<p>save.php file</p>
<pre><code>$html = $_POST['html'];
$username = $_POST['username'];
file_put_contents('temp/' . $username . '.txt', $html);
</code></pre>
|
php javascript
|
[2, 3]
|
5,148,174 | 5,148,175 |
Disadvantages to using lots of if statements
|
<p>Apart from code readability, why is it bad to use lots of if statements?</p>
|
c# java c++
|
[0, 1, 6]
|
2,058,286 | 2,058,287 |
Remove dynamically added element
|
<p>I'm trying to remove a stylesheet that is dynamically being added to the end of <code><head></code> tag</p>
<p>For some reasons, i'm forced to use javascript to remove that stylesheet tag and add my own</p>
<p>here is the code i tried - </p>
<pre><code>jQuery(document).ready(function(){
jQuery('link[href^="somepath/editor.css"]').remove();
jQuery('head').append("<link href='somepath/custom/editor.css' type='text/css' rel='stylesheet' />");
});
</code></pre>
<p>the problem is that this function is being executed before the CkEditor functions. So my Stylesheet is being added before the ckeditor stylesheet and the ckeditor stylesheet
I tried using <code>.load</code> instead of <code>.ready</code> but then the code doesn't seem to run at all.</p>
<p>Any help?</p>
|
javascript jquery
|
[3, 5]
|
2,428,617 | 2,428,618 |
Java script function to hold until save evenet execution is completed
|
<p>I have a javascript function. In thi function i am calling a button event like below.</p>
<pre><code>$("#btnSave").trigger("click");
</code></pre>
<p>My query is , Is there any way to keep the control here on this line until the saving is done?
I have some code written underneath this line and it is being overridden.</p>
<p>Any suggestions?</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
1,720,123 | 1,720,124 |
jquery reset load file back to default
|
<p>I have a 3 layer <code>select</code> use jquery load <code>option</code> into <code>sub-select</code></p>
<pre><code>country->state->city
</code></pre>
<p>so if user select usa, the 2nd <code>select</code> will load usa's state. than user can select city after select the state.</p>
<p>ex. usa->CA->LA</p>
<p>however if user select usa->CA->LA first than user want to change country to aus</p>
<p>it become aus->select state->LA, the 3rd <code>select</code> still stay the same.</p>
<p>Is any way to reset 2nd, 3rd <code>select</code> back to default if user change top <code>select</code>.</p>
<pre><code>$("#country").change(function(){
switch($("#country").val()){
case "aus":$("#state").load("aus_state.php");break
case "uk":$("#state").load("uk_countie.php");break
case "usa":$("#state").load("us_state.php");break
}
});
</code></pre>
<p>how to remove the load files back to default?</p>
|
javascript jquery
|
[3, 5]
|
2,401,540 | 2,401,541 |
Null Pointer Exception while using putExtra and getExtras
|
<p>I'm trying to use putExtra and getExtras to pass some information in an android game I'm writing (it's a score). When I'm passing it, I use this code in the one class to put in the information:</p>
<pre><code>Intent winScreen = new Intent(context, WinScreen.class);
winScreen.putExtra("score", "123");
</code></pre>
<p>And when I'm getting it, I'm using:</p>
<pre><code>Intent x=new Intent(this, GameCall.class);
Bundle ebundle = x.getExtras();
String score = (String) x.getExtras().getSerializable("score");
</code></pre>
<p>I'm just trying to test with a sample score right now, so I don't think setting the value correctly is the problem. That was the suggestion I saw elsewhere for why such a null pointer would occur. I know it understands "score" as an extra. So I am stumped as to where the information is being lost!</p>
|
java android
|
[1, 4]
|
3,934,868 | 3,934,869 |
How does jquery know which function to run?
|
<p>I have:</p>
<pre><code><script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
<div class="demo">
<p>Date: <input id="datepicker" type="text"></p>
</div>
</code></pre>
<p>When I click in the datepicker box the datepicker appears, as expected.</p>
<p>Question: How does jquery know to run that function when I click on the box and not another function? </p>
<p>If I want to add a function for something else, how would jquery know which to refer to? </p>
<p>I am used to using php where all functions have a name and you refer to them by the name...</p>
|
javascript jquery
|
[3, 5]
|
3,017,479 | 3,017,480 |
Using javascript/jquery, validate URL that should have http or https and www
|
<p>Please advice how to validate a url that should have http or https and www in it</p>
<p>Thanks
Amit</p>
|
javascript jquery
|
[3, 5]
|
1,555,802 | 1,555,803 |
How to set new Id of div using its old id dynamically
|
<p>I want to set new id to div using its old Id?</p>
<pre><code>$("#oldId").attr("id","newId");
</code></pre>
<p>Its not working.</p>
|
javascript jquery
|
[3, 5]
|
564,340 | 564,341 |
How to return multiple values from java method to java script?
|
<p>I want to return two values from java method to java script..can you help me.??
would be grateful for help..</p>
|
java javascript
|
[1, 3]
|
1,375,909 | 1,375,910 |
How to call aspx page including server side code in jquery load with out using jquery ajax method?
|
<p>I have a asp calendar control, it is included in update panel. When click on the date, SelectionChanged() event is not fired. Here is the code.</p>
<p>ASPX - </p>
<pre><code><asp:Calendar ID="Calendar" runat="server" BorderColor="green" NextPrevStyle-BackColor="green"
BorderStyle="Solid" Height="414px" NextPrevFormat="FullMonth" TitleStyle-BackColor="green"
DayStyle-Font-Underline="false" ShowGridLines="True" Width="567px" onvisiblemonthchanged="Calendar_VisibleMonthChanged"
SelectedDate="02/23/2013 15:33:22" VisibleDate="2013-02-23" onselectionchanged="Calendar_SelectionChanged">
<DayStyle Font-Underline="True" />
<NextPrevStyle BackColor="green" />
<SelectedDayStyle BackColor="green" Font-Bold="True" ForeColor="Black"
/>
<SelectorStyle Font-Bold="True" />
<TitleStyle BackColor="green" Font-Underline="False" />
<TodayDayStyle BackColor="green" Font-Bold="True" ForeColor="White" />
</asp:Calendar>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Calendar" EventName="SelectionChanged"
/>
</Triggers>
</asp:UpdatePanel>
</code></pre>
<p>Server side code - </p>
<pre><code>protected void Calendar_SelectionChanged(object sender, EventArgs e)
{
Label1.Text = CalEdairy.SelectedDate.ToShortDateString();
}
</code></pre>
|
jquery asp.net
|
[5, 9]
|
3,214,668 | 3,214,669 |
How can alter the value of every single input element, by a fixed amount, without using a loop?
|
<p>I want select every inputbox of type text and transform by a fixed amount, when checkbox is checked, so far I have this. However I wondered if there was a way to do this without iterating over every element ...</p>
<pre><code> $("#myID").change(function(){
if($(this).is(':checked')){
//I can't do this :
$("input:text").val( $("input:text").val()*4);
//I have to do this ?
$("input:text").each(function(index){
$(this).val($(this).val()*4);
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,233,908 | 4,233,909 |
DropDownList duplicate items
|
<p>Hi I am trying to rebind data to a <code>DataList</code> that get's it's data from an <code>SqlDataSource</code> but I keep getting duplicate items. Here is my code:</p>
<p>
</p>
<pre><code><asp:SqlDataSource ID="CategoryDataSource" runat="server"
ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [CategoryName] FROM [forum_categories]">
</asp:SqlDataSource>
protected void Button6_Click( object sender , EventArgs e )
{
string categoryToCreate = CreateCategory.Text;
if(categoryToCreate != string.Empty)
{
CategoryCreateName.Visible = false;
DataAccess.insertDataItem(categoryToCreate);
CategoryList.DataBind();
}
else
{
CategoryCreateName.Visible = true;
}
}
</code></pre>
<p>The <em>insertDataItem</em> inserts a new category into the database.</p>
<p>How can I update the items in the <code>DropDownList</code> so that I do not get duplicate items?</p>
|
c# asp.net
|
[0, 9]
|
4,921,056 | 4,921,057 |
Sum of numeric field checkboxes in gridview
|
<p>I am having difficulties in assigning double value (for example 124.00) of label text in asp.net. This label is in content page of .net master page.</p>
<p>But I am having the following two problems:</p>
<pre><code><script type="text/javascript">
var totalAmount = 0; //Defined global variable;
function addval(vals) //I am passing vals(Double from sever side)
{
totalAmount = totalAmount + vals;
(document.getElementsByTagName("<%= lblCurrentProductTotal.ClientID %>")).value= totalAmount.toString();
}
</script>
</code></pre>
<ul>
<li><p>Each time "clickCh" is called; this sets the <code>totalAmount</code> (a global variable) with the parameter passed. It's like if I pass <code>145</code> first time it assigns as <code>"0145"</code> and second time if I pass <code>156</code> the totalAmount becomes <code>"0145156"</code> as I am expecting it to add as <code>145+156=301</code>.</p></li>
<li><p>It's not assigning the value to the label "lblCurrentProductTotal"
Please let me know if i am missing something.</p></li>
</ul>
<p>Thanks in advance!</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,249,506 | 3,249,507 |
jQuery access to 'this' object with events and triggers
|
<p>I have two classes orchestrated by a main class and I would like to know how to gain access to the correct 'this' object when events are fired among these classes. Here's what I have:</p>
<pre><code>// My main class that orchestrates the two worker classes
function MainClass()
{
this.workerOne = new ChildWorkerOne();
this.workerOne.bindBehaviors.apply(this.workerOne);
this.workerTwo = new ChildWorkerTwo();
this.workerTwo.bindBehaviors.apply(this.workerTwo);
// a custom event I'm creating and will be triggered by
// a separate event that occurs in workerTwo
$(document).bind("customEvent", this.onCustomAction);
}
MainClass.prototype.onCustomAction = function(event, data)
{
// I want to call a method that belongs to 'workerOne'.
this.workerOne.makeItHappen();
// However, the 'this' object refers to the 'Document' and
// not the 'MainClass' object.
// How would I invoke 'makeItHappen' here?
};
ChildWorkerOne.prototype.makeItHappen = function()
{
// Do a bunch of work here
};
ChildWorkerTwo.prototype.bindBehaviors = function()
{
$(div).click(function(e){
$.post(url, params, function(data)
{
// do a bunch of work with this class and then
// trigger event to update data with ChildWorkerOne
$(document).trigger("customEvent", [data]);
}
});
};
</code></pre>
<p>I don't want to merge ChildWorkerOne and ChildWorkerTwo because they are two separate entities that don't belong together and MainClass conceptually should orchestrate the ChildWorkerOne and ChildWorkerTwo. However, I do want to invoke the behavior of one in the other. </p>
<p>What's the best way to go about doing this?</p>
|
javascript jquery
|
[3, 5]
|
2,916,768 | 2,916,769 |
jQuery: Move element position
|
<p>In each div, there are two buttons: higher and lower. When 'higher' is clicked, if this div is not at the top position, then it is moved higher than original. When 'lower' is clicked, then the element will be moved lower than original. </p>
<p>The question is: How to the elements can be moved up and down of with respect to another element?</p>
<pre><code><div>
<div id="a1">a1<input name='higher' type='button' value='higher'/><input name='lower' type='button' value='lower'/></div>
<div id="a2">a2<input name='higher' type='button' value='higher'/><input name='lower' type='button' value='lower'/></div>
<div id="a3">a3<input name='higher' type='button' value='higher'/><input name='lower' type='button' value='lower'/></div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,683,602 | 4,683,603 |
php and jquery cookie mixture?
|
<p>hey guys,
i'm confused,
i have the following jquery script in my header:</p>
<pre><code>forceAnim: <?php echo ($iphone || is_singular()) ? 0 : 1; ?>
</code></pre>
<p>which meanst, that either on the iphone or on a singular-type page forceAnim is 0.
However i want to include an additional query if a jquery cookie is saved.</p>
<p>if the jquery.cookie exists (and equals true) OR it's viewed on the iphone OR its a singular type post forceAnim should be true.</p>
<p>i have just no idea how to mix php with jquery in that case. to query if the jquery.cookie returns true i can just use: </p>
<pre><code>if($.cookie('animate') == 'true'){
//yes the cookie returns true.
}
</code></pre>
<p>any idea how i can query all three things?
thank you for your help.</p>
|
php jquery
|
[2, 5]
|
3,159,433 | 3,159,434 |
jquery arguments.callee
|
<p>I'm trying to adjust a jquery script to my needs and encountered the following lines- </p>
<pre><code> arguments.callee.eabad1be5eed94cb0232f71c2e5ce5 = function() {
_c3();
_c4();
return;
};
</code></pre>
<p>what is it?</p>
|
javascript jquery
|
[3, 5]
|
231,516 | 231,517 |
What is "passive data structure" in Android/Java?
|
<p>From the Android developer web link: <a href="http://developer.android.com/reference/android/content/Intent.html">http://developer.android.com/reference/android/content/Intent.html</a>, you can find that it says "It (Intent) is basically a passive data structure holding an abstract description of an action to be performed." But I don't understand what is "passive data structure"? Could anyone help to explain it? Thanks!</p>
|
java android
|
[1, 4]
|
4,454,524 | 4,454,525 |
How to pass value from php to javascript
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/10437703/pass-php-variable-value-to-javascript">pass php variable value to javascript</a> </p>
</blockquote>
<p>I want to create a progress bar, the value of the progress will be coming from PHP.</p>
<pre><code><div class="prog" id="progressbar"></div>
<label id="amount">
<?php echo $cast; ?>
</label>
</code></pre>
<p>I have this kind of javascript.</p>
<pre><code><script>
$(function() {
$( "#progressbar" ).progressbar({
value: 0
});
});
</script>
</code></pre>
<p>How can I throw the value $cast in my script?</p>
|
php javascript
|
[2, 3]
|
4,980,715 | 4,980,716 |
How to use .html() with a timer in jQuery?
|
<p>I want to replace the contents of a div with the values found in an array. I want to keep each value within the div for 3 seconds each. Here's my code so far:</p>
<pre><code> var images = ['a.jpg', 'b.jpg', 'c.jpg'];
for (i = 0; i < images.length; i++) {
$('#slideShow').html("<img src='../"+images[i]+"' alt='' />");
}
</code></pre>
<p>This of course changes the images so fast that the human eye only sees one image being in the div at all times. I want to keep each image for 3 seconds before the next .html() is done on the div. How to do this?</p>
|
javascript jquery
|
[3, 5]
|
5,816,299 | 5,816,300 |
Jquery: Add class unless there is a child of certain class
|
<p>I want to do an addclass, but only if it doesn't have a child of a certain class.</p>
<pre><code>$selector.addClass('addthisclass');
</code></pre>
<p>So I want:</p>
<pre><code><div class="addthisclass"><span></span></div>
</code></pre>
<p>And nothing on here.</p>
<pre><code><div><span class="badclass"></span></div>
</code></pre>
<p>Anyone know how to do this?</p>
|
javascript jquery
|
[3, 5]
|
3,521,122 | 3,521,123 |
JQUERY - .html() can also view php
|
<p>The following script sends data with ajax for login</p>
<p>I want to format the data returned by using, in essence, a session variable ($ _SESSION)</p>
<p>I can do it</p>
<pre><code> $("#login").click(function(){
username=$("#user_name").val();
password=$("#password").val();
$.ajax({
type: "POST",
url: "inc/login.inc.php",
data: "username="+username+"&password="+password,
success: function(msg){
if(msg!='false')
{
$("#login_form").fadeOut("normal");
$("#shadow").fadeOut();
$("#profile").html("<\?php print(\"$_SESSION['name'].\" <a href='inc\/logout.inc.php' id='logout'>Logout k2<\/a>\");\?>");
//valori menù
if(tipo=='1')
{$("#admin").css('display','none')}
}
else
{
$("#add_err").html("Username o password errata");
}
},
beforeSend:function()
{
$("#add_err").html("<img hspace='84' src='img/loading.gif' alt='Loading...' width='32' height='32'>" )
}
});
return false;
</code></pre>
<p>});</p>
<p>especially this is possible, in this way would print the name of the user just logged. otherwise I would not know how to do</p>
<pre><code>$("#profile").html("<\?php print(\"$_SESSION['name'].\" <a href='inc\/logout.inc.php' id='logout'>Logout k2<\/a>\");\?>");
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
2,661,048 | 2,661,049 |
InputStream.bytesRemaining is less than should be
|
<p>I have bunch of images from dozen or so sources and I am downloading them in background thread. Most of images are downloaded without problems but there are 2 sources that are causing problems. All images from them fail to load.</p>
<p>I am using following code to download (and store) images:</p>
<pre><code>File f=new File(cacheDir, urlHash);
Bitmap bitmap=null;
InputStream is=new URL(url).openStream();
OutputStream os = new FileOutputStream(f);
Utils.CopyStream(is, os);
os.close();
bitmap = BitmapFactory.decodeStream(new FileInputStream(f), null, null);
</code></pre>
<p>Utils.CopyStream : </p>
<pre><code>public static void CopyStream(InputStream is, OutputStream os)
{
int counter = 0;
final int buffer_size=1024;
try
{
byte[] bytes=new byte[buffer_size];
for(;;)
{
int count=is.read(bytes, 0, buffer_size);
if(count==-1) {
Log.d("tag", counter + " bytes copied");
break;
}
os.write(bytes, 0, count);
counter += count;
}
}
catch(Exception ex) {
ex.printStackTrace();
}
}
</code></pre>
<p>when I try to download this image <a href="http://www.zapakatel.cz/static/deal/7193-1057b.jpg" rel="nofollow">http://www.zapakatel.cz/static/deal/7193-1057b.jpg</a> than it fails. BitmapFactory.decodeStream returns NULL. All I could find out about this that could cause a problem is that is.bytesRemaining is missing few thousands bytes: 162721 vs 179845 according to downloaded file size. When I manually download image from that url and upload it somewhere else, than everything works just fine. </p>
<p>Any idea what could cause problems? Is it possible that server hosting this image cuts me out before download is finished? This image load fine on any PC and even in my iphone app (I know that this is completely different platform and that it probably isn't important, I just find it weird)</p>
|
java android
|
[1, 4]
|
3,780,114 | 3,780,115 |
Is there a way to detect mouse press in jQuery?
|
<p>I want to add a class to a link when it is clicked, but I can't use:</p>
<pre><code>$('a.someLink').click(function() {
// code
});
</code></pre>
<p>since click seems to detect when a user clicks and lets go of the mouse clicker on an element. I need to add the class as soon as the user has clicked on the element, even before he lets ago of the mouse clicker and after he lets go I need the class to be removed.</p>
<p>Basically I'm trying to mimic css's active state on links:</p>
<pre><code>a:active
</code></pre>
<p>How can this be done?</p>
|
javascript jquery
|
[3, 5]
|
5,324,832 | 5,324,833 |
Page won't display images
|
<p>My page won't display my images from a webservice. In my jquery function I just want to display 1 image so iterates over the collection and prints out the correct amount of records but i just can't display any images. I've been playing around with the path for the src but Im not getting any where and Im also using a routed page so my url is in this format website2/browse/en-nz/computers</p>
<pre><code>var result = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
$.each(result.Products, function (key, val) {
$('#products > tbody')
.append('<tr><td>'
+ '<img alt="" src="../../images/1113000554523_180X180.jpeg" /><br/>' +
/* ^^ im printing out the same image here just to get it to work
i've tried "/website2/images/1113000554523_180X180.jpeg"
"../images/1113000554523_180X180.jpeg" */
'</td></tr>');
});
</code></pre>
<p>I can't display any images, if you know what im doing wrong or have any suggestions let me know</p>
|
jquery asp.net
|
[5, 9]
|
3,996,252 | 3,996,253 |
Set events for checkbox
|
<p>I want to set events for checkbox to display content.</p>
<blockquote>
<p>If check="Twitter" -> display content of twitter If check="Facebook"
-> display content of facebook</p>
<p>If check all (twitter + facebook) -> display content of twitter +
facebook</p>
<p>Required to choose twitter or facebook.</p>
</blockquote>
<p>I have handle events for checkbox but not display content for-each checkbox checked: <a href="http://jsfiddle.net/vinhnguyenle/hHnUV/" rel="nofollow">http://jsfiddle.net/vinhnguyenle/hHnUV/</a></p>
<pre><code> var $twitter = $('input[name=twitter]'),
$facebook = $('input[name=facebook]');
$twitter.click(function(e) {
if (!!$facebook.prop('checked') == false) {
e.preventDefault();
}
});
$facebook.click(function(e) {
if (!!$twitter.prop('checked') == false) {
e.preventDefault();
}
});
$twitter.trigger('click');
</code></pre>
<p>Please help me display content for-each checkbox checked.</p>
<p>Thanks,</p>
|
javascript jquery
|
[3, 5]
|
1,734,626 | 1,734,627 |
Add random number to .css so it doesn't cache
|
<p>I'm trying to get the styles.css to not cache as the server is having issues with the css when it caches.</p>
<pre><code><script>
var numBAH = Math.floor(Math.random()*100);
</script>
<link href="styles.css+ numBAH +" rel="stylesheet" type="text/css" />
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,542,329 | 5,542,330 |
Can I use ASP.NET 2.0 to create a picture scroller?
|
<p>I am trying to create a picture scroller. In it, I would have a large picture and several thumbnails at the bottom. If a user haover or clicks the thumbnail, it then is displayed in te large box. My plan was to create this in ASP.NET but now I'm drawling a blank on how to implement this? I know ASP.NET and some JavaScript. Any opinions on how to get started?</p>
<p>I should mention my images are stored in the database so I get them as byte arrays.</p>
|
asp.net javascript
|
[9, 3]
|
1,617,353 | 1,617,354 |
Writing an ArrayList back to an XML File
|
<p>When my activity starts I check for an existing data file and if there isn't one I call a web service that provides a blank one to begin with. The file is read into an ArrayList collection and the user makes changes as needed. Now I am in need of advice for the best approach. </p>
<p>Should I try to match the updated contents in the ArrayList to the element in the XML file (there is an ID field that could be used for matching) or should I just write out the ArrayList overwriting the old xml file? No worries about maintaining a hx.</p>
<p>If I write out the file (what I'm thinking is the way to go) do I have to decorate everything in the DataObject class (ie all the properties) as serializable or just at the class level. Do I also somehow need to mark the ArrayList collection serializable as well?</p>
|
java android
|
[1, 4]
|
1,308,142 | 1,308,143 |
asp.net login control. when enter is clicked, submit login
|
<p>I have an asp.net login control. It works fine but you have to press the actual button login in order to login. I would like to do it if the user presses enter as well. how can this be done?</p>
|
c# asp.net
|
[0, 9]
|
2,936,920 | 2,936,921 |
Transfer from web site asp.net to android and from android to web site aps.net?
|
<p>How can I transfer data from website asp.net to android application and mobile to web site.
EX: I want transfer mark each student from web site to device student in application.
please: give me Example or tutorial about that and what is technical use? </p>
|
c# java android asp.net
|
[0, 1, 4, 9]
|
3,394,848 | 3,394,849 |
Use jQuery to not check hidden td:s
|
<p>I'm using the code below to make all checkboxes checked, but the problem is sometimes the checkboxes has a parent <code><td></code> with style="display:none;" css property and should not be checked. </p>
<p>How can I modify the code below to ignore the invisible checkboxes?</p>
<pre><code>// Check / uncheck all checkboxes
$('.check_all').click(function() {
$(this).parents('form').find('input:checkbox').attr('checked', $(this).is(':checked'));
});`
</code></pre>
<p>(the reason the <code><td></code>:s are not visible are due to quicksearch.js)</p>
|
javascript jquery
|
[3, 5]
|
5,796,082 | 5,796,083 |
Remove text from Image attr('src');
|
<p>Im using the src of an image, however im fetching the thumbnail image src and need to manipulate the src to get the fullsize image:</p>
<p>Jquery:</p>
<pre><code>$(this).attr('src');
</code></pre>
<p>That gets me: <code>http://local/images/_w/image_jpg.jpg</code></p>
<p>I need to replace: <code>_w/</code> to get the fullsize image, how can i do this in jQuery?</p>
|
javascript jquery
|
[3, 5]
|
5,307,737 | 5,307,738 |
Select first children in nested list using JavaScript
|
<p>I am trying to select only the first children under Sally. Using JavaScript, how would I select Car, Boat, & Bike and change the font color to red?</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
var j = jQuery.noConflict();
j('#content2 ul li ul').children().css('color', '#ff0000');
});
</script>
<div id="content2">
<div>
<div>
<ul>
<li>Bob</li>
<li>Sally
<ul>
<li>Car</li>
<li>Boat</li>
<li>Bike
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>
</li>
</ul>
</li>
<li>Larry</li>
<li>Mo</li>
</ul>
</div>
</div>
</div>
</code></pre>
|
javascript jquery
|
[3, 5]
|
345,738 | 345,739 |
SharedAssemblyInfo.cs
|
<p>I am using a SharedAssemblyInfo file which seems to be a 'standard' technique:
<a href="http://blogs.msdn.com/jjameson/archive/2009/04/03/shared-assembly-info-in-visual-studio-projects.aspx" rel="nofollow">http://blogs.msdn.com/jjameson/archive/2009/04/03/shared-assembly-info-in-visual-studio-projects.aspx</a></p>
<p>I put the SharedAssemblyInfo.cs file into my web application because with web <strong><em>site</em></strong> projects I cannnot 'add files as a link'.</p>
<p>But now I need to add a second web project to the solution and obviously the SharedAssemblyInfo file cannot be within both projects.</p>
<p>How do I get round this problem without having duplicate SharedAssemblyInfo files?</p>
|
c# asp.net
|
[0, 9]
|
5,914,645 | 5,914,646 |
$.getJSON to make its result global
|
<p>I'm using the jQuery function <code>$.getJSON</code> to get some data from the server side and here is the code: </p>
<pre><code>function (){
$.getJSON("someURI",function(result){
//this alert works fine
alert(result.msg)
});
// this prints the data as undefined
alert(result.msg);
}
</code></pre>
<p>how to change the scope of "result" returned from <code>$.getJSON</code> in order to make it global.. to make the second alert prints its value not to be undefined ??</p>
|
javascript jquery
|
[3, 5]
|
4,926,801 | 4,926,802 |
Common Graphs library for Android and iphone
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4995114/is-there-any-chart-library-working-both-on-iphone-and-android-applications">Is there any chart library working both on iphone and android applications?</a> </p>
</blockquote>
<p>I need to find a common library file to generate graphs for android and iphone. Please let me know if anyone know the library file. </p>
<p>Note: I need the library file to develop a native android/iphone app.</p>
|
android iphone
|
[4, 8]
|
4,496,265 | 4,496,266 |
How do I fix ASP.NET Error CS0103
|
<p>What causes the ASP.NET Error CS0103? I get that error saying that <code>Label01</code> can not be found in the current context` when I try to compile the project. </p>
<p>What is causing it?</p>
|
c# asp.net
|
[0, 9]
|
4,490,900 | 4,490,901 |
Destroy Static Variables in C#/ASP.NET
|
<p>I am forced to use static variables because of the asp.net execution path. I have to have the same variables on the master page as well as the page being called. Static variables make it very easy to carry over variables because they remain static. Unfortunately these variables hang in the ether of memory because the app hasn't actually "exited". Is there a way to destroy these variables when I finished used them? I looked into </p>
<pre><code>IDisposable
</code></pre>
<p>but its implementation is not... clean. Is there a way to destroy variables when the page finishes rendering?</p>
|
c# asp.net
|
[0, 9]
|
5,959,293 | 5,959,294 |
hiddenview inside datalist
|
<p>i have a datalist and inside it i bind a value in a label like this</p>
<pre><code> <asp:Label ID="hf1" runat="server" Visible="false"><%# Eval("DeptId")%></asp:Label>
</code></pre>
<p>how can i get the value of label in datalist EditCommand?</p>
|
c# asp.net
|
[0, 9]
|
4,866,832 | 4,866,833 |
how to put a Location object in Parcelable
|
<p>I have a Location object in one of my other Venue object that implements Parcelable. How do I serialize this correctly in my writeToParcel method implementation? So here's some code:</p>
<pre><code>public class Venue implements Parcelable{
public String id;
public String name;
public String address;
public Location location;
public String city;
public String state;
public String country;
public String postalCode;
@Override
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
@Override
public void writeToParcel(Parcel desc, int flags) {
desc.writeString(id);
desc.writeString(state);
desc.writeString(name);
desc.writeString(address);
desc.writeString(postalCode);
desc.writeString(country);
desc.writeString(city);
//I am still missing on a way to serialize my Location object here
}
}
</code></pre>
|
java android
|
[1, 4]
|
2,726,419 | 2,726,420 |
oninput/onkeyup/onkeydow/onpropertychange doesn't work in IE8
|
<p>As you might have noticed from the title I'm trying to make an event work properly and IE is giving me a hard time. I have tried all possible combinations, none of them seems to work.</p>
<p>I'm trying to mimic the Google suggestions list. A visitor should be able to come down in the list using the arrow keys, which is a Jquery keydown event. This event however also renders the request for the suggestion list at the same time in IE8 so the therefore the arrow keys function comes to an end (because of the request that is being maid.) </p>
<p>I know there must be a simple solution to this, but I can't see it.Help is appreciated. This is a demo: <a href="http://jsbin.com/ituwes/3/edit" rel="nofollow">at jsbin</a> </p>
<p>It works in all browsers but not in IE.</p>
|
javascript jquery
|
[3, 5]
|
1,322,446 | 1,322,447 |
How to get different selected values in javascript?
|
<p>Hello everyone how can I get two values from different select boxes? I get first value in my select box but I can't get the second value from another select box.Here is my javascript code:</p>
<pre><code> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var select = document.forms[0].sel;
var select2=document.forms[0].sel2;
select.onchange = function () {
var value = select.options[select.selectedIndex].value; // to get Value
alert(value);
}
select2.onchange = function () {
var value2 = select2.options[select2.selectedIndex].value; // to get Value
alert(value2);
}
});
</script>
<form>
<SELECT NAME="sel" onChange="split(selected value)">
<OPTION VALUE=1>Milk</option>
<OPTION VALUE=2>tea</option>
<OPTION VALUE=3>water</option>
<OPTION VALUE=4>coffee</option>
</SELECT>
</form>
<form>
<SELECT NAME="sel2" onChange="split(selected value)">
<OPTION VALUE=1>Milk</option>
<OPTION VALUE=2>tea</option>
<OPTION VALUE=3>water</option>
<OPTION VALUE=4>coffee</option>
</SELECT>
</form>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,538,124 | 5,538,125 |
Disable a function
|
<p>I have a tooltip that I want to disable. It is from <a href="http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery" rel="nofollow">this site</a> and is basically set and called as follows:</p>
<pre><code>this.tooltip = function(){....}
$(document).ready(function(){
tooltip();
});
</code></pre>
<p>I don't want to unbind the hover or mouseover events since they are also tied to other effects. I have tried to disable without success as follows (at the bottom of the page):</p>
<pre><code> $(document).ready(function(){
this.tooltip = function() {}
})
</code></pre>
<p>and</p>
<pre><code> $(document).ready(function(){
function tooltip() {}
})
</code></pre>
<p>Am I missing something?</p>
|
javascript jquery
|
[3, 5]
|
1,353,808 | 1,353,809 |
How to test if users has made any changes to a form if they haven't saved it
|
<p>Basically the same functionality as stackoverflow when posting a question, if you start writing a post then try to reload the page. You get a javascript alert box warning message. </p>
<p>I understand how to check if the form has been changed, although how do I do the next step. </p>
<p>I.E: How to I check this when leaving the page, on here you get "This page is asking you to confirm that you want to leave - data you have entered may not be saved."? </p>
<p>EDIT: found correct answer here to another question <a href="http://stackoverflow.com/a/2366024/560287">http://stackoverflow.com/a/2366024/560287</a></p>
|
javascript jquery
|
[3, 5]
|
5,682,012 | 5,682,013 |
C++ setw() for Java
|
<p>Is there a function in Java like <code>setw(int)</code> in C++?<br>
It is needed in matrix output.</p>
|
java c++
|
[1, 6]
|
4,642,907 | 4,642,908 |
How to redirect by using jquery?
|
<p>I have on log in page if user enters both user name and password same then i have to forward user to next page how is it possible. </p>
<p>how do i do this?</p>
|
javascript jquery
|
[3, 5]
|
3,549,371 | 3,549,372 |
Resize photo taken by camera to fit screen
|
<p>I'm attempting to make an app that displays the photo after its taken.
The issue is I can't seem to scale the bitmap with the same aspect ratio to the screen.</p>
<p>I've tried imageView.setScaleType(ScaleType.FIT_XY); but it doesn't keep the ratio.
Nor does any of the Android:Scale.</p>
<p>What can I do?</p>
|
java android
|
[1, 4]
|
4,030,850 | 4,030,851 |
Can only access jQuery.ajax not $.ajax
|
<p>I have a strange problem. I have loaded jquery-min javascript in my file. But I can only access jQuery.ajax not $.ajax. $.ajax is said to be undefined. Why is that?</p>
|
javascript jquery
|
[3, 5]
|
2,177,985 | 2,177,986 |
Remove divs after 20 using jQuery
|
<p>Divs of class=message are generated using a post which pulls data and puts it in the page. Now, I want to remove the lower divs after it reaches 20</p>
<pre><code><div class="message">test</div>
<div class="message">test</div>
<div class="message">test</div>
.
.
.
<div class="message">test</div>
</code></pre>
<p>So i need a sort of function to remove the remaining divs (from bottom) as i am adding to the top.</p>
<p>Also when a div appears, I want it to sort of fade in. How do i achieve that? i receive data in chunks so its something like </p>
<pre><code>html = '<div class="messsage">1</div><div class="message">2</div>';
</code></pre>
<p>Now I tried this but its really not fading in. i would like it to glow yellow and get back to normal (bonus)</p>
<pre><code>$("#data").prepend(html).fadeIn(2000);
</code></pre>
<p>Thank you for your time.</p>
|
javascript jquery
|
[3, 5]
|
91,899 | 91,900 |
How to open a pop-up window
|
<p>I am working on a donations website. The particular web page works by allowing the user to enter a monetary value in a textbox and clicking on the button 'Donate Now' to perform the transaction.</p>
<p>What I would like to do is to bring up a pop-up window with an error message if the user enters an invalid value in the textbox. How can this be done?</p>
|
c# asp.net
|
[0, 9]
|
435,601 | 435,602 |
How do I assign sequential values over a jQuery collection?
|
<p>I feel like a bonehead: I want to assign <code>index=i</code> to each LI I have selected, with i incrementing. It appears to assign them all at once though, and they all get <code>index=1</code>. Thoughts?</p>
<pre><code>$("#window ul li").each(function(){
var i = 1;
$(this).attr("index", i);
i++;
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
288,840 | 288,841 |
randomize display order for controls in asp.net
|
<p>I would like to know how I can randomize the order in which some controls are displayed.
Basically, I have 5 hyperlinks, and I want on each load the order in which they are displayed to be randomized.
Which way I can accomplish that?
Thanks, Laziale</p>
|
c# asp.net
|
[0, 9]
|
5,411,025 | 5,411,026 |
Email messages going to spam folder
|
<p>I have created a community portal, in which user creates his/her account. After successfull registration a confirmation mail is send on registered email address. </p>
<p>I am using the following code to send the mail -</p>
<pre><code>private void SendMail(string recvr, string recvrName, string verCode, int NewUserID)
{
try
{
string emailID = ConfigurationManager.AppSettings["WebMasterMail"];
string mailPass = ConfigurationManager.AppSettings["pass"];
string mailer = ConfigurationManager.AppSettings["mailer"];
MailMessage msg = new MailMessage();
MailAddress addrFrom = new MailAddress(emailID, "Panbeli.in.... Bari community portal");
MailAddress addrTo = new MailAddress(recvr, recvrName);
msg.To.Add(addrTo);
msg.From = addrFrom;
msg.Subject = "You have registered sucessfully on PanBeli.in.";
msg.Priority = MailPriority.High;
msg.Body = RegisterMessageBody(recvrName, verCode,NewUserID);
msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient(mailer);
smtp.Credentials = new System.Net.NetworkCredential(emailID, mailPass);
smtp.Send(msg);
}
catch (Exception Ex) { }
}
</code></pre>
<p>While testing we found that all the confirmation mails are going to SPAM folder instead of Inbox.</p>
<p>Is there anything wrong with the code or is there anything related to security.</p>
<p>Can anybody suggest solution to this problem.</p>
<p>Thanks for sharing your time.</p>
|
c# asp.net
|
[0, 9]
|
1,223,217 | 1,223,218 |
on selecting on li previous should not be selected?
|
<pre><code><li id="left-nav-li_1" value="foo">
<a href="javascript:void(0)"><p class="text-email" id="p_1">foo</p>
<input type="text" id="edit-emailer_foo" class="add-email hide" value="foo" /></a>
</li>
</code></pre>
<p>There is number of similar li where id changes by appending number after _. On click p tag shold be hide and input tag should be show class. When I click other li the previous selected
input should have hide class and p tag should have show class.</p>
<pre><code>$('input[id^="edit-emailer_"]').each(function() { $(this).addClass('hide'); });
$('input[id^="edit-emailer_"]').each(function() { $(this).removeClass('show'); });
</code></pre>
<p>I am trying but it is not working.</p>
|
javascript jquery
|
[3, 5]
|
1,481,405 | 1,481,406 |
pass php array to javascript function
|
<p>i am trying to get php array variable into javascript variable.</p>
<p>this is my code:</p>
<p>
</p>
<pre><code><script type="text/javascript">
function drawChart(row,day,week,month,date)
{
// some code...
}
</script>
</head>
<body>
<?php
for($counter = 0; $counter<count($au); $counter++)
{
switch($au[$counter]->id)
{
case pageID.'/insights/page_active_users/day':
$day[] = $au[$counter]->value;
break;
case pageID.'/insights/page_active_users/week':
$week[] = $au[$counter]->value;
break;
case pageID.'/insights/page_active_users/month':
$month[] = $au[$counter]->value;
break;
}
}
?>
<script>
drawChart(600/50, '<?php echo $day; ?>', '<?php echo $week; ?>', '<?php echo $month; ?>', '<?php echo createDatesArray(cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 day')), date('Y',strtotime('-1 day')))); ?>');
</script>
</body>
</html>
</code></pre>
<p>i can't get value of the php array.</p>
<p>plz anyone help me.</p>
|
php javascript
|
[2, 3]
|
602,241 | 602,242 |
Using jQuery, hide a textbox if a radio button is selected
|
<p>I have 2 radio buttons, what I want is if a user selects the top radio button then hide a textbox.</p>
<p>Not sure how to bind an event to a radio button.</p>
|
javascript jquery
|
[3, 5]
|
2,456,201 | 2,456,202 |
Check different date formats
|
<p>I have function:</p>
<pre><code>sample(date){
//operations, for example add one week (7 days)
return date;
}
var one = new Date('2012-07-16');
var two = new Date('07/16/2012');
var new = sample(one); // or sample(two)
var day = new.getDate();
var month = new.getMonth();
var year = new.gerYear();
alert(day + month + year);
</code></pre>
<p>and now i would like show this date, but how can i check format this date?
For example:</p>
<pre><code>alert(sample(one));
</code></pre>
<p>should show me date with format <strong>2012-07-23</strong>
and if </p>
<pre><code>alert(sample(one));
</code></pre>
<p>should show me <strong>07/23/2012</strong></p>
<p>but how can i check format current date? is this possible?</p>
|
javascript jquery
|
[3, 5]
|
1,136,361 | 1,136,362 |
Cookie missing when called in a class
|
<p>Good day..! I have some issue getting the value of my cookie when called in a class.. </p>
<p>here's my code in my default.aspx.. I can retrieve the value on the when inside the aspx page</p>
<pre><code> HttpCookie myCookie = new HttpCookie("SAMPLE");
myCookie["value"] = HttpUtility.UrlEncode(value);
myCookie.Expires = DateTime.Now.AddDays(1d);
Response.Cookies.Add(myCookie);
if (Request.Cookies["SAMPLE"] != null)
{
string userSettings;
if (Request.Cookies["SAMPLE"]["value"] != null)
{ userSettings = Request.Cookies["SAMPLE"]["value"]; }
}
</code></pre>
<p>But when i called the cookie inside a class using this code HttpUtility.UrlDecode(HttpContext.Current.Request.Cookies["SAMPLE"]["value"]) it doesn't have any value.. Any idea..? Hope to hear from you soon.. </p>
<p>Regards, </p>
<p>Link</p>
|
c# asp.net
|
[0, 9]
|
3,550,288 | 3,550,289 |
TypeError is Null?
|
<p>This is an error in Firebug I keep seeing.</p>
<pre><code>TypeError: $("#gallery-nav-button") is null
[Break On This Error]
$('#gallery-nav-button').addClass('animated fadeOutRightBig');
</code></pre>
<p>Here is my code: </p>
<p><em><strong>JS</em></strong></p>
<pre><code>$(function() {
$("#close-gallery-nav-button").click(function() {
$('#gallery-nav-button').addClass('animated fadeOutRightBig');
});
});
</code></pre>
<p><em><strong>HTML</em></strong></p>
<pre><code><div id="gallery-nav-button">
<h4 id="close-gallery-nav-button">X</h4>
<h3 class="text-center small-text"><a class="inline text-center small-text" href="#gallery-nav-instruct">Click Here for Gallery <br /> Navigation Instructions.</a></h3>
</div>
</code></pre>
<p><em><strong>CSS</em></strong></p>
<pre><code>#close-gallery-nav-button{
text-indent:-9999px;
width:20px;
height:20px;
position:absolute;
top:-20px;
background:url(/images/controls.png) no-repeat 0 0;
}
#close-gallery-nav-button{background-position:-50px 0px; right:0;}
#close-gallery-nav-button:hover{background-position:-50px -25px;}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,370,485 | 3,370,486 |
jquery, if hovering over an element injects something into the DOM, can I still reference it?
|
<p>if hovering over an element injects something into the DOM, can I still reference it?</p>
<p>Or do I have to use the live plugin?</p>
<p>i' using jqeury 1.3.2</p>
<p>i.e. can I do <code>$("#someItem").attr("src", "htt...")</code>; on it?</p>
<p>I am trying to do it, but I think <strong>its not working b/c its a newly added item to the DOM.</strong></p>
|
javascript jquery
|
[3, 5]
|
4,346,810 | 4,346,811 |
Why does jQuery not register my <a> click?
|
<p>In the example below</p>
<pre><code><html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<a href="#">test</a>
<button id="btn-add">Add</button>
<div id="placeholder">
</div>
<script type="text/javascript">
$(document).ready(function () {
$('a').on('click', function () {
alert('clicked');
});
$("#btn-add").on("click", function () {
$('#placeholder').prepend('<a href=\'#\'>blah2</a>');
});
});
</script>
</body>
</html>
</code></pre>
<p>If you click on 'Add' then 'blah2' nothing happens even though I am trying to alert on any anchor click. As a check if you click on 'test'you get the popup</p>
|
javascript jquery
|
[3, 5]
|
1,547,548 | 1,547,549 |
bridge language between PHP and Objective-C
|
<p>i want to show php page in iphone application. I have also used webview to display page but not able to know how to apply slide effect on page please help me...</p>
<p>i am working with one application in which i m working with php listing page and then i want to show detail page but how to show slide transition effect.</p>
|
php iphone
|
[2, 8]
|
3,218,463 | 3,218,464 |
Adding "pause" to the Image Slider
|
<p>Best way to add pause button in this jQuery image slider? I want to add Pause on clicking the orange square shapes button which is working as a timer in my image slider.</p>
<p>Here is the link with what I tried. </p>
<p><a href="http://jsfiddle.net/QNZDX/4/" rel="nofollow">http://jsfiddle.net/QNZDX/4/</a> </p>
<p>For better understanding I am adding the reference site, Here we can find the pause functionality as clicking the orange square shapes.
<a href="https://store.sap.com/sap/cpa/repository/store/sapstore/US/default.html" rel="nofollow">https://store.sap.com/sap/cpa/repository/store/sapstore/US/default.html</a></p>
<p>This reference site works only in Mozilla Firefox.</p>
|
javascript jquery
|
[3, 5]
|
3,082,619 | 3,082,620 |
How to maintain ajax results on Back
|
<p>I have a page in which I have 3 tabs. a 3-step wizard.
on the last step - I have an AJAX call to fetch data.
once clicked on each of the items in this data, I am redirecting the user to another page.</p>
<p>I want to maintain the wizard status (including ajax results) when the user presses BACK on the browser.</p>
<p>What is the best method to achieve this? using #step on the URL????</p>
<p>Thanks</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
4,842,111 | 4,842,112 |
How do I find a table of certain class with jquery selectors
|
<p>How do I select just a table with class d with jquery selectors. For some reason this code won't work properly...</p>
<pre><code>var dTableTags = $(".d table");
</code></pre>
<p>example table would be...</p>
<pre><code><table id="thetable" class="d">
<thead>
<tr><th>Column 1 header</th><th>Column 2 header</th></tr>
</thead>
<tbody>
<tr><td>Column 1 data</td><td>Column 2 data</td></tr>
</tbody>
</table>
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,736,674 | 3,736,675 |
Application crashes after adding a RadioGroup in Mark L. Murphy's "A Fancier Form" tutorial
|
<p>I'm going through the "A Fancier Form" chapter in Mark Murphy's "Android Tutorials" book (1st edition) and I can't get past step#2: Add a RadioGroup. The application compiles and installs on emulator and phone with no errors but when I try to run it I get the:</p>
<p>Sorry!
The application LunchList
(process apt.tutorial) has
stopped unexpectedly. Please try
again.</p>
<p>This is the code from the book (the only code that changes in that section is the RadioGroup part):</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="1">
<TableRow>
<TextView android:text="Name:" />
<EditText android:id="@+id/name" />
</TableRow>
<TableRow>
<TextView android:text="Address:" />
<EditText android:id="@+id/addr" />
</TableRow>
<TableRow>
<TextView android:text="Type:" />
<RadioGroup android:id="@+id/types">
<RadioButton android:id="@+id/take_out" android:text="Take-Out" />
<RadioButton android:id="@+id/sit_down" android:text="Sit-Down" />
<RadioButton android:id="@+id/delivery" android:text="Delivery" />
</RadioGroup>
</TableRow>
<Button android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Save" />
</TableLayout>
</code></pre>
<p>Help please?</p>
<p>Thanks,
~Mike </p>
|
java android
|
[1, 4]
|
4,567,432 | 4,567,433 |
How can I display a string as a combination of password chars and original form in asp.net Textbox control ?
|
<p>I have a Textbox control in which user can add/edit/delete values through this control.It only allows 10 digit numeric value. The first 5 digits should be shown as password chars and last 5 digit should be shown as its original form. (Eg: The value 1234567890 should be shown as <em>*</em>**67890).</p>
<p>How can I implement this in asp.net Textbox control? </p>
|
c# asp.net
|
[0, 9]
|
4,357,785 | 4,357,786 |
how to use jquery auto-complete to load from mysql database
|
<p>What I want to do is to be able to load data from the database which will show up as an auto-complete text below the textbox.
I'm using the ajax function in jquery to load data from the database. My problem now is how to put that data in the auto-suggest box.</p>
<pre><code><html>
<head>
<script src="js/jq.js"></script>
<link rel="stylesheet" href="css/otocomplete.css" type="text/css" />
<link rel="stylesheet" href="css/otocomplete.css" type="text/css" />
<script type="text/javascript" src="js/bigiframe.js"></script>
<script type="text/javascript" src="js/otocomplete.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#example').keyup(function(){
var inpval = $('#example').val();
$.ajax({
type: 'POST',
data: ({p : inpval}),
url: 'query.php',
success: function(data) {
$("#yoh").autocomplete(data);
}
});
});
});
</script>
</head>
<body>
text: <input id="example" />
<div id="yoh"></div>
</body>
</html>
</code></pre>
|
php jquery
|
[2, 5]
|
1,432,471 | 1,432,472 |
js file is loading from cached temporary internet files instead of redownloading from server
|
<p>I have used a external js file for a upload operation in my page.. once the file get loaded in temporary folder, it gets loaded from there even if new changes are made the old version that exist in temp folder gets loaded... i have written</p>
<p><code>Response.Cache.SetCacheability(HttpCacheability.NoCache);</code> </p>
<p>on my page But it still loads the js file in cache. When i cleared the temporary files manually it works fine...But i cannot ask my client to clear temp folder,,,
Is there any solution to load js file not from the cache, ie reload every time page is loaded...</p>
|
asp.net jquery
|
[9, 5]
|
3,357,443 | 3,357,444 |
duplicate html element
|
<p>anyone knows of any jquery plugin that handles duplication of some random html elements? I'm looking for a way to dynamically add identical rows to a form.
I know its not hard to make, but i don't really want to reinvent the wheel here.</p>
|
javascript jquery
|
[3, 5]
|
2,618,786 | 2,618,787 |
How do I put a time delay into my script?
|
<p>I want a 3 second delay in my script</p>
<p>However how can I do this, I don't know!</p>
<p>My script: </p>
<pre><code><script type="text/javascript">
var baslik = document.title;
$(document).ready(function () {
document.title = '(Welcome)' + baslik; // After 3 seconds
document.title = '(What can i do for you ?)' + baslik; // After 3 seconds
document.title = '(Thank u for viewing to me)' + baslik; // After 3 seconds
document.title = baslik;
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
91,781 | 91,782 |
how to create a cross-browser compatible "spotlight" effect?
|
<p>i found a spotlight plugin for Jquery, but it is not functional in IE.</p>
<p>so is there a way to make the rest of the background fade to a dark color while selected or element of focus remains the same ?</p>
|
javascript jquery
|
[3, 5]
|
695,824 | 695,825 |
What's the equivalent of passthru and system for python?
|
<p>Actually I'm rookie in python , as you know we have 2 methods in PHP <code>passthru</code> and <code>system</code>
What's the equivalent of passthru and system for python?</p>
|
php python
|
[2, 7]
|
1,062,704 | 1,062,705 |
Android onTouchListener on LinearLayout
|
<p>I have a linear layout with few child components in it. I have onTouchListener on the linearlayout. I want onTouch event to trigger when I touch child components of the linear layout too.</p>
|
java android
|
[1, 4]
|
4,472,554 | 4,472,555 |
How can I restrict page access by IP address range?
|
<p>I have a password change page in my website to which I want to restrict access to an IP range, such as 10.0.0.0 - 10.255.255.255 (10/8 prefix).</p>
<p>When a user enters the page, it will check if the user is in this IP range or not. If the user is in the range, it shows a welcome message; if not, then it will redirect the user to a login page.</p>
|
c# asp.net
|
[0, 9]
|
979,802 | 979,803 |
Easiest way to persist data on a PHP page
|
<p>I a web application that I am developing (being developed in PHP) when a user posts any request for service the user has to fill in a very length form.</p>
<p>Once user fills in the form and submits it another page (confirmation page) is loaded in which all values filled in by user are show. I must point out that at this stage the data is not saved to MySQL yet. Now on this page the user can either save the service request or go back. </p>
<p>My problem starts here. When the user <strong>goes back</strong>. All <strong>data</strong> filled in is <strong>lost</strong>. BTW User tend to use Browsers Back button instead of the back button provided on the confirmation page.</p>
<p>How can is persist data filled in by user so that user can edit/make changes to data and again submit changed data.</p>
|
php javascript
|
[2, 3]
|
3,146,664 | 3,146,665 |
Rendering different event types in c#
|
<p>Ok so i have 3 different classes (types of rl events)
Each event has different properties</p>
<p>Example is Swimming class that has temperature, PH value, swimming length and so on
next event is Cycling class that has Biketype, tyre width and so on</p>
<p>Now the events all have a date, and i want to render them sorted by date in a list.</p>
<p>Now each class has to be rendered differently according to the design, so im a little confused as to how i should solve this?</p>
<p>Was thinking about creating a list of objects and then passing ALL events of all types into the list
sort by date,,
then iterate through the list and based on what type of object i get, bind it to the usercontrol and render it..</p>
<p>is this is the best way to do this? or is there a simpler approach?</p>
|
c# asp.net
|
[0, 9]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.