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,974,933
3,974,934
Invoke Javascript method from code-behind based on a condition.
<p>This is my javascript method in .aspx file. I want to invoke this method from code-behind based on a certain condition:</p> <pre><code>function confirmboxAndHideMessage() { //HideMessage(); var response = confirm("are you sure?."); if (response == true) { document.getElementById("&lt;%=chkValidated.ClientID%&gt;").checked = true; HideMessage(); } else { HideMessage(); return true; } } </code></pre> <p>The condition upon which I want to invoke is something like this:</p> <pre><code> if (obj.fkValidationStatusId.HasValue &amp;&amp; obj.fkValidationStatusId.Value.Equals(1)) { btnProceedAddNewRecords.Attributes.Add("OnClick", "javascript:return confirmboxAndHideMessage();"); } else { btnProceedAddNewRecords.Attributes.Remove("OnClick"); } </code></pre> <p>This condition is being exercised in a method which is called in PageLoad event inside </p> <pre><code>if (!IsPostBack) { /* condition */ } </code></pre> <p>It is not working and my guess is that the way i am adding the method in button attribute is wrong. My request is that, kindly suggest a way I can invoke this javascript method from my code-behind based on the stated condition. If you think that my approach is flawed, Please do suggest Alternatives. Thanks.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
846,513
846,514
Generate 8 digit uinque id in c#
<p>I need to generate 8 digit unique id in c#. On my site a user will register and I need to generate a unique id for him in c# code(I don't want this logic in DB), after inserting the id I need to save it in database.</p> <p>Edit: I need that numbers to be generated in random manner everytime.</p>
c# asp.net
[0, 9]
5,777,864
5,777,865
How to Register mouserover on elements from Ajax call
<p>I am trying to register the mouseover event on the elements that are generated AFTER user click the button.</p> <p>The elements are generated via ajax. The mouserover doesn't seem to work on the elements that ajax created. I was wondering if there are ways to work around this. Thanks a lot.</p> <pre><code>jQuery.ajax({ type: "GET", url: "http://list.php", data: null, dataType:"json", timeout: 10000, global: true, error: oh_no, success: }); var image = document.getElementById('image'); the image path are from ajax. function listem(){ ......codes ......codes image.innerHTML= image.innerHTML + "&lt;img src="\" + imagePath + \"\&gt;"; } $(document).ready(function(){ $('#image img').mouseover(function(){ alert('mouseOVER!!!'); }); }) html &lt;button id='showstuff' onclick='listem();'&gt;show&lt;/button&gt; </code></pre>
javascript jquery
[3, 5]
417,559
417,560
Save android value and retrieve it again
<p>I have the following void</p> <pre><code>protected void onPaymentSuccess(PaymentResponse response) { // Stuff... } </code></pre> <p>I want to save a string within a void for example</p> <pre><code>String key = "JHIJHFEIRUFHEURFGEU5"; </code></pre> <p>And i want to be able to retrieve it again (this string to be saved to phone) after phone restart, closing application.</p>
java android
[1, 4]
1,449,492
1,449,493
Passing data from intent to other using python server
<p>I have an application with an Android client and a Python server. The android package has three Activities, which access GPS and google maps. I send the GPS coordinates from the second activity to the (python) server using a socket. I want to receive the [changed] value back from the server and pass it to the third Activity via an Intent to open the received location in a MapView. </p> <p>What must be done in Android and on the server side to accomplish this.</p>
android python
[4, 7]
3,761,506
3,761,507
How to add a TableRow/TableCell to an ASP.NET table from Javascript?
<p>What is the best way to dynamically add TableRows and TableCells to an ASP.NET table from Javascript?</p> <p>Thanks,</p> <p>Jeff</p>
asp.net javascript
[9, 3]
119,352
119,353
How to create a jquery function to set max-height on every div?
<p>I would like to do a jquery function that when window resize, it search div with css-class name "taskbox" and set the max-height to the parent div height - current offset for the taskbox to be able to be smaller than the available space but do not extend it.</p>
javascript jquery
[3, 5]
72,497
72,498
Convert data attrs to get/post data
<p>How do I convert data attributes to valid post (or get) data?</p> <pre><code>$('#nav').find('a').click(function(){ var params = $(this).data(); $.get({ type: "get", url: "/view/", data: params }); }) </code></pre> <p>I get this error:</p> <pre><code>POST http://127.0.0.1/Site1/%5Bobject%20Object%5D/ 404 (NOT FOUND) </code></pre>
javascript jquery
[3, 5]
3,162,769
3,162,770
Change ID on scroll -- weirdness happening
<p>I'm working on changing the ID of an element when the user has scrolled to a certain point on the page:</p> <p><a href="http://jsfiddle.net/QupNv/6/" rel="nofollow">http://jsfiddle.net/QupNv/6/</a></p> <p>The ID is supposed to change depending on where they are. Here's my code:</p> <pre><code>$(window).scroll(function() { var scrollTop = $(window).scrollTop(), divOffset = $('#b').offset().top, dist = (divOffset - scrollTop); $('.message').text(dist); if (dist &gt;= 100 &amp;&amp; dist &lt;= 200) { $('.switch').attr('id', 'd') } else if (dist &gt; 1 &amp;&amp; dist &lt; 100) { $('.switch').attr('id', 'e') } else { $('.switch').attr('id', 'c') } }); </code></pre> <p>It works like a dream when I have one condition, but if I add the if else then it wants to jump back up to the top of the window and not continue scrolling down. Any pointers on what I'm doing wrong?</p> <p>Any help is greatly appreciated! Thanks!</p>
javascript jquery
[3, 5]
5,152,926
5,152,927
Gridview sorting and paging events are not firing in embedded .ascx controls
<p>I have a gridview that's inside a .ascx control that's dynamically embedded into another .ascx control, which is then called by a web form. The gridview will initially bind, but when any paging/sorting/command events are then triggered, I can't get any breakpoints inside the events to kick off. Additionally, when I look at the code-behind in the now-blank page, I see the old data sitting there. </p> <p>Any idea what on earth is going on here? For edification, the .ascx page with the control is excerpted.</p> <p>Parent .ascx control:</p> <pre><code>&lt;asp:ScriptManager ID="smIndex" runat="server" EnablePartialRendering="true" EnableScriptLocalization="true" EnableScriptGlobalization="true" /&gt; </code></pre> <p> </p> <p>Child .ascx control:</p> <pre><code>&lt;asp:UpdatePanel ID="upAddAdj" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:GridView ID="gvAddAdjVenList" runat="server" AllowPaging="true" AllowSorting="true" Width="100%" AutoGenerateColumns="false" Font-Size="9px" Font-Names="Verdana" PageSize="10" EnableSortingAndPagingCallbacks="false" DataKeyNames="ID" PagerSettings-Mode="NumericFirstLast" OnRowDataBound="gvAddAdjVenList_RowDataBound" Visible="true"&gt; </code></pre> <p>In the child.ascx code-behind:</p> <pre><code>gvAddAdjVenList.DataBind(); gvAddAdjVenList.Sorting += new GridViewSortEventHandler(gvAddAdjVenList_Sorting); gvAddAdjVenList.PageIndexChanging += new GridViewPageEventHandler(gvAddAdjVenList_PageIndexChanging); </code></pre> <p>Thanks!</p> <p>valkyrie</p>
c# asp.net
[0, 9]
5,019,142
5,019,143
How to show/hide menus using jQuery?
<p>I have a menu with menu items that are only being showed when they are clicked. To hide them again they have to be clicked again. That's all good, but I also need to hide other visible menu items when another menu item is clicked.</p> <p>Im currently using:</p> <pre><code>$(this).parent().find("element").toggle(); </code></pre> <p>So if menu item 2 is visible and menu item 1 is clicked, menu item 2 needs to hide again and menu item 1 needs to be visible. How to do that?</p>
javascript jquery
[3, 5]
25,544
25,545
Iteration in asp.net databinding
<p>Say I have an array like so in my code behind:</p> <p>public static string[] fields = new string[]{"field1", "field2", "field3", "field4"};</p> <p>I would like to use this array to retrieve fields in a gridview when it is databinding, like so:</p> <pre><code>&lt;%# Eval("Field1")%&gt; &lt;%# Eval("Field2")%&gt; &lt;%# Eval("Field3")%&gt; &lt;%# Eval("Field4")%&gt; </code></pre> <p>However, I have had a very difficult time figuring out how to iterate over my array (fields) to produce the above code. It does not want to parse any operators within the databinding server tags (&lt;%# %>) like so:</p> <pre><code>&lt;%# foreach (string field in fields) { Eval(field); } %&gt; </code></pre> <p>And I cannot find a way to reproduce the databinding behavior in regular server tags:</p> <pre><code>&lt;% foreach (string field in fields) { Response.Write(DataBinder.Eval(object, field); } %&gt; </code></pre> <p>The databinder.eval method takes a container object which I'm not sure I can access outside of the regular databinding tags. I have also tried using regular server tags to produce the iteration code surrounding the databinding code, but it is not able to access the variables of the iteration.</p> <p><strong>EDIT:</strong></p> <p>I should be more clear, in the end I want the values to end up on my page, not the field names themselves. My database might look something like:</p> <pre><code>Field1 | Field2 | Field3 | Field4 | | | value1 | value2 | value3 | value4 </code></pre> <p>and when is all said and done, my page should look like:</p> <pre><code>value1 value2 value3 value4 </code></pre> <p>BUT the fields array is dynamic, and may be different depending on the object, so statically accessing each index in the array won't work.</p>
c# asp.net
[0, 9]
4,581,771
4,581,772
Pre check for data insertion
<p>I want to make a program for value prechecking .a user will give the single input (wbslement no) to UI .I want to insert that record into System . Before inserting into database I want to check It is present in Table or not . if it is present in table then It should not insert record into table if it is not present into database then it should insert .</p> <p>currently at load time I am fetching all the records from table after that I am trying to insert into System.</p> <p>in my code it is inserted value any case</p> <pre><code> CrCon = new SqlConnection(spcallloggin); CrCon.Open(); CrCmd = new SqlCommand(); CrCmd.Connection = CrCon; CrCmd.CommandText = "GetOraderNumberDetail"; CrCmd.CommandType = CommandType.StoredProcedure; sqladpter = new SqlDataAdapter(CrCmd); ds = new DataSet(); sqladpter.Fill(ds); for (int count = 0; count &lt; ds.Tables[0].Rows.Count; count++) { if (txtwbs.Text == ds.Tables[0].Rows[count][0].ToString()) { Lbmsg.Visible = true; Lbmsg.Text = "Data Already Exists !"; count = count + 1; } else { insetreco(val); } } </code></pre>
c# asp.net
[0, 9]
49,826
49,827
using repeater control to display an image from database C#
<p>I have a book database(2 books in total right now) where for each book i have a row called 'Image' that contains the name of the images. For example. cprog.jpeg and asm.jpeg</p> <p>Using the repeater i can display the book information like name, author, etc. But i dont know how to get the images to display. The images are stored in the images folder.</p> <p>here is the aspx which is the issue? since, it displays the bookname and description just fine.</p> <pre><code>&lt;asp:Repeater ID="Repeater1" runat="server"&gt; &lt;ItemTemplate&gt; &lt;%# DataBinder.Eval(Container.DataItem, "BookName") %&gt; &lt;hr&gt; &lt;%# DataBinder.Eval(Container.DataItem, "BookDescription") %&gt; &lt;td width="100px"&gt; &lt;p align="left"&gt; &lt;img src= '&lt;%# DataBinder.Eval(Container.DataItem, "Image") %&gt;.jpeg' alt="" style="height:200px;width:200px;border:1px solid gray;"/&gt; &lt;/td&gt; &lt;/p&gt; </code></pre> <p> <br> </p> <p>Code behind</p> <pre><code>String connectionString = "Data Source=" + Server.MapPath(@"~\App_Data\bookDB.db"); String selectCommand = String.Format("Select * from Book where CategoryName = '{0}'", Request.QueryString); SQLiteConnection myConnection = new SQLiteConnection(); myConnection.ConnectionString = connectionString; myConnection.Open(); SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(selectCommand, myConnection); myConnection.Close(); // DataSet ds = new DataSet(); dataAdapter.Fill(ds2); DataTable table = new DataTable(); dataAdapter.Fill(table); Repeater1.DataSource = table; Repeater1.DataBind(); </code></pre> <p>Once, when i ran the project the broken image appeared for a second and then disappeared. I have spent the last 2 days trying to get this with no avail... Thank you.</p>
c# asp.net
[0, 9]
2,580,913
2,580,914
javascript focus problem
<p>I have a form with 3 fields. Country, state and users</p> <p><img src="http://i.stack.imgur.com/beWVs.jpg" alt="none"></p> <p>I am trying to do the following. when United states is selected as a country, the state field will show. The problem is that when i use the tab key on the keyboard, it is skipping the state field and its going on the users field. So i tried using the focus property so when i select United states, the state will show + selected, but I had no luck.. Below please find the code I am using</p> <pre><code>$(document).ready(function () { $("#cmbCountries").change(function () { $("#cmbCountries option:selected").each(function () { if ($(this).text() == "United States") { $("#cmbstate").show(); $("#cmbstate").focus(); } else { $("#cmbstate").hide(); } }); }).change(); }); </code></pre> <p>Any help please?</p>
javascript jquery
[3, 5]
1,207,450
1,207,451
Intercepting HTTP event using JQuery
<p>I have this JQuery code working however I need to know whether how to actually get the URL executed from the tags selected. </p> <pre><code>$("link, script, style, a, img").each(function(){ $(this).load(function(){ // get the URL and log it console.log("Intercepted HTTP Event"); }); }); </code></pre> <p>First thing I need to do it to get the actual URL during the load. </p> <p>Next thing I may need to do is to actually catch before the load event happens, I mean before an image or link is loaded for example. Also, I need to modify the URL of the event that will be executed, for example, <code>img</code> tag has <code>src="/somewhere/image.png"</code> I mean, this will cause a <code>GET /somewhere/image.png</code> I may need to change it to <code>GET/otherplace/image.png</code> </p> <p>Any ideas how to achive any of these?</p>
javascript jquery
[3, 5]
2,335,553
2,335,554
highlight selected tab
<p>I have searched but could not find answer to my satisfaction so I have a header file, which is being included on top of every page and part of the header is a menu with 3 tabs, when user click on tab browser take them to that page (working fine), what i want is, that what ever tab user clicks to be highlighted(diff back color) when that page is loaded.</p> <p>Here is html :</p> <pre><code>&lt;div id="top-choicebar"&gt; &lt;ul id="topmenu"&gt; &lt;li&gt;&lt;a href="daily.php" class="ww" &gt;Daily&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt; href="weekly.php" class="ww"&gt;Weekly&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt; href="monthly.php" class="ww"&gt;Monthly&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="event-menu"&gt; </code></pre> <p>New to php and jquery ... any help will be greatly appriciated </p>
php jquery
[2, 5]
5,873,074
5,873,075
AlarmManager set up Android?
<p>I have Alarm Manager which needs to repeat every 12 hours.</p> <pre><code>AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent in = new Intent(this, myReceiver.class); myAlarmSender = PendingIntent.getBroadcast(getApplicationContext(), 0, in, 0); am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), time, myAlarmSender); </code></pre> <p>after that happen I catch trigger event in class myReceiver which extends Broadcast receiver</p> <pre><code>@Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "text", Toast.LENGTH_LONG).show(); } </code></pre> <p>now I want to set up Status bar Notification or to start my notification class where I have code for notifications, but I'm not able to start new Intent or to write code for notifications inside of onReceive() method. Help? Thanks, Wolf. </p>
java android
[1, 4]
3,039,589
3,039,590
Best way to Read/Write to a php object from Javascript
<p>I have a PHP class/object which acts as the primary data source for my webpage. I'm using jQuery/Javascript to provide a dynamic interactive experience for the user. Both parts work independently really well. </p> <p>I'm now trying to find an elegant and clean way for the javascript library I've written to access and update data stored in the PHP object.</p> <p>Communication Javascript -> PHP: I've previously always created a PHP wrapper that takes input over the GET/POST and routes the data to the appropriate PHP function. This works well enough but surely there is a cleaner way to interface from javascript to PHP?</p> <p>Communicating PHP -> Javascript: Previous websites I've written have seen communication from javascript to PHP only. The PHP would output HTML which Javascript would place in a container (Standard javascript usage I guess). However, in this website, the Javascript library I've written requires structured data in return which it processes to perform multiple UI updates. It seems that looking into JSON would be the right thing here but there seem to be a variety of options.</p> <p>I would love the advice on the best way to get your PHP and Javascript communicating in both directions is a clean and elegant way.</p> <p>Thanks!</p>
php jquery
[2, 5]
3,944,540
3,944,541
display of image name on hovering it.. with jquery code
<p>this html code</p> <pre><code>&lt;div id="imgDisp"&gt; &lt;/div&gt; </code></pre> <p>This jquery</p> <pre><code>$(document).ready(function() { var imgSrc = "images/newIMG.png"; $("#imgDisp").css({ background: "url("+imgSrc+") repeat" }); var newImg = new Image(); newImg.src = imgSrc; newImg.onload = function() { var imgHeight = newImg.height; var imgWidth = newImg.width; $("#imgDisp").css({ width : imgWidth*10, height: imgHeight*10 }); } }); </code></pre> <p>Through this code I repeated an image 10 times horizontally and 10 times vertically. i.e. a 10x10 box i got.</p> <p>Now i tried something so that when i hover on image the name of image shall come.. But image name shall be the number at which it is present. i.e. n hovering image at 2nd row 3rd column its name shall be displayed as i=2, j=3.</p>
javascript jquery
[3, 5]
4,047,713
4,047,714
dropdownlist selected index option not working with javascript
<p>I am using an asp.net dropdownlist it contains 5 values the sample code is as follows </p> <pre><code>&lt;asp:DropDownList ID="ddlSampledropdown" runat="server" Width="250px"&gt; &lt;asp:ListItem Value="0" title="--Select--"&gt;--Select--&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="1" title="Alpha"&gt;Alpha&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="2" title="Bravo"&gt;Bravo&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="3" title="Charlie"&gt;Charlie&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="4" title="Delta"&gt;Delta&lt;/asp:ListItem&gt; &lt;asp:ListItem Value="5" title="Echo"&gt;Echo&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; </code></pre> <p>I want to set the dropdownlist as disabled and set the selected text as alpha how can i do this with the help of a javascript in asp.net 2003</p> <p>I made it as disabled but was unable to set the dropdownlist selected value </p>
javascript asp.net
[3, 9]
1,267,897
1,267,898
asp.net master property string, how to check in content page if string is empty
<p>if i have a master property string for example:</p> <pre><code>public String SharedInfo { get { return (String)Session["SharedInfo"]; } set { Session["SharedInfo"] = value; } } </code></pre> <p>and a label in an content page, i check if the string is empty by doing: if(Master.SharedInfo == null)</p> <p>now my question is: why does if(Master.SharedInfo == "") not work, because the SharedInfo is a string right?</p>
c# asp.net
[0, 9]
5,447,301
5,447,302
jQuery include form elements submit
<p>Working from the ground up on a Joomla Component re-config. I'm trying to incorporate an AJAX search function in my component. So far, I have this:</p> <pre><code>$(document).ready(function() { $('form').submit(function() { var results = $('form').serialize(); var url = 'index.php?option=com_mls&amp;task=ListData&amp;format=raw&amp;' + results; $('#test').html(url); }); }); </code></pre> <p>This just need to dump the values of the the form elements into a div. right now, it will display the text string, but not the <code>results</code> var.</p>
php jquery
[2, 5]
5,172,658
5,172,659
Why doesn't JQuery consolidate its constants?
<p>All my constants are near the top of my javascript file like below.</p> <p>When I search the core JQuery file, nothing comes up for Constant and I can't see that they are pulling out constants? Do they not have any, do they have them spread out through the code, if so, why don't they consolidate them?</p> <p>I'm not concerned about the language construct <code>const</code> but the concept of pulling out your constants into one place like below.</p> <pre><code>var Constant = { VALIDATE_ON: 1, JSON_ON: 0, ROOT: '', PICTURES: '../pictures/', TEXT: '../text/', FAVICON: '../images/logo_small.ico', IMAGES: '../images/', GATEWAY: 'class.ControlEntry.php', ENTER_KEY: 13, SECOND: 1000, MINUTE: 60, HOUR: 3600, DAY: 43200, AML: { "PASS": 0, "FAIL": 1, "NOTDEFINED": 2 } }; </code></pre>
javascript jquery
[3, 5]
3,763,419
3,763,420
Which constructor will called first in the below example
<p>Which constructor will called first in the below example? When i put break point and execute it first pointed to child constructor but executed the parent class constructor, why this?</p> <p>could any one please clarify me?</p> <pre><code>class Program { static void Main(string[] args) { Child child = new Child(); child.print(); Console.ReadLine(); } } public class Parent { public Parent() { Console.WriteLine("Parent Constructor."); } public void print() { Console.WriteLine("I'm a Parent Class."); } } public class Child : Parent { public Child() { Console.WriteLine("Child Constructor."); } public new void print() { Console.WriteLine("I'm a Child Class."); } } </code></pre>
c# asp.net
[0, 9]
4,757,962
4,757,963
jquery unobtrusive validation attributes reference?
<p>Where i can find the reference for <strong>Unobtrusive jquery validation attributes</strong> like </p> <p><code>data-val-length</code> , <code>data-val-required</code> etc..I want the full list of these attributes. Is </p> <p>there any single place where i can find this?</p>
javascript jquery
[3, 5]
2,750,269
2,750,270
Extract data / parse from HTML in PHP / Python
<p>I need a library / logic to extract this data and display a simple graph out of it . Some please help to parse this html to meaningful data like Equity share capital -> array (30.36 , 17,17 .... etc) I would like to get a solution in PHP or Python .I am looking for a code to extract some meaninful data out of a html code something like : </p> <p>The full html is here : <a href="http://paste.pocoo.org/show/307131/" rel="nofollow">http://paste.pocoo.org/show/307131/</a></p> <pre><code>&lt;html:tr&gt; &lt;html:td&gt;Equity share capital&lt;/html:td&gt; &lt;html:td class="numericalColumn"&gt;30.36&lt;/html:td&gt; &lt;html:td class="numericalColumn"&gt;17.17&lt;/html:td&gt; &lt;html:td class="numericalColumn"&gt;15.22&lt;/html:td&gt; &lt;html:td class="numericalColumn"&gt;9.82&lt;/html:td&gt; &lt;html:td class="numericalColumn"&gt;9.82&lt;/html:td&gt; &lt;/html:tr&gt; </code></pre>
php python
[2, 7]
2,629,877
2,629,878
Make changes in UI work in background (with ProgressDialog)?
<p>I am working on an app where in one of the activity different views are added into a ViewGroup, this process takes a while starting up so I wanted to run a progress Dialog in foreground while the UI could setUp in background .</p> <p><strong>What I have Tried</strong></p> <p>I tried using </p> <p>1.<strong>AsyncTask</strong> but it gave Exceptions . 2. while using threads and <strong>runnable()</strong> I am getting <strong>InvocationTargetException</strong>.</p> <p>I wanted to know what could be the best possible approach to this?</p>
java android
[1, 4]
4,546,689
4,546,690
jQuery Multiclasses function
<p>I'm trying to create function that will do this same thing for 3 different classes. The only problem is that every time when I hove over any of the divs it affect all the others instead just one.</p> <p>Could anyone advice me please how can I make it work separately for each class on hover stage:</p> <pre><code>$(document).ready(function() { $(".bbsa-h, .cscs-h, .dorbus-h").hover(function () { $(".bbsa, .cscs, .dorbus").stop().fadeTo(250, 0); }, function () { $(".bbsa, .cscs, .dorbus").stop().fadeTo(250, 1); }); </code></pre> <p>});</p> <p>Thank you for your help in advance.</p> <p>Dom</p>
javascript jquery
[3, 5]
1,022,729
1,022,730
How to access attribute values from HTML to save in DB on button click
<p>i am writing some adding some link attribute like below. which render to HTML, but i want to knwo i can i acess those attributes value at button click event?</p> <p>My code is below</p> <pre><code>protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem gridDataItem = (GridDataItem)e.Item; gridDataItem.Height = Unit.Pixel(10); HyperLink link = (HyperLink)gridDataItem["ContentTitle"].Controls[0]; ViewState["ContentID"] = gridDataItem["ContentID"].Text; link.ForeColor = System.Drawing.Color.Navy; link.ToolTip = Common.grdTextCell(gridDataItem["ContentSummaryDescr"].Text); link.NavigateUrl = "~/SlideImages/" + gridDataItem["ContentName"].Text;//Session["contentFolderPath"] + "\\"+ gridDataItem["ContentName"].Text;// Common.grdTextCell(gridDataItem["ContentName"].Text); link.Target = "_blank"; link.Attributes["name"] = gridDataItem["ContentID"].Text + "," + gridDataItem["SiteContentListID"].Text; HttpResponse myHttpResponse = Response; HtmlTextWriter myHtmlTextWriter = new HtmlTextWriter(myHttpResponse.Output); link.Attributes.AddAttributes(myHtmlTextWriter); link.Attributes.Add("onclick", "document.getElementById('" + dummyBtn.ClientID + "').click();"); } } protected void dummyBtn_Click(object sender, EventArgs e) { } </code></pre> <p>rendered HTML is like this..</p> <p>I am writing this for one row</p> <pre><code>&lt;td&gt;&lt;a style="color:Navy;" target="_blank" href="somepath/abc.doc" onclick="document.getElementById('MainContent_SiteNewCon_dummyBtn').click();" name="1,16" title="rupesh tesr"&gt;test&lt;/a&gt;&lt;/td&gt; </code></pre> <p>i want to use thses name="1, 16" to my button click event so that i can save them to db.</p>
c# javascript asp.net
[0, 3, 9]
1,280,838
1,280,839
Unknown Sources Check over Web Site?
<p>The Android SDK has a way to check for "Unknown Sources using the following API: <a href="http://developer.android.com/reference/android/provider/Settings.Secure.html#INSTALL_NON_MARKET_APPS" rel="nofollow">http://developer.android.com/reference/android/provider/Settings.Secure.html#INSTALL_NON_MARKET_APPS</a>"</p> <p>However, I was wondering if there is anyway to use this through a browser or have Javascript do this?</p> <p>There's a chicken and egg problem that I'm trying to understand of knowing if a user can install and unsigned app before they try to install an unsigned app.</p> <p>Thanks!</p>
javascript android
[3, 4]
1,883,626
1,883,627
Fill in a textbox when other textbox get filled
<p>I have a form with a few textboxes which are used for calculations. When I enter a value in one textbox, I want the other textboxes to get filled immediately when a value is entered. I want to use JavaScript for this. How can I do this when my textboxes are server-side?</p>
javascript asp.net
[3, 9]
3,976,031
3,976,032
How do you make a javascript popup like the ones on AllTop.com
<p>I need to make simple javascript popups like the ones on alltop.com (when you hover over the links). Is there a jQuery plugin for this?</p>
javascript jquery
[3, 5]
5,079,955
5,079,956
Javascript class scope
<p>I am unable to call this.RenderDeals() from inside my Post.success function. I assume this has something to do with scope? Could someone shed some light on the issue, and possibly suggest a workaround. I have tried using prototype and module pattern, both without any luck.</p> <p>FYI Post is an $.ajax wrapper that returns a jQuery Deferred object.</p> <pre><code> function Deals() { this.template = '#trTemplate'; this.container = '#containerTable'; this.GetDeals = function () { Post('Deal.svc/GetDeals') .success(function (result) { this.RenderDeals(result); }); }; this.RenderDeals = function (deals) { $(this.template).tmpl(deals).appendTo(this.container); } } var deal = new Deals(); deal.GetDeals(); </code></pre> <p>UPDATE:</p> <p>Ok, so I added the following line just above the GetDeals function:</p> <pre><code>var me = this; </code></pre> <p>and instead call</p> <pre><code>me.RenderDeals(result); </code></pre> <p>Appears to work correctly, but I'm not sure why.</p>
javascript jquery
[3, 5]
1,750,711
1,750,712
specifiying directory of Python module when calling it from C++
<p>When trying to to import and execute a function within a Python module from a C++ executable, how can I pass in the directory where the module is located as a command line argument?</p>
c++ python
[6, 7]
4,432,292
4,432,293
Android vibration intensity and damage
<p>I realize this is not strictly a code question, but I guess it belongs here anyway. If not, my apologies in advance.</p> <p>Being as there's no inbuilt way to change the vibration intensity for the droid in code I'm using a kind of PWM control (switching the vibrator on and off at high frequency gives me a kind of control over vibration intensity). Right now I'm using a 20ms period (for example, with a 50% duty cycle the vibrator is on for 10ms and off for 10ms and it kind of feels like half power).</p> <p>My question is, can some damage occurr to the vibrator motor using this kind of control?</p>
java android
[1, 4]
630,337
630,338
Change default select behavior for entire document or window
<p>With this I'd like to change the default select behavior for a document. I do that for the document body with <code>getElmentsByTagName</code>. But the code doesn't actually have the desired effect, which is to prevent the user from clicking to select text in the document.</p> <pre><code>&lt;script&gt; $(document).ready ( function () { document.getElementsByTagName("body").addEventListener('mousedown', function(e) { e.preventDefault(); }, false); }); &lt;/script&gt; </code></pre> <p>This works elsewhere on my site to prevent select on specific page elements. How do I do this for the entire document?</p>
javascript jquery
[3, 5]
3,440,219
3,440,220
jQuery .append() does not work from .js file
<p>I have the following line of code:</p> <pre><code>$('#text').append('&lt;h2 style="color:white"&gt;afdghadfg&lt;/h2&gt;'); </code></pre> <p>If I paste this code inside of a script tag in the html, it works fine. However, when placed inside a .js file it does nothing. </p> <p>Know that the .js file has plenty of other working javascript and jQuery code, it is only this line that won't work.</p>
javascript jquery
[3, 5]
3,170,523
3,170,524
how to return the value back to the previous aspx file when 2 file is parallel running
<p>I have an scenario where I have two aspx pages. When I'm running the first one and I click on a button, that button calls the another one.</p> <p>So currently that are two aspx files running at the same time, how can I get the second aspx file value in order to fill a TextField on the first one? , my program pass value flow should be like this file1 >> file2 >> file1 (all running at the same time )</p> <p>1) first file already the session["testing"],</p> <pre><code>protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("&lt;script&gt;window.open('{0}');&lt;/script&gt;", "calendar1.aspx")); if(Session["testing"]!=null) TextBox1.text = Session["testing"].toString(); } </code></pre> <p>2)after that, the second aspx is running, at the same time the first aspx is concurrently running also, a simple example let say the second file have a value in page_load</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { Session["testing"] = "31/12/2012"; } </code></pre> <p>3)but the problem happen here, the first file cannot get the new Session value (immediately) from file2, since that file1 does not re-compile</p> <pre><code>protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("&lt;script&gt;window.open('{0}');&lt;/script&gt;", "calendar1.aspx")); if(Session["testing"]!=null) TextBox1.text = Session["testing"].toString(); } </code></pre> <p>but it work fine when i click the button second time, it get the Session from file2 created, how can i get the value immediately without click the second time?</p>
c# asp.net
[0, 9]
2,888,285
2,888,286
simulate click when parent div is clicked
<p>I'm trying to use jquery to trigger a click on an <code>&lt;a&gt;</code> tag when it's parent div is clicked</p> <p>for this structure </p> <pre><code>&lt;div id="menu_container"&gt; &lt;ul id="header_links_container"&gt; &lt;li class="header_link header_link_large border_box_1"&gt; &lt;a class="header_link" href="http://amazon.com"&gt;LINK 1&lt;/a&gt; &lt;/li&gt; &lt;li class="header_link border_box_1"&gt; &lt;a class="header_link" href="http://google.com"&gt;LINK 2&lt;/a&gt; &lt;/li&gt; &lt;div class="tbc"&gt;&lt;/div&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>using this</p> <pre><code>$('#menu_container').on('click', 'li.header_link', function(){ console.log($(this)); $(this).children('a.header_link').click(); }); </code></pre> <p>produces and infinite amount of clicks. I guess because when I trigger the click() on the <code>&lt;a&gt;</code> tag, it's parent div also receives a click and so it just does everything again. </p> <p>How can I simulate a click on my anchor when it's parent div is clicked? Trying to use the answer from <a href="http://stackoverflow.com/a/9537518/1252748">this SO post</a> isn't working.</p> <p><a href="http://jsbin.com/ucatir/1/edit" rel="nofollow">jsbin example</a></p> <p>Thank you</p>
javascript jquery
[3, 5]
5,837,419
5,837,420
Can someone help me in jquery addition?
<p>I would like to give points to my users who submit articles based on their articles word count.</p> <p>But my page has many text area fields. Lets say message1,message2,message3 </p> <p>When the user fill textarea(message1,message2,message3) it will show like this in the bottom.</p> <pre><code>You have typed x words. Points per word : 0.2. Estimated point: xx </code></pre> <p>I also want to calculate overall points. So i would like to add points of message1,message2,message3 and display it as overall points. </p> <p>I'm a jquery noob. So i'm not sure which variable i should call.</p> <p>Here is the <a href="http://jsfiddle.net/Viruthagiri/yZb7w/29/" rel="nofollow">jfiddle</a> code what i have so far.</p> <p>Can someone help me? Thanks </p>
javascript jquery
[3, 5]
3,018,393
3,018,394
focus on the user control in C#
<p>I have a user control(error control) in a master page. by default the user control is hidden(visible false)</p> <p>on click of a submit button i am showing the error control.Now on post back I want to bring focus to this control.I am writing the java script in register Startup script as following:</p> <pre><code>ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Scroll", "window.scrollTo(0, 0)", true); </code></pre> <p>on postback page goes up shows this control and then comes back to its previous scroll position.</p>
c# asp.net javascript
[0, 9, 3]
2,251,628
2,251,629
Is it better to learn the DOM or jQuery first?
<p>I have gotten very familiar with the core functionality of Javascript and now I am aiming at learning DOM manipulation. I have already thought of learning jQeury for this but I don't know if it is good idea to learning it before first getting familiar with the core functionality of the DOM.</p> <p>Should I first learn the core functionality of the DOM and then learn jQuery? If so, why? Or should I just go on ahead and learn jQuery?</p>
javascript jquery
[3, 5]
3,102,817
3,102,818
How to get the index of an element without 'this'?
<p>I have a form that looks kind of like this:</p> <pre><code>&lt;div&gt; &lt;div class="contact"&gt; &lt;h1&gt;Person's name&lt;/h1&gt; &lt;!-- more stuff goes here --&gt; &lt;form method="post" action="myurl"&gt; &lt;input type="submit" value="go" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="contact"&gt; &lt;h1&gt;Another name&lt;/h1&gt; &lt;!-- more stuff goes here --&gt; &lt;form method="post" action="myOtherUrl"&gt; &lt;input type="submit" value="go" /&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I'm using jQuery to capture the form's <code>submit</code> event and need to get the index of the <code>div</code> containing the button that submitted it. Normally I'd use jQuery's <a href="http://docs.jquery.com/Core/index" rel="nofollow"><code>index()</code></a> function like so:</p> <pre><code>var i = $(this).parents('.contact').index(this); </code></pre> <p>Unfortunately, the <code>this</code> operator in this case refers to the <code>form</code> that is being submitted. I think there's probably something simple I'm missing, but my mind's drawing a blank on this one.</p>
javascript jquery
[3, 5]
5,354,385
5,354,386
Pushing to multidimensional object
<p>I'd like to end up with an object like:</p> <pre><code>{"Red 1":53,"Blue 2":26,"Green 3":25} </code></pre> <p>From the following example:</p> <p>Was trying to push the data from inside .each to the object, but it being multidimensional, i'm not sure how to accomplish this:</p> <pre><code>//html &lt;div class="test"&gt; &lt;div class="color"&gt;Red 1&lt;/div&gt; &lt;div class="value"&gt;53&lt;/div&gt; &lt;/div&gt; &lt;div class="test"&gt; &lt;div class="color"&gt;Blue 2&lt;/div&gt; &lt;div class="value"&gt;26&lt;/div&gt; &lt;/div&gt; &lt;div class="test"&gt; &lt;div class="color"&gt;Green 3&lt;/div&gt; &lt;div class="value"&gt;25&lt;/div&gt; &lt;/div&gt; //js var dataPoints = {}; var colorTitle = ''; var colorValue = ''; $('.test').each(function(index) { colorTitle = $(this).find('.color').html(); colorValue = $(this).find('.value').html(); dataPoints.push({colorTitle:colorValue}); }); </code></pre> <p>The code above clearly does not work, but I wanted to demonstrate basically what I am trying to do.</p> <p>Tried this approach as well:</p> <pre><code>dataPoints[index][colorTitle] = colorValue; </code></pre> <p>Which doesn't work either. Probably missing something all together, but any help is appreciated! Thanks</p>
javascript jquery
[3, 5]
509,211
509,212
Get closest elments of corresponding list of elements in javascript/jquery
<p>I have a list of elements:</p> <pre><code>var checked_inputs = $('.select-feedback:checked'); </code></pre> <p>Now i want to get their closest division element whose class is 'MessageRow'. I have done this trick to get it:</p> <pre><code> $('.radiusRight').click(function(event) { event.preventDefault(); var feedbacks = new Array(); var checked_inputs = $('.select-feedback:checked'); for (var i=0; i&lt;checked_inputs.length; i++) { feedbacks.push($(checked_inputs[i]).closest('.messageRow').attr('id')); } var feedback_ids = feedbacks.map(function(val) { return val.split('-')[1] }); var feedback_divs = feedbacks.map(function(val) { return '#' + val }).join(','); $.ajax({ url: '/business/feedback/delete/', type: 'POST', data: {'ids': feedback_ids}, success: function(data) { $(feedback_divs).fadeOut(); } }) }) </code></pre> <p>Is there any better way to accomplish this? Or is this a good way? Thanks in advance.</p>
javascript jquery
[3, 5]
3,707,204
3,707,205
What "terminating characters" will generally ensure that the subsequent javascript will be run?
<p>Is there a sequence of characters that can be used after malformed javascript code, to ensure the subsequent script will be executed?</p> <p>The idea being that we have separate divisions writing javascript code that will be placed on the same page. The "other" group are notorious for leaving bad code around. Since my code will be in the footer (via site.master), what set of characters can I use to ensure (or make it more likely) that my code will be executed?</p> <p><strong>Example</strong> </p> <pre><code> // &gt; "" ; */ alert("this code will always run, regardless of what happens before..."); </code></pre>
javascript jquery
[3, 5]
4,811,154
4,811,155
How to make a super in javascript function
<p>Like in this example:</p> <pre><code>var teste = {name:'marcos'}; $(teste).each(function(){ var name = this.name; // i don't want to do that. // i want to have access to 'this' inside this function (sayName) var sayName = function(){ alert(name); // there is something like "super" in java? or similar way to do? } sayName(); }); </code></pre> <p>How can i do that?</p>
javascript jquery
[3, 5]
3,892,426
3,892,427
If Date has passed then execute statement
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/492994/compare-dates-with-javascript">Compare dates with JavaScript</a> </p> </blockquote> <p>I was wandering if anyone has a simple solution for executing a jquery statement if a supplied date has passed. </p> <p>Basically I want to hide an image after a certain date has expired. If it could include a time as well as date that would be great.</p> <p>Many thanks</p>
javascript jquery
[3, 5]
162,585
162,586
Accessing properties of SelectedRow during SelectedIndexChanged event in dynamically generated GridView
<p>I have an empty GridView object on a page that I bind to a LINQ qry result at run time. The GridView has a 'Select" button that fires the SelectedIndexChanged event and it's inside of this event that I'd like to access the data of one of the fields in the selected row.</p> <p>So far, I can only find one way to do this, and it seems suboptimal:</p> <pre><code>protected void GridView2_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = GridView2.SelectedRow; string UserID = row.Cells[1].Text; //Do stuff with the userID } </code></pre> <p>So this just access the cell data directly based on the cell index. The UserID just happens to be in the second cell and so it works. But later down the road, the UserID may not be in that same column. It seems like I'd be better off looking up the value of this cell by accessing by the cell's header name, or by any method other than the cell index itself.</p> <p>Any ideas?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,042,972
2,042,973
Importing android library to JAVA project on Eclipse
<p>Can I import android library such as android 2.3.3 which is included android.jar on it into a JAVA project on Eclipse? How can I do it? Thanks</p>
java android
[1, 4]
3,062,348
3,062,349
Is there a security reason to validate a textbox input if you are limiting the max length of the input?
<p>Since I'm new to coding and I'm trying to understand why here is a little more detail on the question.</p> <p>If you have a text box and you are limiting the input to say 2 charactrs do you really need to validate the input further? </p> <p>What I have is a text box that has a max length of 2. Is there a security reason to add a validator to the textbox. I should add this is in Asp.net.</p>
c# asp.net
[0, 9]
2,426,924
2,426,925
OnItemInstered, OnItemUpdated the same code behind
<p>I need to associate different methods of the control with exact same code. I'm doing it like this now: </p> <pre><code>protected void dgvProperty_ItemInserted(object sender, GridInsertedEventArgs e) { BindItems(); } protected void dgvProperty_ItemDeleted(object sender, GridDeletedEventArgs e) { Binditems(); } protected void dgvProperty_ItemUpdated(object sender, GridUpdatedEventArgs e) { BindItems(); } </code></pre> <p>It feels wrong. How can I avoid repetitions?</p>
c# asp.net
[0, 9]
5,464,155
5,464,156
Simple code for android app for connecting to a remote server and sending some data
<p>I am trying to develop an android app which will connect to a remote HTTP sever and send some data to the server. Can someone please help on how to go about writing the code for the android app.</p>
java android
[1, 4]
1,649,900
1,649,901
Finding which elements in the page share the left and the right edges with any component
<p>How to find which elements share their right edge with the left edge of an component and which components share their left edge with the right edge of the component? So my function takes a single id say X and returns me a Java script object like </p> <pre><code>{ leftElements = [leftElement1,leftElement2,...], rightElements = [rightElement1,rightElement2,...], } </code></pre> <p>So leftElements will contain an array of ids of components that share their right edge with the left edge of the argument to the function and rightElements will contain their left edges aligned with the right edge of the argument . The argument will be a string id.</p> <p>So when I do elements('x') , i get an object like the above .</p>
javascript jquery
[3, 5]
1,525,612
1,525,613
Simple Website (Apache/PHP/MySQL + JavaScript)
<p>I've been asked to create a fairly straightforward website for a friend. Essentially a user will log in, fill in a set of information, and submit it. This data will then need to written to a database (and read from/presented at a future point).</p> <p>I'm not really a web developer (I do mostly Java/C++), but about 3 years ago I worked on a project where we created a site using WAMP (Windows, Apache, MySQL and PHP), with a bit of JavaScript/AJAX thrown in for good measure. I was going to use WAMP again, but am concerned that there might be better tools available now. </p> <p>So, is the WAMP approach a good one for a straightforward site like this? </p> <p>If so, what tools would you recommend to use for the development of PHP/Javascript?</p> <p>Finally, I saw in one of the blog posts that Stack Overflow uses JQuery. Would it be worthwhile to use these libs?</p>
php javascript
[2, 3]
2,646,335
2,646,336
adding functions to injected elements
<p>Okay how can i add function to injected elements(which that element dosent exist on first browser load). Please read through my example carefully , i hope you can understand.</p> <p>For example: i go to www.website.com , when it loads it loads up "functions.js" and "other.js" , inside "functions.js" there's a code that injects a new div with ID when user click on a button.</p> <p>The injection code as shown below:(functions.js --jquery)</p> <pre><code>$('a#button').click(function(){ $('a#button').after('&lt;div id="new"&gt;New div&lt;br&gt;&lt;a href="#" id="newdivlink"&gt;Another link&lt;/a&gt;&lt;/div&gt;'); }); </code></pre> <p>However there's another on click functions loaded in another js file which is "other.js" (loaded same time as function.js load).</p> <p>Inside "other.js" has the code for the onclick function when the new div's link (#newdivlink) is clicked.</p> <p>other.js :</p> <pre><code>$('a#newdivlink').click(function(){ alert('you clicked on new div's link yay?'); }); </code></pre> <p>But the problem is , the onclick function for the new div's link(#newdivlink) cant be executed as the script can't find the div (as it is being injected after i loads). Or is there some problems ?</p> <p>P/S if you are asking why not combine both scripts , i don't want, as i want to try this technique out.</p>
javascript jquery
[3, 5]
3,577,515
3,577,516
copy div data that contains grid view
<p>I m implementing copy to clipboard functionality for div that contains asp.net gridview. my code is working on i.e only now how can i make it for all browsers</p> <pre><code>function CopyGridView() { var div = document.getElementById('div1'); div.contentEditable = true; var controlRange; if (document.body.createControlRange) { controlRange = document.body.createControlRange(); controlRange.addElement(div); controlRange.execCommand('Copy'); } div.contentEditable = 'false'; } </code></pre> <p>Please help. </p> <p>Regards,<br> -Nitin</p>
javascript asp.net
[3, 9]
5,434,924
5,434,925
Is it OK to create multiple threadpools (ExecutorService)?
<p>I created multiple ExecutorService instances in my code, usually each UI page has one ExecutorService instance. Each ExecutorService instance will execute some http get request threads.</p> <pre><code>private ExecutorService m_threadPool = Executors.newCachedThreadPool(); </code></pre> <p>Is it OK to do that?</p> <p>The problem I met is that sometimes the http get requests got response code -1 from HttpURLConnection getResponseCode() call. I don't know whether it is caused by multiple threadpool instances.</p> <p>Thanks. </p>
java android
[1, 4]
1,372,162
1,372,163
How can I combine an image slider with scaling images?
<p>I have a bit of a dilemma in the sense that I can't seem to get a jquery image cycler working with scaling images.</p> <p>What I basically have is a website with a small navigation list at the top, and then full screen images which can be cycled using a control at the bottom of the page. Previously I've used <a href="http://srobbin.com/jquery-plugins/backstretch/" rel="nofollow">backstretch</a> to get the desired effect for a background image that stretches with the browser window.</p> <p>I was also hoping on using <a href="http://jquery.malsup.com/cycle/" rel="nofollow">Jquery Cycle</a> as the plugin to do the image slider (as I've used this countless times before).</p> <p>The problem is that I need the effect of backstretch (ie. scaling images) but with a slider. I have tried using other plugins for the stretching but most of them only seem to allow the images to be scaled down (if the window shrinks) rather than upwards. I can't use backstretch because it takes up the entire body tag. I only need a container div to contain the stretched images (so I can have the header/navigation sitting at the top without cropping the images).</p> <p>However I have no idea how to then get this to work with Jquery Cycle.</p> <p>Has anyone done this before or have any examples of this working?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,946,924
4,946,925
Constructing a more efficient javascript user-based chat
<p>I am going to bed soon, so I will not be on until the morning, but I have been struggling with trying to find a javascript/jquery method that solves my problem. I am trying to make a chat box feature where once a post is submitting it is then echoed back out and users on both ends can see it. I know that I need to use javascript and or jquery. Right now I am using a very inefficiency system: </p> <pre><code>&lt;script language='javascript' type='text/javascript'&gt; setInterval( function() { $('#responsechat').load('echogetconversation.php?username=&lt;?php echo $username; ?&gt;&amp;otherchatuser=&lt;?php echo $otherchatuser; ?&gt;'); }, 100); &lt;/script&gt; </code></pre> <p>The only reason that I am using it is because it is the only way I know how to project new posts to both users. I was wondering if someone knew a way to do this. Once a post is submitted, it fades into a div and both users can see it, not only the user who submitted it, so it is like a facebook chat in a way. I have no idea about any possible solutions, and have done research, but I could not find any that i could get to work. Any help and/or insight to what I should do next would be appreciated.</p>
php javascript jquery
[2, 3, 5]
1,488,667
1,488,668
Multiple JavaScript Issue
<p>I include the following in my header</p> <pre><code>&lt;!-- scripts --&gt; &lt;script type="text/javascript" src="http://code.jquery.com/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./js/script.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./js/jquery.infinitecarousel.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./js/news.ticker.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./js/jquery.autogrowtextarea.js"&gt;&lt;/script&gt; </code></pre> <p>but the autogrowtextarea dont work if the script.js,jquery.infinitecarousel.js and news.ticker.js are included, but if i remove those three lines my autogrow textbox function work, why can this be. thanks</p>
javascript jquery
[3, 5]
3,014,496
3,014,497
ModelIt is Undefined [IE7!]
<p>Hello I'm having problems with a featured content area breaking the site in IE7 which is causing the splash to display above the content (as its also jquery).</p> <pre><code>&lt;script type="text/javascript" src="/site/3/design/js/featurebar.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; //&lt;!-- jQuery( function(){ ModelIt.FeatureBar.init() } ); //--&gt; &lt;/script&gt; </code></pre> <p>ModelIt is defined inside featurebar.js</p> <p>Every other browser, the above works fine, in ie7 I get ModelIt is undefined...Any ideas of a work around?</p> <p>Here is a test page: <a href="http://www.prowler.tv/scripts/test.php" rel="nofollow">http://www.prowler.tv/scripts/test.php</a> - I get object unexpected in IE7.</p>
javascript jquery
[3, 5]
4,379,358
4,379,359
jQuery fade effect on replacing divs
<p>I've been struggling to find a solution for a <code>fade</code> effect with this script. I'm still learning basic jQuery, but cant seem to figure it out. The script is working fine, the divs are replacing, but with no animation. I have tried fadeToggle, fadeIn and fadeOut.</p> <pre><code>function HideContent(d) { if(d.length &lt; 1) { return; } document.getElementById(d).style.display = "none"; } function ShowContent(d) { if(d.length &lt; 1) { return; } document.getElementById(d).style.display = "block"; $('#' + d).fadeToggle('slow'); } </code></pre> <p>I call the script with onmouseclick. I have about 14 different divs.</p> <pre><code>&lt;a onmouseclick="ShowContent('div1'); return true; "href="javascript:ShowContent('div1')"&gt; Link button &lt;/a&gt; </code></pre> <p>and to go back:</p> <pre><code>&lt;a onmouseclick="HideContent('div1'); return true;" href="javascript:HideContent('div1')"&gt; BACK &lt;/a&gt; </code></pre> <p>How do I fix this problem?</p>
javascript jquery
[3, 5]
3,371,719
3,371,720
How can I set the order of jQuery functions so that one triggers after the other finishes rendering content?
<p>I'm using <strong>Masonry</strong> and <strong>Embedly</strong> plugin to display embedded content, I've put together an example <a href="http://jsfiddle.net/anir/pBtbb/3/" rel="nofollow">here</a>.</p> <p>My jQuery is as follows</p> <pre><code>//embedly $('.box').find('a').embedly({ maxWidth: 260, wmode: 'transparent', method: 'after', chars: 50, width: 260, key:':cd54253e69944ae18ad5ece38b4d0e1e' //temporal }); //masonry var $container = $('#main-container'); $container.imagesLoaded( function(){ $container.masonry({ itemSelector: '.box', isAnimated: true, isFitWidth: true }); }); </code></pre> <p>It appears the Masonry plugin loads first and it causes the overlapping problem (they only show correctly when you resize the result window) I've read that I could use callback functions or retrigger Masonry once embedly has finished rendering content, but I don't know how to do it. Can you help me? Is there any other solution to fix this?</p>
javascript jquery
[3, 5]
62,111
62,112
How can I populate a message box when mouse cursor enters in a text box?
<p>I am using 3 text boxes. When I click on 2nd text box I want to show 1st text box value in message box (if 1st text box passed the validations). Same procedure when i click on 3rd textbox I want to show 1st text box value and 2nd text box value in message box(if 1st text box,2nd text box passed the validations).</p> <p>Regards, NSJ</p>
javascript asp.net
[3, 9]
5,283,151
5,283,152
JQuery modal popup on specific region
<p>I have a grid and when i change its sorting order i a loading message appear on grid region and block its content like other modal popup but only on grid region is there any available jquery modal popup meet my needs ? can I configure jqueryUI modal to do this ?</p>
javascript jquery
[3, 5]
374,570
374,571
Select a Multi-select DropDown by values with jquery
<p>I have asked a similar <a href="http://stackoverflow.com/questions/12584387/select-a-dropdown-by-values-with-jquery">question</a> this morning, how to select a dropdown by its value rather than sequence.</p> <p>The problem is now how to use a multi-select dropdown and select the options by their value rather than sequence. (e.g. I would like to select a1 and a3, by their respective primary key, 1 and 4) </p> <pre><code>&lt;select id="id_deals-sales_item" multiple="multiple"&gt; &lt;option value="1"&gt;a1&lt;/option&gt; &lt;option value="2"&gt;a2&lt;/option&gt; &lt;option value="4"&gt;a3&lt;/option&gt; &lt;/select&gt; </code></pre> <p>The old way by sequence:</p> <pre><code>for (i=0; i&lt;data[0].fields['sales_item'].length;i++) $('#id_deals-sales_item&gt;option:eq(' + (data[0].fields['sales_item'][i]) + ')').prop('selected', true); </code></pre> <p>I was hoping to apply the same solution here with val(), But it doesn't work.</p> <pre><code>for (i=0; i&lt;=data[0].fields['sales_item'].length;i++) $('#id_deals-sales_item').val(data[0].fields['sales_item'][i]); </code></pre> <p>Do I have to apply a different trick here? Thanks</p>
javascript jquery
[3, 5]
117,693
117,694
How can i access children using parent id
<p>I have this structure of html. To present the list of two different sets. and i must handle the click event differently.</p> <pre><code>&lt;div id='nodelist1'&gt; &lt;ul&gt; &lt;li class='nodeelem'&gt;first node &lt;ul&gt; &lt;li class='nodeelem'&gt;second node &lt;ul&gt; &lt;li class='nodeelem'&gt;third node&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div id='nodelist2'&gt; &lt;ul&gt; &lt;li class='nodeelem'&gt;first node &lt;ul&gt; &lt;li class='nodeelem'&gt;second node &lt;ul&gt; &lt;li class='nodeelem'&gt;third node&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>I have to access the nodes using div id</p> <pre><code>$('#nodelist1 li.nodeelem').click(handler); $('#nodelist2 li.nodeelem').click(handler2); </code></pre> <p>Is this rightway to access children clicks???</p>
javascript jquery
[3, 5]
473,871
473,872
How to get city and postal code from google maps API?
<p>How to get city and postal code from google maps API.My code look like this</p> <pre><code>if (place.address_components) { code = [place.address_components[0].types[0].postal_code]; alert(code); document.getElementById('cityField').value = code; } </code></pre> <p>but when i am trying this it alerts null.</p> <p>Thanks in advance</p>
c# javascript asp.net
[0, 3, 9]
2,926,168
2,926,169
Why do Android callback methods' name start with 'on'?
<p>I'm just curious. (Maybe not only in Android)</p>
java android
[1, 4]
1,626,052
1,626,053
Creating tables and displaying textboxes in codebehind
<p>I have a Dataset from the database which i want to display. My aim is to display a month's data on an aspx page using VS 2005 with 5 days per each row. I have written the code like this but i am confused with the i and j. This code displays nothing. </p> <pre><code>if (ds != null &amp;&amp; ds.Tables[0].Rows.Count &gt; 0) { Table table = new Table(); table.ID = "Table1"; TableRow row = new TableRow(); TableCell cell = new TableCell(); TextBox tb1 = new TextBox(); TextBox tb2 = new TextBox(); // I am not sure what i and j should be here to display 5 per each row.. for (int i = 0; i &lt; 5; i++) { if (int j == 0; j &lt; ds.Tables[0].Rows.Count; j ++) { tb1.ID = "txtDateRow" + x + "Col" + j; tb1.Text = ds.Tables[0].Rows[x]["Date"].ToString(); tb2.ID = "txtDetails" + x + "Col" + j; tb2.Text = ds.Tables[0].Rows[x]["AmountSold"].ToString(); cell.Controls.Add(tb1); cell.Controls.Add(tb2); table.Rows.Add(row); } } Panel1.Controls.Add(table); } </code></pre> <p>If someone could help me solve this, i really appreciate it. Thanks a lot. </p>
c# asp.net
[0, 9]
3,904,499
3,904,500
Jcarousel change a divs text depending on first item shown
<p>I'm having a problem with Jcarousel where i need to have a divs text changing when the next button is pressed on the carousel. I have the carousel set up and working how i want, scrolling one item at a time:</p> <pre><code>jQuery(document).ready(function() { jQuery('.mycarousel').jcarousel({ scroll : 1 });}); </code></pre> <p></p> <pre><code> &lt;li&gt; &lt;img src="img/slider/slide1.gif" alt="slide1" /&gt;&lt;/li&gt; &lt;li&gt; &lt;img src="img/slider/slide2.gif" alt="slide1" /&gt; /li&gt; &lt;li&gt; &lt;img src="img/slider/slide3.gif" alt="slide1" /&gt; /li&gt; </code></pre> <p>Now i want to append the the text inside a div when the next button is pressed i know Jcarousel has the itemFirstInCallback: function but I'm totally lost on how to use this to append a divs text:</p> <pre><code> &lt;div class="copy"&gt; &lt;p&gt; example text &lt;/p&gt; &lt;/div&gt; </code></pre> <p>Any ideas?</p> <p>Thanks,</p> <p>Liam</p>
javascript jquery
[3, 5]
356,509
356,510
How to do Initial Caps With Javascript/jQuery
<p>I have a Dynamic Breadcrumb set up with JavaScript. All I want is to do Initial Caps for each word.</p> <p>Example: Home > Some > Page</p> <p>Currently I have them all converted to lowercase and have removed all - from the strings in pages that have multiple words. I just need to convert the string to Initial Caps. Here is my code that I have working so far:</p> <pre><code>var path = "", href = document.location.href, domain = href.match(/:\/\/(.[^/]+)/)[1], replacedomain = 'http://' + domain + '/', s = href.replace(/-/gi, " ").split("/"), lastElement = document.location.href.split('/').splice(-1,1); for (var i = 2; i &lt; (s.length - 1); i++) { path += "&lt;a class='bc' href=\"" + href.substring(0, href.indexOf("/" + s[i]) + s[i].length + 1) + "/\"&gt;" + s[i] + "&lt;/a&gt; &gt; "; if (i &gt; 0) { breadcrumb = path; } } i = s.length - 1; breadcrumb += "&lt;span&gt;" + s[i] + "&lt;/span&gt;"; var breadcrumbl = breadcrumb.toLowerCase(), domain = breadcrumbl.match(/:\/\/(.[^/]+)/)[1], breadcrumb2 = breadcrumbl.replace(domain, "").replace(domain, ""), breadcrumbs = breadcrumb2, url = '&lt;a href="/"&gt;Home&lt;/a&gt;' + breadcrumbs; document.getElementById('breadcrumb1').innerHTML=url; </code></pre> <p>I think the solution is with a regular expression but I'm not good at writing them and I'm having a hard time with the concept. Also if anyone thinks this script can be optimized further your feedback is welcome. I'll will make variable names more semantic for production.</p>
javascript jquery
[3, 5]
430,306
430,307
Android Native API (getWidth etc) for determining attributes of images return wrong value
<p>In Android while trying to get/set the attributes of an Image I am getting Image attributes as zero which I guess is not a correct value. Please help me on this. here's the excerpt of the code:</p> <p><strong>CODE</strong></p> <pre><code>public class CumulativeGoalProgress extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.cumulative_goals); showCumulativeGoalProgress(); } private void showCumulativeGoalProgress(){ ImageView wellnessBarIndicator = (ImageView)findViewById(R.id.iv_welness_bar_indicator); Log.e("Ravi", "progBarImage getBaseline = " + progBarImage.getBaseline()); Log.e("Ravi", "progBarImage getHeight = " + progBarImage.getHeight()); Log.e("Ravi", "progBarImage getMeasuredHeight = " + progBarImage.getMeasuredHeight()); Log.e("Ravi", "progBarImage getMeasuredWidth = " + progBarImage.getMeasuredWidth()); Log.e("Ravi", "progBarImage getWidth = " + progBarImage.getWidth()); Log.e("Ravi", "progBarImage getBottom = " + progBarImage.getBottom()); Log.e("Ravi", "progBarImage getLeft = " + progBarImage.getLeft()); Log.e("Ravi", "progBarImage getNextFocusLeftId = " + progBarImage.getNextFocusLeftId()); Log.e("Ravi", "progBarImage getPaddingLeft = " + progBarImage.getPaddingLeft()); Log.e("Ravi", "progBarImage getPaddingTop = " + progBarImage.getPaddingTop()); } } </code></pre> <p><strong>The ImageView as defined in the XML</strong></p> <pre><code>&lt;ImageView android:id="@+id/iv_welness_bar_indicator" android:layout_marginTop="119px" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/vis_wellness_bar_indicator" /&gt; </code></pre> <p><strong>vis_wellness_bar_indicator</strong> is the source Image file in PNG format.</p> <p>What am I doing wrong?</p>
java android
[1, 4]
675,863
675,864
loading several forms in a div but every form disappears when i click submit
<p>I have an index page, i am loading several pages in a div in that page by clicking links , some of them are forms(pages). When i click submit, the information is processed correctly and it is stored in the database but the page disappears because of which i am unable to see some useful information like errors generated after form validation. I want that the page should not disappear after loading. A page can be shown in the same div only when i click on the link for that page.</p> <p>I am using php, javascript, jquery, MySqL.</p> <p>Any help ??</p>
php javascript jquery
[2, 3, 5]
254,506
254,507
Get all selected items value
<p>I need to get all values from a set of input text in my page and I need to know if someone of these inputs has value <em>'some value'</em></p> <p>I'm using JQuery so I'm doing something like:</p> <pre><code>$('input.partValue').each(function(){ int count = 0; if($(this).val() == 'some value'){ count++; } }); if(count &gt; 0){ // do something } </code></pre> <p>but could be useful to have something like:</p> <pre><code>if($("input.partValue[value='some value']").length &gt; 0){ // do something } </code></pre> <p>There is something similar?</p>
javascript jquery
[3, 5]
2,172,404
2,172,405
Java bytecode to exe and combing c++ and java
<p>I have read many articles and posts but im still confused how to make/convert bytecode to exe so that it can be run on any standalone machine withour JRE,JVM or any other kind of thing.</p> <p>What does combining C++ and java Program means?</p> <p>And if it's possible to combine C++ and Java Program , how to do so?</p>
java c++
[1, 6]
3,736,860
3,736,861
Unable to validate both textboxes and dropdown lists for empty check
<p>I have nearly 80 textboxes created dynamically and 10 dropdownlist created dynamically. On the click of additem button i want to make sure that none of these controls are empty.</p> <p>I am tring the below code</p> <pre><code> function validateinput() { var arrTextBox = document.getElementsByTagName("input"); var ddlTextBox = document.getElementsByTagName("select"); var retVal = 1; for (i = 0; i &lt; arrTextBox.length; i++) { if (arrTextBox[i].type == "text" &amp;&amp; arrTextBox[i].getAttribute("IsMandatory") == "Y" &amp;&amp; arrTextBox[i].value == ""){ retVal = 0; } } for (j = 0; j &lt; ddlTextBox.length; j++) { if (ddlTextBox[j].getAttribute("IsMandatory") == "Y" &amp;&amp; (ddlTextBox[j].value == "" || ddlTextBox[j].selectedIndex == 0)) { returnValue = 0; } } if (retVal == 0) { alert("Validation Failed"); return false; } else { alert("Validation Success"); return true; } } </code></pre> <p>on ascx.cs file </p> <pre><code> btnAddItem.Attributes.Add("onclick", "{return validateinput()};"); </code></pre> <p>I get validation failed message if textboxes are empty however, if the dropdown values are null it does not give the validation failed message. Please let me know where am I going wrong.</p> <p>Thanks in advance.</p>
javascript asp.net
[3, 9]
4,865,942
4,865,943
how to detect javascript features on Android 1.5
<p>I'm trying to write a code that can run on Android 1.5 and 2.0.1, but I have issues with the javascript engine used on Android 1.5.</p> <p><code>alert(localStorage);</code> just hang on v1.5 while on v2.0.1 it alerts correctly.</p> <p>is there an unblocking way to do it or to detect the version of Android with javascript?</p>
javascript android
[3, 4]
3,829,743
3,829,744
Automatic Timeout Web Client Use
<p>One of the problems I have come accross having complext tasks on the browser is with automatic timeouts. Currently our site has a sliding expiration of 30 minutes. Normally this isn't a problem because we use asp.net and most of the time the users update one or two fields and then submit the form. This obviously keeps the session active. I have struggled with how to handle this with significantly more complex forms/user interaction where there are few if no round trips to the server. Now users can view reports, type emails etc. on our site, and I am struggling with how to keep their session active while they're actually using browser but they are not actively posting information back. I would dispense with the sliding expiration, but it's a requirement, so I am stuck with it. Most of our users are outside of the organization, so I can't use any form of SSO. Does anyone have an elegant solution (I'll even go for an ugly one if it works), or am I out of luck?</p>
c# asp.net
[0, 9]
976,752
976,753
find ID of previous button
<p>I'm looking to find the id of the previous button. It is pretty far away - lots of table rows, tables, divs, etc. between the target and the button but I thought this would still work:</p> <pre><code>alert( $(this).prevAll("input[type=button]").attr('id') ); </code></pre> <p>Unfortunately this returns alerts 'undefined'. Help?</p>
javascript jquery
[3, 5]
560,435
560,436
DataGrid - Preventing Concurrent Access To Rows
<p>I need to write a simple datagrid form which allows users to edit cells - The problem is that different people can edit this at EXACTLY the same time so concurrency becoames an issue</p> <p>I am using data backed by a database</p> <p>I seem to have two options here:</p> <p>1) Continually poll the database and refresh data in the datagrid before allowing editing - This means that updates to the database need to take place just after editing rather then the preffered way of allowing edits, then letting users review and then commiting.</p> <p>2) Allow dirty edits and then prevent users from commiting to the database the changes they want</p> <p>Can anyone describe a mechansim which allows users to edit rows concurrently which would make the implementation easy??</p> <p>EDIT : My question is how to implement this in C# - I have added lock columns but this is still not sufficent - If usera tries to edit row1 and commits changes userB tries to edit a stale version of row1 this will not get caught which is a BIG problem</p>
c# java
[0, 1]
5,850,159
5,850,160
facebook iframe application ,with master page, doesn't firing OnSelectedIndexChanged event
<p>this is my radio button list:</p> <pre><code> &lt;asp:RadioButtonList runat="server" ID="rdlTest" OnSelectedIndexChanged="rdlTst_selectedChange"&gt; &lt;asp:ListItem&gt;1&lt;/asp:ListItem&gt; &lt;asp:ListItem&gt;2&lt;/asp:ListItem&gt; &lt;/asp:RadioButtonList </code></pre> <p>this is the code behind:</p> <pre><code>protected void rdlTst_selectedChange(object sender, EventArgs e) { Response.Write("hello"); } </code></pre> <p>it's not firing the event for some reason</p>
c# asp.net
[0, 9]
30,173
30,174
jQuery event keycode standardisation
<p>I read that the <code>which</code> parameter in all jQuery events are normalized ( <a href="http://api.jquery.com/event.which/" rel="nofollow">specified here</a> ). However, I was trying to figure out where in the source ( of jQuery ), this normalization is achieved. I'm interested in figuring out how it is done. Anybody have an idea? Could you either point me in the right direction or post an explanation here ?</p>
javascript jquery
[3, 5]
5,553,818
5,553,819
Can i use this coding in looping statement
<p>I have a code like this</p> <pre><code>&lt;div id="div1"&gt;&lt;/div&gt; &lt;hr id="line1" color="#0f0" size="2" width="50px"&gt; &lt;div id="div2" &gt;&lt;/div&gt;&lt;br&gt; &lt;hr id="line2" color="#0f0" size="2" width="50px" style="display:none;" &gt; &lt;div id="div3" &gt;&lt;/div&gt;&lt;br&gt; &lt;hr id="line3" color="#0f0" size="2" width="3.5%" style="display:none;" &gt; &lt;div id="div4" &gt;&lt;/div&gt;&lt;br&gt; &lt;hr id="line4" color="#0f0" size="2" width="3.5%" style="display:none;" &gt; &lt;div id="div5" &gt;&lt;/div&gt;&lt;br&gt; &lt;hr id="line5" color="#0f0" size="2" width="3.5%" style="display:none;"&gt; </code></pre> <p>Can i use this coding in any looping statement with the uses of script or jquery.</p>
javascript jquery
[3, 5]
4,033,282
4,033,283
Is there a better way to redirect and pass parameter
<p>I have this table</p> <pre><code>&lt;table id="tableDg" border=1&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td &gt;&lt;input type="hidden" id="path" readonly="true" value="{path}"&gt;{path}&lt;/input&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" class = "chkbCsm" &gt;&lt;/input&gt;&lt;/td&gt; &lt;td &gt;&lt;input type="hidden" id="nameText" readonly="true" value="{name}"&gt;&lt;a href="#" class="aDg"&gt;{name}&lt;/a&gt;&lt;/input&gt;&lt;/td&gt; &lt;td &gt;&lt;input type="hidden" id="nameText" readonly="true" value="{host}"&gt;{host}&lt;/input&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>After reading post from <strong>Felix Kling</strong> My jQuery </p> <pre><code>$('#tableDg tbody tr td a.aDg').live('click', function(){ path=$('input', $(this).parent().prev().prev()).val(); window.location.href = "/simon/infopage.html"; var url_action="/getData"; var client; var dataString; if (window.XMLHttpRequest){ client=new XMLHttpRequest(); } else { client=new ActiveXObject("Microsoft.XMLHTTP"); } client.onreadystatechange=function(){ if(client.readyState==4&amp;&amp;client.status==200) { //here i will get back path in infopage.html } }; dataString="request=getconfigdetails&amp;path="+path; client.open("POST",url_action,true); client.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); client.send(dataString); }); </code></pre> <p>Is this how i should get <code>path</code> from my previous page to <code>infopage.html</code></p>
javascript jquery
[3, 5]
4,662,601
4,662,602
showing content on selecting radio buttion
<p>I am trying to create a scenario where I am showing different content on switching the radio button. it is working fine in chrome but not working in IE. Cant figure out what is going wrong. Any suggestion? </p> <pre><code>&lt;div id="Q6"&gt; &lt;input type="radio" id="Q6A" value="yes" name="Q6"/&gt;Same as current address&lt;br/&gt; &lt;input type="radio" id="Q6B" value="no" name="Q6"/&gt;New address&lt;br/&gt; &lt;/div&gt; &lt;div id="Q6Aoutput" style="display:none;"&gt;1&lt;/div&gt; &lt;div id="Q6Boutput" style="display:none;"&gt;2&lt;/div&gt; &lt;script&gt; $('#Q6').change(function(){ if($('#Q6A').attr('checked')){ $('#Q6Aoutput').show(); }else{ $('#Q6Aoutput').hide(); } // if($('#Q6B').attr('checked')){ $('#Q6Boutput').show(); }else{ $('#Q6Boutput').hide(); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
3,791,362
3,791,363
Jquery - Dynamic button, can I clean this up?
<p>I created a button that will randomly appear on the screen (per my boss's request) that when clicked will open an email in order to provide feedback.</p> <p>My goal is to make this script do everything, mainly so I don't have to access the ASP markup or CSS files for each website. Just throw the script in the header and place the image in the folder.</p> <p>I created the script to:</p> <ul> <li>Create a div that contains the button</li> <li>set the CSS for the elements of that div (there will be a little image next to some text)</li> <li>appear to the user at random</li> </ul> <p>The script I came up with works fine, however, I was wondering if there was anyway I can clean this up at all. (I'm kind of new to writing my own Jquery scripts and I'm trying to learn how to be as organized as possible.)</p> <p>Jquery:</p> <pre><code>$(function () { var fbContainer = $('&lt;div id="feedback"&gt;&lt;img src="image.gif" /&gt; &lt;a href="mailto:[email protected]"&gt;Feedback&lt;/a&gt;&lt;/div&gt;') .css({ 'display': 'none', }); $('#header').append(fbContainer); $('#feedback a').css({ 'font-family': 'arial', 'float': 'left', 'text-decoration': 'none', 'color':'#000000' }); $('#feedback img').css({ 'float': 'left', 'margin': '3px 5px 0 0'; }); var randofactor = .5; var randomizer = Math.random(); if (randomizer &lt; randofactor) { fbContainer.css('display', 'block'); } }); </code></pre> <p>Thanks for any assistance</p>
javascript jquery
[3, 5]
4,528,207
4,528,208
jQuery: I see append, prepend, appendTo, what about take-out-the-content-of?
<p>I see all sorts of jQuery options such as append, prepend, appedTo etc. but I just want to take out the content of a div and append it to the inside of the body. The whole contents, so not by using .html() but being loads of other divs. These divs may have events attached as well so I don't want to mess them all up.</p> <pre><code>&lt;div id="main"&gt; &lt;div id="anything" class="anything"&gt; &lt;p&gt;hello etc.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>So I need to take out everything inside id="main"</p> <p>So, something like $('#main').get-its-contents-and-append-to('body') would do it.</p> <p>I guess I could write a lengthy script, but there must be a simple one-line jQuery option?</p>
javascript jquery
[3, 5]
1,826,784
1,826,785
Closing a tab after server side script has executed
<p>I need a little assistance. I want to close a firefox tab after a classic asp script has executed which is run at specific times of the day automatically.</p> <p>I have tried the following code without success:</p> <pre><code>&lt;% ASP SCRIPT %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;script language="javascript" type="text/javascript"&gt; window.onload = function(){window.close();} &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; </code></pre> <p>Any ideas how this can be accomplished? Any help would be greatly appreciated.</p> <p>Many thanks, neojakey</p>
javascript jquery
[3, 5]
2,193,095
2,193,096
Automatically send an email from an app
<p>My app is really progressing now, much of it due to you guys and your willingness to help out so thanks alot. As to my problem, I want my app to email a user each day as a kind of reminder additional to notifications. However I can't find a way to do this without user intervention, I am aware I can use a send intent but I want it to be automated without the user needing to do anything other then select the option in the settings to enable email reminders. I don't actually know if this is even possible but I'm hoping that is. If it isn't maybe there's a way i can hack it together to achieve the desired outcome?</p>
java android
[1, 4]
1,919,420
1,919,421
can i take value of selected radio button in scriplet after clicking a button
<p>I have a jsp page where i have placed several radio buttons.</p> <p>After selecting radio button and clicking a submit button it will call a javascript function, which needs the selected value of the radio button to perform some operations into the scriplet.</p> <p>Can anyone solve this ?</p> <pre><code>&lt;td align="center"&gt;&lt;input type="radio" name="radio" id="radio" value="value1"&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;input type="radio" name="radio" id="radio" value="value2"&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;input type="radio" name="radio" id="radio" value="value3"&gt;&lt;/td&gt; &lt;td &gt;&lt;a onclick="Javascript:delete();"&gt;&lt;span&gt;Delete&lt;/span&gt;&lt;/a&gt;&lt;/td&gt; &lt;script language="javascript" type="text/javascript"&gt; function delete() { &lt;% String str= here i want that selected radio buttons value%&gt; } &lt;/script&gt; </code></pre>
java javascript
[1, 3]
3,216,827
3,216,828
How to execute Javascript from Python on Windows?
<p>how can I execute Javascript from Python on Windows?</p> <p>I want to get python-spidermonkey functionality. Just like this:</p> <pre><code>&gt;&gt;&gt; class Foo: ... def hello(self): ... print "Hello, Javascript world!" &gt;&gt;&gt; cx.bind_class(Foo, bind_constructor=True) &gt;&gt;&gt; cx.eval_script("var f = new Foo(); f.hello();") Hello, Javascript world! </code></pre> <p><b>I can't use python-spidermonkey, because it doesn't work in <a href="http://stackoverflow.com/questions/1727157/how-to-install-python-spidermonkey-on-windows">windows</a></b></p>
javascript python
[3, 7]
1,771,568
1,771,569
return value javascript UIWebView
<p>i'm trying to get the return value of a javascript function(for example: <code>return "hello"</code>) with iPhone SDK.</p> <p>On OS X the WebView method <code>-stringByEvaluatingJavaScriptFromString</code> returns a NSString containing the js function return value, but on the iPhone no value is returned.</p> <p>How can I solve this?</p> <hr> <p>I found a private UIWebViewDelegate method</p> <pre><code>- (void)webView:(id)fp8 runJavaScriptAlertPanelWithMessage:(id)fp12 initiatedByFrame:(id)fp16 </code></pre> <p>invoked when the alert() function is used in the js script. So I can get the "return" value just by calling <code>alert(myReturValue)</code>.</p> <p>That doesn't solve my problem, because I need something in the public SDK.</p>
javascript iphone
[3, 8]
3,794,837
3,794,838
Is it possible to disable the mouse events on showing some progress is going on
<p>Hi all i am doing an application in <code>asp.net</code> where when i click on a button i will show an <code>image(loading image)</code> saying that <code>progress</code> is going on. At that time i would like to disable the mouse events completely, so that the user should not perform any operations with mouse. Is is possible to achieve this in <code>Web application</code> if so can any one tell how to achieve this.</p>
c# asp.net
[0, 9]
3,025,551
3,025,552
how can I access my public method from aspx code behind to a public class?
<p>I have a public method in my aspx code behind called PhotoDatabinding, what it does is to bind the database to List view control.</p> <pre><code>public void PhotoDatabinding() { lnqPhotoDataContext dbCon = new lnqPhotoDataContext(); var res = from p in dbCon.Photos orderby p.PhotoID descending select new { p.PhotoID, p.FileName }; lvSubAlbumDB.DataSource = res; lvSubAlbumDB.DataBind(); } </code></pre> <p>Now, inside my public class called Process I have a a method called UpdateSave. my question is how can I access the PhotoBinding method so that it will look like this</p> <pre><code>public class Process { public UpdateSave() { ....some code PhotoDatabinding(); } } </code></pre> <p>Thanks and appreciate all your help and suggestions.</p>
c# asp.net
[0, 9]
973,287
973,288
File Upload in database using fileupload control
<p>I have a FileUpload Control and a image control on asp.net page as follows :</p> <pre><code>&lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td align="left"&gt; &lt;asp:Image ID="profileimage" runat="server" ImageUrl="~/Images /images2.jpg" Width="150px" Height="150px" /&gt; &lt;/td&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td colspan="2" align="left"&gt; &lt;asp:FileUpload ID="Fu" runat="server" Width="550px" /&gt; &lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Now how to get access of the filepath uploaded in the fileupload control using code behind and store it in database</p>
c# asp.net
[0, 9]
2,495,573
2,495,574
onclientclick validation not working
<p>The submit button should validate all the txtboxes, so i have written this code,<br> but it is not working and <strong>I also want that if textboxes aren't empty, then it should postback and onclick should call, otherwise not</strong> </p> <pre><code> function submit() { for( var i = 0, t = document.getElementsByName( "txt" ), l = t.length; i &lt; l; i++ ) if( t[i].value) return true; return false; } </code></pre> <p><strong>.aspx</strong></p> <pre><code>&lt;asp:TextBox name="txt" runat="server" ID="email" CausesValidation="True" ClientIDMode="Static" ValidationGroup="email" &gt;&lt;/asp:TextBox&gt; &lt;b&gt;Password:&lt;/b&gt;&lt;br /&gt; &lt;asp:TextBox ClientIDMode="Static" ID="pwd" runat="server" name="txt" TextMode="Password" CausesValidation="True"&gt;&lt;/asp:TextBox&gt; &lt;asp:LinkButton ID="Submit" runat="server" CssClass="button" Text="Login" onclick="Submit_Click" OnClientClick="submit()" CausesValidation="False" /&gt; </code></pre>
javascript asp.net
[3, 9]
1,137,037
1,137,038
Best website or book to learn PHP (Basis already known)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/871331/what-is-the-best-way-to-get-up-to-speed-with-php-javascript">What is the best way to get up to speed with PHP/Javascript?</a> </p> </blockquote> <p>Hi there, i just want to know if someone know WHERE (website or book) it's easy to learn php and javascript in a intermediate level.</p> <p>I already know the basis. variable, integration manipulation..</p> <p>It's a subjective question ..</p> <p>Thanks</p>
php javascript
[2, 3]