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 |
---|---|---|---|---|---|
5,044,922 | 5,044,923 |
jquery Ellipse: How To Create Ellipse shape Gallery With jQuery
|
<p>This code is somewhat near to ellipse shape. I want my gallery shape to be arrange is ellipse shape like cloud carousel example. Right now i am using roundabout plugin shape tearDrop and below function used for tearDrop. I require similar function for ellipse shape.</p>
<pre><code>tearDrop: function (a, b, c) {
return {
x: Math.sin(a + b),
y: -Math.sin(a / 2 + c) + .35,
z: (Math.cos(a + b) + 1) / 2,
scale: Math.sin(a + Math.PI / 2 + b) / 2 + .5
}
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,066,305 | 4,066,306 |
How can I display three months at the same time using FullCalender Jquery
|
<p>How can I display three months at the same time using the FullCalender in Jquery?</p>
|
javascript jquery
|
[3, 5]
|
4,561,506 | 4,561,507 |
DisplayMessageActivity cannot be resolved to a type-Building first android App
|
<p>Hi I have just began working on the first android application on <strong>developer.android.com</strong>.</p>
<p>well to start with I got to learn many error origins and their solutions from S.O. , but i have been trying to figure out this statement
<em>"DisplayMessageActivity cannot be resolved to a type"</em> while we have to set an Intent for button onclick function. It shows this error in the line where the code line is:</p>
<pre><code>Intent intent = new Intent (this, DisplayMessageActivity.class);
</code></pre>
<p>here is the java file:</p>
<p><strong>MainActivity.java</strong></p>
<pre><code>}
/**called when the user clicks the send button*/
public void sendMessage(View view) {
Intent intent = new Intent (this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById (R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity (intent);
}
}
</code></pre>
<p>I tried a lot find which class do I need to import now, and searched but no avail.
may be I am a beginner is what I miss here.</p>
|
java android
|
[1, 4]
|
3,424,252 | 3,424,253 |
File missing in ajax:AsyncFileUpload on saving
|
<p>I have an ajax:AsyncFileUpload on my asp file</p>
<pre><code><asp:UpdatePanel ID="modalActLogAction" runat="server" >
<ajax:AsyncFileUpload ID="fuActionAttachment" runat="server" Width="240px" OnClientUploadComplete = "OnClientUploadCompleteFn"/>
</asp:UpdatePanel>
</code></pre>
<p>The problem is when I try to access after submitting the file, its empty.</p>
<pre><code>if(fuActionAttachment.HasFile)
{
//save statement
}
</code></pre>
<p>I have tried to put <code>enctype="multipart/form-data" method="post"</code> on my form tag in my masterpage and still won't work. On my other pages, I do have the same file upload method and they are working properly.</p>
|
c# asp.net
|
[0, 9]
|
2,279,406 | 2,279,407 |
Prints pdf when page loads
|
<p>I have this code in my aspx page;</p>
<pre><code><a href="javascript:void(0);" onclick=<% Print(); %> title="Print listings">Print</a>
</code></pre>
<p>which presents a link to print a listings to a pdf when the user clicks on it; as you can note the script calls a function from the behind code.</p>
<p>The problem is that when I coded this it happens that when I go this page it prints to pdf when is loading, I thought it would wait for a click but instead it performs the printing.</p>
<p>What is the problem? thanks in advance.</p>
<p>PD. I'm working with VS2005 and for the pdf creation I use iTextSharp.</p>
|
c# asp.net javascript
|
[0, 9, 3]
|
5,704,826 | 5,704,827 |
C# - Get Image path from Client Machine
|
<p>I want to get the path of the Image which is saved in Client Machine. I know the Path and the file name of the Image. By using FileUpload i can do it, but without using fileupload is it possible to get the path of the file ??.</p>
<p>My Scenario is given below,</p>
<pre><code>Public void ConverttoByte()
{
//Get the image path from web.config & this image is in client machine
string strConfig = @"C:\Manikandan\image\image1.jpg";
MemoryStream MS = new MemoryStream();
Byte[] data;
int fiFileSize;
System.Drawing.Image image;
image = System.Drawing.Image.FromFile(strConfig);
image.Save(MS, System.Drawing.Imaging.ImageFormat.Gif);
data = MS.ToArray();
CallDBMethod(data);
}
</code></pre>
<p>Here I converted the image as <em>Byte</em> and I called the <strong>CallDBMethod</strong> to insert this byte details to DB..</p>
<p>This image is available in client machine, but not in server machine..</p>
<p>So, how to i get this image path from client machine & how can i solve this?</p>
|
c# asp.net
|
[0, 9]
|
1,280,420 | 1,280,421 |
how to get array of array in javascript
|
<p><strong>I'm creating graph and for this I need data in this form in javascript:</strong></p>
<pre><code>var currYear = [["2011-08-01",796.01], ["2011-08-02",510.5], ["2011-08-03",527.8], ["2011-08-04",308.48]]
</code></pre>
<p><strong>Data is coming from JSON</strong></p>
<pre><code>var total_click = JSON.parse(<%=raw @report.to_json %>);
var i=0;
var graph_type = "";
var graph_typ = new Array();
while(i < total_click.length){
graph_typ.push("['"+total_click[i].report_date+"',"+total_click[i].clicks+"]");
i++;
}
</code></pre>
<p><strong>Data which I get from this is below</strong></p>
<pre><code>['2012-03-19',48],['2012-03-20',14],['2012-03-21',934]
</code></pre>
<p><strong>How do I get this format</strong></p>
<pre><code>[['2012-03-19',48],['2012-03-20',14],['2012-03-21',934]]
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,387,578 | 4,387,579 |
Creating a System.Web.Caching.Cache object in a unit test
|
<p>I'm trying to implement a unit test for a function in a project that doesn't have unit tests and this function requires a System.Web.Caching.Cache object as a parameter. I've been trying to create this object by using code such as...</p>
<pre><code>System.Web.Caching.Cache cache = new System.Web.Caching.Cache();
cache.Add(...);
</code></pre>
<p>...and then passing the 'cache' in as a parameter but the Add() function is causing a NullReferenceException. My best guess so far is that I can't create this cache object in a unit test and need to retrieve it from the HttpContext.Current.Cache which I obviously don't have access to in a unit test.</p>
<p>How do you unit test a function that requires a System.Web.Caching.Cache object as a parameter?</p>
|
c# asp.net
|
[0, 9]
|
5,202,000 | 5,202,001 |
jquery trigger not opening link
|
<pre><code><a id="divLink" href="http://google.com" target="_blank">GOOGLE</a>
<a id="divLinkOpen" href="#" >Open</a>
$('#divLinkOpen').unbind('click').click(function() {
$('#divLinkOpen').trigger("click");
});
</code></pre>
<p>trigger not opening the link for google</p>
|
javascript jquery
|
[3, 5]
|
443,740 | 443,741 |
How to Set a Parameter for WhereParameters in EntityDataSource
|
<p>I have an EntityDataSource and I need set WHERE to a Local Variable Type: GUID.</p>
<p>My problem is I am not able to send my local variable Guid to EntityDataSource for a WHERE OPERATION.</p>
<p>I also tried to to use a ControlParameter<code><asp:ControlParameter Name="UserId" /></code> and have a Label with Text property on my Guid converted in String. But does not work.</p>
<p>Any idea how to solve teh matter</p>
<pre><code> <asp:EntityDataSource ID="EntityDataSourceListAuthors" runat="server"
AutoGenerateWhereClause="True"
ConnectionString="name=CmsConnectionStringEntityDataModel"
DefaultContainerName="CmsConnectionStringEntityDataModel"
EnableFlattening="False" EntitySetName="CmsAuthors" Where=""
EntityTypeFilter="" Select="">
<WhereParameters>
<asp:Parameter Name="UserId" />
</WhereParameters>
</asp:EntityDataSource>
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,305,752 | 5,305,753 |
Getting alert while trying to delete using jQuery Ajax delete
|
<p>I am getting the following popup while trying to delete a value. I'm using jQuery Ajax to delete the value. Programming language I use is python2.7 and the framework is Django 1.3.2</p>
<p>My code is as follows:</p>
<pre><code>$.ajax({
type: "DELETE",
url: window.location.pathname + id + '/data-centers/' + dc,
contentType: 'application/html; charset=utf-8',
data: {
dc : dc,
},
success: function(){
alert("success");
}
etc...
</code></pre>
<p>When I confirm to delete the value I'm getting the following popup from the JavaScript saying:</p>
<pre><code>"This web page is being redirected to a new location. Would you like to resend
the form data you have typed to the new location?
</code></pre>
<p>And in the Ajax header I can see following (it's trying to redirect to other location, but don't know why):</p>
<pre><code>Connection Keep-Alive
Content-Encoding gzip
Content-Length 251
Content-Type text/html; charset=iso-8859-1
Date Tue, 27 Nov 2012 13:53:44 GMT
Keep-Alive timeout=5, max=100
Location http://www.test.com/403/test-403.html
Vary Accept-Encoding
Request Headers
Accept */*
Accept-Encoding gzip, deflate
Accept-Language en-us,en;q=0.5
Connection keep-alive
Content-Length 12
Content-Type application/html; charset=utf-8
</code></pre>
<p>This only happens when I try to use DELETE.</p>
|
jquery python
|
[5, 7]
|
2,323,078 | 2,323,079 |
setting margin of a TableRow issue
|
<p>I have the following code, which tries to set the margin:</p>
<pre><code>TableRow tr = new TableRow(this);
TableLayout.LayoutParams tableRowParams=
new TableLayout.LayoutParams
(TableLayout.LayoutParams.FILL_PARENT,TableLayout.LayoutParams.WRAP_CONTENT);
int leftMargin=20;
int topMargin=50;
int rightMargin=0;
int bottomMargin=50;
tableRowParams.setMargins(leftMargin, topMargin, rightMargin, bottomMargin);
tr.setLayoutParams(tableRowParams);
TextView name = new TextView(this);
name.setText(Html.fromHtml(venues.get(j).name + "<br><br>" + venues.get(j).getFullAddress()));
</code></pre>
<p>However this doesn't set the margin. What am I doing wrong here?</p>
|
java android
|
[1, 4]
|
983,297 | 983,298 |
Unexpected call to method or property access. in JQUERY
|
<p>My code which is giving error in IE8</p>
<pre><code>$(function(){
$.ajax({url:"http://localhost/css/register.txt",
cache : false,
success:function(ris){$("<style></style>").appendTo("head").html(ris);//culprit statement
},
error:function(){}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,645,181 | 2,645,182 |
Retrieve an email-id from url
|
<p>I have an page where I am embedding email-id of the user into the url and sending him mail
now I want to extract the email from the url and match the value with the database. My question is how do I retrieve that email from that url?</p>
<pre><code>string url = "http://localhost:3063/user/Authenticate-Users.aspx?"+emailfield;
</code></pre>
<p>this is the url...</p>
|
c# asp.net
|
[0, 9]
|
4,115,358 | 4,115,359 |
Convert php code to Java/android
|
<p><a href="http://pastebin.com/Cz8gbxs8" rel="nofollow">http://pastebin.com/Cz8gbxs8</a></p>
<p>is there a way to convert this php code, to a java code?</p>
<p>Thanks, anyway</p>
|
java php android
|
[1, 2, 4]
|
3,622,329 | 3,622,330 |
Working with Arraylist
|
<p>I have an array list for ex</p>
<pre><code>Arraylist name = called an arraylist method();
</code></pre>
<p>the <code>Arraylist</code> method() returns the list which is stored in the <code>Arraylist</code> name</p>
<p>Now I want to assign the <code>Arraylist</code> which shows count 1.
This <code>Arraylist</code> returs two records ie {a, c}</p>
<p>I need to assign a to one vaiable and then c to another variable. How should I do it since I tried </p>
<pre><code>string x=name[0].tostring();
// here it shows this error
// "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
string y=name[1].tostring();
</code></pre>
<p>But the above code does not work</p>
<p>Please provide me with a solution</p>
<p>Thanks </p>
|
c# asp.net
|
[0, 9]
|
1,547,781 | 1,547,782 |
how to check a php cookie is set or not in jquery
|
<p>I am developing w php web site. Here I have set a php cookie</p>
<pre><code> setcookie('hotelId',$resHotel);
</code></pre>
<p>I want to check whether it’s set or not using jquery or javascript. I have used the following code </p>
<pre><code>if($.cookie('hotelId')) {
alert("yes");
};
</code></pre>
<p>But it's not working</p>
<p>Is there is any way to find PHP cookie is exist or not in jquery</p>
<p>Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
994,205 | 994,206 |
How to reuse this C# code?
|
<p>I can´t find a way to reuse the code below in all my webpages.</p>
<p>How can I do it?</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Page.Request.UrlReferrer == null)
{
Response.Redirect("test.aspx");
}
}
}
</code></pre>
<p>I´d like to use something like this:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
CheckURL();
}
</code></pre>
<p>Please, give me a example! :) I´m new using the C#! </p>
|
c# asp.net
|
[0, 9]
|
4,110,983 | 4,110,984 |
php---how the site publish the thumbnail
|
<p>i want to konw how this site (www.retailmenot.com)publish the thumbnail. the thumbnails are under "Today's Top Coupons" part.do they first use a screenshot software to get the site image down and save it then publish it. but this way will have too trouble.am i right? </p>
|
php javascript
|
[2, 3]
|
3,010,836 | 3,010,837 |
replace a text with another within a tag
|
<p>I'm sure it's stupidly easy, but how can I replace just the text within an html tag. For instance, from this:</p>
<pre><code><div style="display: block;">blah blah</div>
<a href="#" style="display: inline; ">(Old text)</a>
</code></pre>
<p>to this:</p>
<pre><code><div style="display: block;">blah blah</div>
<a href="#" style="display: inline; ">(New text)</a>
</code></pre>
<p>replace Old text => New text<br>
Many thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
6,031,341 | 6,031,342 |
Creating a loop that populates a select tag
|
<pre><code>function buildOrder(data) {
var $fragment;
$fragment = $('<div/>');
for (var i = 0; i < data.length; i++) {
$fragment.append('<div class="row-container"><div class="row cupcake-row">' + data[i].name + '</div><div class="clear"></div></div>');
}
$('#review-section').append($fragment);
}
</code></pre>
<p>I essentially want to add a tag with 50 options being dynamically created using a for loop. But I'm not sure what the syntax would be to add it to the <code><div class="row-container"/></code> I know in php I would just throw the loop in the middle and echo the options, however that doesnt work in javascript.</p>
<p>EDIT:</p>
<p>It would look like this:</p>
<pre><code>$fragment.append('<div class="row-container"><div class="row cupcake-row">' + data[i].name + '</div><select><option value="1">1</option> etc...</select><div class="clear"></div></div>');
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,325,422 | 5,325,423 |
Android - first run preference initialization
|
<p>I have next situation:
After installing application it has to init settings from server. And while itis not has right preferences it has to wait. I have several receivers and service - I dont want to check for initialization in every action in these components - I think there have to be better solution. Can somebody help me with it? :)</p>
|
java android
|
[1, 4]
|
2,833,414 | 2,833,415 |
How to monitor iframe clicks?
|
<p>I have a website called A i want to display another website called myFrame through A using iframe i want to count all the clicks in myFrame and want to display in my website A.myFrame site is in different domain.I did the following code but its not working.
i can add any javascript code in myFrame website </p>
<pre><code><html>
<body>
Count: <span id="clicks">0</span>
<iframe id="myframe" src="http://www.myFrame.com" class="restricted" height="400px;" width="400px;" scrolling="no" frameborder="0">
</iframe>
</body>
</html>
<script language="javascript">
$(function() {
var clicks = 0;
$('#myframe').contents().find('a').bind('click', function(e) {
e.preventDefault();
clicks++;
$('#clicks').html(clicks);
});
});
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,574,516 | 5,574,517 |
Jquery: How to disable an image's click function while loading?
|
<p>This won't work using:</p>
<pre><code>$('div#menuBar,#goLeftBtn,#goRightBtn').attr('disabled', true);
</code></pre>
<p>in the document.ready</p>
<p>Any ideas?
Thanks!</p>
<p><strong>EDIT:</strong><br/>
My html is basically like this:</p>
<pre><code> <div id="floatRight">
<img src="./images/all_left.png" id="goAllLeft" class="arrow" />
<img src="./images/left.png" id="goLeft" class="arrow" />
<img src="./images/right.png" id="goRight" class="arrow"/>
<img src="./images/all_right.png" id="goAllRight" class="arrow" />
</div>
</code></pre>
<p>I know those aren't the exact image names in the jquery code above, but that is how all of my img's are basically set up & for that particular line of code I only need those img's to be disabled. </p>
|
javascript jquery
|
[3, 5]
|
1,642,934 | 1,642,935 |
session value lost in asp.net in c#
|
<p>Am doing wepsite for show images from local drive using asp.net.am using session object for Transfer image path from first page to second page
its running nice in vs 2003 .but i converted this website to vs 2005.but session value does't pass to next page.i got null value in session object.
am using inproc session mode</p>
<p>kindly help me
thanks</p>
|
c# asp.net
|
[0, 9]
|
5,617,109 | 5,617,110 |
help me understand JS execution on onclick event of button
|
<pre><code><input type="button" name="reset"
onclick="return ValidateValue(); __doPostBack('ApplyBtn','')" />
</code></pre>
<p>The above is the code generated for asp server button button control on browser.</p>
<p>Now my query is that irrespective of <code>ValidateValue()</code> returning true/false <code>__doPostBack('ApplyBtn','')</code> function is not showing any effect for me. </p>
<p>My understanding is that string passed to onclick acts like function body, and <code>return</code> will from first function will return control preventing second function from execution.
Is that correct ?</p>
<p>Please provide helpful inputs.</p>
|
asp.net javascript
|
[9, 3]
|
4,382,072 | 4,382,073 |
JQuery callback to previously defined function
|
<p>I'm still learning JQuery (and as a result a little JavaScript) but I can't seem to find out how to use a previously defined function in a callback.</p>
<p>Say I have:</p>
<pre><code><script>
$(document).ready(function() {
function ajax_start() {
alert("starting...");
}
});
</script>
</code></pre>
<p>And I wish to use this in another function e.g:</p>
<pre><code><script>
$(document).ready(function() {
$.ajax({
beforeSend: ajax_start(),
url: "insert_part.php",
type:"POST",
data: "customer="+customer
});
});
</script>
</code></pre>
<p>Would this be correct? (I assume not as it doesn't...) what is the proper way of doing a callback?</p>
|
javascript jquery
|
[3, 5]
|
5,055,023 | 5,055,024 |
Changing the inner tags class of a tag using jquery or javascript
|
<p>I have the following code:</p>
<pre><code><li id="toto" class="jstree-leaf">
<ins class="jstree-icon2">&nbsp;</ins>
<a class=""><ins class="jstree-icon2">&nbsp;</ins>Story B</a>
</li>
</code></pre>
<p>I need to change the class of the <code><ins></code> tags for a specific <code><li></code>.
I need to access the <code><li></code> id and then change the class of all <code><ins></code> tags found inside it</p>
<p>I would appreciate it if someone could show me the right way to do that.</p>
<p>Thanks a lot..</p>
|
javascript jquery
|
[3, 5]
|
5,391,718 | 5,391,719 |
Submit form and get redirect url
|
<p>I need to submit some data on a website in-order to register a server. I need to enter information onto a form in the first webpage and upon submitting the information, the webpage takes me to a dynamically created page (I also need to retrieve this page) where I have to enter more information in the form. </p>
<p>I need to accomplish this task programmatically. I can either use Java, Javscript or C#. I am familiar with the languages, but not completely sure what libraries could I use in any of the languages to achieve this task. I would really appreciate it if you guys can provide some help/hints or starting points on this issue. </p>
<p>Thanks</p>
|
c# java javascript
|
[0, 1, 3]
|
419,269 | 419,270 |
How to create Tabbed interface to display the gridview
|
<p>Can anybody help me please it is urgent to me please..... how to Create Tabbed interface to display the Grid view when i click a tab button in asp.net code behind c#.</p>
|
c# asp.net
|
[0, 9]
|
31,086 | 31,087 |
Equivalent implementation for <customErrors mode=RemoteOnly /> behaviour
|
<p>From <a href="http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx" rel="nofollow">msdn</a> site, I know that <strong>customErrors</strong> element provides information about custom error messages for an ASP.NET application. <strong>RemoteOnly</strong> value for <strong>mode</strong> attribute specifies that custom errors are shown only to the <em>remote clients</em>, and that ASP.NET errors are shown to the <em>local host</em>. </p>
<p>At c# side, how can it be implemented, that some logic invokes only for remote clients, and other for local host (c# code which check this condition will be invoked from Global.asax.cs Application_Error level) ?</p>
|
c# asp.net
|
[0, 9]
|
3,943,829 | 3,943,830 |
ajQuery - Start slideshow on click
|
<p>I'm new to jQuery and would like to start a slideshow after a link is clicked instead of after the page is loaded. How to do that?</p>
<pre><code>> <script type="text/javascript">
> jQuery(document).ready(function($){ $("a[rel^='id']").prettyPhoto({
> theme: 'pp_default',slideshow:5000, autoplay_slideshow:true});
> });
> </script>
</code></pre>
<p>I would like to start it like this:</p>
<pre><code><a href="javascript:startSlideshow()">Start Slideshow</a>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,394,907 | 2,394,908 |
EnableViewState Question in nested user controls - ASP.NET
|
<p>I have a page with (EnableViewState = "true") that has a parent control with (EnableViewState = "true"). The parent control loads a child control. </p>
<p>In the child control, I have a viewstate object that gets assigned to null on postbacks. The strange thing is if I set EnableViewState = "true" on the child control, then everything works fine.</p>
<p>My understanding was this directive is true by default. How does it matter whether I set this explicitly or not.</p>
|
c# asp.net
|
[0, 9]
|
2,294,890 | 2,294,891 |
find control in panel in datalist
|
<p>I had Datalist and inside it panel and inside panel label and I want to find label inside panel inside datalist.I did my code but it didnot work well</p>
<p>
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{</p>
<pre><code> Label LblHead = e.Item.FindControl("Label1") as Label;
string LanguageID = Globals.GetSuitableLanguage(Page);
if (LanguageID == "ar")
{
LblHead.Attributes.Add("CssClass", "hed_logo2");
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,076,468 | 2,076,469 |
call a code behind function from jquery in aspx
|
<p>I want to call a codebehind function from jquery.</p>
<p>The aspx file name is group_master.aspx</p>
<p>The jquery is </p>
<pre><code> function populatecontrol(list, control) {
var id = 0;
var GroupName=document.getElementById('<%=hdnGroupNameCheck.ClientID %>');
if (list.length > 0) {
$.each(list, function (key, value) {
var obj = JSON.parse(value);
document.getElementById('<%=hdnGroupNameCheck.ClientID %>').value=obj.Second;
control.html("Group already exist").append('<a id="editclick" href ="edit('+obj.Second+')">Click here to edit or enquire</a>');
});
}
else
control.text="Group does not exist"
}
</code></pre>
<p>The edit('+obj.Second+') is an edit function in codebehind.</p>
<p>Thanks,</p>
|
jquery asp.net
|
[5, 9]
|
1,352,832 | 1,352,833 |
Forms authentication , logged time , get logged username from crypted cookie in the sqldatasource parameter source
|
<p>I have a sqldatasource and a gridview.
I'm using forms authentication.</p>
<p>After the user logged in , I'm crypting his name</p>
<pre><code>FormsAuthenticationTicket tkt;
string cookiestr;
HttpCookie ck;
tkt = new FormsAuthenticationTicket(1, txtUserName.text, DateTime.Now,
DateTime.Now.AddMinutes(30), true, false);
cookiestr = FormsAuthentication.Encrypt(tkt);
ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
ck.Expires=tkt.Expiration;
ck.Path = FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(ck);
</code></pre>
<p>In the redirected page I need to set in the sqldatasource , where -> parameter source : cookie</p>
<ul>
<li><p>BUT,</p></li>
<li><p>1.I don't know the cookie name because as I can see it doesn't have one.</p></li>
<li><p>2.Since the cookie was crypted , the sqldatasource must use the decrypted cookie..well..I'm not sure what to do in order to use the username string.</p></li>
</ul>
<p>All in all , I'm trying to crypt his name and in the redirected page to use the logged user name in a sqldatasource where condition . I can do this if I Don't crypt the cookie but..since the cookie can be edited..I don't want ppl to edit cookies.</p>
|
c# asp.net
|
[0, 9]
|
3,028,976 | 3,028,977 |
Open new process from a java application which is started by a windows service
|
<p>I'm having a java application which opens the notepad.exe using, Runtime.getRuntime().exec().</p>
<p>And I want to run this application as a windows service. So I created a windows service using C#.</p>
<p>and I could successfully installed the service using 'installutil' command. </p>
<p>But although my java application started properly by the windows service, it does not open the notepad.exe.</p>
<p>I thought the problem is where the service is run as a SYSTEM process but not as the current login user. So I installed the service under the current user, by giving user credentials in installutil command.</p>
<p>Then the service and the java application properly started under the current user and I could see notepad.exe also created under the same user. But notepad is not visible.</p>
<p>Can anyone guide what has happened here please.</p>
<p>Thanks</p>
|
c# java
|
[0, 1]
|
5,119,852 | 5,119,853 |
dynamically set the dropdown jquery
|
<p>I am trying to do this.</p>
<pre><code> $("#slot_+num option[value='8']").remove();
</code></pre>
<p>if I do this</p>
<pre><code> $("#slot_0 option[value='8']").remove();
</code></pre>
<p>It works, but if I try to set the selector dynamically with variable num it doesn't do anything. </p>
|
javascript jquery
|
[3, 5]
|
4,623,480 | 4,623,481 |
How to remove "Warning: Unresponsive Script"
|
<p>I am using jQuery ajax code like this: </p>
<pre><code>$.each(url_id, function(index, value) {
$.ajax({
async: false,
type: "POST",
url: "webservices/insert-manual.php",
data: { url_id: value},
dataType: "json"
}).done(function(response){
if(response.code == "200"){
$("#results").append('<div class="results-list"><strong>Well done!</strong></div>');
}else{
$("#results").append('<div class="results-list-error"><strong>Oh snap!</strong> There is no records to update in database.</div>');
}
});
});
</code></pre>
<p>When i run this script I got this error message in mozilla alert.</p>
<pre><code>A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
Script: http://localhost/jquery-project/js/jquery-1.7.2.min.js:2
</code></pre>
<p>and this ask me to <code>Stop Script</code> or <code>Continue</code>. </p>
<p>If I click on <code>Stop Script</code> then it stop the loop <code>$.each</code> or if I click on continue then it continue to run further code and after some time it again ask me.</p>
<p>My question is how can remove this alert. </p>
|
php javascript jquery
|
[2, 3, 5]
|
5,164,986 | 5,164,987 |
jquery cancelling select event
|
<p>Whenever the user does a mousedown on an HTML document and drags the mouse before he releases the button, the content he's moving over becomes selected.</p>
<p>I'm creating a jquery slider and I'd like to cancel this event so that when the user drags his mouse with the mouse down over when the mouse is over text, the text isn't selected.</p>
<p>This example works: <a href="http://www.filamentgroup.com/examples/slider/index2.php" rel="nofollow">http://www.filamentgroup.com/examples/slider/index2.php</a></p>
<p>If you start the mousedown when the cursor is over the "This is an example from the..." text, the text is selected.</p>
<p><strong>However, if you start the mousedown when the cursor is over the scroll elevator and then move the mouse over the "This is an example from the..." text, the text is NOT selected while you're moving the cursor over the text</strong>.</p>
<p>How did they cancel the selection of the text?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
5,775,451 | 5,775,452 |
Find word on page, wrap in span tags with class
|
<p>I would like to Find word on page, wrap in span tags with class. before proceeding to execute a javascript i have almost got ready.</p>
<p>If i can work out how to just do this first part i think i can get the rest.</p>
<p>Find word on page, wrap in span tags with a class applied to the span tags.
Must then be searchable via:</p>
<pre><code> $(document).ready(function(){
var injectionKey = /%id=inject%/ig;
var injectionStack = $('#%id%').html();
(function($) {
var theInjectionPage = $("span.myclass");
theInjectionPage.html(theInjectionPage.html().replace(injectionKey, injectionStack));
})(jQuery)
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,253,839 | 5,253,840 |
Disabled Checkbox is not showing as checked in jQuery
|
<p>All,
I have the following bit of PHP to check a checkbox:</p>
<pre><code><input type="checkbox" name="check_out_gear[]" id="'.$resultsetgear['gear_checkout_id'].'" value="'.$resultsetgear['gear_checkout_id'].'" class="gear_checkout_checkbox" checked disabled>
</code></pre>
<p>That code works fine and the checkbox is checked and it is disabled. I'm checking to see if it at least one checkbox is checked by using the following jQuery:</p>
<pre><code>var fields = jQuery(".gear_checkout_checkbox").serializeArray();
if (fields.length == 0)
{
jQuery.wl_Alert('Please select a piece of equipment that you\'re checking out!','warning','#no_answers','#workform', {sticky:false});
one_selected = false;
}
</code></pre>
<p>When that checkbox is checked and disabled the length is always 0. However as soon as I remove the disabled from the code it has a length of at least 1. Any idea how I can get this code to work with a disabled checkbox?</p>
|
php jquery
|
[2, 5]
|
2,019,925 | 2,019,926 |
The literal of type long is out of range
|
<p>Hi I am trying to do some calculations for a unit converter im creating and have stumbled upon a problem.</p>
<pre><code>out10 = doubleInput / 94605284000000000000000L;
</code></pre>
<p>Eclipse says that "The literal of type long is out of range", I didn't even think this was possible, but maybe some f you know how to work around it ?</p>
|
java android
|
[1, 4]
|
5,739,305 | 5,739,306 |
Getting data from EditText fields
|
<p>I have created a custom <code>AlertDialog</code> with multiple <code>EditText</code> fields using a custom layout. Now the problem is don't know how to get data from these <code>EditText</code> when user clicks. Here's the <strong><code>AlertDialog</code></strong>.</p>
<pre><code> case R.id.menu_newitem:
LayoutInflater factory = LayoutInflater.from(this);
final View textEntryView = factory.inflate(R.layout.newvslayout, null);
new AlertDialog.Builder(this).setTitle("New VS")
.setView(textEntryView).setPositiveButton("Ok", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int whichButton) {
/* User clicked OK so do some stuff */
}
}).setNeutralButton("Cancel", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int whichButton) {
/* User clicked cancel so do some stuff */
}
}).show();
</code></pre>
<p>And this is my layout <strong>newvslayout.xml</strong></p>
<pre><code>....
....
<EditText android:id="@+id/vsname" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Name"
android:inputType="text" />
<EditText android:id="@+id/csize" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="100"
android:inputType="number" />
<EditText android:id="@+id/dsize" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="600" android:inputType="number" />
<EditText android:id="@+id/ssize" android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="200" android:inputType="number" />
....
....
</code></pre>
|
java android
|
[1, 4]
|
3,216,973 | 3,216,974 |
Setting a title to a custom dialog box
|
<p>I have created a custom dialog box extending the <code>DialogFragment</code> class. As stated in the Androïd developer's guide, I have set the style and theme of my dialog. I use the <code>DialogFragment.STYLE_NORMAL</code> style, which, I suppose, authorizes to set a title to the box. This seems confirmed by the fact that a style called <code>DialogFragment.STYLE_NO_TITLE</code> exists.</p>
<p>The problem is I can't find any function to set this title.</p>
<p>How can I do?</p>
<p>Thanks in advance for the time you will spend trying to help me.</p>
|
java android
|
[1, 4]
|
3,530,444 | 3,530,445 |
Div positioning fixed at margin-top:20px when scrolling up
|
<p>I have a div which I want to become fixed at 20px from the top of the window when you scroll up and 40px from the footer when you get the bottom. My code seems inconstant, there must be a better way? <a href="http://www.halogamertags.com/dachs" rel="nofollow">Page Link</a></p>
<pre><code>$(document).scroll(function () {
if($(window).scrollTop() >= 345){
$('#rightShipping').css({'position' : 'fixed', 'top' : '0px'});
}
if($(window).scrollTop() <= 346){
$('#rightShipping').css({'position' : '', 'top' : ''});
}
console.log($(window).scrollTop());
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
6,008,821 | 6,008,822 |
How to replace document.getElementById('file-uploader') with jQuery?
|
<p>How to replace <code>document.getElementById('file-uploader')</code> with jQuery?</p>
<p>just </p>
<pre><code>var myElement = document.getElementById('file-uploader');
</code></pre>
<p>into jQuery expression?</p>
<p>Thanks!!!</p>
|
javascript jquery
|
[3, 5]
|
4,716,354 | 4,716,355 |
Python Regular Expressions in PHP
|
<p>What would be the PHP equivalent to this code, I have tried curl but am unable to get it to work</p>
<pre><code>import urllib2,urllib,re
url=' Delete me'
req = urllib2.Request(url)
req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3 Gecko/2008092417 Firefox/3.0.3')
response = urllib2.urlopen(req)
link=lemon.read()
response.close()
match=re.compile('Delete me 2').findall(link)
print match
</code></pre>
<p>Ok my code now looks like this </p>
<pre><code><?php
$url = "url";
$homepage = file_get_contents($url);
print $homepage
?>
</code></pre>
<p>in python I would now find the strings I need using something like this</p>
<pre><code>match=re.compile('src="(.+?)" border="0" /></td>\n <td class="namewidth"><a title=".+?" href="(.+?)">(.+?)</a>').findall(link)
</code></pre>
<p>(.+?) being the unknown what is the equivalent to this in php?</p>
|
php python
|
[2, 7]
|
5,738,033 | 5,738,034 |
How to trim content of element and put "..." if the characters go over a certain limit?
|
<p>I would like to trim a part of the <code><td></code> if it is too long. This will make sure the table doesn't get messed up. All the data in the following table is retrieved from a database. On the "Subject" part, how could I make the text shorten and put "..." if it goes over a certain character limit? Here is a screenshot of the table:</p>
<p><img src="http://i.stack.imgur.com/hmSJQ.png" alt="screenshot"></p>
<p>As you can see if the subject gets too long it may mess up the table. </p>
<p>Is there any jQuery that will make the element trim only if it goes over a certain limit and put "..." at the end? I don't think a truncate plugin would work because it usually splits it up and makes a line break and I don't need it to show because all the person using this would have to do is click "View ticket" and they will see the full subject there.</p>
<p>I searched other questions on StackOverflow but I couldn't find one that is what I need.</p>
|
javascript jquery
|
[3, 5]
|
4,745,746 | 4,745,747 |
How to find a DropDownList in a GridView ItemTemplate without RowDataBound?
|
<p>I have a DropDownList outside of a GridView and I have a DropDownList inside an ItemTemplate of a GridView. The DropDownList that is outside has a SelectedIndex_Changed event and when that fires, it should populate the DropDownList inside the GridView. The problem is that in the method that I use to populate the inside DropDownList, it can't find the control: Here is sample code that is called when the outside DropDownList is changed:</p>
<pre><code> //Does not find ddlRoom
DropDownList ddlRoom = (DropDownList)gv.TemplateControl.FindControl("ddlRoom");
if (rows.Count() > 0)
{
var rooms = rows.CopyToDataTable();
ddlRoom.Items.Clear();
ddlRoom.Items.Add(new ListItem("Select...", "-1"));
ddlRoom.DataSource = rooms;
ddlRoom.DataBind();
}
</code></pre>
<p>I have also tried:</p>
<pre><code>DropDownList ddlRoom = (DropDownList)gv.FindControl("ddlRoom");
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,030,244 | 4,030,245 |
JavaScript, JQuery Problem: Function triggered automatically when page load!
|
<p>I'm a newbie in jQuery, so excuse me for asking such a simple question. I want to use <a href="http://plugins.jquery.com/project/spin-button" rel="nofollow">jQuery Spin</a> library and get notified when the value is changing. Here is my code:</p>
<pre><code><script>
$(document).ready(function(){
$.spin.imageBasePath = './theme/css/images/spin1/';
$('#spin1').spin({
min: 1,
max: 99,
lock: true,
beforeChange: calculate_price()
});
});
function calculate_price() {
$('#lblTotalPrice')[0].innerHTML = $('#spin1')[0].value;
}
</script>
</code></pre>
<p>It's very simple. But the problem is "calculate_price" function is triggered everytime page loaded and it did not trigger when user change the value of Spin Edit.</p>
<p>Does somebody have an idea why this is happening?</p>
|
javascript jquery
|
[3, 5]
|
3,401,200 | 3,401,201 |
How to read a string from a certain word onward in java?
|
<p>I want to use the uri value of an image (location on disk) in my app. For that, I have to use a string that starts with /sdcard/...</p>
<p>I can open up a file manager to help select the picture, but even so every file manager adds something to the front, be it /mnt/sdcard or something else. I can't use substring because the number of letters in front of /sdcard isn't always the same.</p>
<p>I want to read this string from /sdcard onward, is there a way I can do this? </p>
|
java android
|
[1, 4]
|
3,008,374 | 3,008,375 |
ObjectDataSource not showing up Data Objects in Configure Data Source
|
<p>I am using visual studio 2008, i included a class in the AppCode folder and wated to use its functions in ObjectDataSource.</p>
|
c# asp.net
|
[0, 9]
|
1,981,226 | 1,981,227 |
jquery dropdownlist, onchange reload page using Get request with ID of dropdown value
|
<p>When someone selects an item in a dropdown, I want to reload the current page with the value of the ID in the selected item in the querystring like:</p>
<pre><code>http://www.example.com/mypage?id=234
</code></pre>
<p>How can I do this?</p>
|
javascript jquery
|
[3, 5]
|
2,320,367 | 2,320,368 |
Remove javascript code using jQuery
|
<p>I used</p>
<pre><code><div id="myJSDiv"><script>...</script></div>
$("#myJSDiv").html('');
</code></pre>
<p>and</p>
<pre><code><script id="myJSDiv">...</script>
$("#myJSDiv").remove();
</code></pre>
<p>but nothing removed.</p>
<p>JS script is</p>
<pre><code><script id="count_down">
var ss = 150;
function countdown() {
ss = ss-1;
if (ss<0) {
window.location="google.com";
}else {
document.getElementById("countdown").innerHTML=ss;
window.setTimeout("countdown()", 1000);
}
}
</script>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,631,215 | 2,631,216 |
Only add items to a dropdown list once
|
<p>I have a dropdown list that is populated when the page loads, like this:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
ddlCars.Items.Add("Ford");
ddlCars.Items.Add("Chevy");
ddlCars.Items.Add("BMW");
ddlCars.Items.Add("Jeep");
ddlCars.Items.Add("Nissan");
}
</code></pre>
<p>It works fine, but when a user changes the selection of the dropdown list, the list is repopulated and I see the same items twice, because the page is reloading and these values are being re-added.</p>
<p>What would be the best way to stop this from happening? It is important that AutoPostBack stays enabled, so that I change information based on user selection.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
1,428,140 | 1,428,141 |
Textview on top of list, scrollable container
|
<p>How can I make the question textview to be on top of the list, as if it was the first item of the list, letting the question stretch as down as it needs then starting the list underneath it, while both of them being scrollable by the same scroller?</p>
<pre><code><ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroller"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_above="@+id/linearLayout2"
android:layout_alignParentTop="true"
android:layout_weight="4.34"
android:fillViewport="true"
android:scrollbars="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/question_content"
android:layout_width="match_parent"
android:layout_height="56dp"
android:padding="8dip"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="84dp"
android:layout_weight="0.10" >
</ListView>
</LinearLayout>
</ScrollView>
</code></pre>
|
java android
|
[1, 4]
|
564,314 | 564,315 |
JQuery: How do I determine if a slideToggle has been toggled?
|
<p>How do I do the following pseudo code in JQuery?</p>
<pre><code>$(document).ready(function(){
$(".btn-slide").click(function(){
$("#divToSlide").slideToggle("fast");
if ($(this).isToggled) { // <---- DOESN'T WORK -------
// do something when toggled
} else {
// do something different when not toggled
}
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,884,037 | 3,884,038 |
how to make PHP server sends data to an Android device
|
<p>I want the Android device to send data to a PHP server. After receiving, the PHP server sends other data to Android. The first part can be done by using JSON. However, I don't know how to make the PHP server sends data to Android. Sorry, I am new to PHP! </p>
|
php android
|
[2, 4]
|
397,227 | 397,228 |
jQuery's serialize() function only returns the last selected checkbox value and not all of them!
|
<pre><code>$('form').serialize();
<label>Check what applies:</label>
Laptop Owner: <input type="checkbox" name="applicable" value="laptop owner" /> <br />
Samsung Tv Lover: <input type="checkbox" name="applicable" value="Samsumg tv lover" /> <br />
Animae Watcher: <input type="checkbox" name="applicable" value="Animae watcher" />
</code></pre>
<p>If I check "Laptop Owner" and "Animae Watcher" is only returns the latter, why? I need it to return both.</p>
<h2>EDIT</h2>
<p>I should say when I send the forms values to PHP it only returns the last checked checkbox, this is what my php looks like:</p>
<pre><code><?php
echo $_POST['applicable'].' says PHP';
?>
</code></pre>
|
php jquery
|
[2, 5]
|
5,049,853 | 5,049,854 |
NullPointer Exception on android image gallery onselected
|
<p>I am using android image gallery,I want to select image tag id by click on gallery item and put that id in to <code>HashMap</code> (param_ids). I used the following code.but this gave me a <code>NullPointerException</code> on this line before I clicked on gallery item.</p>
<pre><code> param_ids.put("facial_appearance_id",view.getTag().toString());
</code></pre>
<p>this will working fine on <code>android 2.3</code> but this will give an <code>NullPointerException</code> on <code>android 4.0.3</code>. so how can I slove this issue?</p>
<p>code</p>
<pre><code>Gallery faceGallery= (Gallery) findViewById(R.id.gallery);
faceGallery.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view,int position, long id) {
param_ids.put("facial_appearance_id",view.getTag().toString());
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// TODO Auto-generated method stub
}
});
</code></pre>
|
java android
|
[1, 4]
|
3,289,831 | 3,289,832 |
Why is the asp.net checkbox not disabled?
|
<p>I am trying to set the disabled property for my <code>CheckBox</code> to true. However, when I do a postback the <code>CheckBox</code> is still enabled?</p>
<p><strong>HTML:</strong></p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<head runat="server">
<title></title>
<script>
$(document).ready(
function () {
$("#CheckBoxList1_0").attr('disabled',true);
}
);
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>een</asp:ListItem>
<asp:ListItem>twee</asp:ListItem>
<asp:ListItem>drie</asp:ListItem>
</asp:CheckBoxList>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</form>
</body>
</html>
</code></pre>
<p><strong>c#:</strong></p>
<pre><code> protected void Button1_Click(object sender, EventArgs e)
{
if (!CheckBoxList1.Items[0].Enabled)
{
Response.Write("it is disabled");
}
}
</code></pre>
|
c# jquery asp.net
|
[0, 5, 9]
|
6,013,689 | 6,013,690 |
If Not A HREF Javascript then what [e.g. mobile phones]
|
<p>Re:</p>
<p><a href="http://stackoverflow.com/questions/134845/href-for-javascript-links-or-javascriptvoid0">Href for Javascript links: "#" or "javascript:void(0)"?</a></p>
<p>I am playing with a list of items I am sending from mysql via php o the browser. </p>
<p>In the browser I want to be able to say "Edit this record here".</p>
<p>I want to be able to use on desktop and on my phone.</p>
<p>The issue is that my phone allows me to navigate [give focus to] links, form buttons, form input fields etc but not say icon images. [Not a touch screen phone]</p>
<p>So if I don't use A HREF to pick up a focusable point for onclick events then what?</p>
<p>Thanks</p>
|
javascript iphone android
|
[3, 8, 4]
|
5,847,390 | 5,847,391 |
Parsing Windows Event Logs, is it possible?
|
<p>I am doing a little research into the feasibility of a project I have in mind. It involves doing a little forensic work on images of hard drives, and I have been looking for information on how to analyze saved windows event log files.</p>
<p>I do not require the ability to monitor current events, I simply want to be able to view events which have been created, and record the time and application/process which created those events. However I do not have much experience in the inner workings of the windows system specifics, and am wondering if this is possible?</p>
<p>The plan is to create images of a hard drive, and then do the analysis on a second machine. Ideally this would be done in either Java or Python, as they are my most proficient languages.</p>
<p>The main concerns I have are as follows:</p>
<p>Is this information encrypted in anyway? </p>
<p>Are there any existing API for parsing this data directly? </p>
<p>Is there information available regarding the format in which these logs are stored, and how does it differ from windows versions?</p>
<p>This must be possible from analyzing the drive itself, as ideally the installation of windows on the drive would not be running, (as it would be a mounted image on another system)</p>
<p>The closest thing I could find in my searches is <a href="http://www.j-interop.org/" rel="nofollow">http://www.j-interop.org/</a> but that seems to be aimed at remote clients. Ideally nothing would have to be installed on the imaged drive. The other solution which seemed to also pop up is the JNI library, but that also seems to be more so in the area of monitoring a running system.</p>
<p>Any help at all is greatly appreciated. :)</p>
|
java python
|
[1, 7]
|
4,915,271 | 4,915,272 |
Find out IP address?
|
<p>I've got an app on android, and I'm connecting to a website for some data. Is it possible to find out the IP address that I'm actually connecting to? I'm doing:</p>
<pre><code>HttpUriRequest request = new HttpGet("http://www.example.com");
DefaultHttpClient client = new DefaultHttpClient(params);
HttpResponse response = client.execute(request);
println("You connected to: " + response.getIpAddress(?));
</code></pre>
<p>Thank you</p>
|
java android
|
[1, 4]
|
5,235,184 | 5,235,185 |
ASP.net c# - Could not load type
|
<p>On my page I have:</p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="siteSettings.aspx.cs" Inherits="APack.admin.siteSettings" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
</code></pre>
<p>My code behind is:</p>
<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace APack.admin
{
public partial class siteSettings : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
</code></pre>
<p>It throws the exception:</p>
<pre><code>Parser Error Message: Could not load type 'APack.admin.siteSettings'.
</code></pre>
<p>This was just produced in Visual Studio, right click - > new file. It just doesn't work :( Any ideas?</p>
|
c# asp.net
|
[0, 9]
|
4,527,326 | 4,527,327 |
Want to Not Show title if HoverOut
|
<p>I am creating a hover function in jquery that when you hover over an image, it shows its title in div box. suppose all images are together one after another with no space between them, if i start hover from 1st till last of line it shows me title of all. i set the delay of 1 sec</p>
<p>heres code</p>
<pre><code> $('.media-content img').hover(function(e){
var x = -5;
var y = 15;
var detail= $(this).attr('alt');
$('<span class="hovercontent">'+ detail +'</span>')
.delay(800)
.css('top', e.pageY + y)
.css('left', e.pageX + x)
.appendTo('body')
.fadeIn('fast');
}, function()
{
$('.hovercontent').fadeOut(50);
});
</code></pre>
<p>In this if i hoverout from image then after a second it display.
I wanted that if I hoverout immediately then the title of that image won't display.
you can say like in operating system when u hover a file it show details if you bypass then it won't. similar i wanted here//</p>
|
javascript jquery
|
[3, 5]
|
4,743,240 | 4,743,241 |
Get selected value dynamically and include that in if condition
|
<p>How to get value from select box dynamically without loading page and use that value in if condition ?</p>
|
php jquery
|
[2, 5]
|
5,371,023 | 5,371,024 |
how to expand vertical scroll after slideDown?
|
<pre><code> $(document).ready(function() {
// hides the slickbox as soon as the DOM is ready
$('#content').hide();
// toggles the content when you click the right link
$('#togglebutton').click(function() {
if ( $(this).hasClass("active"))
{
$('#content').slideDown(200);
$(this).removeClass("active");
$("#toggleimg").attr("src", "images/less.png"); //swap the image
var destination = $("#bottombar").offset().top;
//alert(destination);
//$("html,body").animate({ scrollTop: destination},"slow");
$('html, body').delay('200').animate({
scrollTop: $('#bottombar').offset().top + 111
}, 200);
} else {
$(this).addClass("active");
$("#toggleimg").attr("src", "images/more.png"); //swap the image
$('#content').slideUp(200);
}
event.preventDefault();
return false;
});
});
</code></pre>
<p>You can see it in action here www.graysonearle.com/Lumarca
I've tried for hours to get this to work...
I just want the browser window to allow the user to scroll after the div has slid down.</p>
|
javascript jquery
|
[3, 5]
|
1,489,563 | 1,489,564 |
Empty $_POST without Content-type
|
<p>If I make a POST request where the content-type is not set in the request header, the variable $_POST remains empty.</p>
<p>Question: How can I force PHP to fill $_POST?</p>
<p>I encountered the problem making an Javascript AJAX request using <a href="http://msdn.microsoft.com/en-us/library/cc288060%28v=vs.85%29.aspx" rel="nofollow">XDomainRequest</a> where you can not define any headers. Just to make it easier for you to understand the problem you can simulate the same effect without Javascript in PHP this way:</p>
<pre><code>$data = 'test=1';
$fp = fsockopen('www.yourpage.org', 80, $errno, $errstr, 5);
fputs($fp, "POST /test_out.php HTTP/1.1\r\n");
fputs($fp, "Host: www.yourpage.org\r\n");
//fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ". strlen($data) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data);
while(!feof($fp)) { echo fgets($fp, 128); }
fclose($fp);
</code></pre>
<p>test_out.php would be</p>
<pre><code>var_dump($_POST);
</code></pre>
<p>Without the correct content-type the variables in $_POST <em>magically disappear</em>.</p>
<p>This is more an educational question. I am asking this because most people here can not imaging that the content-type has this effect. I was asked to 'come back with facts'. So here you go.</p>
|
php javascript
|
[2, 3]
|
4,747,094 | 4,747,095 |
How to format and add new numbers dynamically to hidden field?
|
<p>I get from server into client side only pure number IDs, how to add dynamically it to html hidden field so that looks like array or JSON format (I mean: <code>["32","33","34"]</code>), so that in next step I can receive on serwer and parse? Hidden field contains on start only blank brackets <code>[]</code>.</p>
<p>My current code override hidden field from <code>[]</code> to e.g. <code>"32"</code>:</p>
<pre><code>$("#myHiddenField").val(JSON.stringify(data.result[0].newid));
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,634,273 | 4,634,274 |
When inserting elements into DOM with jQuery, how do you prevent page from briefly jumping on load?
|
<p>I am moving a DIV (from a hidden iFrame) to the top of a page with jQuery, like so:</p>
<pre><code>$(document).ready(function($) {
$('#precontainer').clone().insertBefore(parent.document.querySelectorAll(".maincontainer"));});
</code></pre>
<p>Whenever I reload that page, I very briefly see the original page jumping down to make room for the DIV I am inserting. Can this behavior be prevented? </p>
<p>What I'm doing now is give the "maincontainer" a large margin at the top with CSS that is roughly as high as the "precontainer" DIV that is inserted above it, and after that DIV is inserted, I use jQuery to remove the top margin from "maincontainer", so the jumping or flashing effect is less severe. But there has to be a better way right?</p>
<p>I should mention that I only have access to the iFrame that I am using to manipulate the DOM of its parent (which holds "maincontainer". I can not modify the parent, so I have to do everything through the iFrame.</p>
|
javascript jquery
|
[3, 5]
|
286,568 | 286,569 |
how to insert value in input, with javascript
|
<p>So I tried to do something like this -</p>
<pre><code>$('#price').val(price);
</code></pre>
<p>price is 300, and it shows good on browser, in input field, but when I want to take it out and mail it with PHP, in $_POST['price'] it doesn't show up, How can I insert something in inputs value with JavaScript, so I can mail it? It seems this is not an insertion in value, but just a feature to display something, correct?</p>
|
javascript jquery
|
[3, 5]
|
5,908,107 | 5,908,108 |
Is there an Cocoa or Objective C api for Java?
|
<p>I'm a Java programmer and i wanted to get into writing so apps for the Iphone. I started to research and found myself looking at xmlvm..that all good, but then xmlvm has a HelloWorld.java with some UIWindow classes that i can't find and can't compile. Short of it is where is the api for Java so i can compile xmlvm's HelloWorld.java for the Iphone. Here's the code: and i've already compiled xmlvm with ant and have xmlvm.jar in my classpath so??</p>
<pre><code>import org.xmlvm.iphone.*;
public class HelloWorld extends UIApplication {
public void applicationDidFinishLaunching(UIApplication app) {
UIScreen screen = UIScreen.mainScreen();
CGRect rect = screen.applicationFrame();
UIWindow window = new UIWindow(rect);
rect.origin.x = rect.origin.y = 0;
UIView mainView = new UIView(rect);
window.addSubview(mainView);
UILabel title = new UILabel(rect);
title.setText("Hello World!");
title.setTextAlignment(UITextAlignment.UITextAlignmentCenter);
mainView.addSubview(title);
window.makeKeyAndVisible();
}
public static void main(String[] args) {
UIApplication.main(args, HelloWorld.class);
}
}
</code></pre>
|
java iphone
|
[1, 8]
|
451,518 | 451,519 |
Best way to disable all submit buttons after postback
|
<p>I'm trying to write code that will disable submit button (or all submit buttons) on the page to avoid double postback.</p>
<p>I thought of generating my own postback javascript function (and inject postback javascript using <code>GetPostbackEventReference</code>) but maybe there are some better ways to do this? Or maybe there is some other way to avoid double postbacks?</p>
<p><strong>Update</strong>:</p>
<p>I also want to figure out the best place to call javascript, e.g. if I call following script in the onclick button handler then button's server click event won't be wired up.</p>
<pre><code>$('input[type=submit]').attr('disabled', 'disabled')
</code></pre>
|
javascript asp.net jquery
|
[3, 9, 5]
|
603,184 | 603,185 |
Assigning roles automatically in registration page
|
<p>I have simple registration page, wherein after submitting the contents (Username and Password) of the page, I need to assign the User with a role.
I have created 2 roles (Admin and member) from WSAT GUI.. </p>
<p>So how'd I assign him with the "member role"</p>
<p>This is my registration form.. </p>
<pre><code>protected void Button1_Click(object sender, EventArgs e)
{
string EPass = Helper.ComputeHash(TextBox2.Text, "SHA512", null);
String var = System.Configuration.ConfigurationManager.ConnectionStrings["KKSTechConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(var);
String str = @"insert into Users (Username, Pass, EmpID, Rolename)
values(@Username, @Pass, @EmpID, @Rolename)";
SqlCommand cmd = new SqlCommand(str, conn);
cmd.CommandText = str;
cmd.CommandType = CommandType.Text;
try
{
var userName = TextBox1.Text;
conn.Open();
cmd.Parameters.AddWithValue("@Username", TextBox1.Text);
cmd.Parameters.AddWithValue("@Pass", EPass.ToString());
cmd.Parameters.AddWithValue("@EmpID", DropDownList1.SelectedValue);
cmd.Parameters.AddWithValue("@Rolename", DropDownList2.SelectedValue);
cmd.ExecuteNonQuery();
}
finally
{
conn.Close();
}
}
</code></pre>
<p>dbo.Users:
Username(PK) | Pass | EmpID (FK) | Rolename</p>
|
c# asp.net
|
[0, 9]
|
5,100,865 | 5,100,866 |
Java concurrent modification exception when removing items from list
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5145135/java-util-concurrentmodificationexception-on-arraylist">java.util.ConcurrentModificationException on ArrayList</a> </p>
</blockquote>
<p>I am trying to remove items from a list inside a thread. I am getting the <code>ConcurrentModificationException</code>. I read from this <a href="http://stackoverflow.com/questions/8090398/java-concurrent-modification-exception">link</a> that it's related to removing items from list. I am putting the sample code below. How can I do this properly without this exception in my case.</p>
<pre><code>try
{
for(Game game:appDeleg.getGlobalGames().getGames())
{
if(game.getOwner().getId().equals(params[0]))
{
synchronized (appDeleg.getGlobalGames().getGames())
{
appDeleg.getGlobalGames().getGames().remove(game);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
return "noconnection";
}
</code></pre>
|
java android
|
[1, 4]
|
5,205,184 | 5,205,185 |
Shutdown XML-RPC server from client/test-harness
|
<p>My problem context is as below:-</p>
<ol>
<li>I have an Apache XMLRPC server implemented on Java using Webserver</li>
<li>A client implemented in Android running on the device/emulator, connecting against the XML-RPC in step 1.</li>
<li>Test cases running on the Android emulator which pass data to the client, which in turn sends it to the server. The server does some comparisons etc. and sends response back to the client which then has logic to say if a test passed/failed.</li>
</ol>
<p>All of this works fine however where I am stuck at the moment is, once I have run all my tests I would like to shutdown the server remotely i.e. through the test-case to Android client route. I can do something like "client.execute("server.shutDown"), which works fine, the only issue is since the server is shut-down it ends up hanging my client on the line "HttpResponse response = client.execute(postMethod);"</p>
<p>Any suggestions would be helpful.</p>
<p>Regards,
Mayank </p>
|
java android
|
[1, 4]
|
1,240,353 | 1,240,354 |
How to avoid Master Page hidden field value lost on new page load.
|
<p>I have a hidden field on master page. I am setting its value on a child page through JavaScript. When I click link on this child page it redirects to another page. Now I want to get the hidden field value on this new child page. But the value is lost(obviously). How can I persist this value.</p>
<p>Anyone help thanks in advance.</p>
|
javascript asp.net
|
[3, 9]
|
2,198,202 | 2,198,203 |
identifying code that compiles in both Java and C# but runs differently
|
<p>I am having to port code from Java to C# (and soon the other way round) by copying and pasting and then editing compiler errors. (Please accept that this is necessary; I can explain if required). Are there cases where the same code fragment runs differently in the two languages? I would include cases where order or operation or operator precedence was defined in one languge but undefined in the other but exclude cases where it was undefined in both.</p>
<p>I would be particulary interested in any development tools which could identify such fragments.</p>
<p>@Thomas. Thanks. J# is not an option - the code is mandated to be in C#. What does "this" refer to in your comment?</p>
|
c# java
|
[0, 1]
|
538,507 | 538,508 |
Function to pass javascript variables to a php file via a GET or POST?
|
<p>I've got the following function</p>
<p><code>function make(point, name, message, type, file, id, lat, lng)</code></p>
<p>I want this function to pass all of these Javascript variables to a php file which would open in a window when a link is pressed how would I do this?</p>
|
php javascript
|
[2, 3]
|
3,929,310 | 3,929,311 |
Cancel form.submit()
|
<p>In javascript function I am submitin a form:<br />
<code>form.submit();</code>, </p>
<p>with huge amount of data. </p>
<p>Is it possible to cancel this operation beside clicking on browser's stop button?</p>
<p><strong>UPDATE:</strong></p>
<p>Maybe i didn't made my self clear i am submiting large files.<br />
form with uploadcontrol that runs in iframe.</p>
|
asp.net javascript
|
[9, 3]
|
5,261,670 | 5,261,671 |
jQuery to database - registration form with validation
|
<p>I find this tutorial in 9lessons.com : <a href="http://www.9lessons.info/2011/01/gravity-registration-form-with-jquery.html" rel="nofollow">http://www.9lessons.info/2011/01/gravity-registration-form-with-jquery.html</a></p>
<p>It's about a registration form with validation.</p>
<p><img src="http://i.stack.imgur.com/FAaXS.gif" alt="enter image description here"></p>
<p>I want to send data to DB.</p>
<pre><code>// Submit button action
$('#submit').click(function()
{
var email=$("#email").val();
var username=$("#username").val();
var password=$("#password").val();
if(ck_email.test(email) && ck_username.test(username) && ck_password.test(password) )
{
$("#form").show().html("<h1>Thank you!</h1>");
///// if OK
///// Show thanks
//// else
//// Error, try again
}
return false;
});
</code></pre>
<p>How can I do ?? I searched in internet in jQuery tutorial and I find much codes ... </p>
|
php javascript jquery
|
[2, 3, 5]
|
4,106,288 | 4,106,289 |
Using jquery to select an item from a select list based on the label
|
<p>So if I have a select list of lets say dates that looks like </p>
<pre><code><option value="624e70cb-2796-4029-bd09-2642abaa54b4">1989</option>
<option value="ff591d9a-e8a4-4280-829b-9307b7b41912">1988</option>
<option value="f2e9e756-7c59-4883-89b5-9c8cccf85ad6">1987</option>
<option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060">1986</option>
<option value="27aa2cd0-f77a-48c0-83f3-5348d5a7239f">1985</option>
<option value="50e375c0-a1fa-405e-8ec9-a3f220041a39">1984</option>
</code></pre>
<p>if I have a string that holds the value 86 is there a good way to select:</p>
<pre><code><option value="c65d6a65-441f-4cb5-9e6d-d9de58efb060">1986</option>
</code></pre>
<p>with jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,881,543 | 2,881,544 |
Data accessing from one class to another class
|
<p>Is there any way to call one class's ArrayList onto another class? In class A ArrayList is there, I need to use that ArrayList in class B, Class A is having <code>AsyncTask</code> in that I have the Arraylist so I need that in side AsynTask's Arraylist in another class.</p>
<p>In class A:</p>
<pre><code>public Class A{
public class HomeTask extends AsyncTask<Void,Void,Bundle> {
onPreexecute(){}
doInbackground(){}
postexecute(){}
Arraylist joblist(); //------------ My data is here;
}
}
</code></pre>
<p>second class:</p>
<pre><code>Class B
{
// I need to use that arraylist here
}
</code></pre>
|
java android
|
[1, 4]
|
3,567,786 | 3,567,787 |
building an auto refresh method in android
|
<p>Im attempting to build a method in an android application that will cause an activity to refresh every 3 minutes, similar to what you see in a twitter or facebook type app where the application will refresh the newsfeed on its own every few minutes, however I am unable to find any tutorials on the web that give me an idea as to how this is done, any help would go a long way thanks! </p>
|
java android
|
[1, 4]
|
1,275,902 | 1,275,903 |
Passing javascript variable to PHP function
|
<p>I have this javascript code </p>
<pre><code><Script>
function getGroupId(){
var group=document.getElementById("selectedOptions").value;
var groupFirstLetter=group.substring(2);
}
</Script>
</code></pre>
<p>I need to pass the <code>groupFirstLetter</code> to a PHP function which will count how many users in this group and return the value to the javascript function.</p>
<p>Any ideas please?</p>
<p>Thanks,</p>
|
php javascript
|
[2, 3]
|
2,132,915 | 2,132,916 |
Which has better performance? Place holder or new page?
|
<p>I have a Select option as follows</p>
<pre><code><option value="#" selected="">Forms</option>
<option value="https://Mysite/erc/Form1.aspx" target="_blank">Form1</option>
<option value="https://Mysite/erc/Form2.aspx" target="_blank">Form2</option>"
</code></pre>
<p>Now I want add one more option as form 3. But form2 and form 3 are almost identical with some changes.</p>
<p>My question is, shall i add one more form as "Form3.aspx" or add a placeholder label to the content on the page(form2.aspx) that will be replaced by appropriate text based on query string parameter? Which has better performance? </p>
|
c# asp.net
|
[0, 9]
|
1,940,733 | 1,940,734 |
Detecting input from bar code reader(and rfid) from javascript
|
<p>I have a bar code reader and RFID reader that act as a HID device and I got output from them as keyboard output, and after the data is red, enter key is pressed.
Is there any way to efferent reading of this data so that it would be written in some specific input field?
I was thinking about detecting the speed of reading...
How can this be implemented in javascript, or jquery?
thank you
Dorijan </p>
|
javascript jquery
|
[3, 5]
|
1,854,958 | 1,854,959 |
Add class to li if content is a certain string
|
<p>Would it be possible to add a certain class to a li that contains a certain string of text using JavaScript/<a href="http://i.stack.imgur.com/sGhaO.gif" rel="nofollow">jQuery</a>? </p>
<p>UPDATE/NEW QUESTION:
Instead of detecting the content of the li, can I have it add the class if the li has another specified class?</p>
|
javascript jquery
|
[3, 5]
|
2,433,330 | 2,433,331 |
OK to throw an error for a missing required querystring parameter?
|
<p>Is there anything wrong with having an asp.net page throw a (custom error) if a a required querystring parameter is missing and having global.asax catch it with Application_Error, then transfer the user to an error page? I have several base classes that perform these checks and I am not sure of the best way to communicate the error to a user. </p>
<p>So, something like this:</p>
<pre><code>int reqParam;
if(!isParamSet("myReqParam", out reqParam))
{
throw new QuerystringParamMissingException();
}
</code></pre>
<p>which is then caught by Application_Error in global.asax.</p>
<p>Also, from a security standpoint how much information should I be providing to the user? Just that it was an error, or that a querystring parameter was missing, or which parameter was missing, or maybe even what that parameter indicates is used for?</p>
|
c# asp.net
|
[0, 9]
|
3,652,834 | 3,652,835 |
Comparing C# and Java
|
<p>I learned Java in college, and then I was hired by a C# shop and have used that ever since. I spent my first week realizing that the two languages were almost identical, and the next two months figuring out the little differences. For the most part, was I noticing the things that Java had that C# doesn't, and thus was mostly frustrated. (example: enum types which are full-fledged classes, not just integers with a fresh coat of paint) I have since come to appreciate the C# world, but I can't say I knew Java well enough to really contrast the two so I'm curious to get a community cross-section.</p>
<p>What are the relative merits and weaknesses of C# and Java? This includes everything from language structure to available IDEs and server software.</p>
|
c# java
|
[0, 1]
|
4,515,068 | 4,515,069 |
DataSet sorting
|
<p>In <code>DataTable</code> I could sorting with </p>
<pre><code> dataTable.DefaultView.Sort = "SortField DESC";
</code></pre>
<p>I'm getting a <code>DataSet</code> from database, I was wondering could I do a sorting on the <code>DataSet</code> like how I do it in <code>DataTable</code>.</p>
|
c# asp.net
|
[0, 9]
|
3,935,312 | 3,935,313 |
ASP.NET & JQuery | Show jQuery LightBox on Submit
|
<p>Currently I have a small form that uses a <code>asp:linkbutton</code> to submit and send out an email.</p>
<p>I want to instead display a lightbox saying "Thank you for your submission" when the user clicks the form rather than a full post back.</p>
<p>What is the best solution?</p>
|
asp.net jquery
|
[9, 5]
|
2,791,857 | 2,791,858 |
Using EasyHook for hooking IIS6 or IIS7
|
<p>I want to hook IIS6 or IIS7 with Easyhook .
can any body help me?how?
I worked with Easyhook to hook some unmanaged and managed dll and functions</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
233,411 | 233,412 |
jQuery function not recognised on iPhone
|
<p>I have a jQuery slideshow that works across all browsers and android devices, but when testing on an iPhone 4 it doesn't work.</p>
<p>Stripping it back to a simple in-page alert, jQuery still doesn't work on iPhone. Any suggestions as to what's going on here? </p>
<pre><code><script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
// works everywhere, except on iPhone
<script type="text/javascript">
$(document).ready(function() {
alert('jQuery function');
});
</script>
// works
<script type="text/javascript">
alert('js function');
</script>
</code></pre>
|
jquery iphone
|
[5, 8]
|
5,811,047 | 5,811,048 |
Javascript keycodes
|
<p>I am facing is weird problem. I have an input field on my page which gets its feed from a barcode scanner which appends a carriage return at the end (keycode: 13). When I use my scanner on a regular notepad, Once the input prints on screen, the cursor moves to the next line (it gets the carriage return), where as if I do the same thing on the <code><INPUT></code> tag, it never gives the carriage return. I tried <code><textarea></code> as well, but with no luck. How to tackle this issue? </p>
|
javascript jquery
|
[3, 5]
|
1,797,567 | 1,797,568 |
Next count no. clients connected to the server
|
<p><a href="http://stackoverflow.com/questions/8854176/get-a-list-of-all-active-sessions-in-asp-net">Get a list of all active sessions in ASP.NET</a>
the above linked show the get active session but how to used this method when i used the application_start or user form load it returns null.</p>
<p>i want to calculate the how many user active in current session or server .this question is linked with my previous question
<a href="http://stackoverflow.com/questions/9495241/next-count-no-clients-connected-to-the-server">.Next count no. clients connected to the server</a></p>
<p>i have used the get IP address & add to the arraylist & counting the IP address collection its working but when the already login user get close the application the IP address not remove from the arraylist . i have used the session_end event to remove the IP aadress when i try to remove the IP address the again get the IP address from context it throws exception . but session end event throws after specific timeout . but i want to remove the IP address when client disconnected or close the browser.</p>
|
c# asp.net
|
[0, 9]
|
1,698,983 | 1,698,984 |
What is wrong with my body-click event?
|
<p>I have that text field:</p>
<pre><code><input type='text' id='title' name='title'>
<div id='error' class='error'></div>
</code></pre>
<p>When user clicks out of the text field and there is a validation problem, the div "error" appears.</p>
<p>What I want to do is to hide that little div when user clicks anywhere in the body.
I tried e.stopPropagation in the body click event but didn't work.</p>
<p>The div never appears because when I blur out of the textfield, it's considered a body click</p>
<p>Please let me know if you have any idea. Regards</p>
<p>EDIT:
I have updated the code. The code inside the body click event is supposed to hide the "error" div when anything but the text field is clicked, but can't get it to work.</p>
<pre><code>$('body').click(function(event){
if ($(event.target).closest('#title').get(0) == null ) {
$("#error").hide();
}});
// Validation
$('#title').blur(function(){
var titleinput=$('#title').val();
if (titleinput.length <30 || titleinput.length >50){
$('#error').text('Your title must be between 30 and 50 characters').show();
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,437,326 | 4,437,327 |
jquery .height() not work in IE9
|
<p>project_cat is a div, the following code is try to get its height, but all not working in IE9, </p>
<pre><code>jQuery("#project_cat").height();
jQuery("#project_cat").innerHeight();
jQuery("#project_cat").css('height');
</code></pre>
<p>how to get it work in IE9?</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.