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 |
---|---|---|---|---|---|
3,557,574 | 3,557,575 |
POSTing an image to PHP file
|
<p>I'm trying to POST an image to a PHP file from my android app and am wondering what format (File, Fileoutputstream etc) I have to post it in for it to be recognized as a file and refer to it with $_FILE['filename'] in my php script.</p>
<p>Thanks :)</p>
<p><strong>EDIT:</strong></p>
<p>Sorry I may not have been clear, I'm not looking for the PHP script, I already have that finished accepting the $_FILE['sample'] and doing what I need with it, I'm just not sure the file TYPE that I have to post to the php file (IN JAVA) in order for php to 'see' it as $_FILE</p>
<p>FYI: I am using the loopj asynchronous http request library.</p>
<pre><code>public void add_image_android(final Bitmap image, String party_id, String guest_id)
{
String url = "http://www.mysite.com/urltopost";
/* not sure what to set fOut to for the bitmap to be passed as file */
RequestParams params = new RequestParams();
params.put("file", fOut);
params.put("guest_id", guest_id);
params.put("party_id", party_id);
client.post(url, params, new JsonHttpResponseHandler()
{
@Override
public void onSuccess(JSONObject response)
{
((ResponseListener)_mainContext).add_image_android_response(response.toString());
return;
}
@Override
public void onFailure(Throwable e)
{
fireToast("api error:"+e);
Log.d("api error:",e.toString());
}
});
}
</code></pre>
|
java android
|
[1, 4]
|
5,395,619 | 5,395,620 |
same form data, different actions on two separate submit buttons
|
<p>I have what is essentially a shopping cart that needs to have two separate checkout options. The first of which takes the user away from the site, but form data must be posted.</p>
<p>How can I create two submit buttons that will send the same form data to their own separate page?</p>
|
php javascript
|
[2, 3]
|
5,371,152 | 5,371,153 |
mouseenter mouseleave not working the way I think it should
|
<p>I am relatively new to jQuery, and I seem to be stuck with this mouseenter/mouseleave problem. I would like to setup a menu that "hides" when the page isn't at the top, which seems to be working fine, when it's hidden I would like to make it so when a user hovers over it the class switches and the menu comes back out. However, I don't want this when it gets scrolled back to the top. It works fine when the page first loads (in firefox and chrome) and I haven't scrolled yet, but after scrolling down and back to the top the menu will hide on mouseleave. </p>
<p>Here is a <a href="http://jsfiddle.net/bJquD/" rel="nofollow">jsFiddle</a> of my current code setup.</p>
<p>I've been trying to solve this for awhile now, and have tried a few other methods.</p>
<p>I tried just using hover like this</p>
<pre><code>$("#access").hover(function() {
$(this).removeClass("scroll").addClass("normal");
}, function() {
$(this).removeClass("normal").addClass("scroll");
});
</code></pre>
<p>but that did the same thing as the code I have right now.</p>
<p>Some of the other methods I tried was to pass the b variable to another function, create a seperate div and track it's position to determine whether or not to use the mouseenter/mouseleave, and finally to bind them, but none of this seemed to work as I thought it should.</p>
<p>I can't think of anything else to try, so I am not sure if it's something I'm doing wrong or if this isn't even possible to accomplish like this.</p>
<p>This is my first question I tried to include as much information as I could think of hopefully it's enough information.</p>
|
javascript jquery
|
[3, 5]
|
3,638,516 | 3,638,517 |
check if input is checked using jquery
|
<p>How would I achieve this:</p>
<pre><code>if($(this).parent().find('input:checked') == true)
{$(this).find('.switch').attr('state','on');}
else{$(this).find('.switch').attr('state','off');}
</code></pre>
<p>I know this is wrong but you get the idea I think :). If there is an input that is checked add state on if not state off.</p>
<p>Thanks for your help :)</p>
|
javascript jquery
|
[3, 5]
|
358,600 | 358,601 |
Send an encrypted WindowsIdentity and decrypt it back in asp.net
|
<p>I'm using a windows authentication in my web application and I want to prevent the app from asking the user for credentials, if the user can give its credentials through the URL (encrypted). </p>
<p>I'm not sure whether I need to use windowsIdentity object or not, but if I do:</p>
<p>The windowsIdentity of the user is not always the one I need to use (like using one identity for windows and a second identity foe some tasks). In that case, the authentication fails and a logIn prompt. </p>
<p>I'd like to avoid that by sending the right credentials by creating a windowsIdentity from one place (where the URL is created, with all the right parameters) and use it in my application (I assume in the PageLoad function).</p>
<p>If there is a better solution please feel free to share!</p>
<p>I'd appreciate your help here :-)</p>
<p>Yael.</p>
|
c# asp.net
|
[0, 9]
|
3,983,716 | 3,983,717 |
How can I use jquery to display updates when I detect them in my code behind file?
|
<p>I have an asp.net application and in the UI I have a jquery plugin called growel. When I detect that someone have changed their account (code behind) I need to call the jquery plugin to display but this is on the client side. </p>
<p>But how is this possible, I cant call jquery from code behind code (C#), has anyone a workaround or am i missing something. </p>
|
asp.net jquery
|
[9, 5]
|
5,177,604 | 5,177,605 |
In Gridview Anchor tags are not working in Safari
|
<p>In my project i am using Gridview to display List of Companies, under the Company name i have link to navigate to company details for this link i am using html anchor() tag. It's working good in IE and Chrome but in the Safari it's not navigating. Below is my sample gridview TemplateField.</p>
<pre><code> <asp:TemplateField HeaderText="Company Name" ItemStyle-Width="175px" HeaderStyle-HorizontalAlign="center"
ItemStyle-HorizontalAlign="left" SortExpression="CompanyName">
<ItemTemplate>
<a href="#" title="Edit Company" onclick="LoadCompanyDetails('<%# Eval("CompanyId") %>', '<%# Eval("CompanyName") %>', 0)">
<%# Eval("CompanyName")%></a>
</ItemTemplate>
</asp:TemplateField>
</code></pre>
<p>JavaScript Function:</p>
<pre><code> function LoadCompanyDetails(companyId, companyName, copyFlag) {
$get('hdnCompanyId').value = companyId;
$get('hdnCompanyName').value = companyName;
$get('hdnCopyFlag').value = copyFlag;
$get('btnEdit').click();
}
<a id="btnEdit" href="#" runat="server" onserverclick="btnEdit_ServerClick" style="display: none">
</code></pre>
<p>And out side grid also anchors are not working in safari.</p>
<p>Can any one help me please.</p>
|
javascript asp.net
|
[3, 9]
|
1,908,463 | 1,908,464 |
javascript doesnt work on a link
|
<p>I have got this html:</p>
<pre><code> <a style="display:block; padding:100%; text-decoration: none;" href="http://google.com " class="Jasmin" id="target_site_to_visit">
<span data-app-id="88" class="btn" id="visit_site" style="right:22px; top:65px; padding:5px;z-index: -99999;">VISIT SITE</span>
</a>
</code></pre>
<p>and this jquery:</p>
<pre><code> (function($){
$('#target_site_to_visit').live('click',function(event){
event.preventDefault();
var appName=$('#target_site_to_visit').attr('class');
$.post('db/update_site_viewed.php',{ name:appName }, function(data){
throw new Error("AppName: "+appName);
},'html').error(function(data){
throw new Error("Error: "+data.responseText);
});
document.location.href=$('#target_site_to_visit').attr('href');
}); })(jQuery);
</code></pre>
<p>A problem exists, whenever the button is clicked.. the post method is executed which puts the data into the database. But that only happens when the last line in jquery doesnt exist: document.location.href.. the redirection effects the post somehow..and doesnt probably doesnt give the post method to execute..resulting in no record being inserted to the db (or in other post method doesnt execute).. is it possible that that is the cause..cause the redirection does effect the execution of the post method</p>
|
javascript jquery
|
[3, 5]
|
2,603,237 | 2,603,238 |
how to insert php on jquery/javascript
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/9451212/how-to-insert-php-into-jquery">How to insert PHP into jQuery?</a> </p>
</blockquote>
<p>how to insert php on jquery/javascript ? for example </p>
<p>php </p>
<pre><code>$tot =4;
</code></pre>
<p>javascript</p>
<pre><code>$(function()
if( can put php here? )
eg : if( <?php tot > 4 ?> )
</code></pre>
<p>i want to put the php in 'if statement' ,it`s possible?</p>
|
php jquery
|
[2, 5]
|
476,503 | 476,504 |
asp.net to have console like window on the page
|
<p>I want to move my console application to asp.net website, where I show some action logs. What kind of control should I use for read-only actions logs? Let say on the button click I have a loop and I want to display actions from inside that loop. Should I use multiline textbox? how do I append lines? should I wrap with update panel control? </p>
<p>not sure which controls to pick to replicate console.log view for the website page..</p>
|
c# asp.net
|
[0, 9]
|
532,421 | 532,422 |
Javascript - how do I minimise this code example?
|
<p>a quick question. </p>
<p>At the moment I have 12 links on a page, and 12 corresponding javascript codes that run when a each button is clicked.</p>
<p>I know 100% there must be a method of having 1 javascript code and the link passing a variable to it, so I don't have to have 12 different codes. </p>
<p>EG. Here is a link I'm currently using:</p>
<pre><code><a href="#" id="button1">Anatomical Pathology</a>
</code></pre>
<p>And the Javascript function that is run when the link is clicked loads some html from a php script into a div which is previously defined as level2:</p>
<pre><code>$('#button1').click(function() {
level2.load("http://hello/script.php?url=poodles");
});
</code></pre>
<p>What I'd really like to do is something like this with the link:</p>
<pre><code><a href="#" id="button1" passurl="poodles">Anatomical Pathology</a>
</code></pre>
<p>And the function something like this, so I only need the 1 function not 12:</p>
<pre><code>$('#button1').click(function() {
level2.load("http://hello/script.php?url=' + passurl + '");
});
</code></pre>
<p>How do I go about getting the data from the link tag into javascript, and also how do I add this passed variable into the url I want the javascript to pull data in from?</p>
|
javascript jquery
|
[3, 5]
|
5,535,314 | 5,535,315 |
Reading all values from an ASP.NET datagrid using javascript
|
<p>I have an ASP.NET Datagrid with serveral text boxes and drop down boxes inside it. I want to read all the values in the grid using a javascript function. How do i go about it?</p>
|
asp.net javascript
|
[9, 3]
|
4,468,861 | 4,468,862 |
body html of iframe
|
<p>Hi my code returns all the html of the iframe. I would like just the body html. Any one know how to amend to suit?</p>
<p>Code:</p>
<pre><code>alert( $("#uploaderIframe").contents()[0].documentElement.innerHTML );
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,776,048 | 3,776,049 |
How to see if an element in offscreen
|
<p>I have a list of divs, and everytime I want to go to the next div I press a key. I need to check if that div is offscreen, and if so, I need to move the screen to show that div either using anchors or another method.</p>
<p>What is my best option for doing this?</p>
<p>Just to clairify, offscreen in my case means something that can't be seen right now without scrolling down. So if you are on the StackOverflow Home Page at the top, the last question on the entire page is offscreen.</p>
|
javascript jquery
|
[3, 5]
|
4,414,937 | 4,414,938 |
jQuery :not and :first ordering
|
<p>I am trying to get the first input field in a form that isn't disabled or hidden. I need to be able to exclude radio buttons, selects, and particular IDs.</p>
<p>The following code works perfectly, EXCEPT when a select comes before the text or password field that I want:</p>
<pre><code>$("form :input:visible:enabled:first:not('select')");
</code></pre>
<p>If I exclude the :not('select'), the select is returned as the first input field (correctly so, as :input returns pretty much all form elements). However, when I include the :not('select'), nothing is picked up. Any ideas?</p>
<p>Second part to this question - I assume it is ok to chain :nots so I could have something like:</p>
<pre><code>$("form :input:visible:enabled:first:not('select'):not(#specific_id):not(type[radio])");
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,840,485 | 1,840,486 |
Program command to be called every 5 seconds
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1542280/do-something-every-5-seconds-and-the-code-to-stop-it-jquery">Do something every 5 seconds and the code to stop it. (JQuery)</a> </p>
</blockquote>
<p>I have a gallery that i want to automatically run without me using it.</p>
<p>How can i run a script that calls this every 5 seconds or so on this <a href="http://www.meadmiracle.com/SlidingGalleryDemo1.htm" rel="nofollow">http://www.meadmiracle.com/SlidingGalleryDemo1.htm</a></p>
<p>I need this to be called every 5 seconds or so bsaically so the gallery looks like it automatically scrolls. </p>
<pre><code>$.galleryUtility.slideLeft( )
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,355,883 | 3,355,884 |
Disable Image Save option by right click option
|
<blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/2018802/prevent-saving-image-from-my-site">prevent saving image from my site</a><br>
<a href="http://stackoverflow.com/questions/4514610/transparent-div-to-prevent-right-click-save-as">Transparent <div> to prevent right-click, Save As</a> </p>
</blockquote>
<p>Hi guys is there any way to disable image "save","copy","save as" option by right click user mouse.Because i don't want any one to save my images.There are some scripts are available but they are not valid for all browsers.Any help which should be valid for all type browsers.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,172,372 | 5,172,373 |
Connection pooling with URLConnection?
|
<p>I've just read the android article about http client options. I'd like to start using HttpsURLConnection, how does one enable connection pooling for it? The article says that is possible, but doesn't explain how.</p>
<p><a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html" rel="nofollow">http://android-developers.blogspot.com/2011/09/androids-http-clients.html</a></p>
<p>Ideally the pooling would cut down on response time for my http requests.</p>
<p>Thank you</p>
|
java android
|
[1, 4]
|
5,511,794 | 5,511,795 |
can't convert undefined to object in javascript
|
<p>Update: I have added the fiddle. Please refer <a href="http://jsfiddle.net/fPVaJ/" rel="nofollow">here</a>. use web console for error.</p>
<p>I am writing a code for traveling salesman problem. Here is the code :</p>
<pre><code>var ind =[]; //values selected
var cp =[];
var X;
var Y;
var tour = [];
// no values selected in the starting
for(j=0;j<friends_cnt;j++) {
ind[j] = 0;
}
// distances at i,i infinity
for(i=0;i<friends_cnt;i++) {
distance[i][i] = 9999999999999;
}
var k = 0;
var X = 0;
tour[k] = X;
ind[X] = 1;
var i =1;
while(i<friends_cnt && ind[i] === 0) {
var min = 9999999999999;
// finding minimum of the undeleted values
for(j=0;j<friends_cnt;j++) {
if(ind[j] === 0) {
if(distance[X][j] < min) {
min = distance[X][j];
Y = j; // y is the min city
}
}
}
k = k+1; // counter for the starting city
tour[k] = Y; //city added
ind[Y] = 1;
X = Y;
i++;
}
k = k+1;
tour[k] = tour[1];
for(var q=0;q<k+1;q++) {
console.log(tour[q]);
}
});
});
</code></pre>
<p>now here whenever i run my program, it shows an error </p>
<p><code>TypeError: can't convert undefined to object</code></p>
<p>in the line </p>
<pre><code>var min = 9999999999999;
</code></pre>
<p>My question is that is this because JavaScript cant handle large numbers or something else ?</p>
|
javascript jquery
|
[3, 5]
|
3,283,153 | 3,283,154 |
JavaScript For loop appending 4 times
|
<p>I have a JavaScript program that isn't properly functioning. For some reasons before it appends what it is actually getting from the checked radio box it appends three times with noting in the append except the styling. I'm not sure what I'm doing wrong.</p>
<pre><code>$(document).delegate('#add-owner', 'pageinit', function () {
loadOwners();
$('#add-owner-save').bind('click', function () {
var permission = $('#editing-permissions option:selected').text();
var selection = $("input[type='radio']:checked") || [];
if (selection.length > 0) {
for (var i = 0; i < selection.length; i++) {
console.log($('#label-' + selection[i].id).find('.owner-name').text());
console.log($("input[type='radio']:checked").val());
$('.display-owners').append('<div class="ui-grid-a"><div class="ui-block-a">' + $('#label-' + selection[i].id).find('.owner-name').text() + '</div><div class="ui-block-b" style="text-align:right">' + permission + '</div></div>');
}
$('.display-owners').trigger('create');
}
$('.display-owners').show();
$('#add-owner').dialog('close');
$('input[name=contribute-radio]').attr('checked', false).checkboxradio("refresh");
return false;
});
});
</code></pre>
<p>I think the problem is that I have multiple radio areas on this page. How do I specify that I just want these radio buttons are the ones I want it to checked?</p>
|
javascript jquery
|
[3, 5]
|
4,779,030 | 4,779,031 |
working data from/to PHP and jquery, possible?
|
<p>I'm looking at a <a href="https://www.website.ws/orderflow/index.dhtml?sponsor=gditraffic&src=DSP&last_page=DSP" rel="nofollow">domain registration site</a> that looks like it uses jquery to process users data inputed and to register domains.</p>
<p>What I was wondering is if it's possible for users to be able to fill in data on a form on my website and then when the user is ready to complete payment, be taken to the actually domain registration site where all the data they typed in on my site will be posted to the domain reg site.</p>
<p>So basically, the users fills in a load of info on my site, AND attempts to check for domain availability on my site. Once the users has found the domain they want, they will be redirected over to the actual domain reg site where all their info will be posted.</p>
<p>Now I know if the domain reg site used PHP to process all the stuff, it wouldn't be a problem. But they don't use PHP.</p>
<p>Do you guys reckon this could be possible?</p>
|
php jquery
|
[2, 5]
|
4,972,627 | 4,972,628 |
How can I capture the blur and focus of the entire browser window?
|
<p>I would like to capture the blur and focus of the actual browser window - meaning that change of focus to child frames is not of interest.</p>
<p>Currently I have been using
<code>$(top).focus()</code>
<code>$(top).blur()</code></p>
<p>and
<code>$(window).focus()</code>
<code>$(window).blur()</code></p>
<p>However, these fire when the user changes focus to embedded iframes, which I don't want.</p>
<p>Does anyone know of a way to capture TRUE activation and deactivation of the window?</p>
<p>[EDIT]</p>
<p>Blur and focus events fire when a user moves from a web-page, to the web-page of an embedded iframe.
This is different from 'window activation' events, which only fire when the actual BROWSER WINDOW (or tab) is brought to the front, or sent away (i.e, tab changed, or minimized).</p>
<p>I am not interested in blur, because the fact that the user has navigated to an embedded frame is of no consequence to the program. However, if the user minimizes the window, changes tabs, or switches to another program, I want to know about it...</p>
|
javascript jquery
|
[3, 5]
|
1,163,780 | 1,163,781 |
Converting single quotes to double quotes inside a title attribute
|
<p>I have an image title that has a tag with double quotes in it, and I need to convert it to single quotes for use in a photo slideshow. I don't have the option of changing anything other than the attribute name, so I can't escape the quotes inside the value. </p>
<p>Here's my html:</p>
<pre><code><div id="image-gallery">
<img alt="Alt Text" src="photo.jpg" title="Title <a href="#link">here</a>" />
</div>
</code></pre>
<p>I've tried grabbing the title and using replace to change the double quotes to single quotes, like so:</p>
<pre><code>mystr=string = $("#image-gallery img").attr('title');
mystr=mystr.replace(/\"/g,'\'');
</code></pre>
<p>The title still drops off after the first double quote though. Any ideas?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
1,363,390 | 1,363,391 |
Use jQuery to mirror height of a dynamic element
|
<p>I have a sidebar on my page that I want to always be 100% of the container size. Sadly, I can't tell the element to do this via CSS alone as the page has a variable height due to dynamic content.</p>
<p>Is it possible to use jQuery to find the height of the content container, and adjust the sidebar height to match it?</p>
<p>I found a few jQuery plugins that kind of do what I want, but feel they are over complicated (and I can't seem to get them to work anyway!).</p>
|
javascript jquery
|
[3, 5]
|
1,671,429 | 1,671,430 |
rawurldecode and regexp for splitting words with and without quotes in javascript?
|
<p>so here is the case:</p>
<p>i have a string in php (containts 2 words):</p>
<pre><code>windows "mac os"
</code></pre>
<p>i encode it with rawurlencode and put it in the URL after ?name= in an anchor.
when i click it i see the following in the browsers url.</p>
<p>index.php?name=windows%20%5C%22mac%20os%5C%22</p>
<p>and then i get it with javascript with jquery bbq.</p>
<pre><code>var string = $.deparam.querystring();
document.write(string.name);
</code></pre>
<p>and get:</p>
<pre><code> windows \"mac os\"
</code></pre>
<p>i want to get windows "mac os" when i output it with javascript. and then i want to split the words to:</p>
<pre><code> array[0] = windows
array[1] = mac os
</code></pre>
<p>the first step i think should be to get the string with rawurldecode but for javascript so i will get windows "mac os" rather than windows \"mac os\"?</p>
<p>and then the second step should be what regexp to use in javascript split() to split it to the words in the array above?</p>
<p>ive tried a numerous options but none is working. im stuck here..and its really frustrating. any help with these 2 steps would be appreciated</p>
|
php javascript jquery
|
[2, 3, 5]
|
349,146 | 349,147 |
Javascript - Closing confirmation message if no response from user
|
<p>I have got asp.net 2.0 website, in which I display session timeout through confirm message box, asking user to select ok or cancel.</p>
<p>Problem: if user doesn't provide any input (assuming his desktop is locked and he is out for lunch) - then how can I close this confirmation message and display another pop-up or re-driect to login page</p>
<p>Regards</p>
|
javascript asp.net
|
[3, 9]
|
4,824,200 | 4,824,201 |
How to access data inside Dialog Builder's inner class?
|
<p>This is more of a Java question, i believe. I would like to access myBundle from within the OnClickListener. Currently, i am getting this compiler error - Cannot refer to a non-final variable dataSend inside an inner class defined in a different method. Is there any way to achieve what i want to do? Thanks. Relevant piece of code....</p>
<pre><code>protected Dialog onCreateDialog(int id, Bundle myBundle) {
switch (id) {
case DIALOG_DELETE:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setPositiveButton("Oh My God", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
executeDelete(myBundle);
}
});
}
}
</code></pre>
|
java android
|
[1, 4]
|
1,882,238 | 1,882,239 |
Allow and Prevent postback in javascript in asp.net
|
<p>I was trying to validate dates using java script on button click event.If validation returns false post-back should be prevented and if returns true post-back should be allowed.</p>
<p>The problem is that post-back is occuring even if the validation returns false.....</p>
<p>I'm new to javascript.Kindly give me any solution.....</p>
<p>Here's my code</p>
<pre><code><script type="text/javascript">
function ValidateDate() {
var GridView = document.getElementById('GridView1');
var i = 1;
var rows = GridView.rows.length;
for (var j = 0; j < rows - 2; j++) {
i = i + 1;
var FromDate = new Date(document.getElementById('GridView1_ctl0' + i + '_txtFrom').value);
var ToDate = new Date(document.getElementById('GridView1_ctl0' + i + '_txtTo').value);
if (ToDate < FromDate) {
document.getElementById('GridView1_ctl0' + i + '_txtFrom').focus();
alert('ToDate is less than from date');
return false;
}
}
return true;
}
</script>
</code></pre>
<p>I've called javascript on pageload event</p>
<pre><code>this.btnSave.Attributes.Add("onClick", "ValidateDate();");
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,278,670 | 3,278,671 |
how to bind image from a popup window to parent window
|
<p>i have a aspx page and a popup page.</p>
<p>i have a imagebutton control in the aspx page when user click on the imagebutton a popup is shown,
The popup page contain a fileupload control and a done button,</p>
<p>The user will select a image from the fileupload control and click on done button,i want the selected image should be display in the imagebutton control which is present in parent page.</p>
<p>My code in default page to open popup as</p>
<pre><code><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css" />
<script src="jquery/braviPopup.js" type="text/javascript"></script>
<link href="css/braviStyle.css" rel="stylesheet" type="text/css" />
<title>braviPopUp</title>
<script type="text/javascript">
$(document).ready(function () {
$('#btnTest').click(function () {
$.braviPopUp('testing title!', 'popup.aspx', 600, 400);
});
});
</script>
</code></pre>
<p><strong>how to do this task</strong> ,I was able to do this task by opening popup as
window.open()
and
opener.document.getelementID("").src code in the popup page ,</p>
<p>but i dont want to use the above two line of code since the popup has scrollbar,menubar etc.</p>
<p>That why i prefer jquery popup.</p>
|
jquery asp.net
|
[5, 9]
|
5,355,387 | 5,355,388 |
How to open one single popup window for multiple onclick event of anchor tag?
|
<p>I have one aspx page with 1000 anchor tag. </p>
<p>I want to open single popup onclick of anchor tag & display data in popup window from database dynamically. </p>
<p>I want to use only one popup in my page.</p>
<p>For 1000 anchor tag inner data of popup will change with respect to anchor click change.</p>
<p>plz give me solution for it.</p>
<p>Plz help me. its very urgent.</p>
<p>Thanks in advance.</p>
<pre><code><h5><a href="#" runat="server" >Advertise & Media</a>
<em>
2 entries
</em>
</h5>
<ol>
<li><a id="advMedia1" runat="server" href="#" onclick="advMedia1_onclick">Advertise Agency</a></li>
<li><a runat="server" runat="server" href="#">Magazine</a></li>
<li><a runat="server" runat="server" href="#">Press</a></li>
<li><a runat="server" runat="server" href="#">Weekly</a></li>
</ol>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,662,649 | 2,662,650 |
getAction() gives only ACTION_DOWN
|
<p>For an application I am writing, I want to invoke a certain action once the user lifted his finger off the screen. I understood I need to check if event.getAction() is ACTION_UP, but all I get from getAction() is ACTION_DOWN. My code looks like this:</p>
<pre><code>menu = new MenuView(this);
menu.setBackgroundColor(Color.WHITE);
menu.setKeepScreenOn(true);
...
setContentView(menu);
menu.requestFocus();
...
public class MenuView extends View
{
...
public MenuView(Context context)
{
super(context);
setFocusable(true);
}
</code></pre>
<p>Anybody knows what is the reason for the problem?</p>
<p>Thank you in advance.</p>
|
java android
|
[1, 4]
|
1,745,852 | 1,745,853 |
Javascript function and PHP session variable
|
<p>I have the following script in my Body Tag inside a PHP page:</p>
<pre><code><script type="text/javascript">
function goNext()
{
<?php
if(isset($_SESSION['current']))
{
?>
window.location="step2.php";
<?php
}
else
{
?>
alert('Please select one item to continue.');
<?php
}
?>
}
</script>
</code></pre>
<p>I am setting the session vaible in PHP.
So when I click a link on the page, the session is set.
After that, when I call this function, it still goes to the Alert.</p>
<p>If I refresh the page, then it skips the alert and forwards to the URL mentioned in the function.</p>
<p>Any idea why while I have not refreshed the page, it does not go to the URL?</p>
<hr>
<p>Update</p>
<hr>
<p>I am already setting the Session_start at the begining of the page.
The session is getting set properly, because when I refresh, I can see it working.
Thirdly, I am already using AJAX to set sessions without doing page refresh.
There are other elements on the screen that respond to session change and they are working.
Its only this function where the "issset" function is not detecting the session.</p>
|
php javascript
|
[2, 3]
|
3,370,980 | 3,370,981 |
Javascript or jQuery help
|
<p>This is my website: <a href="http://keironlowe.x10hosting.com/" rel="nofollow">http://keironlowe.x10hosting.com/</a> </p>
<p>I need to know how to make the red line slowly get longer when hovering over, and slowly shrink back to normal size afterwards using javascript or jQuery.</p>
<p>Could someone show me something to get started in the right direction?</p>
|
javascript jquery
|
[3, 5]
|
5,204,842 | 5,204,843 |
javascript link inside span
|
<p>I'm trying to add a link to a span of text using Javascript below. Please help.</p>
<pre><code><div id="features">
<h2>Features</h2>
<div id="emma2011_left">
<h2>Image of the Day</h2>
<div id="dImg">
<div id="dailyimg" class="feature"></div>
<div id="title" class="feature"></div>
<div id="caption" class="feature"></div><br />
<span id="span" class="feature"><a id="pidlink">Link to the object</a></span>
</div>
</div>
<script type="text/javascript">
...
link = document.createElement("a");
link.setAttribute("href", "http://abc.org/index.aspx?objectid=" + oTodayImage.pid);
var span = document.createElement("span");
var txt = link.href;
var textNode = document.createTextNode(txt);
span.appendChild(textNode);
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,248,350 | 5,248,351 |
How do I remove value from POST if checkbox is unchecked
|
<p>jQuery</p>
<pre><code>$("input[type=checkbox]:checked").live("click", function (e) {
var data = $('.variation:checked').map(function (i, n) {
return {
'val': $(n).val()
};
}).get();
$.post('/variations.php', {
'data': data
}, function (data) {
$('#variations').html(data);
});
});
</code></pre>
<p>HTML output</p>
<pre><code><div id="variations">
Array
(
[data] => Array
(
[0] => Array
(
[val] => 1
)
)
)
</div>
</code></pre>
<p>PHP</p>
<pre><code>print_r($_POST)
</code></pre>
<p>Question: How do I remove value from POST if checkbox is unchecked?</p>
|
php jquery
|
[2, 5]
|
4,372,361 | 4,372,362 |
Modifying GridView data using Jquery doesn't persist back to Server events
|
<p>So i have an ASP.NET GridView control in which each column is a 'BoundField'. I did not create a TemplateField(ItemTemplate/EditItemTemplate), because i was planning on using JQuery to convert the BoundField row to a 'Edit' field by just converting the text in each cell to a textbox or textarea when that row was clicked. This is done all client side.</p>
<p>So far all the client side stuff works great. But I have a 'Save' button on each row of the grid that triggers an eventhandler on the server side. In that server side method, i try to grab values of that current row, but they are all the OLD cell values before I modified the fields/data using jquery/javascript.</p>
<p>When i iterate through each cell of the row, <strong>it's the same state as it was when it was rendered.</strong> </p>
<p>So what i'm trying to understand is. Why do all of this fancy javascript/jquery stuff when the state of the Grid stays exactly as it was when it was rendered when posting back to the server ?</p>
<p>someone please shed some light on this!!!
Thanks!</p>
|
asp.net jquery
|
[9, 5]
|
964,744 | 964,745 |
Setting a TextView to the value of an integer
|
<pre><code>public class DataHelper extends Activity{
TextView tvRslt;
public static int insert(String firstFB, String firstRL) {
// TODO Auto-generated method stub
Integer a = new Integer(firstFB).intValue();
Integer b = new Integer(firstRL).intValue();
int firstResult = a / b;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.result);
</code></pre>
<p>I wanted to set the integer "firstResult" to display on the TextEdit "tvRslt".</p>
<p>How do I do this?</p>
<p>If any further information is required, let me know.</p>
|
java android
|
[1, 4]
|
2,690,784 | 2,690,785 |
jQuery library 1.4.4 not allowing spaces in textbox
|
<p>I'm using asp text boxes and some javascript code in my project.</p>
<p>After seeing that spaces in my text boxes are disabled, I went through similar problems others have been faced with and got that mostly javascript makes this kind of issues. So after trying I got that jQuery library 1.4.4 is the cause. But by removing that, my slideshow would be disabled.</p>
<p>Any idea what could be the better or a proper solution for this?</p>
<p><a href="http://bijanarts.somee.com/" rel="nofollow">Here</a> is the sample.</p>
<p>The result of what I've tried shows me that the scripts below in file " jq1.js " is making the issue. </p>
<pre><code>$(function () {
$('#MainGalleryData .test').lightBox();
$('#MainGalleryData2 .test').lightBox();
$('#MainGalleryData3 .test').lightBox();
$('#MainGalleryData4 .test').lightBox();
$('#MainGalleryData5 .test').lightBox();
$('#MainGalleryData6 .test').lightBox();
$('#MainGalleryData7 .test').lightBox();
$('#MainGalleryData8 .test').lightBox();
$('#MainGalleryData9 .test').lightBox();
$('#MainGalleryData10 .test').lightBox();
$('#MainGalleryData11 .test').lightBox();
$('#MainGalleryData12 .test').lightBox();
</code></pre>
<p>});</p>
<pre><code>jQuery(document).ready(function () {
jQuery('#MainSlidesUl').fadeSlideShow();
});
</code></pre>
|
jquery asp.net
|
[5, 9]
|
534,108 | 534,109 |
ViewGroup.LayoutParams Java android dot notation
|
<p>I don´t understand the notation <code>VieuwGroup.LayoutParams</code>
This a subclass that extends <code>Object</code>...
I know it´s possible to do <code>class.field</code> or <code>class.method</code>
But this looks like <code>class.class</code> ? Is this some kind of inner class ?</p>
|
java android
|
[1, 4]
|
2,873,078 | 2,873,079 |
asp.net hide download
|
<p>I am making an application to edit mp3 files. After the editing is finished I want to present a link to download the file. I am just concerned that the file location, if known, can be abused for illegal files. What do I need to do so that, instead of presenting a link to a file on the server, I can store it in memory (which I already have using taglib) and then stream the download without storing it on the server.</p>
|
c# jquery asp.net
|
[0, 5, 9]
|
4,720,462 | 4,720,463 |
Using a dynamic variable within a for statement
|
<p>I would like to dynamically create and reference some variables on the fly, but i'm not understanding how to.</p>
<p>Here is what I would think 'should' work, but I know doesn't.</p>
<pre><code>var weeks = 4;
for(i=0; i<weeks.length;i++){
var 'week_'+i = valueFromXML;
}
function wtFn (){
'week_'+i.splice(-1, 1);
if('week_'+i.length <=0){
$(this).parent().parent().slideUp();
}
}
</code></pre>
<p>I'm open to suggestions. Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
5,202,294 | 5,202,295 |
Migrating from VB 2003 (ASP.Net) to C# 2008 ASP.Net
|
<p>I am converting an existing vb2003 asp.net 1.1 application to C#2008 asp.net 3.5.
I have copied the HTML onto my C# markup window (consisting of Labels, text fields & buttons)</p>
<p>However, when I attepmt to "View in browser", I get the error below:</p>
<p>Compiler Error Message:
CS1061: 'ASP.apps_forms_newproductregistration_newproductreg_aspx' does not contain a definition for 'btnSubmit_Click' and no extension method 'btnSubmit_Click' accepting a first argument of type 'ASP.apps_forms_newproductregistration_newproductreg_aspx' could be found (are you missing a using directive or an assembly reference?)</p>
<p>Source Error:</p>
<pre><code>Line 320:<tr>
Line 321: <td><input type="reset" value="Reset" class="formbutton">
Line 322: <asp:button cssclass="formbutton" text="Next" id="btnSubmit" runat="server" onclick="btnSubmit_Click"/></td>
Line 323:</tr>
</code></pre>
<p>My code behind contains the following code:</p>
<pre><code> protected void btnSubmit_Click(object sender, EventArgs e)
{
if (ValidateHeader() && ValidateFooter())
LoadDatabase();
}
</code></pre>
<p>Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
5,909,698 | 5,909,699 |
Having a problem binding an event handler in this way whats wrong?
|
<p>I'm trying to bind an event handler using jQuery:</p>
<pre><code>$(document).ready(function () {
var newsScrollerForPage = new NewsScroller();
newsScrollerForPage.init();
$('#scroller-left-a').bind('onclick', newsScrollerForPage.decreasePage());
});
<div class="scroller-left">
<a id="scroller-left-a" href="#">
<img src="/Images/Left-Scroller.jpg"/>
</a>
</div>
</code></pre>
<p>But I'm having a problem:</p>
<blockquote>
<p>handler is undefined [Break On This
Error] if ( !handler.guid ) {</p>
</blockquote>
<p>Is there anything wrong with the way I am trying to bind this event handler?</p>
|
javascript jquery
|
[3, 5]
|
353,965 | 353,966 |
jquery - traverse up tree and find elements with specified class
|
<p>I thought that the closer() function would do this for me, but seemingly not. I have the following markup and I want to add a class to all parent anchors with the class trigger:</p>
<pre><code> <ul>
<li class="selected">
<a class="trigger" href=""></a>
<a href=""></a>
<ul>
<li class="selected">
<a class="trigger" href=""></a>
<a href="" id = "my_target"></a>
</li>
</ul>
</li>
</ul>
</code></pre>
<p>I want to select my target - in this example, the deepest anchor, then add a class to each a.trigger in its ascendants. What would be the best way to do this? Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,316,163 | 1,316,164 |
Troubleshooting ClassNotFoundException when using PHP/Java bridge
|
<p>I've followed this tutorial <a href="http://www.dsl.uow.edu.au/~sk33/php5java.htm" rel="nofollow">http://www.dsl.uow.edu.au/~sk33/php5java.htm</a>, but at last when I tried this</p>
<pre><code><?php
java_require('http://localhost/test/HelloWorld.jar');
$myObj = new Java('HelloWorld');
// display Hello World
echo (String) $myObj->getHelloWorld();
?>
</code></pre>
<p>I got this exception</p>
<blockquote>
<p>PHP Fatal error: Uncaught [o(Exception):"java.lang.Exception: CreateInstance failed:new HelloWorld. Cause: java.lang.ClassNotFoundException: Could not find HelloWorld in java_require() path. Please check the path and the SEL and File permissions. Responsible VM: 1.5.0_14@http://java.sun.com/" at:#-10 php java.bridge.DynamicJavaBridgeClassLoader.loadClass(DynamicJavaBridgeClassLoader.java:293)</p>
</blockquote>
|
java php
|
[1, 2]
|
4,057,882 | 4,057,883 |
External Iframes somehow redirecting out of my site, how do I prevent this?
|
<p>How do external iframes manage to redirect out of your site?</p>
<p>How can this be prevented?</p>
<p>Is it possible to listen to "redirect requests" and prevent them if there was no click?</p>
|
javascript jquery
|
[3, 5]
|
220,230 | 220,231 |
Why is Request.ServerVariables["HTTP_HOST"] different from Request.Url.Host?
|
<p>Same server, same site - two different results.</p>
<h1>Case 1</h1>
<p>request URL: domain.com (resolving to domain.com/default.aspx)<br>
request header in Firebug: domain.com<br>
<code>Request.ServerVariables["HTTP_HOST"]</code> = domain.com<br>
<code>Request.Url.Host</code> = domain.com (Ok, this is good and expected)</p>
<h1>Case 2</h1>
<p>request URL: domain.com/default.aspx<br>
request header in Firebug: domain.com<br>
<code>Request.ServerVariables["HTTP_HOST"]</code> = domain.com<br>
<code>Request.Url.Host</code> = <strong>app5</strong> (name of the server) </p>
<p>Looking at two requests I can't see anything that would cause that. Why would this be the case?<br>
Server is running Windows 2003 and IIS6.</p>
|
c# asp.net
|
[0, 9]
|
2,250,290 | 2,250,291 |
Sleep() in java (Android)
|
<p>I am following this tutorial to have a loading screen in my program. The tutorial says my activity should Sleep() using the Sleep() command, however it does not recognise Sleep() as a function and provides me with an error, asking if I would like to create a method called Sleep().</p>
<p>Here is a link to the tutorial:</p>
<p><a href="http://androidcookbook.com/Recipe.seam;jsessionid=4DBCC1688B51DB16A2A40A86E135D361?recipeId=1599" rel="nofollow">http://androidcookbook.com/Recipe.seam;jsessionid=4DBCC1688B51DB16A2A40A86E135D361?recipeId=1599</a></p>
<p>Here is the code sample:</p>
<pre><code>public class LoadingScreenActivity extends Activity {
//Introduce an delay
private final int WAIT_TIME = 2500;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
System.out.println("LoadingScreenActivity screen started");
setContentView(R.layout.loading_screen);
findViewById(R.id.mainSpinner1).setVisibility(View.VISIBLE);
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
//Simulating a long running task
this.Sleep(1000);
System.out.println("Going to Profile Data");
/* Create an Intent that will start the ProfileData-Activity. */
Intent mainIntent = new Intent(LoadingScreenActivity.this,ProfileData.class);
LoadingScreenActivity.this.startActivity(mainIntent);
LoadingScreenActivity.this.finish();
}
}, WAIT_TIME);
}
}
</code></pre>
|
java android
|
[1, 4]
|
4,563,760 | 4,563,761 |
Adding references in C#
|
<p>How to add assembly reference for c# class file while converting from website to web application</p>
<p>I recently converted a VS project of mine from a website to a web application. When I did so, upon trying to view the site, I get the following error:</p>
<p><code>The type or namespace name 'FunFactory' could not be found (are you missing a using directive or an assembly reference?)</code></p>
<p>FunFactory is a class file in App_Code - what do I need to do to get this class recognized by my web application?</p>
|
c# asp.net
|
[0, 9]
|
2,992,163 | 2,992,164 |
How to check that panel is visible or not in JavaScript?
|
<p>How do I check that panel is visible or not in JavaScript?. I am using ASP.NET 2.0.</p>
|
javascript asp.net
|
[3, 9]
|
1,890,580 | 1,890,581 |
Split to get the text between separators?
|
<p>I am making a cross domain AJAX request, and because of this, I can't pass the original array from the PHP page to my HTML page. Instead, the request gets the results as a string. I have it set up so that the syntax looks like this:</p>
<pre><code>([SCHOOL] Name [/SCHOOL][STATUS] Status [/STATUS])
([SCHOOL] Other name [/SCHOOL][STATUS] Other status [/STATUS])
</code></pre>
<p>On my HTML page, I want to be able to form an array from these different values, in the form of:</p>
<pre><code>Array (
[0] =>
[0] Name
[1] Other
[1] =>
[0] Name
[1] Other status
)
</code></pre>
<p>This way, I can use a <code>for</code> loop to get specific values. </p>
<p>The only problem with is that <code>split</code> only does just that, splits things. Is there a way in JS to find the text within separators, and form an array from it? In the example again, it'd find all text within the parenthesis, and form the first array, then within that array, use the text between <code>[SCHOOL][/SCHOOL]</code> for the first object, and use the text between <code>[STATUS][/STATUS]</code> for the second object.</p>
|
javascript jquery
|
[3, 5]
|
5,644,020 | 5,644,021 |
to remove first and last element in array using jquery
|
<p>How to remove first and last element in an array using jquery</p>
<p>Example:</p>
<pre><code>var fruits = ["Banana", "Orange", "Apple", "Mango"];
</code></pre>
<p>My Expected output:</p>
<pre><code>Orange,Apple
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,464,900 | 4,464,901 |
jstree 1.0 does not work well
|
<p>I have a problem with the new version of jstree when using this part of code. At the first execution, the data function returns the root node. The problem is that this code never executes again. So whatever happens, I just have the root node. Does anybody know a solution?</p>
<pre><code>$('#tree').jstree(
json_data: {
ajax: {
url: '<%=url %>',
dataType: "json",
data: function (n) {
return {
"id": n.attr ? n.attr("id") : 0
};
}
}
},
themes: { url: '/ThirdParty/jquery/jsTree/themes/', theme: "default", dots: true, icons: true },
plugins: ["json_data", "themes", "ui"]
})
{
</code></pre>
|
asp.net javascript
|
[9, 3]
|
5,573,480 | 5,573,481 |
JS/jQuery: How to highlight or select a text in a textarea?
|
<p>I don't want to highlight text (by changing background color to yellow - NO), I just want to select a portion of the text inside textarea, exactly as if the user clicked and hold the click then moved the mouse to highlight only a portion of the text</p>
<p>How to do that? is it possible?</p>
|
javascript jquery
|
[3, 5]
|
4,451,426 | 4,451,427 |
jQuery change() fires on Page Load
|
<p>This code fires on the page load, but not when the change event actually occurs. </p>
<pre><code>jQuery('select#order_note_type').change(function() {
random code here
});
</code></pre>
<p>I have to add that it is not inside the <code>ready</code> method. Do I need to bind it?</p>
<p>EDIT: I changed my code to be inside the <code>$(document).ready()</code> and used bind, but I still get my method to fire only at page load:</p>
<pre><code>jQuery(document).ready(onReady);
function onReady() {
jQuery('select#order_note_type').bind('change',showTrackingInfo);
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,599,350 | 4,599,351 |
Action indicator during JQuery each() function
|
<p>How to do simple action indicator during execution of JQuery each(), is this possible?
I have some problems with my JQuery code, i don't understand the behavior of it :/
I am new to JQuery.</p>
<p>js code look like this:</p>
<pre><code>$(function () {
$('#offer_discount').keyup(function () {
//here i try to show my hidden div with action indicator
$('#mask').show();
$('#search-result').find('tr').each(function (index) {
// do some calc
});
// here i try to hide my div with action indicator
$('#mask').hide();
});
});
</code></pre>
<p>it didn't work properly, hidden div shows at the end of calculations. Anybody can help?</p>
|
jquery javascript
|
[5, 3]
|
3,547,162 | 3,547,163 |
Implementing background loading properly and efficiently
|
<p>The following code is a summary of what I'm trying to do, which is to develop a interface that allows the user to scroll left and right through images. Images start off the screen and then to the centre, and it also pushes the previous image back off the screen.</p>
<p>I would love some advice on the code I have or suggestions on how to do it better. Obviously, if the user rapidly clicks the arrows it will undoubtedly break the script, so I will need help here. Maybe prevent the arrows from being clicked when in a "load" state?</p>
<p>I should also mention that backgroundLoad preloads the next and previous image. And when I say "off screen" it will animate to the centre. I'm not looking for a image gallery/lightbox solution. This question is more about the preloading process.</p>
<pre><code>var imgArray=[];
var b = 0;
function loadImage(ini){
b = ini;
//preload image
var num_loaded = 0;
imgArray[ini] = new Array();;
for(var i=0;i<2;i++){
imgArray[ini][i] = new Image();
imgArray[ini][i].onload = function(){
num_loaded++;
if(num_loaded == 1){
}
if(num_loaded == 2){
//do something
backgroundLoad(ini+1);
}
}
imgArray[ini][i].src = ArrayOfFiles[ini][i];
}
}
function backgroundLoad(ini){
var num_loaded = 0;
imgArray[ini] = new Array();;
for(var i=0;i<2;i++){
imgArray[ini][i] = new Image();
imgArray[ini][i].onload = function(){
num_loaded++;
if(num_loaded == 2){
// loaded
}
}
imgArray[ini][i].src = ArrayOfFiles[ini][i];
}
}
$("div#arrow-left").click(function(){
loadImage(b+1);
});
$("div#arrow-right").click(function(){
loadImage(b-1);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,725,220 | 5,725,221 |
android - read from text file line by line
|
<p>I have the following code which I know that works in Java. I am now trying to do the equivalent in and Android application. The operation is quite simple: I need to make use of a method in a class (in the same workspace) where I first need to get the lines off a text file which I stored in <strong>/res/raw</strong>.</p>
<p>Basically I need to call this method residing in a Java class from an Android Activity Class. How is this possible?</p>
<p>Activity Class snippet (CaptureActivity.java):</p>
<pre><code>setContentView(R.layout.orientation);
try {
SentenceGenerator sentenceGenerator = new SentenceGenerator();
ArrayList<String> firstState = stateGenerator.getState(resultOutput, result, result);
String viewPoint = firstState.get(0);
String object = firstState.get(1);
String subject = firstState.get(2);
Thing subjectInfo = new Thing();
if(resultOutput.equals("Sliema")){
Sliema sliema = new Sliema();
subjectInfo = sliema.getInfo(viewPoint, object, subject);
}
try {
String s = sentenceGenerator.generateSentence("start.txt", "middle.txt", "end.txt", resultOutput, viewPoint, object, subject, subjectInfo.type, subjectInfo.name, subjectInfo.properties, false);
TextView instructionTextView = (TextView) findViewById(R.id.instructionTextView);
instructionTextView.setText(s);
} catch (Exception e) {
}
} catch (ClassNotFoundException e) {
}
</code></pre>
<p>Java Class snippet (SentenceGenerator.java):</p>
<pre><code>public static ArrayList<String> getLines(String filename) throws Exception {
ArrayList<String> lines = new ArrayList<String>();
FileInputStream fstream = new FileInputStream(filename);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
while ((strLine = br.readLine()) != null) {
lines.add(strLine);
}
in.close();
return lines;
}
</code></pre>
<p>Thank you for any help in advance!</p>
|
java android
|
[1, 4]
|
2,705,956 | 2,705,957 |
hover more than one element
|
<p>Is it possible to use more than one element in jQuery hover?
This code is only for <code>a</code> elements but how may you use it for <code>div</code>,<code>texterea</code>,<code>a</code> and <code>li</code> elements together?</p>
<p>Example:</p>
<pre><code>$("a").hover(function () {
var id = $(this).attr("class");
$("#helparea").text(id);
},
function () {
$("#helparea").empty();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,104,426 | 5,104,427 |
How come I am getting different responses on browser than the server
|
<p>Here is an example website</p>
<p><a href="http://us.blizzard.com/store/browse.xml?f=c:5,c:33" rel="nofollow">http://us.blizzard.com/store/browse.xml?f=c:5,c:33</a></p>
<p>When I inspect the response in Firefox it is application/xhtml</p>
<p>When I make a request to the same url server side with the following headers</p>
<pre><code>var request = (HttpWebRequest)WebRequest.Create(url);
var cookieContainer = new CookieContainer();
request.CookieContainer = cookieContainer;
request.UserAgent = @"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5";
request.Method = "GET";
request.AllowAutoRedirect = true;
request.Timeout = 15000;
</code></pre>
<p>The response is application/xml</p>
<p>Any Ideas?</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
4,718,038 | 4,718,039 |
array vs.list performance issue
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/454916/performance-of-arrays-vs-lists">Performance of Arrays vs. Lists</a> </p>
</blockquote>
<p>I want to know which one is better way to do this task.</p>
<pre><code>string[] week = new string[7]
week[0] = "Sunday";
week[1] = "Monday";
week[2] = "Tuesday";
foreach (string day in week)
{
//Some task
}
</code></pre>
<p>and<br> </p>
<pre><code>List<string> week = new List<string>();
list.Add("Sunday");
list.Add("Monday");
list.Add("Tuesday");
foreach (string day in list)
{
//Some Task
}
</code></pre>
<p>Is there any performance issue?Or any other better way.Thanks.</p>
|
c# asp.net
|
[0, 9]
|
4,110,233 | 4,110,234 |
Checking length of a textbox and showing relevant error message if its 0
|
<p>I have a textbox and im trying to check if it has anything in, and if it doesnt i need to show a relevant error message but even when i have entered something in it, it continues to show the error message</p>
<p>Iv created a it here <a href="http://jsfiddle.net/Atkinson1988/SzuVQ/" rel="nofollow">http://jsfiddle.net/Atkinson1988/SzuVQ/</a></p>
<pre><code>var DiarisedReason = $("#txtDiarisedReason").val();
if (jQuery.trim(DiarisedReason).length < 0);
{
alert('Please Enter Diarised Notes');
return false;
}
</code></pre>
<p>Im not sure what im doing wrong?</p>
<p>Thank you for your time.</p>
|
jquery asp.net
|
[5, 9]
|
2,922,485 | 2,922,486 |
jQuery Slider Maintain Value on Postback
|
<p>I am using a jQuery UI slider without any troubles other than this: I have an ASP.NET hidden field that stores whatever the user selected with the slider. Say 25, or 50. I need that server control so that I can use its value after other steps are performed. It works but when the page does the postback, the slider reverts to where it originally was. In other words, the user selects 50 on the slider, the post to the server goes and retrieves 50 records. But the slider goes back to 25 as that was its initial value. How do I fix this so that it keeps the setting stored in the hidden field control (or what the user selected)?</p>
<p>I have added the code here:</p>
<pre><code> $(document).ready(function () {
//setup slider
$('#slider').slider({
range: "max",
min: 25,
step: 25,
max: 100,
value: 75,
slide: function (event, ui) {
$('#radiusText').val(ui.value);
//set the hiddenfield for server postback of radius
$("#<%= Radius.ClientID%>").val(ui.value);
}
});
$('#radiusText').val($('#slider').slider('value'));
});
</code></pre>
|
jquery asp.net
|
[5, 9]
|
2,042,907 | 2,042,908 |
hide a message after 30 seconds.?
|
<p>How can after click on button show a message and next <strong>hide it after 30 seconds</strong>?</p>
<p><strong>Like:</strong></p>
<pre><code>$('#message').live('click', function() {
$('#sm').hide();
$('#sm').hide().show('slow').html('You have successfully registered');
// how is hide "$('#sm')" after 30 seconds??
});
</code></pre>
<p>Please give me example in <a href="http://jsfiddle.net/" rel="nofollow">http://jsfiddle.net/</a></p>
|
javascript jquery
|
[3, 5]
|
3,812,041 | 3,812,042 |
How to send SMS from asp.net application
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1125332/sms-from-our-site">sms from our site</a> </p>
</blockquote>
<p>I want to send SMS from my asp.net application. Suppose there will be 2 text boxes in my UI, one for mobile or cell phone number and another one is for message writing. When I will click the submit button then this SMS will be send to that cell number.
I want to use my cell phone number as transmission number.
Please inform me the possible ways.
I am using asp.net C# </p>
|
c# asp.net
|
[0, 9]
|
4,820,367 | 4,820,368 |
JQuery simple dialog box
|
<pre><code><link href="simpledialog.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="simpledialog.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.simpledialog').simpleDialog();
});
$(document).ready(function () {
$('.simpledialog').simpleDialog({
opacity: 0.3,
duration: 500,
title: 'Simple Dialog',
open: function (event) {
console.log('open!');
},
close: function (event, target) {
console.log('close!');
}
});
});
</code></pre>
<p></p>
<pre><code>$strLink = "<a href='viewTicket.php?id={$row['id']}' class='simpledialog'>$strName</a>";
<a href="#" rel="dialog_content" class="simpledialog">show dialog!</a>
<!-- content -->
<div id="dialog_content" style="display:none;">
<h3>DEMO</h3>
<p>This is a demonstration of jQuery SimpleDialog.</p>
<a href="#" class="close">close</a>
</div>
echo "<td>" . $strLink . "</td>";
</code></pre>
<p>when I click on the link it is not triggering the jquery</p>
<p>Thanks for any help!</p>
|
php jquery
|
[2, 5]
|
3,907,686 | 3,907,687 |
How do I add response from TextBox? c#
|
<p>Hi
I have created my own control which contains TextBox control as a child control. this textbox has autopostback set on. when the postback is called I dont get any text in request.querrystring.
where should I specify text entered into texbox will be send to response ? or is there any easier way of sending this information? I want to have the entered text once again in textbox after postback.</p>
<p>thank you</p>
|
c# asp.net
|
[0, 9]
|
5,911,817 | 5,911,818 |
Convert Javascript function to jQuery plugin
|
<p>I have already a short-hand function like so:</p>
<pre><code>function myObj() {};
myObj.prototype.read = function (name) {alert(name);};
...(more functions)
</code></pre>
<p>Now I would like to "convert" this to a jQuery plugin.<br>
What is the best way to do so? (My function doesn't need a selector before it).
I thought about doing it like this:</p>
<pre><code>$.myObj.methodHere();
</code></pre>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
1,203,237 | 1,203,238 |
Whats the difference between using .on('click' and .click?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/9122078/difference-between-onclick-vs-click">Difference between .on('click') vs .click()</a> </p>
</blockquote>
<p>When handling a click of a div whats the difference between using .on and .click : </p>
<pre><code> $('#myDiv').on('click' , function(e) {
});
$('#myDiv').click(function(e) {
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,053,098 | 4,053,099 |
How can I transfer data between two phones in a local wireless network for testing?
|
<p>For testing purposes, I'm managing to develop a chat app to work through local wireless network. What would be the best options for the communication transfer? (assuming that the only information that each phone have it's the local IP) Sockets?</p>
<p>I referred chat because It's just for testing, my purpose is to transfer data like value of some variables, arrays etc.</p>
<p>Appreciate any idea/suggestion :)</p>
|
java android
|
[1, 4]
|
4,469,910 | 4,469,911 |
how do you get the html and value output to a string
|
<p>given this html input element, <input id="input1" type="text" /></p>
<p>if the user enters a value of 'test', is there a way in jQuery to serialize that to a string?</p>
<p>The output I would be looking for is, <input id="input1" type="text" value="test" /></p>
<p>I am not copying this to another element in DOM, I need the actual string so I can send it to EVOPdf. I've already tried the clone(true), but it doesn't give me any values the user has entered into the inputs. </p>
<p>I'm resigned to having to parse the html() string and insert a value for each input unless someone knows a better way.</p>
|
javascript jquery
|
[3, 5]
|
504,324 | 504,325 |
Access to external literal class inside a function
|
<p>What I have is something like that:</p>
<pre><code>jQuery(function($) {
'use strict';
var App = {
init: function() {
App.startTool();
}
[...]
</code></pre>
<p>and when I try to call <code>App.init();</code> from another file it say that <code>App is not defined</code>.</p>
<p>I'm trying to create some test with jasmine and I've the same error.</p>
<p>How can I go inside this "literal class", nested inside a simple function, from external files?</p>
|
javascript jquery
|
[3, 5]
|
1,472,520 | 1,472,521 |
making asynchronous calls with jquery
|
<p>I have a function called <code>checkStatus(x)</code> where x is Id. How can I call this function n times asynchronously ? Without being dependent one on another to completed and for another to start?</p>
<p>I'm using jquery</p>
<p><strong>EDIT:</strong></p>
<p>I'm not sure if I used the correct term, but here is what I want. I have a list of ID's and I iterate trough a list, I want to execute this function for each ID. </p>
<p>But I don't want to wait for one id to finnish, and then to execute this function on another id. Is it possible to execute this function at the same time?</p>
|
javascript jquery
|
[3, 5]
|
4,360,991 | 4,360,992 |
How do I test for a empty string/null, using JavaScript?
|
<p>How do I test for a input[text] field that has nothing in?</p>
<p>This is what I have so far:</p>
<pre><code> if ($('#StartingPrice').length == ""){
alert("ERROR!");
}
</code></pre>
<p>Any help would be greatly appreciated, Thanks </p>
|
javascript jquery
|
[3, 5]
|
2,626,910 | 2,626,911 |
Javascript source file download progress?
|
<p>I am sourcing a large mapping/widget javascript file (1.3 MB) and wanted to display a progress bar as it loads. I know firebug's net watch tab knows a lot of this information, but I would like something more lightweight. I came across this website:
<a href="http://blog.greweb.fr/2012/04/work-in-progress/" rel="nofollow">http://blog.greweb.fr/2012/04/work-in-progress/</a> </p>
<p>which almost gets me there except that I need to source the file I'm downloading. I didn't see any listeners on jQuery's getScript as the file downloads. Does anyone know how to get at the progress of a sourced file download?</p>
<p>Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
618,865 | 618,866 |
What is the input for PushEndPointDemo?
|
<p>I can run the sample code. It shows PushPointEndDemo EditText and Register button. Now the problem is I don't know what I give in that box to register through the emulator. </p>
|
java android
|
[1, 4]
|
2,697,995 | 2,697,996 |
Insert variables into $.post within a function
|
<p>i'm writing a function to send $.post show please how to correctly insert variables into object depending if they are set.
here is what i'm trying to do:</p>
<pre><code>function SendCommand(Command, QuestionId, Attr) {
$.post('/survey/admin/command',
{
'Command': Command,
if (QuestionId) 'QuestionId' : QuestionId,
if (Attr) 'Attribute' : Attr
}
);
}
</code></pre>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,652,028 | 3,652,029 |
call code behind method from window.onbeforeunload?
|
<p>I would like execute code behind method <strong>(like save data to database)</strong> from window.onbeforeunload. I cann't use PageMethods because of <strong>non-sharedmembers (txtboxed, cmbboxes etc)</strong> in the save method. How to handle this situation? It is literally killing my time. </p>
<p>Please help me out.</p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
3,881,888 | 3,881,889 |
If clicked img src contains specific text
|
<p>Hi all how can i check If clicked img src contains specific text if then do some functions? </p>
<p>Example:</p>
<p><code><img src="file:///C:/path/img4-dog.jpg">,
<img src="file:///C:/path/img4-cat.jpg"></code> </p>
<p>run alert if clicked img src contains 'dog' something like that?</p>
|
javascript jquery
|
[3, 5]
|
5,327,404 | 5,327,405 |
Android Emulator: Write file to local file system?
|
<p>I am wondering if its possible to get my android application to save a file to a windows file system or is there a simple work around I can adopt?</p>
<p>I am using the android emulator to do tests and I need it to write to the local hard drive so I can do further processing on the file.</p>
<p>I hope this is possible and I appreciate any help.</p>
|
java android
|
[1, 4]
|
181,563 | 181,564 |
javascript/jQuery Array concatenation?
|
<p>I have some simple jQuery code:</p>
<pre><code>var response = Array()
$('.task-list').each(function() {
response.concat(response,$('#' + this.id).sortable('toArray'));
}
);
console.log(response);
</code></pre>
<p>The problem I'm having is that I think I'm using concat improperly- the result is an empty array. When I use array push, it works correctly.</p>
|
javascript jquery
|
[3, 5]
|
995,335 | 995,336 |
jQuery focus not working with the plugin chosen
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/8281627/jquery-chosen-focus-on-page-load-onload">Jquery Chosen focus on page load (onLoad?)</a> </p>
</blockquote>
<p>i am using a jQuery plugin chosen (http://harvesthq.github.com/chosen/) to create more useful select boxes.</p>
<p>however, jQuery focus event is not working with this plugin.</p>
<p>my html code:</p>
<pre><code><select class="product">
<option value="1">Product One</option>
<option value="2">Product Two</option>
</select>
</code></pre>
<p>and javascript code:</p>
<pre><code>$('.product').chosen().focus();
</code></pre>
<p>it is not focusing the element..</p>
<p>here is my jsFiddle: <a href="http://jsfiddle.net/JigneshManek/queZ6/11/" rel="nofollow">http://jsfiddle.net/JigneshManek/queZ6/11/</a></p>
<p>is there any other method or event specified in the plugin to focus the element?</p>
|
javascript jquery
|
[3, 5]
|
421,023 | 421,024 |
Operating System Detection by Java or JavaScript
|
<p>I need to detect OS name & version in Java. That I can do by </p>
<pre><code>String os_name = System.getProperty("os.name", "");
String os_version = System.getProperty("os.version", "");
</code></pre>
<p>but the problem is that this is not reliable. Sometimes it returns incorrect information, and I can't detect all operating systems, except the most popular Windows, MacOS, Linux etc, and this even provides wrong information in the case of 64 bit operating systems. I need to detect any OS with any kind of specification. I am unable to find the right solution for this.</p>
<p>Maybe I can do this with JavaScript? If it's impossible in Java then please tell me how to do it with JavaScript.</p>
<p>Any input or suggestions highly appreciated.</p>
<p>Thanks in advance.</p>
<p>Best regards,</p>
<p>**Nilanjan Chakraborty</p>
|
java javascript
|
[1, 3]
|
5,775,222 | 5,775,223 |
Getting Image size in Javascript not working the first time
|
<p>I am getting the image size using javascript, but it won't return the correct size until after I run it a second time. I wonder why this is. Here is my code:</p>
<pre><code> var img = new Image()
img.src = src
img.onLoad = alert(img.width);
</code></pre>
<p>This returns <code>0</code> sometimes, but after a couple times it returns the actual image width. How do I make it get the right size the first time? I thought this was the right way.</p>
|
javascript jquery
|
[3, 5]
|
859,766 | 859,767 |
How to tell jQuery that all selectors I write should be limited to the object being worked on?
|
<p>I made this incredible plugin that will change the fate of the world <a href="http://jsfiddle.net/4phfC/1/" rel="nofollow">http://jsfiddle.net/4phfC/1/</a>:</p>
<pre><code><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
$.fn.colorText = function(color) {
$('.bar', $(this)).css('color', color);
// a million other lines of code here...
}
$(function() {
$("#div1").colorText("red");
});
</script>
<div id="div1" class="foo" style="width:100px;height:100px;border:1px solid green">
<span class="bar">Hello</span>
</div>
<div id="div2" class="foo" style="width:100px;height:100px;border:1px solid green">
<span class="bar">Good Bye</span>
</div>
</code></pre>
<p>In order to effect just the span tag with the class "bar" that is within the object that I attached the plugin to and not the other one on the page I did:</p>
<pre><code>$('.bar', $(this)).whatever();
</code></pre>
<p>But notice the spot where the million other lines of code will go, it would be somehwat of a pain to use this convention throughout the rest of the plugin.</p>
<p>Is there any way to tell jQuery from now on all selectors I declare are applicable only to the element that the plugin is attached, so that I can use selectors like normal:</p>
<pre><code>$('.bar').whatever();
</code></pre>
<p>and this won't affect any ".bar"'s that are outside of the element being worked on.</p>
|
javascript jquery
|
[3, 5]
|
5,101,655 | 5,101,656 |
c# how to: define a long string with linebreaks?
|
<p>is there a way to define a single long string with line breaks within the string definition code? </p>
<p>my string is somethign like this:</p>
<pre><code>string sql = "SELECT
a.bg_user_56 AS Project,
a.bg_user_60 AS SubSystem,
a.BG_USER_81 AS AssignedToUserName,
a.bg_responsible AS AssignedTo,
FROM mytable"
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,015,836 | 2,015,837 |
Changing fragment view has no effect
|
<p>Im changing the view of a fragment with the following code</p>
<pre><code>public void updateView() {
View newView = LayoutInflater.from(mActivity).inflate(R.layout.fragment_lobby, (ViewGroup)mActivity.findViewById(mContainerId),
false);
ViewGroup container = (ViewGroup)mActivity.findViewById(mContainerId);
container.removeAllViews();
container.addView(newView);
}
</code></pre>
<p>Until the addView everything is fine, but then the new view aint added, the fragment remains empty.</p>
<p>If i change my code to display R.layout.fragment_lobby first and in updateView i change it to what is currently the first content then i see the R.layout.fragment_lobby correct and it voids the container again in updateView.</p>
<p>In all the other postings ive found about updating or modifying the view object of fragments that was the suggested code but it does not work for me. If you need some of the xml just tell me, they are both LinearLayout's and the content is (for testing) nearly the same, just different controls, nothing fancy.</p>
|
java android
|
[1, 4]
|
3,004,041 | 3,004,042 |
jQuery not detecting enter key pressed in textarea
|
<p>My setup: jQuery 1.6.2</p>
<p>I have this HTML</p>
<pre><code><textarea class="comment_box"> Write a comment...</textarea>
</code></pre>
<p>And the following Javascript</p>
<pre><code><script>
$('.comment_box').keydown(function (e){
if(e.keyCode == 13){
alert('you pressed enter ^_^');
}
})
</script>
</code></pre>
<p>When I press the enter key in the textarea, nothing triggers</p>
<p><strong>EDIT</strong> Oops, cut and paste error, I do have <code>$</code> in my code and it still doesn't work, must be something else going on.</p>
<p>My bad, it is a user operator error, it does work. Sorry for the confusion.</p>
|
javascript jquery
|
[3, 5]
|
4,683,736 | 4,683,737 |
C# Restoring Values to Controls Iterativley
|
<p>I have a situation here where the user has about 100 controls mostly multi select listboxes
but some other stuff peppered in (drop downs checkboxes) and they narrow down complex search criteria for screenings. When they go back later they want the act of pulling up a record to reset the controls to the values that they had used to match the criteria. </p>
<p>So I made a table that has a column for each control and iterativley stores the values - comma
deliminated for listboxes - when the user locks in the search criteria to move to the next step.</p>
<p>Other then using a switch to say if value is x: set control x to value(s) so and so is there a good way to iterate through this, seeing as the name of the column is the name of the control ? I'm stumped at the moment ... </p>
<p><img src="http://i.stack.imgur.com/MRt2i.png" alt="enter image description here"></p>
<pre><code> var CParam = QueryFnc.RstrCntrls(Jnum, Qnum);
foreach(var a in CParam)
{
//Map Values to Matching Named Control
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,394,611 | 5,394,612 |
<hr> between divs
|
<p>Based on time i show up divs one by one.</p>
<p>I do this with jquery with </p>
<pre><code>$("#section_"+index).show();
</code></pre>
<p>My divs have id's like:
section_1, section_2, section_3 etc.</p>
<p>i have the var currentSection which is the id of the last one that is shown.
Now i want a hr (horizontal ruler) between the last one shown and the previous one.
And if it shows the next one the old hr should be removed and a new hr should be shown.</p>
<p>Can this be done with jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,407,021 | 2,407,022 |
how to show 20 rows on datagrid each time?
|
<p>i show data on gridview like this:</p>
<pre><code>SQL = "SELECT * FROM MEN ";
dsView = new DataSet();
adp = new SqlDataAdapter(SQL, Conn);
adp.Fill(dsView, "MEN");
adp.Dispose();
GridView1.DataSource = dsView.Tables["MEN"];
GridView1.DataBind();
</code></pre>
<p>but i see along list... </p>
<p>how to show Every time only 10 rows ?</p>
<p>i work on asp.net and C#</p>
|
c# asp.net
|
[0, 9]
|
902,418 | 902,419 |
JS/AJAX Auto submit form: Disabling enter key to prevent page refresh
|
<p>I am using a function that will submit with ajax and without the help of a button click. But I am currently undergoing two issues which with trial and error haven't found plausible solutions: </p>
<p>First is there any way I can disable the enter button click(this causes the whole page to refresh)?</p>
<p><a href="http://jsfiddle.net/pXA6U/3/" rel="nofollow">JSFIDDLE</a> basic example in how the JS function works</p>
<p>Second, It feels like I am going the roundabout way to display what has been posted. How can I change this part of the function <code>$('#special').html('<p>' + $('#resultval', result).html() + '</p>');</code> to have it POST just inside a div called <code>#special</code> without the need of <code>span or <p> #resultval</code>?</p>
<p>Everytime i echo through php I have to do set it like this to display a result: <code><div id="special"><span id="resultval">This is the result.</span></div></code></p>
<pre><code><script>
$(document).ready(function() {
var timer = null;
var dataString;
function submitForm(){
$.ajax({ type: "POST",
url: "posting.php",
data: dataString,
success: function(result){
$('#special').html('<p>' + $('#resultval', result).html() + '</p>');
}
});
return false;
}
$('#ytinput').on('keyup', function() {
clearTimeout(timer);
timer = setTimeout(submitForm, 050);
var name = $("#ytinput").val();
dataString = 'name='+ name;
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
15,462 | 15,463 |
How to dislay Validation Message from code behind
|
<p>I have one textbox..
i want to validate it's value based on dropdownlist value..
So i am displaying message from code behind using <code>RegularExpressionValidator</code>..
But it is not working plz,give me suggestion.. </p>
<pre><code><asp:TextBox ID="tbnooflecture" runat="server" Width="119px" Height="33px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ForeColor="#6600FF"
runat="server" ValidationGroup="upper"
ControlToValidate="tbnooflecture"></asp:RegularExpressionValidator>
<asp:Button ID="bfillattendence" runat="server" Text="To Fill Attendence Click Here"
onclick="FillAttendence_Click" Width="218px" Height="33px" CausesValidation="true" ValidationGroup="upper"/>
</code></pre>
<p>i am writing below code in Button click event</p>
<pre><code>string batchname = dpbatchname.SelectedItem.Text.ToString();
int lengthofbatch=batchname.Length;
if(lengthofbatch==2)
{
RegularExpressionValidator1.ValidationExpression = "[1-9][02468]|[02468]";
RegularExpressionValidator1.ErrorMessage = "Only Even No. of Attendence is Valid for Lab.";
}
else if (lengthofbatch == 1)
{
RegularExpressionValidator1.ValidationExpression = "[0-9][0-9]|[0-9]";
RegularExpressionValidator1.ErrorMessage = "Attendence Shold be Like 9,50";
}
else
{
RegularExpressionValidator1.ValidationExpression = "[0-9][0-9]|[0-9]";
RegularExpressionValidator1.ErrorMessage = "Attendence Shold be Like 9,50";
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
1,384,892 | 1,384,893 |
Runtime error appeared after I moved some code to new class
|
<p>I had the code:</p>
<pre><code>namespace ShowDiagram1
{
public partial class WebForm1 : System.Web.UI.Page
{
bitmap.Save(Server.MapPath("pic1.jpg"), ImageFormat.Jpeg);
Image1.ImageUrl = this.ResolveUrl("pic1.jpg");
}
}
</code></pre>
<p>It worked okay.
I moved this code to new class</p>
<pre><code> namespace ShowDiagram1
{
public class MyDraw : WebForm1
{
...
bitmap.Save(Server.MapPath("pic1.jpg"), ImageFormat.Jpeg);
Image1.ImageUrl = this.ResolveUrl("pic1.jpg");
}
}
</code></pre>
<p>Now I have runtime error</p>
<blockquote>
<p>Object reference not set to an instance of an object. Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.</p>
<p>Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.</p>
<p>Source Error:</p>
<p>Line 85: Image1.ImageUrl = ResolveUrl("pic1.jpg");</p>
</blockquote>
<p>pic1.jpg was created okay.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
830,858 | 830,859 |
Check all fields together?
|
<p>There are three field. i want check each a of field if have value, show class <code>.koko</code>. if on all field not have value, hide class <code>.koko</code>.</p>
<p>How is it?</p>
<p>in the this code, each field is check separate but i want check all fields together:</p>
<pre><code><input type="text" name="ok" class="ko" value="">
<input type="text" name="ok" class="ko" value="">
<input type="text" name="ok" class="ko" value="">
<div class="koko" style="display: none;">Hello, how are you?</div>
$('.ko').live("keyup", function () {
var $val = $(this).val();
$('.koko').show();
if ($val == '') {
$('.koko').hide()
}
});
</code></pre>
<p><a href="http://jsfiddle.net/P8fMj/" rel="nofollow">DEMO</a></p>
|
javascript jquery
|
[3, 5]
|
3,200,660 | 3,200,661 |
Accessing data from iframe
|
<p>Suppose we have the following structure :</p>
<pre><code> <div id='main'>
<div id="1"> .. </div>
<div id="2">
<iframe id="ifr" src="some"></iframe>
</div>
</div>
</code></pre>
<p>How can we access div#1 contents from inside the iframe#ifr?</p>
|
javascript jquery
|
[3, 5]
|
5,634,283 | 5,634,284 |
JQuery Get current ID of Widget
|
<p>I have have the following</p>
<pre><code><div id="dualList"></div>
</code></pre>
<p>And I have written a plugin but for the sake of testing I have stripped it away. I am having problems with the plugin displaying the id of the div.</p>
<pre><code><script>
(function($) {
$.fn.DualList = function() {
var thisControl = $(this);
alert(thisControl.attr('id'));
}
})(jQuery);
</script>
</code></pre>
<p>And its bound on document on ready using
<b>$("#dualList").DualList();</b></p>
<p>Any ideas why the ID isnt echoing out?</p>
|
javascript jquery
|
[3, 5]
|
2,555,681 | 2,555,682 |
recognize position of element with jquery
|
<p>i've got a little pictureblog and would like to add the same affect like in the google reader. That means if a picture is in the center of my screen it should get a border. In the following example i relized similar thing with the hover effect. but this is not exactly what i want. How can i realize that with jquery? </p>
<pre><code>$(".blogentry").hover(
function() {$(this).css("border", "1px solid gray");},
function() {$(this).css("border", "1px dotted gray");}
)
</code></pre>
<p>Thank You!</p>
|
javascript jquery
|
[3, 5]
|
3,261,465 | 3,261,466 |
set value with jquery doen't work on the ipad for me
|
<p>if I do </p>
<pre><code>console.log($('#title').val());
</code></pre>
<p>everything works fine in every browser of course. Even on the iPad in ios-safari. But if I try to set a value like</p>
<pre><code>$('#title').val('some title');
</code></pre>
<p>nothing happens?</p>
<p>is that a known issue?</p>
<p>chris </p>
|
javascript jquery
|
[3, 5]
|
1,060,702 | 1,060,703 |
Resetting setTimeout object if exists
|
<p>When somebody clicks my checkboxes, from a long list of checkboxes, I want to show the number of selected checkboxes in a little popup element. My problem is, the little popup element should disappear 5 seconds after the <strong><em>last</em></strong> click, which is OK for one checkbox being clicked, but if I quickly check 5 boxes, the timer is still set on the first box, resulting in the popup element disappearing too quickly.</p>
<p>As you can see in my function, I've tried using the <code>clearTimeout(timeoutName)</code> function but have experienced some troubles applying it. The console log states that the <code>clearTimeout(timeoutName)</code> is undefined, which I can understand: the setTimeout hasn't even started yet.</p>
<p>How can I check that the timer exists before I clear it? Or is this really not the best method? When a checkbox is checked (this function runs) there could be a timer running but sometimes there could not be.</p>
<pre><code>$('.name_boxes').live('click', function() {
var checked_count = $('.name_boxes:checked').length;
// other stuff
clearTimeout(hide_checked_count_timer); // if exists????????
$(".checked_count").hide();
$(".checked_count").text(checked_count+" names selected");
$(".checked_count").show();
hide_checked_count_timer = setTimeout(function() {
$(".checked_count").hide();
},5000);
});
</code></pre>
<p>Any help gratefully received...</p>
|
javascript jquery
|
[3, 5]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.