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
1,247,540
1,247,541
jquery - Datatables row grouping - how to add row id per group
<p>How to add row id per group in datatable row grouping, below is my code</p> <pre><code>oTable1 = $('#tblVisitPanelDetails').dataTable({ "bJQueryUI": true, "bDestroy": true, "bRetrieve": true, "aaSorting": [[4, "desc"]] }).rowGrouping({ bExpandableGrouping: true, bExpandSingleGroup: true, iExpandGroupOffset: -1, asExpandedGroups: [""] }); </code></pre> <p>Thanks in Advance</p>
jquery asp.net
[5, 9]
2,887,650
2,887,651
window.onpopstate for android?
<p>Im making a mobile optimised website that has fullscreen dialog windows that open when you 'click' certain elements on the page. These windows are actually just divs that are animated into position. </p> <p>If the user presses the browser back button when one of these dialoge windows is open I want the dialoge box to close, not for the page to be left all together.</p> <p>I can do this with iPhone. If I make the element you click a link fragment, then on the window.onpopstate event I can use window.location.href to check the url and hide the dialoge box if appropriate. </p> <p>However I cant get this to work on Android as window.onpopstate isn't supported (at least with the phone im testing with which is quite old). How can I get round this? jQuery Mobile can do this, so I know it must be possible somehow.</p> <p>Thanks </p>
javascript android
[3, 4]
2,770,228
2,770,229
Replacing Link Button and label with check boxes
<p><a href="http://stackoverflow.com/questions/4263489/need-help-with-repeater">This</a> is my repeater in GUI and code behind ..I need to replace the 'Make Default' linkbutton with a Check Box now. What I want to do is that When user Checks the checbox, the Default value is set to TRUE in DB , Also when a check box is Checked, it will be grayed out..</p> <p>NOW :( I was just trying to implement this but there's no CommandName attribute for checkbox and not even CommandArgument attribute!!</p> <p>How do I change my code now ? :(</p> <p>All I wanna do is replace that Link Button with Checkbox. Somebody please help me out with this..How do i pass arguments to this check box ..I need the command arguments for my "SetDefault" method that sets the address to TRUE if Default is selected </p> <p><strong>[EDIT]</strong></p> <p>I am not getting it..in my Link Button now I am passing 2 command arguments like this <code>CommandArgument='&lt;%# Eval("UserID") + "," + Eval("IsB") %&gt;'</code> Now how do i pass these two Comand arguments that I need for my SetDEfault method in checkebox!? ok i got it that we use OnCheckChanged event when its check box and ItemCommand event is used when its link button...I am just not getting how will I pass these two command arguments in my checkbox</p> <p>[EDIT] <strong>Do I need to pass these two command arguments via text attribute ?</strong></p> <pre><code>&lt;asp:CheckBox Text='&lt;%# Eval("UserID") + "," + Eval("IsB") %&gt;' runat="Server"/&gt; </code></pre>
c# asp.net
[0, 9]
5,273,562
5,273,563
How to get the http://www.blbah.com part of the url in javascript?
<p>My url on a page is like:</p> <pre><code>http://www.example.com/dir1/file.html?a=1 </code></pre> <p>I need to extract:</p> <pre><code>http://www.example.com </code></pre> <p>how can I do this in javascript?</p>
javascript jquery
[3, 5]
2,934,664
2,934,665
jQuery to Javascript code converting
<p>I have not a good Javascript knowledge, but I'm kinda good with jQuery though. I want to change some jQuery code to pure Javascript, but I have no idea how to do it.</p> <pre><code>$(document).ready(function() { $('#block').one('click', function() { $(this).val('{L_SEND_CONFIRM}').removeClass('button1'); $('#replacement').val('{L_BLOCK_CODE}'); }); }); </code></pre> <p>Anyone willing to help me out please? </p> <p>P.S: Sorry for asking such a dumb question, I really need to learn Javascript myself ASAP.</p>
javascript jquery
[3, 5]
4,172,732
4,172,733
Changing input value using javascript
<p>I've been looking for a reason why this doesn't work, but I can't find one. In my asp.net application I create a a bunch of hidden inputs in c# and then try to modify them in javascript before I call them back to the server.</p> <p>My c# code:</p> <pre><code> hidden3 = new HtmlInputHidden(); hidden3.ID = "total"; hidden3.Value = index.ToString(); this.Controls.Add(hidden3); </code></pre> <p>my javascript code:</p> <pre><code> mod = document.getElementById("total"); mod.value = newVal; </code></pre> <p>I can call the value back fine but it doesn't change. I have also added alerts for the original value and then the value after changing values and they both show up fine. However the code is never changed so when I pull the values </p> <p>To get the value back I am using this;</p> <pre><code> HtmlInputHidden hiddenControl = (HtmlInputHidden)FindControl("total"); </code></pre>
c# javascript asp.net
[0, 3, 9]
1,305,937
1,305,938
Checking username and password in Android
<p>I have a username and password field and now i need to check and redirect him to the next page in Android. </p> <pre><code> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final EditText loginText = (EditText) findViewById(R.id.widget44); final EditText loginPassword = (EditText) findViewById(R.id.widget47); final Button button = (Button) findViewById(R.id.widget48); button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent myIntent = null; if(loginText.getText().equals("admin") &amp;&amp; loginPassword.getText().equals("admin")) { System.out.println("Entering"); myIntent = new Intent(view.getContext(), Page1.class); } else { } startActivity(myIntent); } }); } </code></pre> <p>Temp now i am checking by hardcoding the values, but this too does not work for me. Why? I usually check in <strong>Java</strong> like this, why does it not accept me the same way in Android</p>
java android
[1, 4]
181,906
181,907
ASP.Net dropdown control loses state after being set dynamically through javascript
<p>I have an asp.net dropdownlist control. There are two ways it can be selected.</p> <p>The first is through a button that sets the value in the drop-down list via javascript.</p> <p>The second is by manually selecting the dropdownlist option.</p> <p>Each of these methods work by themselves.</p> <p>If I do the first followed by the second and then hit save - the value that is saved is the value set by the javascript. The manual selection did not have any effect.</p> <p>Does anyone know why this is the case? </p> <p>EDIT: </p> <p>In the HTML Head section:</p> <pre><code>&lt;script&gt; function Select(allocationId) { document.getElementById('Accounts').value=allocationId; } &lt;/script&gt; </code></pre> <p>In the HTML Body:</p> <pre><code>&lt;asp:DropDownList ID="Accounts" runat="server"&gt;&lt;/asp:DropDownList&gt; &lt;button onclick="Select(&lt;%#"'" + DataBinder.Eval(Container.DataItem, "Associated_AccountId") + "'"%&gt;)" type="button"&gt;Select&lt;/button&gt; &lt;asp:Button ID="btn_SaveAndClose" runat="server" Text="Save and Close" OnClick="btn_SaveAndClose_Click"&gt;&lt;/asp:Button&gt; </code></pre> <p>In the code behind:</p> <pre><code>protected void btn_SaveAndClose_Click(object sender, System.EventArgs e) { int id = Convert.ToInt32(this.Accounts.SelectedValue); } </code></pre> <p>EDIT:</p> <p>Funnily enough - when I use:</p> <pre><code>int id = Convert.ToInt32(Request.Form["Accounts"]); </code></pre> <p>it works. But I don't know why.</p>
asp.net javascript
[9, 3]
103,530
103,531
Javascript - how do I minimise this code example?
<p>a quick question. </p> <p>At the moment I have 12 links on a page, and 12 corresponding javascript codes that run when a each button is clicked.</p> <p>I know 100% there must be a method of having 1 javascript code and the link passing a variable to it, so I don't have to have 12 different codes. </p> <p>EG. Here is a link I'm currently using:</p> <pre><code>&lt;a href="#" id="button1"&gt;Anatomical Pathology&lt;/a&gt; </code></pre> <p>And the Javascript function that is run when the link is clicked loads some html from a php script into a div which is previously defined as level2:</p> <pre><code>$('#button1').click(function() { level2.load("http://hello/script.php?url=poodles"); }); </code></pre> <p>What I'd really like to do is something like this with the link:</p> <pre><code>&lt;a href="#" id="button1" passurl="poodles"&gt;Anatomical Pathology&lt;/a&gt; </code></pre> <p>And the function something like this, so I only need the 1 function not 12:</p> <pre><code>$('#button1').click(function() { level2.load("http://hello/script.php?url=' + passurl + '"); }); </code></pre> <p>How do I go about getting the data from the link tag into javascript, and also how do I add this passed variable into the url I want the javascript to pull data in from?</p>
javascript jquery
[3, 5]
5,408,622
5,408,623
Get Value of ItemData in Repeater into Repeater
<p>I have a Repeater nested in another Repeater. For clarity, we'll refer to them as <code>ParentRepeater</code> and <code>ChildRepeater</code>. I need to get a value from <code>ParentRepeater</code> in <code>ChildRepeater</code>. How can I do this?</p>
c# asp.net
[0, 9]
4,964,079
4,964,080
Getting JavaScript data arrays from webpage
<p>OK, so this webpage does things different. It uses text files and loads the data in JavaScript and then displays it in JavaScript. I tried using PHP methods but I can't get it.</p> <p>How do I get the <code>S</code> array of player hiscores from <a href="http://queville.com/cgi-bin/forums/index.cgi?a=scores&amp;b=Overall" rel="nofollow">http://queville.com/cgi-bin/forums/index.cgi?a=scores&amp;b=Overall</a></p> <p>Like, if you view the source, you'll see this between <code>&lt;script&gt;</code> <code>&lt;/script&gt;</code> tags:</p> <pre><code> S[na]="|Daminion|442776|30436|125645|90728|40835|79058|16318|15927|43700|129|0|"; na++; S[na]="|superfly|442490|32398|32032|161903|93689|75086|20018|11020|15937|407|0|"; na++; S[na]="|GodessCrystal|435702|46422|41721|95881|43717|105026|23324|23500|30296|25815|0|"; na++; S[na]="|grandkool|432065|110849|34644|12438|7706|165145|60924|12436|23446|4477|87|"; na++; </code></pre> <p>I've tried using PHP's <code>file_get_contents</code> and like but it doesn't work...</p>
php javascript
[2, 3]
1,393,901
1,393,902
Why is the label not changing color using RegisterClientScriptBlock?
<p>I have an aspx page defined as follows:</p> <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;script type="text/javascript" language='javascript'&gt; function changecolor() { var lbl = document.getElementById('lblDisplayDate'); lbl.style.color = 'red'; }; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Label ID="lblDisplayDate" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;&lt;br /&gt; &lt;asp:Button ID="btnPostBack2" runat="server" Text="Register Client Block Script" onclick="btnPostBack2_Click" /&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p> </p> <p>Here is the btnPostBack2 Click event:</p> <pre><code>protected void btnPostBack2_Click(object sender, EventArgs e) { if (!ClientScript.IsClientScriptBlockRegistered("JSScriptBlock")) { ClientScript.RegisterClientScriptBlock(this.GetType(), "JSScriptBlock", "changecolor();", true); } } </code></pre> <p>Even though, I put the script in a function to change the color, it is still not doing it and why do I need to add the script tags to true if the function is already enclosed in script tags?</p> <p>lblDisplayDate is in the Page Load where it is set to the current time on every page reload.</p>
c# asp.net javascript
[0, 9, 3]
5,127,367
5,127,368
jQuery Scroll Path?
<p>Im trying to make a simple scroll path using this plugin "http://joelb.me/scrollpath/" and all I want to do is make a simple line, without rotations, arcs etc only I cant seem to understand how this works, nor find a tutorial on the plugin!? </p> <p>I want a path like...</p> <pre><code> __________________ ______________| </code></pre> <p>I've written the following with no luck...</p> <p>Can anyvbody see what im doing wrong?</p> <pre><code>.moveTo(400, 50, {name: "one"}) .lineTo(400, 50, {name: "two"}) .lineTo(400, 50, {name: "three"}) .lineTo(400, 50, {name: "four"}) .lineTo(400, 50, {name: "five"}) .lineTo(400, 50, {name: "six"}) </code></pre>
javascript jquery
[3, 5]
4,463,101
4,463,102
Is the callback on jQuery's getScript() unreliable or am I doing something wrong?
<p>I'm using the following bit of script to load another one:</p> <pre><code>$.getScript("CAGScript.js", function () { try { CAGinit(); } catch(err) { console.log(err); } }); </code></pre> <p>The idea is that $.getScript loads the script, then executes the callback when it's done. <code>CAGInit()</code> is a function that lives in <code>CAGScript.js</code>.</p> <p>The problem is that roughly half the time, <code>CAGInit()</code> doesn't fire (in any browser). Logging to the Firebug console reports that it's not defined. The rest of the time it works perfectly.</p> <p>Does anyone have any ideas what I'm doing wrong?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,551,827
4,551,828
URL String Get Directory
<p>I have a string that contains a URL:</p> <pre><code>var url = "http://www.domain.com/Shared%20Documents/Test%20Plans/CC-12%20Test%20Plan.doc"; </code></pre> <p>I am trying to get the url of the directory (ie remove the filename and keep the rest.) I realize that this is probably pretty simple but I can't seem to find anything on it.</p> <p>Desired result:</p> <pre><code>var url = "http://www.domain.com/Shared%20Documents/Test%20Plans/"; </code></pre>
javascript jquery
[3, 5]
5,308,333
5,308,334
Receiving e-mail message
<p>How can I get the content of the last e-mail message in Android (theme and message body) if I know how to access contacts and get necessary e-mail address?</p>
java android
[1, 4]
3,767,898
3,767,899
hebrew keyboard changes edittext gravity
<p>I have an <code>EditText</code> in which I am supposed to input text in hebrew language which goes RTL so the gravity is set to right but this works fine with english keyboard but for hebrew keyboard the gravity is again changed to left. how to solve this problem?</p> <p>I want gravity to be right all the time.</p> <p>I did config changes entry for keyboard and in <code>onConfigurationChanged()</code> function <code>setGravity</code> back to right. Will that be enough?</p>
java android
[1, 4]
3,583,537
3,583,538
jquery using this to access object context when inside callback
<p>Let us presume I have the following object defined:</p> <pre><code>var myObj = function(){ this.hello = "Hello,"; } myObj.prototype.sayHello = function(){ var persons = {"Jim", "Joe", "Doe","John"}; $.each(persons, function(i, person){ console.log(this.hello + person); } } </code></pre> <p>Problem is that inside $.each this refers to person but I would like to access the obj property hello. </p> <p>The only solution which i could find was declaring in sayHello function something like </p> <blockquote> <p>var _this = this;</p> </blockquote> <p>and then in $.each i would use something like </p> <pre><code>console.log(_this.hello + person); </code></pre> <p>But unfortunately, this is not very good code. Is there another way to resolve this problem elegantly ?</p>
javascript jquery
[3, 5]
1,031,045
1,031,046
Library to convert Java types to Python types in Python?
<p>I have an object in Python whose type is <code>&lt;class 'jpype._jclass.java.lang.Float'&gt;</code>, and I need to convert this to a float in Python. I tried <code>float()</code> but the compiler complains. Is there a library to do this conversion?</p>
java python
[1, 7]
2,964,752
2,964,753
how to use wildcard characters to fetch sim contacts in android java
<p>I have used following query/code to fetch sim contacts in android</p> <pre><code>Cursor cursor = ContentResolver.query(callUri,null,"name LIKE 'AN'%",null, null); </code></pre> <p>but this is not working instead fetching whole contacts. So please reply with that what query I should use to fetch and what the cloumn_name to fetch contacts name. </p>
java android
[1, 4]
1,523,301
1,523,302
formview paging dependent on gridview using pageddatasource
<p>I am displaying a formview on click of a row in a gridview. I have used pageddatasource for formview paging but i don't know what to set for the currentpageindex of the formview. </p> <pre><code> protected void FormView(string id) { try { GroupMasterClass gm = new GroupMasterClass(); gm.igroup_id = Convert.ToInt32(id); ResultClass objres = gm.fn_GetGroupMasterFormView(); ResultClass objres1 = gm.fn_GetGroupList(); eslist&lt;GroupMasterClass&gt; OBJLISTS = objres1.objData as eslist&lt;GroupMasterClass&gt;; eslist&lt;GroupMasterClass&gt; OBJLIST = objres.objData as eslist&lt;GroupMasterClass&gt;; if (OBJLIST.Count &gt; 0) { if (OBJLISTS.Count &gt; 0) { DataTable dt = (DataTable)OBJLIST; pdsfrm.DataSource = dt.DefaultView; pdsfrm.AllowPaging = true; //pds.PageSize = Convert.ToInt16(ddlPerPage.SelectedValue); pdsfrm.PageSize = 1; pdsfrm.CurrentPageIndex = frmCurrentPage; lnkbtnfrmNext.Enabled = !pdsfrm.IsLastPage; lnkbtnfrmPrevious.Enabled = !pdsfrm.IsFirstPage; dvGroupMaster.DataSource = pdsfrm; dvGroupMaster.DataBind(); dofrmPaging(); //dvGroupMaster.DataSource = OBJLIST; //dvGroupMaster.DataBind(); frmvwGroup.Visible = true; gridmain.Visible = false; lblfrmvrecords.Text = OBJLISTS.Count.ToString(); } } } catch { } } </code></pre> <p>Thanks,</p>
c# asp.net
[0, 9]
4,069,013
4,069,014
JavaScript Mobile Drag and Drop
<p>I was testing out an interface I built using jQuery UI draggable, droppable and sortable and noticed that the drag and drop doesn't work in the mobile browser. I suppose there is a different way in which events are fired in the mobile browser.</p> <p>Are there any JavaScript frameworks yet, that support drag and drop in the mobile browser?</p> <p>If not, any ideas on how one could go about putting together some basic drag/drop functionality?</p>
javascript jquery android
[3, 5, 4]
2,308,147
2,308,148
javascript code to php?
<p>How do I write the following javacript code in php:</p> <pre><code>var ShareImageIdVar = location.href.match(/\d+/); </code></pre> <p>there is a number in the url that I want to store it in the variable <code>ShareImageIdVar</code>.</p> <p>an example of a possible url:</p> <pre><code>http://www.mysite.com/5.php http://www.mysite.com/41.php http://www.mysite.com/547.php http://www.mysite.com/2145.php </code></pre>
php javascript
[2, 3]
1,405,768
1,405,769
global.asax in asp.net
<p>how can we use global.asax in asp.net? and what is that?</p>
c# asp.net
[0, 9]
1,415,121
1,415,122
Character limit of a javascript string variable
<p>Can JavaScript string store 100K characters? I've written a script where a string from PHP is passed to a variable in JavaScript. It works fine when it is cut short to almost ten thousand characters but breaks the script when attempting to pass the entire string whose length is a bit greater than 100K. No errors could be found though. Is there any solution for this as to any way of increasing character limit of JavaScript variable? I'm just a beginner. Would appreciate is some one could find a solution for this.</p>
php javascript
[2, 3]
5,265,530
5,265,531
Function in current object cannot be called. Why?
<p>I have a function called <code>Validation</code> which contains three functions. Now when I want to call one other function from one function inside <code>Validation</code> i.e. on line 13. Then I get this error </p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'validateAddress' </code></pre> <p>Here is my code</p> <pre><code>var Validation = function () { var inputs, field, errors = [], self = this, emptyFieldsValidation = function () { $('#form input').each(function (i, el) { inputs = $(this); if ( inputs.val() == '' ) { inputs.css('border', '1px solid red'); return errors.push('emptyFields'); } else { inputs.css('border', '1px solid #ccc'); if (inputs.hasClass('from')) { if (!self.validateAddress(inputs.val())) errors.push('invalidFromAddress'); } if (inputs.hasClass('to')) { if (!self.validateAddress(inputs.val())) errors.push('invalidToAddress'); } if (inputs.hasClass('time')) { if (!self.validateForNumber(inputs.val())) errors.push('invalidTime'); } } }); return !!errors.length; }, validateAddress = function (val) { var streetregex = /^[\w+\s]+\d+,\s*[\s\w]+$/; if (streetregex.test(val)) return true; else return false; }, validateForNumber = function (val) { if (!isNaN(val)) return true; else return false; }; return { emptyFieldsValidation: emptyFieldsValidation }; } </code></pre>
javascript jquery
[3, 5]
756,961
756,962
Checking if popup window is already open while browsing another page
<p>How to check that popup is already opened?</p> <pre><code>var popup = null; $('#menu').bind('click', function(e) { if (popup == null || popup.closed ) popup = window.open (...); }); </code></pre> <p>The above JQuery code works when in the same page. When the user browse to another page with, still with element <code>#menu</code>, popup variable will be <code>null</code>. Any idea on this?</p> <p>When a popup is aleady opened, I don't want the same popup to open.</p> <p>How to check if a window with a given name already opened?</p> <p>Thanks</p>
javascript jquery
[3, 5]
3,276,814
3,276,815
How to map java's AffineTransform to android's Matrix?
<p>Suppose I initialize an AffineTransform as below:</p> <p>AffineTransform af = new AffineTransform(2, 3, 4, 5, 6, 7);</p> <p>How would I create an equivalent Matrix using android's sdk?</p>
java android
[1, 4]
5,511,330
5,511,331
How to unpack Javascript in Python
<p>I would like to retrieve the contents of a javascript script instead of executing it upon requesting it. </p> <p>EDIT: I understand that Python is not executing the javascript code. The issue is that when I request this online JS script it gets executed. I'm unable to retrieve the contents of the script. Maybe what I want is to decode the script like so <a href="http://jsunpack.jeek.org/dec/go" rel="nofollow">http://jsunpack.jeek.org/dec/go</a></p> <p>That's what my code looks like to request the js file:</p> <pre><code>def request(self, uri): data = None req = urllib2.Request(uri, data, self.header) response = urllib2.urlopen(req) html_text = response.read() return html_text.decode() </code></pre> <p>I know approximately what the insides of the script look like but all I get after the request is issued is a 'loaded' message. My guess is that the JS code gets executed. Is there any way to just request the code? </p>
javascript python
[3, 7]
776,421
776,422
javascript/jquery select all child elements inside a parent element
<p>I have a bunch of child elements that are uniquely identified within a parent div. I want to know if there's a way in jQuery (or javascript) to capture all of them? The number of children in the parent div is arbitrary, meaning it could be any number for each div. For example:</p> <pre><code>&lt;div class="parent1"&gt; &lt;span class="child1"&gt;some text here&lt;/span&gt; &lt;span class="child2"&gt;some other text&lt;/span&gt; ... &lt;span class="child49"&gt;yet more text&lt;/span&gt; &lt;span class="something_else"&gt;other text i don't want to select&lt;/span&gt; &lt;/div&gt; &lt;div class="parent2"&gt; &lt;span class="child1"&gt;some text&lt;/span&gt; &lt;span class="child2"&gt;some text&lt;/span&gt; ... &lt;span class="child120"&gt;some text&lt;/span&gt; &lt;/div&gt; </code></pre> <p>So considering the above example, how do I get ALL the children (<code>.child1</code> through <code>.child49</code>) within the class <code>parent1</code>?</p> <p>I know that doing the following will work in jQuery (using multiple selector):</p> <pre><code>$(".child1, .child2, ..., .child49").css("background","red"); </code></pre> <p>But is there a better way? I won't always know how many children are in each parent.</p> <p>EDIT: also, I might have other children in the parent with a different class name that I DO NOT want to select; I specifically want to select all the "child*" classes.</p>
javascript jquery
[3, 5]
2,870,018
2,870,019
How to communicate with a car via Android smartphone?
<p>I want to start an app to be used by an Android smartphone to send information to a car. One example would be to unlock the car, but that is not precisly what I want to do is just an example. My question is, how can I communicate with the car? I am thinking of using a webservice, don't know if this would be adecuate for the prototype.</p> <p>I would appreciate some links, or info to point me in the right direction to enable a communication of some sort with the car, that is adding a modem to the car or something, I don't know much about how to be able to communicate. </p> <p>Is there a way to communicate in a longer distance, that is not using bluetooth, since bluetooth is for short distances?</p> <p>Thanks!</p>
java android
[1, 4]
3,888,831
3,888,832
why getEdgeFlags() always return 0
<p>I want to detect the touch edge in onTouchEvent function for my view, but getEdgeFlags() always return 0 in my Nexus S 4.1.1, anyone can help me? thanks advance.</p> <pre><code>@Override public boolean onTouchEvent(MotionEvent event) { int edgeFlags = event.getEdgeFlags(); //edgeFlags alway 0! switch (edgeFlags) { case MotionEvent.EDGE_LEFT: Log.i("tag", "EDGE_LEFT"); break; case MotionEvent.EDGE_RIGHT: Log.i("tag", "EDGE_RIGHT"); break; case MotionEvent.EDGE_TOP: Log.i("tag", "EDGE_TOP"); break; case MotionEvent.EDGE_BOTTOM: Log.i("tag", "EDGE_BOTTOM"); break; default: Log.i("tag", "" + edgeFlags); break; } return super.onTouchEvent(event); } </code></pre>
java android
[1, 4]
690,594
690,595
How to convert milliseconds into a readable date?
<p>The following:</p> <pre><code>new Date(1324339200000).toUTCString() </code></pre> <p>Outputs:</p> <pre><code>"Tue, 20 Dec 2011 00:00:00 GMT" </code></pre> <p>I need it to return <code>Dec 20</code>. Is there a better method I can use besides <code>toUTCString()</code>? I am looking for any way to parse through milliseconds, to return a human readable date.</p>
javascript jquery
[3, 5]
5,828,437
5,828,438
Deleting images with javascript function
<p>In a page, i am showing thumbs of images from a folder, with a link below them "Delete Image", through this code:</p> <pre><code>echo '&lt;li&gt; &lt;a href="Gallery/'.$file.'" rel="lightbox['.$lightbox.']"&gt;'; echo '&lt;div id="image" &gt;&lt;img src="Gallery/thumbs/'.$file.'" alt="" /&gt;&lt;br&gt; &lt;a href="javascript:Del();"&gt;&lt;font style="font-size:9px"&gt;Delete Image&lt;/font&gt;'; echo '&lt;/a&gt;&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;'; </code></pre> <p>On the Delete Image I am calling a javascript function Del(). I want that if a User clicks on Delete Image, the Image thumb should be deleted, from its containing folder i.e., Gallery/thumbs.</p> <p>The function Del is:</p> <pre><code> &lt;script type="text/javascript"&gt; function Del(){ var image_x = document.getElementById('image'); image_x.parentNode.removeChild(image_x); } &lt;/script&gt; </code></pre> <p>This function removes the images from the page, not from the folder. And also it deletes them like, if i delete on third image it will remove first, then second, in a sequnce. I want images to be deleted , only those on which user click Delete Image</p> <p>I hope you all understand.</p>
php javascript
[2, 3]
2,758,483
2,758,484
Which universities/colleges teach Microsoft ASP.NET and other MS technologies?
<p>I saw "<a href="http://stackoverflow.com/questions/543223/which-universities-teach-python">Which universities teach Python?</a>", so I thought I would ask one about Microsoft technologies. Do you know of any schools that teach beginning to advanced Microsoft programming languages? </p>
c# asp.net
[0, 9]
4,013,946
4,013,947
Previewing TIF documents on the Web (.Net C#)
<p>I am looking for a way to display TIF documents on a web page. It basically needs to render a Multi-page TIF in some form of container on a web page.</p> <p>Do I need a control or is there a simple way to build something like this? Is there any free stuff that we could simply implement?</p> <p>I have looked at the <a href="http://www.telerik.com/products/reporting.aspx" rel="nofollow">Telerik reporting</a> product which apparently contains a Tif viewer. I haven't looked into the licensing for this though. (If I only need the TIF Viewer, do I need to purchase the entire reporting solution?</p> <p>Our biggest issue at the moment (like always) is that we have a very tight deadline with very little available resource. This product will be installed at a client so ActiveX controls that request user permission to install are less than ideal.</p> <p>Any suggestions and/or comments would be welcome.</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,328,955
4,328,956
Load a external URL into a div using jquery
<p>I want to load a whole site into a div... When i use </p> <pre><code>$(document).ready(function(){ $('#result').load('http://www.yahoo.com'); }); </code></pre> <p>its not working...plz help</p>
javascript jquery
[3, 5]
3,328,751
3,328,752
Making a DIV float between header and footer
<p>I have the below fairly simple java-script function on a webpage with a header, footer and a banner in between the header and footer right side of the body, to make the banner seem to be floating between the header and footer when users scroll the webpage.</p> <pre><code> $(window).scroll(function() { if ($(window).scrollTop() &gt; headerHeight) $(".banner").css("position", "fixed"); else $(".banner").css("position", "relative"); } </code></pre> <p>I want the banner to be auto scrolled/floated/moved when user scrolls the browser window. The code works fine: it makes the banner float/move and stops the banner from floating/moving over the header. But I need to add one more condition: the banner must stop floating before the end of webpage is reached because a footer is present. This code now causes the banner to be moving/floating over the footer when user reaches the bottom of the page.</p> <p>Can anyone help me in getting this condition included in the if block as an or condition?</p>
javascript jquery
[3, 5]
3,321,099
3,321,100
Insert clob data or all types of file store in database
<p>I try to save All types of file in database , I try to save it in nclob in java but I got following exception</p> <p>Exception in thread "main" java.lang.AbstractMethodError: oracle.jdbc.driver.OraclePreparedStatement.setNClob(ILjava/io/Reader;J)V</p> <p>Please help me to sort out this problem. </p>
java javascript
[1, 3]
5,035,740
5,035,741
What is the best way to dynamic load connection strings
<p>I've seen some other posts in this topic, but thought I would ask the qustion with a description on my problem.</p> <p>I have a login page wich uses SQL provider for the user login. Then the user should be redirected to the main application. This is a web based CRM application wich we have muliple clients.</p> <p>My goal is to use a single web site, but multiple SQL databases. And the user that signes in should use a connection string that coresponds to the company he belongs.</p> <p>Any good ideas?</p>
c# asp.net
[0, 9]
5,160,675
5,160,676
ASP.NET - Can I handle the "ASP.NET client-side validation has succeeded" event in javascript?
<p>I have a product page with an add to cart button</p> <p>When the <strong>add to cart</strong> button is clicked, a couple of input fields are validated using ASP.NET validation controls (which use client-side validation to prevent the postback from occurring upon invalid input). </p> <p>In order to prevent double-clicks from adding multiple items to the cart, I would like to disable the add to cart button after the initial click, but ONLY if validation has succeeded. (It would be rather bad to disable "add to cart" just because they goofed up an input)</p> <p>Is it possible to handle the "on ASP.NET client-side validation succeeded" event in javascript?</p> <p>I may just end up rolling my own validation mechanism for this page.</p>
javascript asp.net
[3, 9]
1,868,688
1,868,689
Is there a fast way to copy files to sdcard
<p>I have a function to copy a jpeg stored in assets to the sd card. It works, but very very slow. The averg file size is around 600k . Is there a better way to do this, code:</p> <pre><code>void SaveImage(String from, String to) throws IOException { // opne file from asset AssetManager assetManager = getAssets(); InputStream inputStream; try { inputStream = assetManager.open(from); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return; } // Open file in sd card String extStorageDirectory = Environment.getExternalStorageDirectory().toString(); OutputStream outStream = null; File file = new File(extStorageDirectory, to); try { outStream = new FileOutputStream(file); } catch (FileNotFoundException e) { e.printStackTrace(); return; } int c; while ((c = inputStream.read()) != -1) { outStream.write(c); } outStream.close(); inputStream.close(); return; } </code></pre>
java android
[1, 4]
2,978,373
2,978,374
How to get end time using jquery
<p><a href="http://jsbin.com/akuber/1/edit" rel="nofollow"><strong>Demo</strong></a> Here in jsbin demo i m getting start time but i dnt know any idea how to get end time. how should i go further to get end time. <strong>i dont want to change html.</strong> i have to get end time using present html. i m trying since last three days. </p> <pre><code>$("#btnAllot").click(function () { var calculateStartMins = $('td.csstd:first');var calculateStartHrs = calculateStartMins.parent().prevAll().andSelf().find('td:first-child').filter(function(){return $.trim($(this).text()) !== '';}).last(); var fromTime = calculateStartHrs.text().trim() + calculateStartMins.text().trim(); var fromTimeAMPM = fromTime.substring(5, 7); var fromTimeHour = fromTime.trim().substring(0, 2); var fromTimeMinute = fromTime.substring(7, 10); var hidFromTime = fromTimeHour.trim() +":"+ fromTimeMinute.trim();alert("Start Time is "+hidFromTime.trim()); var endTime = $('td.csstd:last').parent().next().andSelf().find('td:first-child'). filter(function () {return $.trim($(this).text()) !== ''; }).last();alert("End Time is "+endTime); }); </code></pre>
javascript jquery
[3, 5]
3,578,901
3,578,902
Android request a url with out opening browser
<p>So I have an arduino with an Ethernet shield and I am currently controlling it using browser url commands eg "192.168.2.1/digital/2/1" (digital pin 2 goes high), i want to have an android button which requests that url without opening it in the browser.. is that possible and how would i do it?</p>
java android
[1, 4]
3,168,447
3,168,448
Adding a javascript variable to html
<p>I need to add some JavaScript into my HTML.</p> <p>I have a JavaScript variable. How can I add it to my HTML code?</p> <pre><code>&lt;a href="index.php?something=MYJAVASCRIPT VARIABLE"&gt; </code></pre> <hr> <p><strong>UPDATE:</strong> Tried this:</p> <pre><code>&lt;a href="#" onclick="window.location.href = 'index.php?month=' +thisyear+'-1-1'" rel="external"&gt; Jan &lt;/a&gt; </code></pre> <p>But it's not working for some reason...</p>
javascript jquery
[3, 5]
4,461,762
4,461,763
How do I write the following code as a for loop?
<p>Firstly, Is there a way for me to put variable declarations in a for loop?</p> <p>E.g. the following:</p> <pre><code>var origh1 = $('#candidates img:eq(0)').height(); var origh2 = $('#candidates img:eq(1)').height(); var origh3 = $('#candidates img:eq(2)').height(); var origh4 = $('#candidates img:eq(3)').height(); var thumb1h = $('#candidates img:eq(0)').height()*0.20; var thumb2h = $('#candidates img:eq(1)').height()*0.20; var thumb3h = $('#candidates img:eq(2)').height()*0.20; var thumb4h = $('#candidates img:eq(3)').height()*0.20; </code></pre> <p>Then using that those variables, I would like the following in a for loop. Naturally, 'origh1' should equal img:eq(i), where i = 0. So I imagine if origh1 were in the loop, it would be something like origh(i+1). </p> <pre><code>$('#candidates img:eq(0)').fadeIn('normal').delay(300).animate({ height : origh1}, 1200, 'easeInQuad'); $('#candidates img:eq(1)').fadeIn('normal').delay(300).animate({ height : origh2}, 1200, 'easeInQuad'); $('#candidates img:eq(2)').fadeIn('normal').delay(300).animate({ height : origh3}, 1200, 'easeInQuad'); $('#candidates img:eq(3)').fadeIn('normal').delay(300).animate({ height : origh4}, 1200, 'easeInQuad'); </code></pre> <p>Thanks :)</p>
javascript jquery
[3, 5]
4,331,725
4,331,726
How to bind clicks on new data loaded with AJAX? -- JQuery
<p>I have a bunch of links with a 'Show more' Ajax request which loads more:</p> <pre><code>&lt;a href="#" class="item"&gt;abc&lt;/a&gt; &lt;a href="#" class="item"&gt;abc&lt;/a&gt; &lt;a href="#" class="item"&gt;abc&lt;/a&gt; </code></pre> <p>I have a binding function this that does something:</p> <pre><code>$('.item').click(function(e) { // some stuff }); </code></pre> <p>Problem is that <strong>when I load more of these links with Ajax, clicking them doesn't go to this function!</strong></p> <p>How could I "re-bind" all links to make the new ones work as well?</p>
javascript jquery
[3, 5]
3,054,509
3,054,510
Null Value in Label object
<p>I have created on GridView with Label. I have written store procedure to get StatusCode</p> <pre><code>SELECT StatusCode From TableName </code></pre> <p>This line in GridView</p> <p>&lt; asp:Label ID="lblStatusCode" runat="server" Visible="false" </p> <p>Text='&lt;%#DataBinder.Eval(Container.DataItem, "StatusCode")%>' /></p> <p>These lines in .cs file</p> <pre><code>Label lblStatusCode = (Label)row.FindControl("lblStatusCode"); objJV.Status = Convert.ToInt32(lblStatusCode.Text); </code></pre> <p>but in <code>lblStatusCode.Text</code> it is showing <em>NULL</em> even though there is value in Table.</p> <p>When I execute stored procedure independently it is giving values. </p> <p>// bind function</p> <p>protected void Page_Load(object sender, EventArgs e) {</p> <pre><code> if (!IsPostBack) { BindJVJobValidationDetails(); } } </code></pre> <p>protected void BindJVJobValidationDetails() {</p> <pre><code> JVSummary objJV = new JVSummary(); DataSet dataJobValidation = new DataSet(); if (SessionVariables.PERID != null) { dataJobValidation = objJV.GetjvTransaction(SessionVariables.PERID); gvEmployee.DataSource = dataJobValidation; gvEmployee.DataBind(); } } </code></pre> <p>What might be the problem...?</p>
c# asp.net
[0, 9]
958,968
958,969
jQuery and JavaScript
<p>Is it necessary to learn JavaScript before jQuery?</p>
javascript jquery
[3, 5]
74,649
74,650
How to get onclick value in JS
<p>Let's say, that I have on my site something like this:</p> <pre><code>&lt;a href="" onclick="lol(222)"&gt; &lt;a href="" onclick="lol(223)"&gt; &lt;a href="" onclick="lol(212)"&gt; &lt;a href="" onclick="lol(122)"&gt; </code></pre> <p>And then I would like to parse it to get in the <code>match</code> variable all values in <code>lol()</code></p> <p>Like this:</p> <pre><code>match[0] = 222; match[1] = 223; ..... </code></pre>
javascript jquery
[3, 5]
5,122,266
5,122,267
Remove divs after 20 using jQuery
<p>Divs of class=message are generated using a post which pulls data and puts it in the page. Now, I want to remove the lower divs after it reaches 20</p> <pre><code>&lt;div class="message"&gt;test&lt;/div&gt; &lt;div class="message"&gt;test&lt;/div&gt; &lt;div class="message"&gt;test&lt;/div&gt; . . . &lt;div class="message"&gt;test&lt;/div&gt; </code></pre> <p>So i need a sort of function to remove the remaining divs (from bottom) as i am adding to the top.</p> <p>Also when a div appears, I want it to sort of fade in. How do i achieve that? i receive data in chunks so its something like </p> <pre><code>html = '&lt;div class="messsage"&gt;1&lt;/div&gt;&lt;div class="message"&gt;2&lt;/div&gt;'; </code></pre> <p>Now I tried this but its really not fading in. i would like it to glow yellow and get back to normal (bonus)</p> <pre><code>$("#data").prepend(html).fadeIn(2000); </code></pre> <p>Thank you for your time.</p>
javascript jquery
[3, 5]
804,166
804,167
block user for sometime after insert a data from his ip
<p>I want to block a user for 5-10 minutes after he add some data to server.... It is just like for security...A user can not insert data more than 1 time for 5 to 10 minutes. Or if I insert something then the javascript function which calls the inserting code will blocked for 5-10 minutes...</p> <p>Thank in advance..</p>
php javascript
[2, 3]
1,794,604
1,794,605
Parse url from javascript popup in ASP.net
<p>I am developing web app using ASP.NET and i am also using javascript in the gridview header as TemplateField to open a window like this,</p> <pre><code>&lt;a href="javascript:var popup = window.open('PopUp.aspx?+Value','Popup','width=200,height=200'); </code></pre> <p>What I need to do in the "PopUp.aspx" code behind is to parse "Value" from "PopUp.aspx?+Value" in order for display a text based the value of "Value".</p> <p>How do I get the "Popup.aspx?+Value from the PopUp.aspx?</p> <p>Thanks.</p>
javascript asp.net
[3, 9]
1,124,568
1,124,569
Which method is the best for developing Excel sheet as ASP.NET web application?
<p>In my company, we have a big excel sheet that we use it as a data entry. This matrix is filled with the data by many employees. each employee is required to fill specfic cells in that data entry. Now, we want to automate this matrix by developing a web-based system that contains this matrix. I am new ASP.NET developer and I just developed two systems with it. Now, I want to know what is the proper way to develop this matrix and if there is any example that can help me in this issue.</p> <p>Should I use one of the controls like GridView, ListView or DetailsView for this issue? Which technique I should use for developing this? </p>
c# asp.net
[0, 9]
1,180,163
1,180,164
Javascript show layer on page load
<p>Getting an error when i use the following script to show a div when the page is loaded.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $("#friendslist").Show(); }); &lt;/script&gt; </code></pre> <p>It says <code>$("#friendslist").Show()</code> is not a function</p>
javascript jquery
[3, 5]
4,219,537
4,219,538
Javascript Math Round
<p>im getting a little issue here. Im trying to do a simple math, but im forgetting something.</p> <p>Here's what:</p> <pre><code>var valorOriginal = 9.90; var discount = Math.round(valorOriginal*12*0.25); var anual = Math.round(valorOriginal*12)-discount; alert(anual); </code></pre> <p>If you do this math on calc, it will give you <code>89.1</code>, but im just getting 89 rounded. Whats wrong?</p> <p>Thanks!</p>
javascript jquery
[3, 5]
157,572
157,573
PHP and Python interfacing
<p>I have a Python application (command line tool running on a machine M1) that has input I1 and output O2. Also, I have a PHP application (website running on a machine M2) that feeds the Python application with input I1 and expects to read the output O1. My question is what's the best approach to solve this problem? (the environment is GNU/Linux)</p> <p>I was thinking at a solution with ssh; the PHP script executes a command via ssh: "ssh M2:./my_script.py arguments output_file" and transfers the output file "scp M2:output_file ." from M2 to M1. But, I don't think this solution is elegant. I was thinking of web services (the Python application should expose a web service), but I'm not sure what's the complexity of this solution or if it works.</p> <p>Thanks,</p>
php python
[2, 7]
5,895,545
5,895,546
jquery preloading multiple images
<p>I managed to do preloding of 1 image like this:</p> <pre><code>var img = new Image(); $(img).load(function () { //do something after }).attr('src', response.image1); </code></pre> <p>How can I make the same for multiple pictures. Let's assume that my response is a json object which has several image sources. Thanks!</p>
javascript jquery
[3, 5]
3,126,444
3,126,445
jQuery/Javascript - reload current page with an appended querystring?
<p>I've got a dropdown menu on my form, which when something is selected I need to reload the current page, but with an appended querystring.</p> <p>How would I go about doing this?</p>
javascript jquery
[3, 5]
161,585
161,586
add second onclick to Listview
<p>I want to add a second <code>on click</code> to a ListViewItem. I already created the View (ImageView) and i set the on Click. The function gets called. But: How can i get the Informations of this ListViewItem? It would be enough to get the Position in the ListView?</p> <p>The ImageView:</p> <pre><code>&lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|center_vertical" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:onClick="favorite" android:src="@drawable/star" /&gt; </code></pre> <p>The code for my on click function:</p> <pre><code>public void favorite(View view){ ImageView iView = (ImageView) view; iView.setImageResource(R.drawable.star_checked); ViewParent v = iView.getParent(); } </code></pre>
java android
[1, 4]
1,295,392
1,295,393
Display changing without AJAX
<p>I have 2 drop down lists , and value of the second drop down list should change according to the value selected in first drop down list. The current drop down lists are.</p> <pre><code>&lt;select name="first"&gt; &lt;option name="a" value="a"&gt;a&lt;/option&gt; &lt;option name="b" value="b"&gt;b&lt;/option&gt; &lt;option name="c" value="c"&gt;c&lt;/option&gt; &lt;/select&gt; &lt;select name="second"&gt; &lt;option name="a1" value="a1"&gt;a1&lt;/option&gt; &lt;option name="a2" value="a2"&gt;a2&lt;/option&gt; &lt;option name="b1" value="b1"&gt;b1&lt;/option&gt; &lt;option name="b2" value="b2"&gt;b2&lt;/option&gt; &lt;option name="c1" value="c1"&gt;c1&lt;/option&gt; &lt;option name="c2" value="c2"&gt;c2&lt;/option&gt; &lt;/select&gt; </code></pre> <p>I want the second drop down to be displayed according to the value selected in First dropdown, ie, if "a" is selected in first then only a1 and a2 should be shown. Also drop down values are pulled from a database Thanks</p>
php javascript
[2, 3]
3,747,010
3,747,011
Access a databound variable in regular inline expression
<p>I'm trying to access a databound variable within a regular C# inline expression.</p> <p>I was hoping there was some way I could access it using the <code>Eval()</code> command, but you cannot use it inside a regular inline code block. (What I mean by that, is the <code>&lt;% %&gt;</code> tag).</p> <p><strong>NOTE</strong>: The below inline code is not complete, I set the boolean (IsCommented) beforehand.</p> <pre><code>&lt;% if (IsCommented) Response.Write("&lt;a href='#' onclick='Comment(" + Eval("commentid") + "', $(this)); return false;' class='btn btn-info'&gt;Comment&lt;/a&gt;"); else Response.Write("&lt;a href='#' onclick='Comment(" + Eval("commentid") + "', $(this)); return false;' class='btn btn-inverse'&gt;Commented!&lt;/a&gt;"); %&gt; </code></pre> <p>Is this at all possible?</p> <p>(Note that I have this all contained within a <code>ListView</code>)</p>
c# asp.net
[0, 9]
4,351,600
4,351,601
What does the Request object do in the following scenario?
<p>If I see something like:</p> <pre><code>if(Request["Email"]) { } </code></pre> <p>What does this actually mean? Where is the Email collection member actually being set?</p>
c# asp.net
[0, 9]
5,109,553
5,109,554
Handel checkbox's checkd/unckhecked events in javascript
<p>I have a textbox which is read-only. It is used to take input of date from the javascript date picker. Other thing is I have gridview which contains checkbox inside item template. Now what I want is when user clicks on any of the check box in grid, the corresponding date should be filled in the date textbox or when user uncheck that particular check box, texbox should get clear. More over, if the date text box is filled and if he chooses date from date picker, in that case selected date should be filled in date box and selection of checkbox should get clear.. I don't know how to handle all this things??</p>
javascript asp.net
[3, 9]
4,801,119
4,801,120
Padding on Shape in Progressbar
<p>I'm using xml file to define progress bar. I defined padding on background shape. But this setting will be sometimes displayed correctly, sometimes not. So If I start my application or Activity with progressbar inside, there will be correctly displayed progressbar with background and 'padded' progress. Then I close my application and start it again, and, progressbar is displayed without padded background, on next start will be displayed correctly and son on ... Could you please advice possible reasons for this?</p> <p>xml file: </p> <pre><code>&lt;item android:id="@android:id/background" &gt; &lt;shape&gt; &lt;corners android:radius="15dip" /&gt; &lt;padding android:left="1dp" android:top="6dp" android:right="1dp" android:bottom="6dp" /&gt; &lt;solid android:color="#00000000" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item android:id="@android:id/progress" &gt; &lt;clip android:clipOrientation="horizontal" android:gravity="left" &gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"&gt; &lt;corners android:radius="15dip" /&gt; &lt;stroke android:width="1px" android:color="#ffffffff" android:dashWidth="2px" android:dashGap="0px"/&gt; &lt;solid android:color="#ff0000ff" /&gt; &lt;/shape&gt; &lt;/clip&gt; &lt;/item&gt; </code></pre> <p> </p>
java android
[1, 4]
1,894,377
1,894,378
jQuery double object constructor
<p>Assume you have the following code:</p> <pre><code>function name() { $(this).css('background', 'red'); } $('selector1').click(name); $('selector2').click(function () { name.call($(this).parent()); }); </code></pre> <p>Now, when the function is called by clicking on 'selector1' <code>this</code> is an HTML object and <code>$(this)</code> a jQuery object, but if the function is called by clicking on 'selector2' <code>this</code> is already a jQuery object so what is <code>$(this)</code>?</p> <p>I know I could do something like <code>name.call($(this).parent()[0]);</code> to get an HTML object, but my question is what happens when you do something like <code>$($(this))</code> or <code>$($('selector'))</code>? What is the result of that and, most impotently, is there any harm in using such a construct?</p>
javascript jquery
[3, 5]
5,367,880
5,367,881
Recentering divs on window resize gets me "Uncaught TypeErrors"
<p>I have got a modal window set-up on my page that works fine, but needs repositioning on window resize in order to stay centred. Unfortunately, I simply get the error:</p> <blockquote> <p>Uncaught TypeError: Object # has no method 'outerHeight'</p> </blockquote> <p>Am I using "this" incorrectly?</p> <pre><code> $(window).resize(function() { //If mask is open, resize modal elements if ($('#modalMask').is(':visible')) { //Resize and position modal windows //Get window dimensions var mWinHeight = $(window).height(); var mWinWidth = $(window).width(); //Make sure all open modal windows are centred $('.modalWindow:visible').each(function (i) { var $this = $(this); $this.css('top', mWinHeight/2-(this.outerHeight()/2)); $this.css('left', mWinWidth/2-(this.outerWidth()/2)); }); } }); </code></pre>
javascript jquery
[3, 5]
4,347,373
4,347,374
How do I prevent the error: System.FormatException: Input string was not in a correct format
<p>My code works just fine as long as the database returns a result set. When it returns nothing it breaks and gives me the following error:</p> <pre><code>System.FormatException: Input string was not in a correct format. </code></pre> <p>Here is my code:</p> <pre><code>DataTable data = GeneralFunctions.GetData( query ); object sumObject; sumObject = data.Compute( "Sum(Minutes_Spent)", "" ); if ( reportType == 1 ) { RepeaterPCBillable.DataSource = data; RepeaterPCBillable.DataBind(); LabelPCBillable.Text = ParseTime( int.Parse( sumObject.ToString() ) ) == null ? ParseTime( int.Parse( sumObject.ToString() ) ) : ""; // ERROR HERE } else { RepeaterDTSTBillable.DataSource = data; RepeaterDTSTBillable.DataBind(); LabelDTSTBillable.Text = ParseTime( int.Parse( sumObject.ToString() ) ) == null ? ParseTime( int.Parse( sumObject.ToString() ) ) : ""; } </code></pre> <p>ParseTime:</p> <pre><code>protected string ParseTime ( int TotalMinutes ) { int hours = TotalMinutes / 60; int minutes = TotalMinutes % 60; if ( hours == 0 ) { return String.Format( "{0} minutes", minutes ); } else if ( hours == 1 ) { return String.Format( "{0} hour and {1} minutes", hours, minutes ); } else if ( hours &gt; 1 ) { return String.Format( "{0} hours and {1} minutes", hours, minutes ); } else { return ""; } } </code></pre>
c# asp.net
[0, 9]
3,522,875
3,522,876
thumbnail photo selector with javascript/jquery
<p>I want to create something like the screenshot below. The big image on top will be the main display, and when you click on bottom thumbnails the big image on top will change to the thumbnail image.</p> <p>ps ignore the "back to the top" text.</p> <p>is there an easy way to do this with javascipt/jquery?</p> <p><img src="http://i.stack.imgur.com/7vFYD.png" alt="enter image description here"></p>
javascript jquery
[3, 5]
4,525,120
4,525,121
Is this a bug in ASP.NET 3.5?
<p>In ASP.NET when I try to add a dynamic control (includes validation) to <code>Placeholder</code> or any other control container, the name of control become an important. For example, this is very normal, easy control adding code.</p> <pre><code>var control = LoadControl("TestUserControl.ascx"); control.ID = Guid.NewGuid().ToString(); PlaceHolder1.Controls.Add(control); </code></pre> <p>as you see, I'm giving guid to control's ID. In Runtime, this code fails, and compiler says this is a javascript error, and error message like ';' character expected, missing.. etc..</p> <p>The problem is very interesting. Dynamically added ASP.NET control (includes validation), causes an error because of " - " character in dynamically named ID property (or anything like '-', '.',etc..).</p> <p>When I refine my code like:</p> <pre><code>var control = LoadControl("TestUserControl.ascx"); control.ID = Guid.NewGuid().ToString().Replace("-", string.Empty); PlaceHolder1.Controls.Add(control); </code></pre> <p>problem goes away :)</p> <p>Is this a bug in <strong>ASP.NET 3.5</strong>? Why its look like a javascript error in page?</p>
c# asp.net
[0, 9]
476,425
476,426
who can give me explain it about javascript?
<p>javascript:delete_reply_notify('14557174');void(0)</p> <p>it make javascript delete one row which id = 1455174</p> <p>but ,why is void(0)? what's mean ?</p>
jquery javascript
[5, 3]
4,847,375
4,847,376
How to upload multiple file in php
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/3078124/how-to-upload-multiple-files-in-php">How to upload multiple files in PHP</a> </p> </blockquote> <p>How to upload multiple file in php just like multiple attachment in ant gmail or yahoo. in my application i m using a ajax button to upload file . and also showing a progress bar .what actually want is when click that button 1 file upload and then again that button apper to it side.. so plz help me out</p>
php javascript jquery
[2, 3, 5]
2,059,423
2,059,424
android countdown timer continues to run in background
<p>I want to make a 30 second countdown to run in my activity and continue to run until it hits 0. Is there any method? </p> <p>Basically I want it to run and update its value in a textview.</p>
java android
[1, 4]
3,956,950
3,956,951
Let user review a file before uploading it
<p>I am programming a control to allow the users of our intranet to upload multiple files into our system, but with some added functionality.</p> <p>Imagine you as a user are uploading N files, when you add N files the intranet presents you a list like this:</p> <p>File_name_1 ..... [View] [Remove] [Upload]<br> File_name_2 ..... [View] [Remove] [Upload]<br> .<br> .<br> .<br> File_name_n ..... [View] [Remove] [Upload]<br><br> [Remove all file] [Upload all files]</p> <p>If you clic on the View button the file named "file_name_X" will be opened so you can review it and be sure it really is the file you want to upload.</p> <p>Is this possible?, I am new on the Web programming world and all I found suggest the browsers do not allow you to access local file system from inside a web, but I am not sure.</p>
asp.net javascript
[9, 3]
3,246,550
3,246,551
How do I find a control I placed inside a panel?
<p>I have a button inside a Panel. I'm trying to find the id of the button, but my code doesn't work:</p> <pre><code>protected void pnl_nocutomer_Load(object sender, EventArgs e) { Button btn; btn = this.FindControl("btn_clear") as Button; Page.LoadComplete += new EventHandler(Page_LoadComplete); string LanguageID = Globals.GetSuitableLanguage(Page); if (LanguageID == "ar") { btn.Text = Globals.Translate("Ok", LanguageID); } } </code></pre>
c# asp.net
[0, 9]
6,019,836
6,019,837
How to clear GPS cache from my device programatically?
<p>I have the following task: when AlarmManager generates the event the application must define location and send the coordinates to my letter; after it LocationManager deletes this location listener(I do it in callback method of listener - manager.removeUpdates(this)). All works except location defining. I have following code for it:</p> <pre><code>@Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub Log.e("event", "onReceive"); LocationManager lm = (LocationManager)context.getSystemService(context.LOCATION_SERVICE); String provider=lm.isProviderEnabled(LocationManager.GPS_PROVIDER) ? LocationManager.GPS_PROVIDER : LocationManager.NETWORK_PROVIDER; CustomLocationListener listener=new CustomLocationListener(new AutoQueryWorker(context), lm, provider); lm.requestLocationUpdates(provider, 0, 0, listener); } </code></pre> <p>I have the following question: for example, the alarm wakes up and the application defines coordinates using GPS. User waits at same position, and alarm wakes up again. Will requestLocationUpdates be executed again, or, because user waits at the same point, onLocationChanged method won't be executed? Please, tell me. </p>
java android
[1, 4]
3,913,033
3,913,034
setting a class to a menu depending of the url link
<p>Here is my scenario, my sub pages are not recognizing the parent, probably cause I set the structure bad, however going to back to fix that is not an option for now, problem the menu parent is getting the parent class in the wrong places....</p> <p>So what I need to achieve...</p> <p>if I have this url structure: domain.com/products/.... assign "current" class to menu X...</p> <p>If I have this other: domain.com/sales/..... assign "current" class to Y....</p> <p>I know I can do it via javascript, however I lack of knowledge of it, I'm just looking for a solid starting point.</p> <p>I would appreciate any help.</p> <p>Thanks in advanced.</p>
javascript jquery
[3, 5]
5,058,693
5,058,694
Conversion calculation from string do double
<p>i'm working in android and I need your help. In <strong>string</strong> in <strong>values</strong> I have this</p> <pre><code>&lt;item&gt;(1 / 1024)&lt;/item&gt; </code></pre> <p>I need to parse this string to double this way</p> <pre><code>outputDouble = Double.parseDouble(unitsValues[outputPosition]); </code></pre> <p>so it means this</p> <pre><code>outputDouble = Double.parseDouble((1 / 1024)); </code></pre> <p>This second code mean, that I find the line by index I need and it tries to convert it from string to double but it is impossible because it can recognize this string (1 / 1024) to double. Do you have any ideas?</p> <p>Thank you</p>
java android
[1, 4]
41,995
41,996
Progress dialog not showing in AsyncTask
<p>I have a huge array of Strings which I'm trying to insert into the sqlite DB. Due to this, I am using the <a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#beginTransaction%28%29" rel="nofollow">begintransaction idiom</a> in my <code>doInBackground</code>, which works perfectly. The problem is that the ProgressDialog is <strong>not</strong> being shown. What could be the problem? Is it because beginTransaction works only in EXCLUSIVE mode? Any help is appreciated. Thanks!</p> <pre><code> @Override public void onCreate(SQLiteDatabase database) { database.execSQL(Constants.CREATE_TABLE_DICT); mDatabase = database; readFile(R.raw.dict); new InitDB().execute(); } public class InitDB extends AsyncTask&lt;Void, Void, Void&gt; { InsertHelper ih; int wordColumn; private ProgressDialog mProgD; @Override protected void onPreExecute() { super.onPreExecute(); mProgD = ProgressDialog.show(mContext, "", "Wait", true);//NOT BEING SHOWN! ih = new InsertHelper(mDatabase, "dictionary"); wordColumn = ih.getColumnIndex("word"); } @Override protected Void doInBackground(Void... params) { mDatabase.beginTransaction(); try { String [] ss = mWords.toString().split("\\|"); for(int i=0; i&lt;ss.length; i++) { ih.prepareForInsert(); String word = ss[i]; ih.bind(wordColumn, word); ih.execute(); } mDatabase.setTransactionSuccessful(); } finally { mDatabase.endTransaction(); } return null; } @Override protected void onPostExecute(Void result) { super.onPostExecute(result); mProgD.dismiss(); } } </code></pre> <p><strong>EDIT:</strong> Here's where the context comes from:</p> <pre><code> //Constructor public AppDatabase(Context context) { super(context, Constants.DATABASE_NAME, null, Constants.DATABASE_VERSION); mContext = context; } </code></pre>
java android
[1, 4]
5,241,617
5,241,618
Call a javascript function after 5 sec of last key press
<p>I have a form with an <code>&lt;input type=text /&gt;</code> and I want to call a javascript function after 5 seconds of the last key press, and every time a new key is pressed, this timer should reset and only call the function after 5 seconds.</p> <p>How can I do this?</p> <p>I'm using jQuery.</p> <p>thanks!</p>
javascript jquery
[3, 5]
493,857
493,858
How to write optional parameter in $.getJSON
<p>I used $.getJSON to retrieve the data from my database. If the parameter dID is not null, then there is one parameter like : </p> <pre><code>$.getJSON(urlGetProByDep, { depID: dID }, function (data) { //blah blah blah }); </code></pre> <p>But if both dID and cID are not null so the function will use 2 parameter as below :</p> <pre><code> $.getJSON(urlGetProByDep, { depID : dID,catID : cID }, function (data) { //blah blah blah }); </code></pre> <p>Could anyone tell me how can I change the paramter in {....} due to the value of dID and cID.</p> <p>Thanks so much.</p>
javascript jquery
[3, 5]
918,987
918,988
Change text based on select box value
<p>Full Disclosure: I am bad at javascript.</p> <p>I'm trying to write something that takes the value of a select box (in this case, it contains a list of themes the user can choose from), compares it against an array containing all the themes allowed, and display a preview link to the user.</p> <p>Below is some select code.</p> <p>My Array containing the preview links:</p> <pre><code>var themePreview = []; themePreview[0] = '&amp;nbsp;&amp;nbsp;&lt;a href="http://www.trafficgettingblogs.com/?preview=1&amp;template=arclite&amp;stylesheet=arclite&amp;TB_iframe=true&amp;width=1000&amp;height=700" class="thickbox thickbox-preview"&gt;Preview Arclite&lt;/a&gt;'; themePreview[1] = '&amp;nbsp;&amp;nbsp;&lt;a href="http://www.trafficgettingblogs.com/?preview=1&amp;template=arras&amp;stylesheet=arras&amp;TB_iframe=true&amp;width=1000&amp;height=700" class="thickbox thickbox-preview"&gt;Preview Arras&lt;/a&gt;'; themePreview[2] = '&amp;nbsp;&amp;nbsp;&lt;a href="http://www.trafficgettingblogs.com/?preview=1&amp;template=carrington-blog&amp;stylesheet=carrington-blog&amp;TB_iframe=true&amp;width=1000&amp;height=700" class="thickbox thickbox-preview"&gt;Preview Carrington Blog&lt;/a&gt;'; </code></pre> <p>My jQuery attempting to get the select box value and display a preview link:</p> <pre><code>$('select #selectedTheme').change(function() { //document.write('test'); // Try to see if I'm selecting what I need. $('#previewTheme').value() = themePreview[$('#selectedTheme option:selected').value()]; }); </code></pre> <p>The select box has an ID of <code>selectedTheme</code>.</p> <p>I'm not getting any errors, but I don't seem to be selecting the select box.</p> <p>I am sure this is a very simple problem. I'm trying to improve my javascript skills. Rather unsuccessfully, it seems.</p>
javascript jquery
[3, 5]
798,914
798,915
How do I increase a counter by dragging a page element and moving the mouse right or left with JQuery?
<p>I need to do something like the Apple <a href="http://www.apple.com/iphone/gallery/" rel="nofollow">website gallery</a> (the 360° iPhone view). So I need to increase or decrease a counter according to the mouse movement after the onclick event (dragging) so I'll be able to load the right image (ending with an incremental number).</p> <p>Is there any way to do this? If I didn't explain it well just let me know, thank you.</p>
javascript jquery
[3, 5]
3,873,502
3,873,503
Jquery accordion with repeater, row details are not visible when activating row
<p>I am trying to use the jquery accordion with a repeater. I used the sample directly from the jquery documentation. When I click on the section links, the details open and expand, but you can't see any of the text. The html output looks right to me, not sure where this is going wrong. </p> <pre><code>&lt;script&gt; $(document).ready(function () { $("#accordion").accordion(); }); &lt;/script&gt; &lt;div id="accordion"&gt; &lt;asp:Repeater ID="respondToExceptionsList" runat="server"&gt; &lt;ItemTemplate&gt; &lt;h3&gt;&lt;a href="#"&gt;Section 1&lt;/a&gt;&lt;/h3&gt; &lt;div&gt; sdfffffffffffffff &lt;/div&gt; &lt;/ItemTemplate&gt; &lt;/asp:Repeater&gt; &lt;/div&gt; </code></pre> <p>This is the html output.</p> <pre><code>&lt;DIV id=accordion class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons" role=tablist jQuery1315324170464="2"&gt; &lt;H3 aria-expanded=true class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top" role=tab tabIndex=0 jQuery1315324170464="3"&gt; &lt;SPAN class="ui-icon ui-icon-triangle-1-s" jQuery1315324170464="13"&gt;&lt;/SPAN&gt;&lt;A tabIndex=-1 href="#"&gt;Section 1&lt;/A&gt;&lt;/H3&gt; &lt;DIV style="HEIGHT: 19px" class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" role=tabpanel&gt;sdfffffffffffffff &lt;/DIV&gt; &lt;/DIV&gt; </code></pre>
c# jquery
[0, 5]
4,352,098
4,352,099
on focus not working in asp textbox
<p>On entering rate and quantity I want the total amount to be calculated automatically, so I tried the following.</p> <pre><code>function getAmt() { if(isNaN(document.getElementById('&lt;%=TxtRate.ClientID%&gt;').value)) { alert("Illegal Rate Entered, Please Check It Out."); document.getElementById('&lt;%=TxtRate.ClientID%&gt;').focus; return; } else if(isNaN(document.getElementById('&lt;%=TxtQty.ClientID%&gt;').value)) { alert("Illegal Quantity Entered, Please Check It Out."); document.getElementById('&lt;%=TxtQty.ClientID%&gt;').focus; return; } document.getElementById('&lt;%=TxtAmt.ClientID%&gt;').value=parseFloat (document.getElementById('&lt;%=TxtRate.ClientID%&gt;').value)*parseFloat (document.getElementById('&lt;%=TxtQty.ClientID%&gt;').value) } </code></pre> <p>Now I created a text box:</p> <pre><code>&lt;TextBox ID="TxtAmt" runat="server" BorderStyle="Solid" onFocus="getAmt()"&gt; </code></pre> <p>This code is not running.. what am i missing ??</p>
javascript asp.net
[3, 9]
3,530,200
3,530,201
Is there any good library for Audio or Sound files comparison in Java / Android?
<p><strong>I need to check two sound files are identical or not identical in android.</strong> I got confused between different libraries in Java. So please anyone suggest me good lib.</p> <p>Thanks in advance. </p>
java android
[1, 4]
453,847
453,848
Can we integrate napster in a .net website?
<p>Can we integrate napster in a .net website? If so please suggest any documentation to refer to. Thanks.</p>
c# asp.net
[0, 9]
2,394,300
2,394,301
Alert input "file" filename using jQuery with "split"
<p>I'm trying to alert the filename from a upload input.</p> <p>Here's my <a href="http://jsfiddle.net/xwdct/" rel="nofollow">fiddle</a></p> <p>It works, but there's the "C:Fakepath..." something like that. I just want the filename, without the Fake path. I tried using the <code>split</code> function, but I'm not sure why it's not working.</p> <p>Example html:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Test Page&lt;/title&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="file" id="tester" /&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Example script:</p> <pre><code>$(function() { var bogus; var triple; $('#tester').change(function() { triple = $('#tester').val(); bogus = triple.split(/[\s/]+/); alert(bogus[bogus.length - 1]); }); }); </code></pre> <p>​ Any idea?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
3,319,600
3,319,601
Loop through string of dropdown options and select
<p>I want to select an option in a string, where the string will be the contents of a dropdown, but I dont know how to loop through the string as an object please. In the example I would like "Saab" to be selected and the string alerted.</p> <pre><code>var x = '&lt;select&gt;&lt;option&gt;Volvo&lt;/option&gt; &lt;option&gt;Saab&lt;/option&gt; &lt;option&gt;Mercedes&lt;/option&gt; &lt;option&gt;Audi&lt;/option&gt; &lt;/select&gt;'; $.each($(x), function(index, value) { if ($(this).val() == "Saab"){ $(this).attr("selected","selected") } }); alert(x); </code></pre>
javascript jquery
[3, 5]
1,363,039
1,363,040
C# dealing with objects
<p>so im using this library for C#, im a php developer, and when i get a list of users by using the following: <a href="http://help.globalscape.com/help/eft5_com/Retrieving_a_list_of_users.htm" rel="nofollow">http://help.globalscape.com/help/eft5_com/Retrieving_a_list_of_users.htm</a></p> <p>I get an object, now in php i would just -> to break into this object and then foreach to loop through all the array elements to check if a user exists, but i am unsure how to do this in c#, can anyone help me out.</p>
c# php
[0, 2]
1,067,050
1,067,051
localization in asp.net-HTML controls
<p>In my application i need different culture for HTML controls. is it possible through the .resx file or is there anyother methods.</p> <pre><code> &lt;ul&gt; &lt;li&gt;&lt;a href=".."&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Admin&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;View List&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>How to apply localization for all the pages from master page? or whether i need to apply the code for all the pages? is there any method for applying the localization for javascript and Jquery other than creating separate script for different languages.</p>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,977,454
4,977,455
Javascript executed twice?
<p>I have default js file that i load in every page. There is simple jquery <code>jQuery(document).ready(function($){ ... });</code> in which i places rest of my code.</p> <p>However, when i try to execute some alert or console.log code that is in the center of page, i get it executed twice. And in console i see this:</p> <pre><code>some text adresar:110 some text (program):2 </code></pre> <p>When i click on "adresar:110" It shows me adresar's html with js where i wrote it. And when i click "(program):2" it shows just the js code that i placed inside </p> <p>This is what i wrote in the ~middle of html body :</p> <pre><code>&lt;script type="text/javascript"&gt; console.log('some text'); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
4,089,317
4,089,318
Basics of inertia in JavaScript
<p>I am looking to produce a draggable element with inertia when you move it. I am pretty new to JavaScript, looking for the basics of doing it. I would like to use a library like jquery ui for the drag n drop functionality then add inertia, I have done some as3 inertia but am wondering where to begin with JavaScript.</p>
javascript jquery
[3, 5]
5,839,349
5,839,350
How to get specific item in Item template of Asp Grid view by using Jquery?
<p>How can I get effect on specific row of grid veiw</p> <pre><code>&lt;asp:GridView ID="gvSearch" runat="server" DataKeyNames="guidId" &gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;div class="test1"&gt; "test paragraph" &lt;img src="../Images/double-arrow.png" style="margin-left: 741px;margin- top:39px;" class="PreviewImage" onclick="DisplayImg('&lt;%# Eval("guidId") %&gt;')"/&gt; &lt;/div&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt; </code></pre> <p>Now by using Jquery, how can I show only one image on event of onmouseover on div, I tried below but it display images of all the rows.</p> <pre><code> $('div.test1').mouseover(function () { $('.PreviewImage').show(); }) </code></pre>
c# jquery
[0, 5]
25,827
25,828
Downloading progress in AsyncTask android
<p>I am trying to create downloading progress. I have my class which extends AsyncTask: <strong>public class DownloadFileTask extends AsyncTask</strong></p> <p>When downloading starts i want to create progress:</p> <pre><code> @Override protected void onPreExecute() { progressDialog = new ProgressDialog(whatContext); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setMessage("Loading..."); progressDialog.setCancelable(false); progressDialog.show(); } </code></pre> <p>But i don't know what context i should give to new ProgressDialog becouse i am not in Activity class. I tried to give some context but there an error:</p> <p><strong>No enclosing instance of the type Main_Tab is accessible in scope</strong></p> <p>So how i could create this progress ? </p> <p>Also i wanted to create progress not in this class (becouse i want seperate functions and design), but i did't figure out how to do that.</p> <p>Thank you guys for help.</p>
java android
[1, 4]
911,950
911,951
How do I attach jQuery .live() to this snippet of code?
<p>I'm using a plugin called cloud zoom. the problem is, it attaches itself to anything with <code>class="cloud-zoom"</code> when the DOM is ready. My problem is I don't attach that class to DOM elements at render time. It is appended dynamically. So I need somehow to mix .live() with it to make it work:</p> <pre><code>$(document).ready(function () { $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom(); }); </code></pre> <p>.live() expects an event. I'm not sure how to specify an event called invoke CloudZoom() on any element that gets injected into the DOM with the class cloud-zoom.</p>
javascript jquery
[3, 5]
409,282
409,283
How to send image dat over network as fast ?
<p>I am working with client-server using Java. Client is performs on android and wants to request some images from server. And the server will response image as byte[] data to client. The approximate size of data is 150K per/request (already re-size). And the process usually use 3 seconds for response. I think it use long time to response client.</p> <p>Could anyone guide me as trick for use shorter time response?</p> <p>Thanks in advance</p>
java android
[1, 4]
1,270,292
1,270,293
populate ASP.NET dropdownlist using javascript
<p>how can I populate an ASP.NET dropdownlist using javascript? also how can I clear all dropdownlist items?</p> <p>thanks</p>
javascript asp.net
[3, 9]
5,290,887
5,290,888
How to remove all occurence of a character when losing focus of a textbox?
<p>I need to create in jquery a function that once a user tabs out of a control or finishes typing in the textbos, removes the # character from the field,</p> <pre><code> $('[id$=txtClient]').keyup(function (){ } </code></pre> <p>First I dont know how to remove it, and should I do it in the keyup? or in another event?</p>
javascript jquery
[3, 5]
5,499,255
5,499,256
How does jQuery have the $ object constructor and the methods associated with the $?
<p>How is it that jQuery can do <code>$("#foo").addClass("bar")</code> and <code>$.ajax()</code>?</p> <p>I'm creating a micro javascript framework and want to create a new instance of an object, such as <code>$("#hello")</code>. With this object there are associated methods, such as <code>addClass</code>, <code>css</code>, etc, just like with jQuery. So I could do something like</p> <pre><code>$("#foo").addClass("remove").css("color", "red"); </code></pre> <p>I have been successful in creating this. However, when I want to call a method from this object, such as <code>$.ajax</code>, the constructor function is overwritten, and I can call $.ajax, but not $("#foo").</p> <p>Basically, how can jQuery do both?</p>
javascript jquery
[3, 5]