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,171,432 | 2,171,433 |
jQuery help wanted ...
|
<p>I have a site there is a pop up window in right. and have a button. My query is , if i click that button then the pop up windows will come to left and if i again click that button then the pop up window will go back it's previous place i mean right. it's like slideToggle . I have try something . but it comes only left but it's not going back . How to do it ? </p>
<pre><code><script>
function goto(){
//animate to the div id.
$(".pop_up").animate({"left": -($(id).position().left)});
}
$(document).ready(function(){
$(".red_sec").click(function(){
$(".pop_up").animate({left:'-560px'});
});
});
</script>
</code></pre>
<p>Sorry for my bad English skill . </p>
<p>Thanks </p>
|
javascript jquery
|
[3, 5]
|
2,453,642 | 2,453,643 |
Pop up enabling
|
<p>I have a web app in ASP.NET, when you a click a link, am opening a pop up window in a new page, while i do that, if pop ups are disabled in end user computer, is there a way to detect that & enable pop up blockers? so that the new window can automatically open.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,012,903 | 4,012,904 |
How to: Swap options with jQuery using Address
|
<p>I am looking for a way to swap to option values between them.
I made a simple fiddle which would swap inputs but when I change it to select options it doesn't seem to work.</p>
<p>I'm using the method of Address. Eg:</p>
<pre><code>var prevAddress = $(this).parent().prev('.forms').find('.first option');
var nextAddress = $(this).parent().next('.forms').find('.second option');
var tmp = prevAddress.val();
prevAddress.val(nextAddress.val());
nextAddress.val(tmp);
</code></pre>
<p>Here's the fiddle: <a href="http://jsfiddle.net/rfe8K/" rel="nofollow">http://jsfiddle.net/rfe8K/</a></p>
<p>Thanks alot</p>
|
javascript jquery
|
[3, 5]
|
3,012,706 | 3,012,707 |
On button click, select a sibling element with JQuery
|
<p>I have this code:</p>
<pre><code><div class="item">
<div class="hidden">44</div>
<input type="submit" id="btnAddCommentForAnswer" value="Add Comment" />
<script type="text/javascript">
$(document).ready(function () {
$('#btnAddCommentForAnswer').click(function () {
alert(XXX);
});
});
</script>
</div>
<div class="item">
<div class="hidden">12</div>
<input type="submit" id="btnAddCommentForAnswer" value="Add Comment" />
<script type="text/javascript">
$(document).ready(function () {
$('#btnAddCommentForAnswer').click(function () {
alert(XXX)
});
});
</script>
</div>
</code></pre>
<p>what code should I put at XXX to get the content of the div with class=hidden when i press the button at the same div with class=item?
<br />
If you click the first button you should get 44, and for clicking the second button you get 12.</p>
|
javascript jquery
|
[3, 5]
|
3,122,062 | 3,122,063 |
JQuery html function on a td
|
<p>I am trying to place some html within a td that has an id but this doesn't seem to work. Can JQuery not put html in a td by using its id as a selector??</p>
<p>I do this:</p>
<pre><code>$('#total_match').html("<b>Test</b>");
</code></pre>
<p>Here is the td:</p>
<pre><code><td id="total_match"></td>
</code></pre>
<p>No errors occur and nothing appears in the TD - I view the source to confirm.</p>
<p>I appreciate any help.</p>
|
javascript jquery
|
[3, 5]
|
5,514,459 | 5,514,460 |
How to add alphanumeric check to jQuery validation plugin?
|
<p>This exact question was asked here:</p>
<p><a href="http://stackoverflow.com/questions/1053618/using-the-jquery-validation-plugin-how-can-i-add-a-regex-validation-on-a-textbox">using the jquery validation plugin, how can I add a regex validation on a textbox?</a></p>
<p>But unfortunately the solution posted isn't working for me. I am using the very popular jquery validation plugin, specifically this version:</p>
<p><a href="http://jquery.bassistance.de/validate/jquery.validate.js" rel="nofollow">http://jquery.bassistance.de/validate/jquery.validate.js</a></p>
<p>I tried adding the custom alphanumeric function (from the above stack overflow question) like so:</p>
<pre><code><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="http://jquery.bassistance.de/validate/jquery.validate.js"></script>
<script type="text/javascript">
$(function() {
$.validator.addMethod("loginRegex", function(value, element) {
return this.optional(element) || /^[a-z0-9\-]+$/i.test(value);
}, "Username must contain only letters, numbers, or dashes.");
$("#myForm").validate({
rules: {
"login": {
required: true,
loginRegex: true,
}
},
messages: {
"login": {
required: "You must enter a login name",
loginRegex: "Login format not valid"
}
}
});
});
</script>
<form method="post" id="myForm">
<input type="text" name="login" />
<input type="submit" value="Go" />
</form>
</code></pre>
<p>If you run this code you can see that it only validates for some type of input, it doesn't validate the input through the custom alphanumeric function. How can this be made to work?</p>
|
javascript jquery
|
[3, 5]
|
3,160,553 | 3,160,554 |
$.load() is not working in ie
|
<p>i have the following code;</p>
<pre><code>$("#testbtn").live("click", function(){
$("#targetdiv").load("http://localhost/test/test.php");
});
</code></pre>
<p>but it is not working in ie but working fine in chrome firefox safari etc...</p>
|
php jquery
|
[2, 5]
|
4,980,804 | 4,980,805 |
How to receive Application ID from C2DM?
|
<p>I have completed my application and launched in android market.Now I want to add notification. I registered in C2DM and received a mail.But I am so confused. Please anybody tell me the procedure for receiving Registration ID from C2DM?</p>
|
java php android
|
[1, 2, 4]
|
633,102 | 633,103 |
Is there any possibility how to send an AJAX after close the browser window?
|
<p>Is there any possibility how to send AJAX after close the browser window? </p>
<p>I have a browser game with movement in JavaScript (jQuery) and if I send Ajax after each movement it would be difficult for the server. So I want to send one AJAX when user close the window (or bookmark).
It must be functional in all modern browsers.</p>
<p>Thank you for answers</p>
|
javascript jquery
|
[3, 5]
|
3,542,138 | 3,542,139 |
How To Concatenate JavaScript Value to HTML Input 'name' Field?
|
<p>I have one variable <code>value</code> in my jQuery ready function, and I have one HTML input tag. I want this variable to be concatenated to input tag name field. Please help me.</p>
|
javascript jquery
|
[3, 5]
|
1,339,453 | 1,339,454 |
Add row to the beginning of a table - JavaScript - jQuery
|
<p>What is the best method in jQuery to add an additional row to a table as the first row?</p>
<p>I have a table like this</p>
<pre><code><table id="mytable" cellpadding="0" cellspacing="0">
<tr>
<td>col1</td>
<td>col2</td>
<td>col3</td>
</tr>
<tr>
<td>col1</td>
<td>col2</td>
<td>col3</td>
</tr>
</table>
<button id="but">mybutton</button>
</code></pre>
<p>I want to add a row <strong>as the first row</strong> to the beginning of the table with given default values. How can I accomplish this using JavaScript and jQuery? A fiddle will be helpful.</p>
|
javascript jquery
|
[3, 5]
|
5,606,078 | 5,606,079 |
Inserting a character inside the body of a paragraph
|
<p>If someone enters a very long title/sentence, the text will stretch across the web page.</p>
<p>Is there a way to break the text so it continues on to the next line?</p>
<p>Using overflow hidden will hide the text.</p>
<p>I think I should be using the wbr tag.</p>
<p><strong>Should I use the insert(); method for this?</strong></p>
<p>i.e.</p>
<pre><code>string myText = "111111111111111111111111111111111111111111111111111111111111111111111111";
myText = myText.Insert(80, "<wbr/>");
</code></pre>
<p>Not sure how cross browser the wbr tag is also!</p>
|
c# asp.net
|
[0, 9]
|
3,348,663 | 3,348,664 |
How to disable arrow keys for dropdown/selector element?
|
<p>What is a good jquery/javascript approach to prevent a user from using the up and down arrow keys to select options in a dropdown box (i.e. to force the user to only use the mouse to select menu options)? Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,638,911 | 3,638,912 |
What is the equivalent of header('Refresh: 2, blah.php') in jquery
|
<p>I wonder if there is an equivalent code or any function of jquery that should replace the <code>header('Refresh: 2, blah.php')</code> in php</p>
<p>I tried <code>window.location.href = "blah.php"</code> but doesnt satisfy my needs,..,
I want that after clicking the link it should pause a sometime then redirects,.,.
Is there any way out,.thank you!!!</p>
|
php jquery
|
[2, 5]
|
2,812,388 | 2,812,389 |
Find text when <br> is not in front of <img>
|
<p>I need to find out the content before <code><img></code> tag in my HTML if it does not have <code><br/></code> before it. And if <code><img></code> jas some other content before it then I need to add <code><br/></code> before it.</p>
|
javascript jquery
|
[3, 5]
|
3,580,541 | 3,580,542 |
How do I make javascript file work on any page that inherit from the master page?
|
<p>I am new to asp.net. I have a question, How do I make javascript file work on any page that inherit from the master page? Because i put <code><link type="text/javascript" href="scripts/JScript.js" /></code> in the masterpage and it didn't seem to work?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,310,216 | 1,310,217 |
Android: Displaying a 2-D animation on top of Existing View/Activity
|
<p>I've been banging my head against the wall for a couple hours trying to figure out the best way to overlay an animation on top of a current View. I have a ListView, and I want to display an animation (say a frame-by-frame bomb explosion) on top of the ListView when a user clicks a button.</p>
<p>Can someone point me in the right direction?</p>
|
java android
|
[1, 4]
|
3,195,506 | 3,195,507 |
Force a full screen Activity to remeasure/redraw on resume?
|
<p><strong>Edited to add more details:</strong>
(originally asked nearly two months ago...still haven't found a solution)</p>
<p>I have an activity with a somewhat complicated view. Not complicated in a technical sense...there's just a lot going on. All activities in this particular app are set to FullScreen NoTitleBar, and they're all set to Landscape orientation. I noticed early on in development when the app is hidden and then resumes, there was an infrequent tendency for the layout to slide down vertically as if to make room for the titlebar and statusbar.</p>
<p>Later on in development, the app now calls out to various external intents. I notice now that there is more of a tendency to make this same shift when resuming from an externally handled fired intent (such as creating a "chooser" intent or picking an image). I am able to reproduce it inconsistently using the exact same steps...sometimes it happens sometimes it doesn't. It seems as if there's a race condition in between various phases of measuring and laying out. I assume that one of these steps that the system is doing for me is checking for fullscreen and notitlebar, and making the necessary shift. This is probably happening late in some cases.</p>
<p>I put a bunch of logging, and calls to invalidate(), requestLayout(), etc trying to maybe catch the race condition, but the problem seems external to my layouts. The top() and bottom() values of my root layout are always 0 and the height of my screen, respectively, even when I'm logging this while the issue is occurring.</p>
<p>Is there some other method of the Window, WindowManager or any other system view-related object that I can force a full remeasure, redraw, re-check for current theme/style flags?</p>
|
java android
|
[1, 4]
|
2,657,422 | 2,657,423 |
Javascript Android - plot ECG graph without using 3rd party API's
|
<p>I need to plot an ECG graph using Javascript without using any API's. I will get a response (graph-co-ordinates) from the server and i have to plot a graph. It can be done in Javascript "CANVAS" or "SVG". But i dont know where to start. Give me some guidance for this criteria.</p>
|
java javascript android
|
[1, 3, 4]
|
1,231,401 | 1,231,402 |
How can i raise activate event in Asp.net?Is there any possibility?
|
<p>We have activate event in windows application like that is there any event in asp.net? How can i raise activate like event in Asp.net?Is there any possibility?</p>
|
asp.net javascript
|
[9, 3]
|
5,437,104 | 5,437,105 |
Image gallery with Jquery
|
<p>I am creating a jquery image gallery, I tried a little bit with my script. But its not working fine, so onclick of thumbs images the larger images should open.</p>
<p>this is what I have tried</p>
<p><a href="http://jsfiddle.net/T657N/14/" rel="nofollow">http://jsfiddle.net/T657N/14/</a></p>
|
javascript jquery
|
[3, 5]
|
1,007,791 | 1,007,792 |
HttpBrowserCapabilities not working while using Chrome
|
<p>I am using HttpBrowserCapabilities to check the users browser. But when using chrome to debug i'm getting in objBcp as "AppleMAC-Safari". While using IE it shows correctly as "IE".</p>
<pre><code> System.Web.HttpBrowserCapabilities objBcp= Request.Browser;
if(objBcp.Browser=="Chrome")
{}
</code></pre>
<p>Is there other extension for Chrome?</p>
|
c# asp.net
|
[0, 9]
|
5,887,450 | 5,887,451 |
jQuery problem with multiple radio selects
|
<p>I'm trying to validate a form that contains several different radio buttons. A few radio buttons in the form have the same classname 'video_type'. </p>
<p>In the jQuery validation script, after the form is submitted I want to check if any of the radio buttons with the classname 'video_type' have been selected. If the user has selected <strong>at least one</strong> radio button with the classname 'video_type' and the value as 1, it should return true. Otherwise it should return false.</p>
<p>At the moment I'm using this:</p>
<p><strong>HTML:</strong></p>
<pre><code><input type="radio" name="video_option_1" class="video_option" value="1">Yes
<input type="radio" name="video_option_1" class="video_option" value="0">No
<input type="radio" name="video_option_2" class="video_option" value="1">Yes
<input type="radio" name="video_option_2" class="video_option" value="0">No
</code></pre>
<p><strong>jQuery:</strong></p>
<pre><code>$("#completeOrderForm").submit(function(){
if($(".video_type").val() == 0){
$("#showerrors").show().html("Please select a video type.");
return false;
}
});
</code></pre>
<p>But I realise it's incorrect. What do I need to do?</p>
|
javascript jquery
|
[3, 5]
|
5,515,064 | 5,515,065 |
Android multiple activities access one java class
|
<p>I am new to android development and appreciate any help.
I have multiple android activities that have to access one java class. This class has synchronized getters and setters, but I'm having problems making a single instance of this class across the activities. Is there any way to easily do this?</p>
|
java android
|
[1, 4]
|
5,355,930 | 5,355,931 |
When to use anonymous JavaScript functions?
|
<p>I'm trying to understand when to use anonymous JavaScript functions.</p>
<p>State differences between the functions? Explain when you would use each.</p>
<pre><code>var test1 = function(){
$("<div />").html("test1").appendTo(body)
};
function test2() {
$("<div />").html("test2").appendTo(body)
}
</code></pre>
<p>I think the answer is that one uses anonymous function and the other doesn't to replace an empty div element. Does that seem right?</p>
|
javascript jquery
|
[3, 5]
|
146,002 | 146,003 |
IndexOutOfRange/ System.FormatException in Gridview
|
<p>I have a gridview with checkbox in my codebehind page. The functionality is that I need to select the records to be deleted using checkbox and click the delete button. I use the below code to do that.. But when I select the last row it does not get deleted. Instead it throws IndexOutOfRange/ System.FormatException ..</p>
<p>The error is thrown at this line </p>
<pre><code> CheckBox chkb = (CheckBox)gvAll.Rows[i].Cells[0].FindControl("chk");
for (int i = 0; i < count; i++)
{
CheckBox chkb = (CheckBox)gvAll.Rows[i].Cells[0].FindControl("chk");
if (chkb.Checked == true)
{
string name = gvAll.Rows[i].Cells[3].Text;
if (!(name.Equals(System.DBNull.Value)))
{
a.delete(name);
}
}
}
</code></pre>
<p>It's an urgent issue. Please help..</p>
|
c# asp.net
|
[0, 9]
|
3,656,244 | 3,656,245 |
Disabling submit button stops form from being submitted PHP / Javascript
|
<p>I think I got a classic problem but I was not able to find a working solution so far.</p>
<p>I have got a form , the user clicks "Send" and everything works fine using a PRG pattern and doing both client-side and server-side validation.</p>
<p>The problem arises when any user (let's assume he entered valid inputs) clicks more then once quickly before the server script ends its execution...</p>
<p>I do not get any duplicated entry because I took care of that but the browser does not go to my "thanks for submitting page".
Instead it re-submits the same page with the same values and what I get are the custom errors I set to warn the user he is trying to enter details already stored in the database. The details sent in the first place are all in the database but the user has no chance to know that.</p>
<p>I tried to disable the submit button on a submit event using jQuery but in that case the data are not submitted. </p>
<p>HTML</p>
<pre><code> <div id="send-button-container">
<input id="send-emails" type="submit" name="send_emails" value="Send"/>
</div>
</code></pre>
<p>jQuery</p>
<pre><code> $(document).ready(function(){
$('#mail-form').submit(function(){
$('#send-emails').attr('disabled','disabled');
});
});
</code></pre>
<p>I am wondering if I can force a submission using Javascript after disabling the button and also how to deal with UAs with Javascript disabled</p>
<p>Thanks in advance</p>
|
php jquery
|
[2, 5]
|
4,462,376 | 4,462,377 |
Autocomplete text and SQLite
|
<p>There is a text field with Autocomplete text. Autocomplete goes diractly from the database. Autocomplete works correctly. For example, if you type "H", and there is "HONDA" in the database, then you will be prompted with a hint "HONDA". If you enter it in the database and there is nothing there, then nothing appears, and I need phrase "NO RESULTS" to be displayed. I can not figure out how to do it.
Hint works with this code. But there is no verification of results and display of the phrase "NO RESULTS" here, if there is no data to display. Could you be so kind as to explain how to add a check?</p>
<p>MainActivity.java:</p>
<pre><code>SearchCar = (AutoCompleteTextView) findViewById(R.id.SearchCar);
SQLiteCarAssistant = new SQLiteAssistant(MainActivity.this);
SQLiteCarAssistant.openDB();
String[] cars = SQLiteCarAssistant.getAll();
adapter = new ArrayAdapter<String>(this, R.layout.list_item,cars);
SearchCar.setAdapter(adapter);
SearchCar.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable s) {
MainActivity.this.adapter.getFilter().filter(s);
}
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// Abstract Method of TextWatcher Interface.
}
public void onTextChanged(CharSequence s, int start, int before, int count) {
// Abstract Method of TextWatcher Interface.
}
});
</code></pre>
<p>SQLiteAssistant.java: </p>
<pre><code>public String[] getAll(){
Cursor cursor = this.sqliteDBInstance.query(DB_TABLE_NAME, new String[] {NAME}, null, null, null, null, null);
if(cursor.getCount() > 0) {
String[] str = new String[cursor.getCount()];
int i = 0;
while (cursor.moveToNext()){
str[i] = cursor.getString(cursor.getColumnIndex(NAME));
i++
}
return str;
}
else {
return new String[] {};
}
}
</code></pre>
|
java android
|
[1, 4]
|
4,197,595 | 4,197,596 |
Too much redundant javascript code
|
<p>On my asp.net pages i need to control for Dirty controls. I'm not that good in javascript so i found a solution on the internet for doing that by doing so : </p>
<pre><code><script type="text/javascript" language="javascript">
//Demo of completely client side dirty flag.
function setDirty() {
document.body.onbeforeunload = showMessage;
//debugger;
document.getElementById("DirtyLabel").className = "show";
}
function clearDirty() {
document.body.onbeforeunload = "";
document.getElementById("DirtyLabel").className = "hide";
}
function showMessage() {
return ""
}
function setControlChange() {
if (typeof (event.srcElement) != 'undefined') {
event.srcElement.onchange = setDirty;
}
}
document.body.onclick = setControlChange;
document.body.onkeyup = setControlChange;
window.onunload = function (sender, eventArgs) {
if (window.opener != null) {
window.opener.ClearBlocker();
if (window.opener.TempClientReturnFunction != null)
window.opener.TempClientReturnFunction = window.opener.ReturnFunction;
}
}
</script>
</code></pre>
<p>but if i have like 7 pages where i need to control for Dirty Controls, its gonna be too much redundant code. Are there any ways to create some class/library from where i can just call functions or are there maybe even smarter way of doing that? </p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,061,744 | 1,061,745 |
Asp.Net : How to provide email preview for the different email providers
|
<p><p>In my asp.net application I need to show the email preview of created email, like with gmail the email will display some different formatting & with hotmail it will some different formatting...</P></p>
<p>
So, How to provide email preview for the different email providers like gmail, hotmail rediffmail etc...</p>
<p><br/>
Is their any tool with which I can render in my application?</p>
|
c# asp.net
|
[0, 9]
|
1,442,043 | 1,442,044 |
javascript function that run php file who delete table row in database,mysql
|
<p>As title says, I was wondering is there any way to create function in javascript that will delete row in table? To call some php to delete row in table? I need help quickly! Thanks in advanced!</p>
|
php javascript
|
[2, 3]
|
1,677,213 | 1,677,214 |
how to create one simple android game?
|
<p>hi how to create one game in android application i am very new android any one tell me basic things....simple android game now i am using android 2.2 version </p>
|
java android
|
[1, 4]
|
976,155 | 976,156 |
return; return true and return false - what are the differences?
|
<p>In languages like javascript/c++, sometimes there are <code>return false;</code> or <code>return 0;</code> being used. However, in languages like PHP, <code>return;</code> stops the script, and <code>return false;</code> returns the (bool) false and continues the script.</p>
<p>It is confusing me alot lately.</p>
<p>Can anyone explain what are the usages of return?</p>
<p>Ps. My questions is mostly PHP/javascript/jQuery related.</p>
|
php javascript
|
[2, 3]
|
3,515,276 | 3,515,277 |
Jquery operation on DOM element with '.' in ID has no effect
|
<p>e.g. "Live" version here: <a href="http://jsfiddle.net/Ltmbd/5/" rel="nofollow">http://jsfiddle.net/Ltmbd/5/</a></p>
<pre>
<html>
<body>
<select id="some.list" >
<option value="1" >AAA</option>
<option value="2" >BBB</option>
</select>
</body>
</html>
</pre>
<p>and corresponding javascript/jquery:</p>
<pre>
$(function()
{
$("select").each(function()
{
$(this).val("2");
});
});
</pre>
<p>This should select "BBB" in the select list (and if you remove the '.' from the ID "some.list", it works as expected). Note that the <a href="http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F" rel="nofollow">jquery FAQ</a> mentions a related but slightly different problem.</p>
<p>The obvious answer is "don't put a . in your IDs" - however I'm using scaffolded (generated) grails views, so it would be a lot of work to go against this convention.</p>
<p>Using Jquery 1.4.4</p>
|
javascript jquery
|
[3, 5]
|
5,764,647 | 5,764,648 |
jQuery expandable menu
|
<pre><code><div id="firstDiv">
<div id="secondDiv">
<ul id="accordionMenu">
<li><a href="#">menu item</a></li>
<li><a href="#">menu item</a>
<ul>
<li><a href="#">suboption 1</a></li>
<li><a href="#">suboption 2</a></li>
</ul>
</li>
<li><a href="#">menu item</a></li>
<li><a href="#">menu item</a></li>
<li><a href="#">menu item</a></li>
</ul>
</div>
</div>
</code></pre>
<p>How to make it expandable?</p>
<p>I have the following JavaScript code:</p>
<pre><code>$(document).ready(function() {
// Collapse everything but the first menu:
$("#accordionMenu > li > a").not(":first").find("+ ul").slideUp(1);
// Expand or collapse:
$("#accordionMenu > li > a").click(function() {
$(this).find("+ ul").slideToggle("fast");
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
118,818 | 118,819 |
finding value of dynamically created combobox
|
<p>I'm using VS2010,C#, I have a table that its data should be created dynamically (from an SQL server table), I have to add a combobox (with 3 items) to one of the columns, this combo box is also created dynamically, then I give each combo a unique ID, it has autopost back set to off and also enableviewstate and viewstatemode to true and enabled, when users changes values for some combo boxes (each row has a combox), and then presses the submit button, I want to have current state of my comboboxes but their selectedindex is 0 so I cannot use them, what should I do? what are my options? (I find each combobox using FindControl and unique ID of the combobox)</p>
<p>thanks</p>
|
c# asp.net
|
[0, 9]
|
2,184,348 | 2,184,349 |
how to set attributes by jquery and access them by c#
|
<p>I wanna change or add custom attributes in client side by jquery and check them in server side by c#</p>
<p>(for example add a custom attributed named "Loaded=1" to an image HTML element when the image is loaded successfully and in server side I access to this attribute through Image control Attributes Collection)</p>
<p>Is it possible ??</p>
<p>Thanks for your feedbacks</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
3,124,884 | 3,124,885 |
removeAttr() issue
|
<p>Hands up - I can't figure it out what's wrong with it. Is that a bug or a wrong code ?</p>
<pre><code> $(document).ready(function() {
$("#rem_but").click(function(){
var mail_name = $("#mail_rem").val();
var dataString = 'mail_name='+ mail_name;
if (mail_name.val() == "") { $("#rem_but").attr("disabled",true); }
else { $("#rem_but").removeAttr("disabled"); };
}); });
</code></pre>
<p>So when there's no input the button returns false correctly - when there's an input in the field - still the button returns false, hence the removeAttr() doesn't work - why ? Regards.</p>
|
javascript jquery
|
[3, 5]
|
4,760,016 | 4,760,017 |
select loses focus when mouse is over options
|
<p>I am trying to do a hover effect as follows:</p>
<pre><code><div>Some Text</div>
</code></pre>
<p>should be substituted by a <code><select></code> upon mouseover. as soon as the mouse leaves that select it should display either the value previously displayed or the new selected value.</p>
<p>Unfortunately the mouseleave is called when you open the dropdown to select some options and I cannot get it to work. Has anyone had this problem before and knows the solution?</p>
<pre><code><div id="text">Some Text</div>
<select id="selector" style="display: none">
<option value="1" selected="selected">Some Text</option>
<option value="2">Some More</option>
<option value="3">Some Other</option>
</select>
</code></pre>
<p>the jQuery:</p>
<pre><code>$("#text").mouseover(function()
{
$(this).hide();
$("#selector").show();
});
$("#selector").mouseleave(function()
{
$(this).hide();
$("#text").show();
});
</code></pre>
<p>Can anyone let me know how I can make sure that the mouseleave isn't called when somebody is opening the select and hovers over the options?</p>
<p>BTW: It does work when the mousebutton is being pressed during the selection</p>
|
javascript jquery
|
[3, 5]
|
2,439,869 | 2,439,870 |
convert 1,00 to 100 in .Net
|
<p>How do I convert the number "1,00" to "100" in .Net?</p>
<p><strong>Clarification:</strong> I have this code:</p>
<pre><code>VALOR = order.Total.ToString("#0.00");
</code></pre>
<p>It returns the text "1,00" but I need "100" (without comma).</p>
|
c# asp.net
|
[0, 9]
|
1,339,036 | 1,339,037 |
Getting some experience with asp.net
|
<p>Hi I recently learned asp.net webforms and looking to get some experience under my belt using it.I found a website that provided some exercises here:</p>
<p><a href="http://www.wiseowl.co.uk/free-exercises/asp.net-4.0-c-sharp.htm" rel="nofollow">asp.net exercises</a></p>
<p>There weren't that many and I managed to finish them all.Are there any other website or books with similar exercises or tasks that could help me get some experience in using asp.net?</p>
|
c# asp.net
|
[0, 9]
|
5,326,683 | 5,326,684 |
How should I store a small amount of event data and share it between two asp.net pages?
|
<p>I am a PHP developer and have been asked to make some amends to an Asp.Net site. There is a hardcoded table on one page which contains event information (Date, venue etc). The page uses javascript to toggle table row colours based on whether the event has already happened. </p>
<p>I need to add a block on another page which displays 2 upcoming events based on the current date. What is the simplest way to store and share the event data between pages? There is no database available so it needs to be a local file or array etc.</p>
<p>I would appreciate some insight on any good libraries / techniques which would be appropriate. This is for a simple, low-traffic site.</p>
|
c# asp.net
|
[0, 9]
|
1,688,067 | 1,688,068 |
jQuery is it possible to equal js var to php var
|
<p>is it possible to equal js var to php var?</p>
<pre><code><?php $count=0; ?>
<?php $count++; ?>
</code></pre>
<p>...</p>
<pre><code><script>var $total = {<?php $count; ?>};</script>
</code></pre>
<p>soemthing like this</p>
|
php jquery
|
[2, 5]
|
2,220,832 | 2,220,833 |
How to only clear file upload field?
|
<p>Here is the JSfiddle: <a href="http://jsfiddle.net/buyC9/128/" rel="nofollow">http://jsfiddle.net/buyC9/128/</a></p>
<p>I want to clear only the file upload field when pressed on clear.</p>
<p>My HTML:</p>
<pre><code><h1>Upload image:</h1>
<input type="file" name="blog[opload]" id="blog_opload" class="imagec">
<input type="url" size="50" name="blog[url]" id="blog_url" class="imagec">
<div id="preview">
</div>
</code></pre>
<p>My Jquery:</p>
<pre><code>$('input').change(function() {
var el = $(this);
if (this.value === "") {
$('.imagec').prop('disabled', false);
this.disabled = false;
$('#preview').hide();
} else {
$('.imagec').prop('disabled', true);
el.prop('disabled', false);
alert(el.val());
if (el.attr('type') == 'url') {
$('#preview').show().html('<img src=' + '"' + el.val() + '"' + ' />');
}
}
});
function reset_html(id) {
$('.' + id).html( $('.' + id).html() );
}
var imagec_index = 0;
$('input[type=file]').each(function() {
imagec_index++;
$(this).wrap('<div id="imagec_' + imagec_index + '"></div>');
$(this).after('<input type="button" value="Clear" onclick="reset_html(\'imagec_' + imagec_index + '\')" />');
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,478,075 | 3,478,076 |
How to rewrite this Javascript code using Jquery?
|
<pre><code>function SelectDistrict(argument)
{
var sel=document.getElementById("city");
sel.style.display = '';
sel.options.length = 0;
sel.options.add(new Option('Please select a location',''));
var i=1;
var tempInt=parseInt(argument);
if (tempInt%10000==0)
{
var place1=document.getElementById('place1');
place1.innerHTML =county[tempInt];
}
sel.options.add(new Option('all',tempInt));
$('#inputcity').hide();
while (i<=52)
{
tempInt+=100;
if (county[tempInt]==undefined)
{
break;
}
else {
op_cir = new Option(county[tempInt], tempInt);
sel.options.add(op_cir);
}
i++;
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,907,784 | 5,907,785 |
Android: Null Pointer Exception at Text View
|
<p>Here is a code for which I face the Exception</p>
<pre><code>public class SHOSuper extends Activity{
String officerName;
String arr[];
String[] offN;
public void onCreate(Bundle savedInstanceState) {
try{
super.onCreate(savedInstanceState);
final TextView tv;
tv=(TextView)findViewById(R.id.txt1);
System.out.println("I AM NEW ACTIVITY");
arr=Receiver.split(Receiver.orignal, ",");
String value1= arr[1];
System.out.println("Array index " + value1);
String value2=arr[2];
System.out.println("Array 2nd index " + value2);
tv.setText(value1 + " At " + value2);
officerName= arr[5];
offN =new String[officerName.length()];
offN=Receiver.split(officerName, "_");
}
catch(Exception e){
e.printStackTrace();
}
setContentView(R.layout.main);
}
}
</code></pre>
<p>On line <code>tv.setText(value1 + " At " + value2);</code> I face Null pointer Exception like this</p>
<pre><code>**04-12 13:25:18.105: WARN/System.err(527): java.lang.NullPointerException
04-12 13:25:18.265: WARN/System.err(527): at com.sho.SHOSuper.onCreate(SHOSuper.java:24)**
</code></pre>
<p>Can you help me? </p>
|
java android
|
[1, 4]
|
4,086,179 | 4,086,180 |
JQuery - How to keep link selected after the form has been submitted
|
<p>I'm not sure if this is the place to ask this question but here I go.</p>
<p>I was wondering how can I keep a link selected once I submit my form and the data is displayed back to me. I basically want to know how to keep my link highlighted after I submit my form data using JQuery or PHP if possible.</p>
<p>Here is my JQery code.</p>
<pre><code>$(document).ready(function() {
$('.editor, .active-editor').click(function(event){
event.preventDefault();
$(this).siblings().addClass('text-editor').removeClass('active-text-editor');
$(this).addClass('active-editor').removeClass('editor');
});
});
</code></pre>
|
php jquery
|
[2, 5]
|
856,829 | 856,830 |
How to write regular expression that matches only numbers,text,spaces and only two special characters
|
<p>How to write regular expression that matches only numbers,text and only these two special characters # and -
[a-zA-Z0-9#-\s]+ anything else should be rejected</p>
|
c# asp.net
|
[0, 9]
|
205,605 | 205,606 |
Delete does not ask for confirmation
|
<p>When Delete button is clicked, the confirmation box should pop up if the selected node has child nodes. Otherwise, it should not do anything.</p>
<p>Right now, when I click on delete, it just deletes without confirming.</p>
<p>Here is the code:</p>
<pre><code> <asp:Button ID="btn_delete" runat="server" Height="32px"
onclick="btn_delete_Click" OnClientClick = "return childnode();"
Text="Delete" Visible="False" />
<script type="text/javascript">
function childnode() {
var treeViewData = window["<%=nav_tree_items.ClientID%>" + "_Data"];
var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);
if (selectedNode.childNodes.length > 0) {
return confirm("heloo");
}
return false;
}
</script>
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,366,522 | 1,366,523 |
Hide the parent element if the child value matches certain string JQuery
|
<p>In a table I have a <code><td></code> whose html is either <strong>True</strong> or <strong>False</strong>. If the value is <strong>False</strong> then hide the <strong>parent</strong>.</p>
<p>HTML :</p>
<pre><code><tr>
<td class="IsRequired" align="left" valign="middle" style="width:3px;">False</td>
</tr>
</code></pre>
<p>Query :</p>
<pre><code>$('.IsRequired').html("False").parent().hide();
</code></pre>
<p>This hides all the <code><td></code> whose class is "<strong>IsRequired</strong>"</p>
<p>Please advice.</p>
|
javascript jquery
|
[3, 5]
|
3,651,554 | 3,651,555 |
How to get an int[] from a string of integers in javascript / jQuery?
|
<p>I'd like to allow a user to be able to enter a list of IDs into a textarea and allow the IDs to be seperated by whitespace such as a new line as well as by commas.</p>
<p>Then I'd like to convert that into an int[] or throw an error if the string is bad: contains letters, decimals, etc.</p>
<p>But I'm having trouble working it out.</p>
<p>Can anyone give an example of how to do this?</p>
<p>I'd apprecuate any help.</p>
|
javascript jquery
|
[3, 5]
|
1,785,437 | 1,785,438 |
How can I tell when all images on a page are loaded using jQuery?
|
<p>I’m using jQuery for my project. <code>$(function(){...})</code> fires the function “when the DOM is ready” — this doesn’t say that all images are loaded, right?</p>
<p>Is there an event that gets fired when every image is loaded too?</p>
|
javascript jquery
|
[3, 5]
|
5,791,035 | 5,791,036 |
how to find linkbutton id in javascript,
|
<p>my linkbutton is in datalist, this datalist is in panel, this panel is in ajax updatepanel</p>
<p>if linkbutton is not selected then need to alert a message...</p>
<p>how can i achieve this...</p>
|
asp.net javascript
|
[9, 3]
|
609,000 | 609,001 |
JQuery .post method problem with comma in php
|
<p>This Works fine and count returns 2:</p>
<pre><code>$request_ids="166409183417843,1913616994605";
$sent = explode(',',$request_ids);
$count = count($sent);
</code></pre>
<p>But when using Jquery to post to another page sent var returns only the last id and count returns 1.</p>
<p>Page of origion:</p>
<pre><code>$(function(){
$.post("process_ids.php", { request_ids: response.request_ids } );})
</code></pre>
<p>process_ids.php file:</p>
<pre><code>$sent = explode(',', $_POST['request_ids']);
$count = count($sent);
</code></pre>
<p>I also checked with alert() the value of response.request_ids value and it's the same.
Something is totally screwed here, what's wrong? </p>
|
php jquery
|
[2, 5]
|
4,651,964 | 4,651,965 |
Accessing Java API information with Python
|
<p>I'm looking for a very simple way, from Python, to get information about Java classes:</p>
<ul>
<li>name of the class</li>
<li>what it extends and implements</li>
<li>methods with returns types and parameters</li>
<li>attributes with type information</li>
</ul>
<p>Basically all of the information you'd need to generate a javadoc.</p>
<p>Is there an existing Python library that can get me this information either for a .java or .class file, doesn't matter. I'd probably even be okay with something that gets this information from a javadoc.</p>
<p>I know there is javaclass library but that is overkill for what I'm looking for.</p>
<p>Just want to make sure something doesn't already exist like this before I implement my own.</p>
|
java python
|
[1, 7]
|
2,294,758 | 2,294,759 |
how to put javascript variable in php echo
|
<p>I want to add javascrept variable to php echo </p>
<pre><code>arr[i]='<?php echo $winner[javascript variable]; ?>';
</code></pre>
<p>Thanks </p>
|
php javascript
|
[2, 3]
|
4,932,151 | 4,932,152 |
What is the best way to dynamic load connection strings
|
<p>I've seen some other posts in this topic, but thought I would ask the qustion with a description on my problem.</p>
<p>I have a login page wich uses SQL provider for the user login. Then the user should be redirected to the main application. This is a web based CRM application wich we have muliple clients.</p>
<p>My goal is to use a single web site, but multiple SQL databases. And the user that signes in should use a connection string that coresponds to the company he belongs.</p>
<p>Any good ideas?</p>
|
c# asp.net
|
[0, 9]
|
763,056 | 763,057 |
What is the JQuery code for this snippet?
|
<p>I have a parent page that contains a textarea and a link to open a child window. The child window has another textarea and a button. User enters some text in the textarea in the child window and clicks the button, a javascript gets fired that updates the content of the textarea in the parent window with that of the textarea of the child window and closed the child window. </p>
<p>I am currently doing this in javascript and it works fine, but since we will move to jQuery very soon how would one accomplish the same using jQuery. </p>
<pre><code>page1.html
----------
<script type="text/javascript">
function newwin() {
window.open('page2.html','','width=600');
}
</script>
<body>
<textarea id='t1'>
<a href="javascript:void(0)" onclick="newwin();">Click here</a>
</body>
page2.html
----------
<script type="text/javascript">
function updateparent() {
window.opener.document.getElementById('t1').value = document.getElementById('t2').value;
window.close();
}
</script>
<body>
<textarea id='t2'>
<input type="submit" onclick="updateparent();">
</body>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,747,845 | 2,747,846 |
what data type should select to store song url and name in asp c#?
|
<p>I want to upload a mp3 and store song details in audio table and save that song to a folder. and when user click the play button then pass that song url to windows media player to play the song...</p>
<p>i has created a table like:</p>
<pre><code>Column Datatype Allownulls
s_ID (primary) int no
Songurl Varchar(MAX) yes
song name Varchar(50) yes
</code></pre>
<p>i am using MS visual studio 2008 and sql server 2005.</p>
<p>plz suggest me idea and example of code to how to create...
Advace thank you...</p>
|
c# asp.net
|
[0, 9]
|
1,543,256 | 1,543,257 |
Action after a variable number of async events have complete
|
<p>I have a variable number of asynchronous events that I want execute. I want to be able to take some further action after they have ALL completed.
The code snippet below shows my attempt at calling the events using the jquery deferred object.. Could anyone help? (I know the code won't run as is). bubble.transitionTo is the async event. The alert('complete'); is called before the async callbacks have been complete, in fact before they are executed. </p>
<pre><code>var events = [];
for (var i = 0; i < stageBubbles.length; i++) {
var element = stageBubbles[i];
var bubble = new Object();
bubble = this.dataPointLayer.get('#' + element.name)[0];
bubble.setOpacity(0.5);
events.push(bubble.transitionTo({
x: element.x,
y: element.y,
radius: element.radius,
duration: 3,
easing: 'ease-in',
callback: function () {
}
}));
}
$.when.apply(this, events).done(function () { alert('complete'); });
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,846,310 | 4,846,311 |
How to localize a non-embedded javascript file with resource?
|
<p>In my project, there are embedded and non-embedded javascript codes. And i did localization of the embedded codes like below and it works.</p>
<pre><code>CN.DEFAULT_CONFIG = {
strings : {
year: '<%=GetGlobalResourceObject("Resource", "YEAR") %>'
</code></pre>
<p>...
..
.</p>
<p>But, this method does not work for non-embedded javascript codes. How can i do localization for them?</p>
|
javascript asp.net
|
[3, 9]
|
5,285,311 | 5,285,312 |
Change input when div state changes
|
<p>I have this div and this input:</p>
<pre><code><fieldset>
<input/>
<label></label>
<div class="toggle_box">
<div class="switch"></div>
</div>
</fieldset>
</code></pre>
<p>I want the input to be <code>checked</code> when the state of <code><div class="switch"></div></code> changes:</p>
<pre><code><fieldset>
<input checked="checked" />
<label></label>
<div class="toggle_box">
<div class="switch" state="on"></div>
</div>
</fieldset>
</code></pre>
<p>Any idea how I would do that using jQuery?
Thank you :)</p>
|
javascript jquery
|
[3, 5]
|
2,142,142 | 2,142,143 |
Explain Java Notation 'new' with bracketed code
|
<p>I see this notation, a new operator with a class name and then bracketed code, occasionally in Android examples. Can someone explain this? In the example below, <em>PanChangeListener</em> is a class (or maybe an interface) and 'new' creates an instance, but what role does the bracketed code play with respect to the <em>PanChangeListener</em>?</p>
<pre><code>fType pcListener = new PanChangeListener() {
@Override
public void onPan(GeoPoint old, GeoPoint current) {
//TODO
}
});
</code></pre>
<p>Even a name for this syntax would be useful, as I could Google it.</p>
|
java android
|
[1, 4]
|
3,296,827 | 3,296,828 |
Deserializing JSON as a Generic List
|
<p>I have a filter string as shown in the below format:</p>
<pre><code>{"groupOp":"AND","rules":[{"field":"FName","op":"bw","data":"te"}]}
</code></pre>
<p>I need to deserialize this as a Generic list of items.</p>
<p>Can anyone guide me on how to do this?</p>
|
javascript asp.net
|
[3, 9]
|
5,018,956 | 5,018,957 |
how to check/uncheck checkbox by using value in query
|
<p>HTML CODE:</p>
<pre><code><form id="myform">
<input type='checkbox' name='foo[]' value='1'>
<input type='checkbox' name='foo[]' checked='true' value='2' >
<input type='checkbox' name='foo[]' value='3' >
<input type='checkbox' name='foo[]' checked='true' value='4' >
</form>
</code></pre>
<p>JS CODE:</p>
<pre><code>$('input[name=foo]:checked').each(function(i,el){
if(clusterVal == 'ALL')
{
/* what do I have to do here? */
}
array.push($(el).val());
});
</code></pre>
<p>how to check/uncheck checkbox by using value in query</p>
|
javascript jquery
|
[3, 5]
|
1,448,861 | 1,448,862 |
How to check if a plugin's function exists?
|
<p>I have this code:</p>
<pre><code>$(document).ready(function() {
$('.tabs-container').tabs({
tabs: '.bar',
tabs_container: '.foo'
});
});
</code></pre>
<p>Sometimes the tabs plugin script isn't loaded which causes the rest of the page's js to break due to this error in the console:</p>
<pre><code>TypeError: $(...).tabs is not a function
</code></pre>
<p>How can I check to see if tabs function exists before attaching that plugin to an element?</p>
|
javascript jquery
|
[3, 5]
|
3,517,702 | 3,517,703 |
String with CR from .get functions
|
<p>I have a mobile app coming along nicely.
It uses <code>jQuery.get</code> to get the data from the server and formats that data into the page using
<code>jQuery.before</code>. Works a treat.</p>
<p>However when the data from the <code>.get</code> has Carriage Return (CR) the javascript processing falls apart.</p>
<p>How can I get round this.<br>
All I can think of is before sending from the server go through the data and change it to escape the CR and LFs so as the Javascript with not fail.</p>
<p>Open to thoughts.</p>
<p>The server app is in PYTHON and creates the reply to .get using DJANGO sends a file of javascript containg the data emeded at literals. </p>
|
javascript jquery
|
[3, 5]
|
5,914,163 | 5,914,164 |
Javascript matching to see if an email or phone number has been supplied
|
<p>I created a contact form with a text area input only field, which allows the end user to fill out and include a method on how to be contacted. They can choose to enter an email, phone number or both within their message.</p>
<p>I am using jQuery along with javascript to process the form and check if a contact method has been inputted into the message. Here is what I have and it is not getting the job done. Am I doing my matching on the value correctly?</p>
<pre><code>var error = ''
if (value == '' || value == 'Fill out this form and include an email or phone number to be contacted ...') {
error = 'A message along with your contact details are required before sending.';
}
else if (!value.match(/^[a-zA-Z0-9_\.\-]+\@([a-zA-Z0-9\-]+\.)+[a-zA-Z0-9]{2,4}$/) || !value.match(/^[0-9\-\(\)\ ]+$/)) {
error = 'Your message should contain an email address or phone number.';
}
</code></pre>
<p>The first error checking works, the 2nd keeps giving an error even if I do enter an email or phone number or both into the message. Should I be breaking this apart and searching each word individually is that how you do it?</p>
|
javascript jquery
|
[3, 5]
|
2,071,557 | 2,071,558 |
Event which triggers when stylesheets, not only the DOM, are loaded on the page
|
<p>I tried to use the <a href="http://api.jquery.com/ready/" rel="nofollow">http://api.jquery.com/ready/</a> callback for executing a code, which I would like to get started only when the page is fully loaded. However, this triggers when the DOM is loaded, and it can often happen that the stylesheets are not loaded fully.</p>
<p>How can I ensure that a particular code is loaded after DOM and also the stylesheets (or even everything) are loaded? I found some similar questions (like <a href="http://stackoverflow.com/questions/8681440/is-there-event-that-triggers-after-dom-was-loaded-but-before-any-external-assets">this one</a>), but they are not about stylesheet loading, which I am particularly interested in.</p>
<p>Thanks for suggestions.</p>
|
javascript jquery
|
[3, 5]
|
3,619,262 | 3,619,263 |
Is it possible to pass GET or POST variable to external javascript
|
<p>I am wondering whether is it possible to pass any variable to <strong>external</strong> java-script file</p>
<p><strong>For example</strong></p>
<p>I have <strong>this</strong></p>
<pre><code><script type="text/javascript" src="gallery.js"></script>
</code></pre>
<p><strong>I'd like to know</strong> if it's possible to pass an argument to that script file, and if so, how do I read it in the external file? Something like this perhaps:???</p>
<pre><code><script type="text/javascript" src="myscript.js?id=123"></script>
</code></pre>
<p><strong>Thank you</strong></p>
|
javascript jquery
|
[3, 5]
|
303,539 | 303,540 |
jquery ajax is loading entire external html rather than targeted div
|
<p>I have a simple ajax request loading in an external html file but it's pulling in the entire page rather than just the specific div I requested. Does this only work using the .load?</p>
<pre><code> $.ajax({
url: 't3.html #test',
success: function(data) {
$('.incoming').append(data);
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,585,283 | 4,585,284 |
Jquery: please help explain this code because I need to tweak it
|
<p>Can someone explain this to me? I'm trying to understand exactly why drop down lists inside a li tag work okay but when using a form the menu disappears when clicked anywhere. </p>
<pre><code>menu.find('ul li > a').bind('click', function (event) {
event.stopPropagation();
}
</code></pre>
<p>It works in combo with:</p>
<pre><code>$("html").click(function() {
menu.find('.active').removeClass('active');
});
</code></pre>
<p>Full code with menu example: </p>
<p><a href="http://jsfiddle.net/e4yy4/" rel="nofollow">http://jsfiddle.net/e4yy4/</a></p>
|
javascript jquery
|
[3, 5]
|
5,353,193 | 5,353,194 |
How to block a php script from being executed directly from address bar?
|
<p>I have something like this:</p>
<pre><code>$.getJSON('/scripts/commons/theScriptDoTravelBackInTime.php',{
}, function(){
// etc.. etc...
}
});
</code></pre>
<p>Is there a way to stop the php script from being executed simply by a direct call in the
address bar like <a href="http://www.myserver/scripts/commons/theScriptDoTravelBackInTime.php" rel="nofollow">http://www.myserver/scripts/commons/theScriptDoTravelBackInTime.php</a> ?</p>
<p>Maybe outputting an echo "Hey no cheating !"</p>
|
php jquery
|
[2, 5]
|
511,797 | 511,798 |
How to show Image Preview using javascript or jquery in Internet Explorer
|
<p>I'm not able to show the image preview in Internet Explorer.</p>
<p>I'm using FileReader() it working fine all the browsers but not in ie(version 9) and lower versions.</p>
<p>I need the alternative for FileReader to diplay the preview.</p>
<pre><code> $('#FileUpload').live('change', function () {
var result = checkFileType();
alert(result);
var fileList = this.files;
var file = fileList[0];
var r = new FileReader();
r.onload = function () {
var binimage1 = r.result;
// binimage1 = binimage.replace('data:image/jpeg;base64,', '');
//var imag = "<img " + "src='" + "data:image/jpg;base64," + binimage + "' style='width:100px'/>";
// var src = $('#prevImage').attr("src").replace("../../images/nologo.gif", image);
$('#prevImage').attr("src", binimage1);
// $("#partial1").html(imag);
};
r.readAsDataURL(file);
// r.readAsBinaryString(file);
//r.readAsDataURL(file);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,037,289 | 3,037,290 |
How to let the web application sends automatic emails with the link to the last created quiz in the system?
|
<p>I am a new ASP.NET developer. I need to develop the web application to be able to send emails automatically everyday at 7am. I know how to do that using Windows Task Scheduler. All what I need to do is creating a page that contains a script which send emails to all users in the database with link to the last created quiz in the database.
The schema of the tables:</p>
<p><strong>Employee Table: Username, Name, Job, Email</strong></p>
<p><strong>Quiz Table: QuizID, Title, Description</strong></p>
<p><strong>Question Table: QuestionID, Question, Answer1, Answer2, Answer3, CorrectAnswer, QuestionOrder, QuizID.</strong></p>
<p>Now, I could be able to send emails by creating a page that contains the required code for sending</p>
<p>email in the Page_load method, but I don't know how to include the link of last created quiz in this email, in addition, to the emails of the users. How to do that?
My Code-Behind is: </p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
SmtpClient sc = new SmtpClient("mail address");
MailMessage msg = null;
try
{
msg = new MailMessage("[email protected]",
"[email protected]", "Message from PSSP System",
"This email sent by the PSSP system");
sc.Send(msg);
}
catch (Exception ex)
{
throw ex;
}
finally
{
if (msg != null)
{
msg.Dispose();
}
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,355,310 | 5,355,311 |
Grid View Format By Row
|
<p>I'm wondering if it is possible to format a Grid View like the pattern below</p>
<pre><code>Usual Grid View:
Name Address Age Gender <--- Fields Name
Example Example Example Example <--- Values
What I want to look like
"Fields" "Values"
Name Example
Address Example
Age Example
Gender Example
</code></pre>
<p>Any thought will be highly appreciated</p>
|
c# asp.net
|
[0, 9]
|
2,641,382 | 2,641,383 |
Determine the number of elements in a variable
|
<p>If i have a js variable that contains some html tags, how can I determine the number of tags inside the variable? Something like this:</p>
<pre><code>contents = "<p>something</p><p>something else</p>";
$(contents).find("p").length > 2;
</code></pre>
<p>Basically, I'm doing a <code>$(".someClass").each()</code> and iterating through a bunch of elements - when I encounter a <code><p></code> tag I'm putting it in the variable with .html() and now I need to know whats inside the variable to make another decision but my approach above isn't working. </p>
|
javascript jquery
|
[3, 5]
|
3,227,059 | 3,227,060 |
jQuery hide div function
|
<p>Is there any function for hiding 'DIV's or other html elements on right click, some tutorial, script, simple code javascript or jquery. Example: when is click on link or <p> tag or 'li' or 'Ul' or 'a' with right click to hide this element... How to do that?</p>
<p><strong>UPDATE:</strong> Yes, all your solutions is OK but please view this code and why doesn' work:</p>
<pre><code><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script>
$(document).on("mousedown", "div, img, span, a", function () {
if (event.which === 3)
$(this).hide();
});
</script>
<?php
$url = 'http://www.kupime.com/';
$data = file_get_contents($url);
$data = '<head><base href='.$url.' target="_blank" /></head>'.$data;
echo $data;
?>
</code></pre>
<p>And when I click nothing happend. WHY?</p>
|
javascript jquery
|
[3, 5]
|
173,537 | 173,538 |
Updating a data object with a new value
|
<p>I'm trying to update a data object with a new value. I have </p>
<pre><code> if($("#ArticlesHolder").data(event.data.id) != null)
{
$("#ArticlesHolder").data(event.data.id, {name:event.data.name, nr:newNr, price:event.data.price, articlenr:event.data.articlenr});
}
</code></pre>
<p>Now I want to update a existing data object on <code>$("#ArticlesHolder")</code> but I only want to update one value not all values. How do I, for example, only update the <code>nr</code> to <code>nr +1</code>?</p>
|
javascript jquery
|
[3, 5]
|
2,642,058 | 2,642,059 |
jQuery syntax problem
|
<p>This is my simple function and I have</p>
<pre><code><p>This is paragraph 1.</p>
</code></pre>
<p>like this but this function is not working? What is wrong here?</p>
<pre><code>function select(){
$('p')[0].innerHTML="Helooo!!";
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,986,960 | 1,986,961 |
how to select only the background in jQuery
|
<p>I would like to add two events to my items.</p>
<p>One for the "background" of the document: $(document).click(function() {do()});</p>
<p>One for the divs in the document: $("div").click(function() {do2()});</p>
<p>The problem is that when I click on a div, both functions, do and do2 are called.</p>
<p>How can I thus tell to call do() only when I click on no element?</p>
<p>Thanks for your help,</p>
<p>J.</p>
<p><hr /></p>
|
javascript jquery
|
[3, 5]
|
4,244,141 | 4,244,142 |
Onclick not added until after Postback
|
<p>I have the following:</p>
<pre><code><asp:Button id="SubmitButton" Text="Submit" runat="server" OnClientClick="Do();"
OnClick="SubmitButton_Click"/>
</code></pre>
<p>When the page is first rendered, I go to the view source in my browser and see that the <code>onclick="Do();"</code> is not added to my submit button tag. But when I do a post back, and do the view source again, the <code>onclick</code> is added to the submit.</p>
<p>Why would the <code>onclick</code> not be there on the first request?</p>
|
asp.net javascript
|
[9, 3]
|
5,398,316 | 5,398,317 |
How to write a script when successful online Order made ,sends receipt to network printer??
|
<p>Is there a script that when someone places a successful online order, it will send a command to a network printer to print of a receipt of the order?</p>
|
php javascript
|
[2, 3]
|
2,928,238 | 2,928,239 |
Get entry assembly from ASP.NET application
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/4277692/getentryassembly-for-web-applications">GetEntryAssembly for web applications</a> </p>
</blockquote>
<p>There is class library which gets its executing assembly location by calling <code>GetEntryAssembly()</code>. However using that class library in ASP.NET web application that function returns null.</p>
<p>Is it possible to get location of ASP.NET application executable from class library which it calls?</p>
<p><code>GetCallingAssembly()</code> is not suitable since the function is not called directly from web application.</p>
|
c# asp.net
|
[0, 9]
|
2,847,927 | 2,847,928 |
jQuery: There's a more efficient way of doing this, isn't there?
|
<p>I have a plugin which essentially sorts a table on the server side and puts the content back into a container. I have a binding function which adds a click event to the table header cells to call the parent form submission. I feel like this isn't the best way of going about this. Any ideas?</p>
<pre><code>$.fn.myplugin = function() {
return this.each(function() {
var parentform = $(this).parents("form");
var tableidentifier = $(this).attr("id");
var bindclicks = function() {
parentform.find("table#" + tableidentifier + " thead tr th").click(function() {
// Some code to change the sort column- boring!
parentform.submit();
});
}
bindclicks();
parentform.submit(function() {
$.post(parentform.attr("action"), parentform.serialize(), function(res) {
parentform.find("table#" + tableidentifier).replaceWith($(res));
bindclicks();
})
return false;
});
});
}
</code></pre>
<p>I call the <code>bindclicks()</code> function first to set the click handlers up, then since I am doing <code>replaceWith()</code> I am calling it again to re-bind those events. It works, but I'm curious..</p>
|
javascript jquery
|
[3, 5]
|
5,397,501 | 5,397,502 |
Problems submitting dynamic checkbox values
|
<p>I'm working on creating a dynamic list of checklists and came to the below implementation. I have been trying for a week now to get the fnameID text values on the submit button click to send the values into the database. I do not want to use the postback oncheckedchanged.on each check because the checklist is over 1000 rows long and each postback/reload wastes too many resources. I just want to be able to use some method to be able to grab the checked values so I can insert them into the database on the submit button "Click Me!" click.</p>
<p>I googled and found the FindControl method but i still am not able to grab the fnameID values. I either get a undefined or it errors out on me. Any help would be greatly appreciated! Thanks!</p>
<p>aspx:</p>
<pre><code><div id="aGAccountabilityCheckListBox">
"Panel1" runat="server">
<asp:LinkButton ID="LinkButton1" Width="66px" runat="server" onclick="LinkButton1_Click">
Click Me!
</asp:LinkButton>
</code></pre>
<p>code behind:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 50; i++)
{
CheckBox _checkbox = new CheckBox();
_checkbox.ID = "dynamicCheckListBox" + Convert.ToString(i);
Panel1.Controls.Add(_checkbox);
Panel1.Controls.Add("&nbsp; <span id='fnameID" + i + "' >test" + i + "&lt;/span>");
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["cnDatabase"].ToString());
SqlCommand cmd = new SqlCommand("usp_CreateUser", cn);
cmd.CommandType = CommandType.StoredProcedure;
cn.Open();
cmd.ExecuteNonQuery();
cn.Close();
}
</code></pre>
<p>Thanks!</p>
|
c# asp.net
|
[0, 9]
|
573,571 | 573,572 |
jQuery code layout style
|
<p>So I just started learning how to use jQuery and so far I really like it except for the 'standard' code layout in the book I'm reading about it. My question is, is there any problem with using a different style for laying out the code?</p>
<p>Here is what seems to be the standard:</p>
<pre><code>$(document).ready(function() {
$('#clickMe').click(function() {
$('img').fadeIn(1000);
$('#picframe').slideToggle('slow');
});
});
</code></pre>
<p>Here is the style of coding I use in my JS, PHP, ActionScript, etc:</p>
<pre><code>$(document).ready(addEvents)
function addEvents()
{
$('#clickMe').click(fadeInImg)
}
function fadeInImg()
{
$('img').fadeIn(1000);
$('#picframe').slideToggle('slow');
}
</code></pre>
<p>Both of these layouts do the same thing and run without problems but I find the second style MUCH easier to read. Yes, the number of lines are increased but after minimizing the code for production use, the increase in bytes would be negligible. Any thoughts or opinions on this topic?</p>
|
javascript jquery
|
[3, 5]
|
3,193,685 | 3,193,686 |
convert Jquery code to javascript
|
<p>Please can any body convert this small code to javascript?</p>
<pre><code>(function($) {
$(document).ready(function(){
$("p").click(function () {
$("p").filter(function(){
return ($(this).text().search(/(أ|ب|ت|ث|ج|ح|خ|د|ذ|ر|ز|س|ش|ص|ض|ط|ظ|ع|غ|ف|ق|ك|ل|م|ن|ه|و|ي)/) > -1);
}).addClass("rtl");
});
});
})(jQuery);
</code></pre>
<p>I attached this code with jQuery to Google Chrome Extension to fix direction to be RTL when detect Arabic language but it isn't worked when the website contain jQuery version</p>
<p>Please help</p>
|
javascript jquery
|
[3, 5]
|
1,493,823 | 1,493,824 |
Multiple file selection issue with jquery uploader (blueimp) in IE8 & IE9
|
<p>I use the jquery file upload from <a href="https://github.com/blueimp/jQuery-File-Upload" rel="nofollow">blueimp</a>.</p>
<p>I have an issue in IE8 and IE9 ( I hate it :) ) with multiple file selection. </p>
<p>The jquery file upload framework works with HTML5.</p>
<p>A simple HTML code I used:</p>
<pre><code><form>
<input type="file" name="files[]" multiple>
</form>
</code></pre>
<p>and in header I put the following javascripts:</p>
<pre><code><script src="jquery.fileupload.js" type="text/javascript"></script>
<script src="jquery.iframe-transport.js" type="text/javascript"></script>
<!--[if lt IE 10]><script src="html5shiv.js"></script><![endif]-->
</code></pre>
<p>Of course, in Firefox and Chrome works perfectly but not in IE8-IE9 even I put <code>html5shiv.js</code> file.</p>
<p>Do you know any workaround for this ? Or I have to use a framework which supports multiple environments like Flash, Silverlight ?</p>
|
javascript jquery
|
[3, 5]
|
3,461,839 | 3,461,840 |
Ms Word Text to binary
|
<p>I need to convert a Ms Word file's text to binary and store it in database. I have managed to open up the file and TrackRevisions also. How can I save the MS word text in database and retrieve it back and show it in MS Word</p>
|
c# asp.net
|
[0, 9]
|
1,323,792 | 1,323,793 |
Running a Java (.jar) app inside a C# app
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/512124/use-a-jar-java-library-api-in-c">Use a .jar java library API in C#?</a> </p>
</blockquote>
<p>I have a jar file I want to run in a C# application, is there anyway to do this?</p>
|
c# java
|
[0, 1]
|
4,924,966 | 4,924,967 |
ASP.NET - How to get and set MasterPage attribute in page code behind?
|
<p>I have an ASP.NET page that uses a MasterPage. I have a <code>public</code> <code>bool</code> attribute in the MasterPage called <code>ShowChangePassword</code>. I want to set this to true or false in the page that uses this MasterPage.</p>
<p>I have the following code, but I can't set the attribute:</p>
<pre><code> var masterPage = this.Master;
masterPage.ShowChangePassword = false;
</code></pre>
<p>What code do I need to do this?</p>
|
c# asp.net
|
[0, 9]
|
4,160,198 | 4,160,199 |
Why do I have a shared cache when I `jQuery.extend` two objects with the same caching object?
|
<p>I can explain the problem best with this simple code snippet:</p>
<pre><code> var child1 = {name: 'child1'};
var child2 = {name: 'child2'};
var parent = {
_cache: [], // storage var
writeCache: function(key, val)
{
console.log('writing cache::'+this.name);
this._cache[key] = val;
},
readCache: function(key)
{
if(this._cache[key] == undefined)
{
return false;
}
return this._cache[key];
},
};
jQuery.extend(child1, parent);
jQuery.extend(child2, parent);
child1.writeCache('myKey', 123);
console.log(child1.readCache('myKey')); // returns 123 as expected
console.log(child2.readCache('myKey')); // returns 123 unexpectedly (for me at least)
</code></pre>
<p>See this last line:</p>
<pre><code> console.log(child2.readCache('myKey'));
</code></pre>
<p>Now why does it return 123 when we've accessed only child1's writeCache()?</p>
|
javascript jquery
|
[3, 5]
|
5,717,714 | 5,717,715 |
Looking for advice on what approach to take for multiple image swaps
|
<p>I'm working on designing an interactive university campus map and need some direction with what I am looking to do.</p>
<p>Link to page: <a href="http://www.torontoclassfind.com/startpage.html" rel="nofollow">http://www.torontoclassfind.com/startpage.html</a></p>
<p>I want to be able to click on the links in the top menu (only one link is active so far and it loads and Ajax page in lower left div) and have it swap the building image with a different image to show that it's been selected.</p>
<p>I could do that with the following: </p>
<pre><code>$("#buildinglink1").click(function () {
$("#buildingimg1").attr("src","highlightedimage.gif")
})
</code></pre>
<p>Problem is I need to change back the image to it's default image once another menu link is clicked and a new building is selected.</p>
<p>The building images are located at www.torontoclassdfind.com/building/ and the highlighted images are located at www.torontoclassdfind.com/buildingc/ and the names for the buildings are the same in both locations.</p>
<p>I am thinking of using JQuery's .replace element to do this (ex: <a href="http://stackoverflow.com/questions/6955933/jquery-remove-part-of-url">jquery remove part of url</a>) which would remove or add the 'c' to the url, but I'm kind of lost from here.</p>
<p>Any tips? I think I need to make a function that would indicated a link is selected and somehow merge it with the .replace element.</p>
|
javascript jquery
|
[3, 5]
|
2,635,418 | 2,635,419 |
Get minimum and maximum value using linq
|
<p>I have a list that has values as displayed below<br>
Using Linq how can i get the minimum from COL1 and maximum from COL2 for the selected id.</p>
<pre><code>id COL1 COL2
=====================
221 2 14
221 4 56
221 24 16
221 1 34
222 20 14
222 1 12
222 5 34
</code></pre>
<p>Based on the below list it should display id <code>221 1 56</code> and <code>222 1 34</code>
help me out</p>
|
c# asp.net
|
[0, 9]
|
2,825,420 | 2,825,421 |
Facebook link inspector
|
<p>I'm building a website and am looking for a way to implement a certain feature that Facebook has. The feature that am looking for is the link inspector. I am not sure that is what it is called, or what its called for that matter. It's best I give you an example so you know exactly what I am looking for.</p>
<p>When you post a link on Facebook, for example a link to a youtube video (or any other website for that matter), Facebook automatically inspects the page that it leads you and imports information like page title, favicon, and some other images, and then adds them to your post as a way of giving (what i think is) a brief preview of the page to anyone reading that post.</p>
<p>I already have a feature that allows users to share a link (or URLs). What I want is to do something useful with the url, to display something other than just a plain link to a webpage, to give someone viewing a shared link (in the form if a post) some useful insight into the page that the url leads to. </p>
<p>What I'm looking for is a script, or tutorial, or at the very least someone to point me in the right direction, so that it can help me accomplish this (using PHP preferably).
I've tried googling it but I don't know exactly what such a feature would be called and google isn't helpful when you don't exactly know what you're looking for.
I figure someone out there, in this vast knowledge basket called stackoverflow, can help me with this. Can anyone help me?</p>
|
php javascript
|
[2, 3]
|
4,409,851 | 4,409,852 |
Change Attribute Every Second
|
<p>I want an image to change every second. I'm having trouble with setInterval. Could someone post a quick snippet on how to do this</p>
<p>This is what I came up with.</p>
<pre><code>var images = 'images/image_*.png';
for(var i = 1; i <= 5; i++){
function changeImg(){
var path = images.replace('*', i);
$('img').attr('src', path);
}
setInterval('changeImg()', 1000);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,725,177 | 4,725,178 |
CustomValidator not calling javascript
|
<p>I am trying customvalidator control of asp.net but the problem is that it is not calling the javascript function. However it is calling the server side version of the validation method..</p>
<pre><code> <asp:CustomValidator EnableClientScript="true"
ID="RegularExpressionValidatorFixedNames" runat="server" ControlToValidate="TextBoxChapterName"
Text="Name not allowed" Font-Size="XX-Small"
ValidationGroup="Name"
ClientValidationFunction="LQA_Validate"
onservervalidate="RegularExpressionValidatorFixedNames_ServerValidate"> </asp:CustomValidator>
</code></pre>
<p>the javascript function</p>
<pre><code> function LQA_Validate(sender, args) {
var re = /(?! My Ls|My As|My Qs).*/ig;
args.IsValid = re.test(args);
}
</code></pre>
<p>the server side method</p>
<pre><code> protected void RegularExpressionValidatorFixedNames_ServerValidate(object source, ServerValidateEventArgs args)
{
Regex regex = new Regex(@"^(?!My Ls|My Qs|My As).*", RegexOptions.IgnoreCase);
args.IsValid = regex.IsMatch(args.Value);
}
</code></pre>
<p>what can be the problem is this problem because of the regex or I am doing some technical mistake?</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
214,286 | 214,287 |
prevent direct access to jquery post url
|
<p>i've a jquery script which <code>post/get</code> data to .php script. but i wanna prevent direct access to the php script. for example if the user look at the html source code,they will be able to access the php script directly by copying the url from the js file and i dont want that. how do i prevent users from doing that?? i want the user to use it via the html UI. i've google but found no link on this. however, i did notice that some popular websites are able to do that. how should i go about doing this??</p>
|
php jquery
|
[2, 5]
|
3,618,046 | 3,618,047 |
Issue modifying control from static method
|
<p>There are a few questions on here that are similar, but they didn't work for me.</p>
<p>I have a custom drop down list on a page, the page name is <code>WebForm1</code>. On <code>WebForm1</code> I have an assembly reference to it: <code><%@ Register Assembly="GroupDropDownList" Namespace="GroupDropDownList" TagPrefix="cc1" %></code> </p>
<p>I then have a static method like this:</p>
<pre><code> public static void Populate_Country_DDL(System.Web.UI.Page page)
{
GroupDropDownList
.GroupDropDownList ddlCountry =
((GroupDropDownList.GroupDropDownList)page.FindControl("ddlCountry"));
using (DataContext db = new DataContext())
{
var country = db.Countries.OrderBy(x => x.Text);
ddlCountry.DataSource = country; //Error here
</code></pre>
<p>On <code>WebForm1</code> i'm trying to access the static method like this:</p>
<pre><code>Utility.Populate_Country_DDL(this.Page);
</code></pre>
<p>The problem is that I'm getting an "Object reference not set to an instance of an object" error. I put a using statement in my utility class for <code>GroupDropDownList</code></p>
<p><code>GroupDropDownList</code> simply allows me to put option groups inside a drop down list.</p>
<p><strong>Update:</strong> To fix the problem I modified my utility method to take a <code>ContentPlaceHolder</code> instead of <code>Page</code> class, and then in my calling method I found the ContentPlaceHolder within the current pages MasterPage like this:</p>
<pre><code>Utility.Populate_Country_DDL(
(ContentPlaceHolder)this.Master
.FindControl("ContentPlaceHolder1"));
</code></pre>
|
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.