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,052,488
3,052,489
Losing the session after the Postback
<p>I have been using session variables in my asp.net application for passing the next property:</p> <pre><code>[DefaultValue(true)] public bool IsModificationMode { get { return (bool)Session["ModificationMode"]; } set { Session["ModificationMode"] = value; } } </code></pre> <p>In the PageLoad, I set it's value.</p> <p>Now after the Postback, I am losing it's value having a a NullReferenceException</p>
c# asp.net
[0, 9]
1,377,467
1,377,468
Raise an event or override a method when the user logs out in ASP.NET
<p>I need to do something when the user logs out. I have used ASP.NET Forms Authentication.</p> <p>What should I override or implement?</p> <p>I have an ASP.NET login control and I want to empty the basket-viewer when the customer logs out of the system.</p>
c# asp.net
[0, 9]
3,766,749
3,766,750
Convert PHP to C++ code
<p>I'm looking for a way to convert PHP code to C++. There are a few reasons I want to do so:</p> <p><strong>Main reason: There are bunch of great PHP tools/software that I'd love to use and incorporate into C++ GUI or non-GUI applications</strong></p> <ol> <li>To boost performance</li> <li>To avoid dependency on PHP libraries</li> <li>To avoid disclosing source code on shared hosting environments</li> <li>To be empowered by C++ language features and make use of frameworks like Qt C++ and Poco</li> </ol> <p>So far I've found:</p> <p><a href="http://sourceforge.net/projects/binaryphp">http://sourceforge.net/projects/binaryphp</a></p> <p><a href="http://www.mibsoftware.com/php2cpp/">http://www.mibsoftware.com/php2cpp/</a></p> <p>Please share your ideas and tools that you know. Thank you in advance!</p> <p><strong>EDIT:</strong> I also need cross-platform operability and good match for $$, syntactic sugar functions and Interface.</p> <p><strong>EDIT:</strong> Please note that 2 aforementioned tools use 2 different approaches. The former has built-in libraries to convert PHP procedural code and make it run. The latter translates (word by word) from PHP to C++.</p>
php c++
[2, 6]
404,252
404,253
jQuery - Find any input with a given class that has no value
<p>I have a (very) basic validation script. I basically want to check for any inputs with class .required to see if there values are a) blank or b) 0 and if so, return false on my form submit. This code does not seem to return false:</p> <pre><code>function myValidation(){ if($(".required").val() == "" || $(".required").val() == 0){ $(this).css({ backgroundColor:'orange' }) ; return false; } } </code></pre> <p>Appending this function to my onSubmit handler of my form is not returning any results. Any light shed on this matter will be appreciated. </p> <p>I am basically after a function that iterates through all the inputs with class .required, and if ANY have blank or 0 values, return false on my submit and change the background colour of all badly behaved inputs to orange.</p>
javascript jquery
[3, 5]
1,359,194
1,359,195
jquery.selectbox-0.2 issue with ie7 - dropdowns appearing behind elements instead of in front
<p>I'm using <a href="http://code.google.com/p/select-box/" rel="nofollow">http://code.google.com/p/select-box/</a> select box jquery plugin so that I can change the appearance of my select boxes.</p> <p>The plugin is great and works fine except in ie7 where the dropdown lists appear behind any element that they happen to overlap with. It seems to be a known issue but no-one seems to have answered the person who reported it.</p> <p>I was wondering if anyone could suggest a fix?</p> <p>the issue can be seen here: <a href="http://code.google.com/p/select-box/issues/detail?id=8" rel="nofollow">http://code.google.com/p/select-box/issues/detail?id=8</a></p> <p>thanks for any help :)</p>
javascript jquery
[3, 5]
1,211,169
1,211,170
request response from server
<p>this below my code can successful return json code. but i cant request responce from server</p> <pre><code>&lt;?php include_once ('./AFactory.class.php'); $database= new AFactory; $db=new AFactory(); $link=$db-&gt;getDBO(); $query=array('id'=&gt;NULL,'userCode'=&gt;$_POST['userCode']); $sql=$db-&gt;insertQuery('`a_mis`.`users`',$query); if ( mysql_query($sql) ) {$data['success']=true;$data['message']='ok';} else {$data['success']=false;$data['message']='no';} echo json_encode($data); ?&gt; </code></pre> <p>OUTPUT:</p> <pre><code>{"success":true,"message":"ok"} </code></pre> <p>i'm using this code from localhost and send post to server.i cant get result from server</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; &lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://code.jquery.com/jquery-1.8.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $.post("http://site.com/index.php", {userCode:"ttt-ddd-fff"}, function(data){ alert (data.message); },'json'); }); &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; </code></pre>
php jquery
[2, 5]
5,261,971
5,261,972
Regular Expression Nightmare
<p>Does anyone know the regular expression for this following format in C#: yyyy/mm/dd This regular expression stuff is really doing my head in, any help would be greatly appreciated.</p>
c# asp.net
[0, 9]
3,630,110
3,630,111
Add User To Role in memeber ship Provider
<p>I have gone through a video tutorial regarding <code>Asp.net Membership Provider</code> in which he has done his coding in <code>VB</code>. The same code i used in <code>C#</code> but at this point i am getting an error as <code>The best overloaded method match for 'System.Web.Security.Roles.AddUsersToRole(string[], string)' has some invalid arguments</code></p> <p>This is what i have written with reference to that video can any one tell what's going wrong</p> <p><code>Roles.AddUsersToRole(User.Identity.Name, ListBox1.SelectedValue);</code></p>
c# asp.net
[0, 9]
5,783,787
5,783,788
Checkbox update page (show more info if checked)
<p>I am trying to figure out how to list 3 check-boxes at the top of a page that, when checked, auto reveal more info on the page.</p> <p>Using php if I can hide the info, but how will it update page? I am guessing some form of java.</p>
php javascript
[2, 3]
3,542,192
3,542,193
How to call Javascript from C# PageLoad?
<p>I want to ask How to call javascript from C# page load. My Javascript is</p> <pre><code>function Hide(lst) { if (document.getElementById) { var tabList = document.getElementById(lst).style; tabList.display = "none"; return false; } else { return true; } } </code></pre> <p>and want to call from pageload</p> <pre><code>if (dtSuperUser(sLogonID).Rows.Count &lt; 1) { //Call Javascript with parameter name tablist } </code></pre> <p>thanks</p>
c# javascript asp.net
[0, 3, 9]
1,910,582
1,910,583
call jquery fom php script
<pre><code>&lt;script type="text/javascript"&gt; &lt;!--// // on DOM ready $(document).ready(function (){ $("#current_rev").html("v"+$.jnotify.version); $("a.example").bind("click", function (e){ // prevent default behavior e.preventDefault(); var $ex = $($(this).attr("href")), code = $.trim($ex.text()); // execute the sample code $.globalEval(code); }); // style switcher $("button.css_switcher").click(function (){ switchCSS(this.title); }); }); //--&gt; &lt;/script&gt; </code></pre> <p>Instead of using click events like <code>&lt;a href="#example-1" class="example"&gt;[Run]&lt;/a&gt; and &lt;a href="#example-2" class="example"&gt;[Run]&lt;/a&gt;</code></p> <p>How can I call events if a condition is true or false?</p> <pre><code>&lt;?php if (true){ &lt;a href="#example-1" class="example"&gt;[Run]&lt;/a&gt;}else{ &lt;a href="#example-2" class="example"&gt;[Run]&lt;/a&gt;} ?&gt; </code></pre>
php jquery
[2, 5]
1,501,980
1,501,981
validation on asp.net wizard control
<p>I am using the Wizard control for so I can break registration up into smaller pieces.</p> <p>This is the code of wizard:</p> <pre><code>&lt;asp:Wizard DisplaySideBar="False" ID="Wizard1" runat="server" ActiveStepIndex="0" BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" OnFinishButtonClick="OnFinishButtonClick" OnNextButtonClick="savePassword" &gt; &lt;HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Left" /&gt; &lt;NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" /&gt; </code></pre> <p>On the original version of the form I have a validation summary at the top keyed into all the required fields and regular expression, so I am wondering how can I make every step of ASP.NET wizard make validation both required and regex. </p> <p>Note that the required field works well in every step, but regex works only on finish stop </p> <p>Does anybody know the answer?</p>
c# javascript asp.net
[0, 3, 9]
4,339,573
4,339,574
Counting Rows in C# after dynamically adding them with jQuery
<p>I just have a simple ASP Table seen here:</p> <pre><code>&lt;asp:Table ID="tblCategories" runat="server" CssClass="oneColTable padded-table dataTable"&gt; &lt;asp:TableHeaderRow CssClass="tableHeader"&gt; &lt;asp:TableHeaderCell&gt;Category Name&lt;/asp:TableHeaderCell&gt; &lt;asp:TableHeaderCell Width="50"&gt;Delete&lt;/asp:TableHeaderCell&gt; &lt;/asp:TableHeaderRow&gt; &lt;/asp:Table&gt; </code></pre> <p>And if the user wants to add an additional row I use the jQuery Clone method to copy and append a new row.</p> <p>My issue comes when I want to count the rows present on the C# side it always lists 1 Row. The row for the header entry.</p> <p>How can I correctly grab the accurate row count on the C# (Codebehind) side?</p> <p>Thanks,</p> <p>-Seth</p>
c# asp.net jquery
[0, 9, 5]
5,522,586
5,522,587
Confused. How can I grab hold of the returned InputStream?
<p>I'm trying to fetch some XML and eventually use it as a String. Here's my two methods, the former of which calls the latter. </p> <pre><code>public static void getAllXML(String url) throws XmlPullParserException, IOException, URISyntaxException{ XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser parser = factory.newPullParser(); parser.setInput(new InputStreamReader(getUrlData(url))); XmlUtils.beginDocument(parser,"results"); int eventType = parser.getEventType(); do{ XmlUtils.nextElement(parser); parser.next(); eventType = parser.getEventType(); if(eventType == XmlPullParser.TEXT){ Log.d("test",parser.getText()); } } while (eventType != XmlPullParser.END_DOCUMENT) ; } public static InputStream getUrlData(String url) throws URISyntaxException, ClientProtocolException, IOException { DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = new HttpGet(new URI(url)); HttpResponse res = client.execute(method); return res.getEntity().getContent(); } </code></pre> <p>Then I use a method which takes an <code>InputStream</code> and converts it to a <code>String</code>. But how do I grab hold of the <code>InputStream</code> returned by the <code>getUrlData</code> method so I can call <code>convertStreamToString(myInputStream)</code>?</p>
java android
[1, 4]
306,589
306,590
Accessing SessionState in IHttpModule after 404?
<p>Is it possible to access SessionState in the Error event handler of a HttpModule following a 404?</p> <p>Im trying to implement a consistent error handling mechanism for both full and partial postbacks using the technique described in this blog post,</p> <p><a href="http://blogs.microsoft.co.il/blogs/oshvartz/archive/2008/05/17/asp-net-error-handling-using-httpmodule-full-and-partial-post-back-ajax-updatepanel.aspx?CommentPosted=true#commentmessage" rel="nofollow">ASP.NET Error Handling......</a></p> <p>Instead of passing loads of parameters on the query string im trying to push the exception into session state and access it from the error page. </p> <p>SessionState is never available at point I do my Server.Transfer (in error handler of HttpModule) so not available to error page.</p> <p>Ive tried the trick of resetting the IHttpHandler to one with the IRequestSessionState interface but no joy.</p> <p>Thanks in advance,</p> <p>EDIT - The code of the IHttpModule error handler is,</p> <pre><code>void context_Error(object sender, EventArgs e) { try { var srcPageUrl = HttpContext.Current.Request.Url.ToString(); // If the error comes our handler we retrieve the query string if (srcPageUrl.Contains(NO_PAGE_STR)) { // Deliberate 404 from page error handler so transfer to error page // SESSION NOT AVAILABLE !!!! HttpContext.Current.ClearError(); HttpContext.Current.Server.Transfer(string.Format("{0}?ErrorKey={1}", ERROR_PAGE_URL, errorKey), true); } else HttpContext.Current.Server.ClearError(); return; } catch (Exception ex) { Logging.LogEvent(ex); } } </code></pre> <p>Matt</p>
c# asp.net
[0, 9]
2,406,949
2,406,950
Run one method 1000 times in a short period of time
<p>Let's say we are building some public service that grabs the setup of a user (what server, user and pwd he wants to perform the call), logs in into that server and do some processing...</p> <ul> <li>the process takes about 15 seconds to complete</li> <li>each user has a different setup (server/user/pwd), so the process needs to run against each one </li> </ul> <p><strong>if 1000 users</strong> tells the system to run the method at <strong>1:00PM</strong></p> <p><strong>How can I insure</strong> that the method is processed in the next <strong>15 minutes</strong>?</p> <p>What should be the correct approach to this little problem?</p> <p>I'm thinking that I need to do something Asynchronously, and parallel processing could speed up things, maybe throttling the processes, maybe execute 100 calls per each 30 seconds? </p> <p><strong>I never did something like this</strong> and would love to get your feedback on <strong>ideas and future problems</strong> just to spend 100 hours of work and realize that I took a wrong road :(</p> <p>Thank you.</p> <hr> <p><strong>added</strong></p> <blockquote> <p>The only thing to have in consideration is that this should be a 100% web solution.</p> </blockquote>
c# asp.net
[0, 9]
4,828,819
4,828,820
when do you need .ascx files and how would you use them?
<p>When building a website, when would it be a good idea to use .ascx files? What exactly is the .ascx and what is it used for? Examples would help a lot thanks!</p>
c# asp.net
[0, 9]
975,577
975,578
jQuery: Call a function twice
<p>I'm trying to run a function twice. Once when the page loads, and then again on click. Not sure what I'm doing wrong. Here is my code:</p> <pre><code>$('div').each(function truncate() { $(this).addClass('closed').children().slice(0,2).show().find('.truncate').show(); }); $('.truncate').click(function() { if ($(this).parent().hasClass('closed')) { $(this).parent().removeClass('closed').addClass('open').children().show(); } else if ($(this).parent().hasClass('open')) { $(this).parent().removeClass('open').addClass('closed'); $('div').truncate(); $(this).show(); } }); </code></pre> <p>The problem is on line 13 where I call the <code>truncate();</code> function a second time. Any idea why it's not working?</p> <p><strong>Edit</strong> jsFiddle here: <a href="http://jsfiddle.net/g6PLu/" rel="nofollow">http://jsfiddle.net/g6PLu/</a></p>
javascript jquery
[3, 5]
1,616,895
1,616,896
Get javascript to write text exactly where it is
<p>is it possible to get javascript to output html where the javascript code is?</p> <p>For example</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;header&lt;/div&gt; &lt;div&gt;main &lt;script type="text/javascript" language="javascript"&gt; // print some html here, maybe &lt;a href="http://www.google.com"&gt;google&lt;/a&gt; &lt;/script&gt; &lt;/div&gt; &lt;div&gt;footer&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Where the end results would look like:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt; &lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;header&lt;/div&gt; &lt;div&gt;main&lt;a href="http://www.google.com"&gt;google&lt;/a&gt;&lt;/div&gt; &lt;/script&gt; &lt;/div&gt; &lt;div&gt;footer&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I understand that I can give the containing div and id and then get javascript to insert the anchor take like that, but I just wanted to know if it's possible to do this directly, as in write the html exactly where the javascript is?</p>
javascript jquery
[3, 5]
2,196,318
2,196,319
Setup place-holder for the text-box input[type=" password"]
<p>I am trying to show placeholder text(enter password) for the text-box which has input[type="password"]. Now i am trying to change the <em>input[type="password"]</em> to <em>input[type="text"]</em> to show the placeholder and if the user click the text box i am again changing the <em>input[type="text"]</em> to <em>input[type="password"]</em>. Here it is not working please check script <br/> My <strong><a href="http://jsfiddle.net/sureshpattu/9HagB/3/" rel="nofollow">jsfiddle is here</a></strong></p> <pre><code> function setupPasswordPlaceholder(thisEl) { if('' !== thisEl.attr("alt")) { if('' === thisEl.val()) { thisEl.val(thisEl.attr("alt")); thisEl.removeAttr("type"); thisEl.attr('type','text'); thisEl.css({'font-weight':'normal','font-size':'10pt','color':'#999','font-family': '"lucida grande", tahoma, verdana, arial, sans-serif'}); } thisEl.focus(function() { if(thisEl.val() == thisEl.attr("alt")) { thisEl.val(""); thisEl.removeAttr("type"); thisEl.attr('type','password'); thisEl.css({'color': '#18A505','font-size': '10pt','font-weight':'normal'}); } }); thisEl.focusout(function() { if('' === thisEl.val()) { thisEl.val(thisEl.attr("alt")); thisEl.removeAttr("type"); thisEl.attr('type','text'); thisEl.css({'font-weight':'normal','font-size':'10pt','color':'#999','font-family': '"lucida grande", tahoma, verdana, arial, sans-serif'}); } }); } } $("input[type='password']").each(function(){ setupPasswordPlaceholder($(this)); }); </code></pre> <p>​</p>
javascript jquery
[3, 5]
4,771,392
4,771,393
insert into data base by javascript
<p>i have this code for get rss from other site </p> <pre><code>gfeedfetcher.prototype._displayresult=function(feeds){ var rssoutput=(this.itemcontainer=="&lt;li&gt;")? "&lt;ul&gt;\n" : "" gfeedfetcher._sortarray(feeds, this.sortstring) for (var i=0; i&lt;feeds.length; i++){ var itemtitle="&lt;a href=\"" + feeds[i].link + "\" target=\"" + this.linktarget + "\" class=\"titlefield\"&gt;" + feeds[i].title + "&lt;/a&gt;" var itemlabel=/label/i.test(this.showoptions)? '&lt;span class="labelfield"&gt;['+this.feeds[i].ddlabel+']&lt;/span&gt;' : " " var itemdate=gfeedfetcher._formatdate(feeds[i].publishedDate, this.showoptions) var itemdescription=/description/i.test(this.showoptions)? "&lt;br /&gt;"+feeds[i].content : /snippet/i.test(this.showoptions)? "&lt;br /&gt;"+feeds[i].contentSnippet : "" rssoutput+=this.itemcontainer + itemtitle + " " + itemlabel + " " + itemdate + "\n" + itemdescription + this.itemcontainer.replace("&lt;", "&lt;/") + "\n\n" } rssoutput+=(this.itemcontainer=="&lt;li&gt;")? "&lt;/ul&gt;" : "" this.feedcontainer.innerHTML=rssoutput } </code></pre> <p>then i need to insert title and linke of the new on table on data base this cod by javascript</p>
php javascript
[2, 3]
3,639,037
3,639,038
Changing the cursor in asp.net
<p>I want to change the cursor to an hourglass in my asp.net application to let my users know that the process is running. I searched for an answer and was advised to use javascript as follows. </p> <p>1) Add this javascript</p> <pre><code>function hourglass() { document.body.style.cursor = "wait"; } </code></pre> <p>2) then in my code in the page load event: </p> <pre><code>btnImport.Attributes.Add("onclick", "javascript: hourglass();"); </code></pre> <p>When btnImport is the button they click on</p> <p>However this does not work. But if I add an alert to the hourglass function. it does work. Is there some way to get this to work without the alert.</p> <p>Thanks in advance.</p> <p>Bob Avallone</p>
c# asp.net javascript
[0, 9, 3]
3,951,254
3,951,255
jQuery find() Issue
<p>I have the following Code</p> <pre><code>var page = '&lt;h1&gt;Hello!&lt;/h1&gt;&lt;p&gt;FOO&lt;/p&gt;&lt;span class="username"&gt;this is ur name&lt;/span&gt;&lt;p&gt;sample text&lt;/p&gt;'; </code></pre> <p>when I alert <code>$(page).html()</code> i get Hello! and when I wrap the contents of the page in a div and alert <code>$(page).html()</code> I get the whole html contents.</p> <p>What I am trying to accomplish here is I have a page string with html template and I am trying to find a class <code>username</code> in it and i am getting <code>null</code>.</p> <p>I am confused with this happens</p> <p>Here is a small fiddle of the issue</p> <p><a href="http://jsfiddle.net/6TSuq/1/" rel="nofollow">http://jsfiddle.net/6TSuq/1/</a></p>
javascript jquery
[3, 5]
4,630,204
4,630,205
Inserting empty datarows into a Grid
<p>I am trying to create a gridview where User can insert rows. I am trying to have 10 empty rows in the grid with all the columns empty. Is it possible?</p> <p>User just need to enter into textboxes, so i will have to save all the 10 rows into the database! This is using c# asp.net..</p> <pre><code>&lt;asp:TemplateField ItemStyle-Width="50"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtSpots" runat="server" Text='&lt;%#Eval("Spots")%&gt;' Width="45px"&gt; &lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-Width="180"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtCompanyName" runat="server" Text='&lt;%#Eval("CompanyName")%&gt;'&gt;&lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre>
c# asp.net
[0, 9]
4,091,341
4,091,342
Server.mappath confusion
<p>There is a little confusion in my mind about server.mappath which is correct and what's the difference betwwen these two</p> <pre><code>FileUpload1.saveAs(Server.MapPath("~/User/images/")+"ankush.jpg")); FileUpload1.saveAs(Server.MapPath("~/User/images")+"ankush.jpg")); </code></pre>
c# asp.net
[0, 9]
40,396
40,397
Android - How can i make this intent auto dial
<p>How can I make this intent not only goto the telephont dialer with number, but I don't want to hit the CALL button, I just want it to starting dialing when the intent is started.</p> <pre><code>Intent dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:999-999-9999")); startActivity(dialIntent); </code></pre> <p>Please advise? FlinxSYS</p>
java android
[1, 4]
3,980,315
3,980,316
Adding javascript inside TinyBox2
<p>I am trying to add the following script inside the TinyBox2 ( <a href="http://www.scriptiny.com/2011/03/javascript-modal-windows/" rel="nofollow">http://www.scriptiny.com/2011/03/javascript-modal-windows/</a>) pop-up:</p> <pre><code>&lt;script type="text/javascript" src="http://www.addpoll.com/poll-88331.js" charset="utf-8" id="adpEmbed88331"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href="http://www.addpoll.com/luisp/poll/88331"&gt;Best theme&lt;/a&gt;&lt;/noscript&gt; </code></pre> <p>I am using the 'Ajax - Advanced Functions" TinyBox2. I added text before and after this script in advanced.html and the text shows up in the pop-up as those the "Best theme" link, but the contents of the script (a poll) do not. What can I do?</p> <p>This is how I make the call: </p> <pre><code>&lt;li onclick="TINY.box.show({url:'advanced.html',width:300,height:150})"&gt;Vote&lt;/li&gt; </code></pre> <p>Advanced.html contains:</p> <pre><code>&lt;p&gt;Hi 1&lt;/p&gt; &lt;script type="text/javascript" src="http://www.addpoll.com/poll-88331.js" charset="utf-8" id="adpEmbed88331"&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href="http://www.addpoll.com/luisp/poll/88331"&gt;Best article&lt;/a&gt;&lt;/noscript&gt; &lt;p&gt;Hi 2&lt;/p&gt; </code></pre> <p>I posted this on their support site but never heard back.</p> <p>Thanks,</p>
javascript jquery
[3, 5]
1,599,967
1,599,968
How to clear a Asp.net tree view control in javascript?
<p>How to clear a Tree View control in javascript ? I am looking for something like treeview.nodes.clear();</p>
c# asp.net
[0, 9]
1,733,190
1,733,191
ASP.NET web application
<p>I am trying to make a web application using C# in asp.net. Can someone kindly give me the instructions starting from downloading asp.net including links, if possible to achieve this?</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,544,041
2,544,042
How to uppercase Javascript object keys?
<p>Anyone know a good way to turn this?:</p> <pre><code>var obj = [{key1: value1,key2: value2},{key3: value3,key4: value4}]; </code></pre> <p>into:</p> <pre><code>var obj = [{Key1: value1,Key2: value2},{Key3: value3,Key4: value4}]; </code></pre>
javascript jquery
[3, 5]
896,730
896,731
JavaScript subtract elements from string
<p>I am sending to JavaScript function string from C# which is <strong><em>"11-2-2013"</em></strong>, and expect in JavaScript function that string, but I am gating 11 - 2 - 2013 = <strong><em>-2004</em></strong>.</p> <p>C# code:</p> <pre><code>string id = 11 + '-' + 2 + '-' + 2013; textBoxBO.Attributes.Add("onblur", "TextBoxReset(this," + id + ")"); </code></pre> <p>JavaScript code:</p> <pre><code>function TextBoxReset(txt, ID) { if (txt.value &gt; 0) { var textBoxRR = document.getElementById("ContentPlaceHolder1_txtRR" + ID); textBoxRR.value = 0; } } </code></pre> <p>How to tell JavaScript not to subtract element from that string.</p>
c# javascript
[0, 3]
2,902,019
2,902,020
PHP script for creating calendar table or jquery complete solution required
<p>Ok so this is what I want to make:</p> <p><img src="http://i44.tinypic.com/eiwphl.jpg" alt="alt text"></p> <p>red = booked</p> <p>green = available</p> <p>I have data in mysql in the format of: <code>property_id, booked_from, booked_until</code> .</p> <p>Before I start trying to create the correct loops etc to create and style the table, i thought i best ask if there are already good jquery plugins / php classes create this visual interface and uncluttered enough to allow me to add a select date range method (like Google Analytics)?</p> <p>I'm looking for something to create a basic calendar table on a loop, which i can then style and add jquery features. Though worth asking if there's a complete package that already does what i plan on making?!!</p> <p>(jquery ui's date-picker doesn't look powerful enough / easy enough to modify)</p>
php jquery
[2, 5]
4,634,674
4,634,675
Real-time load result (ajax)
<p>I dont know how write this script. I need load results with some URL (eg: localhost/index.php?action=get&amp;type=29) and this result to give a variable for further processing. I need create this on Jquery. Thanks.</p>
javascript jquery
[3, 5]
898,311
898,312
JavaScript minifier that strips out unused code
<p>Does anyone know of a JavaScript minifer that can detect unused code and strip it out.</p> <p>Google Closure seems alright but it appears to only compact.</p> <p>I'm looking for something much more advanced, where it can look through my JavaScript and not only compact but also remove unused code.</p> <p>Anyone know of such a tool?</p> <p>The use base being, I use very little functionality of JQuery - what I would like to do is remove from the base/core all the bloat that is unneeded from my use.</p>
javascript jquery
[3, 5]
2,124,797
2,124,798
Java math conversion
<p>I have this code in C++</p> <pre><code>float result = -log(result)/0.5231-1.0; </code></pre> <p>And I converted that into Java code like this</p> <pre><code>float result = (float) (-Math.log(result)/0.5231-1.0); </code></pre> <p>Is this correct way to convert the c++ code?</p>
java c++
[1, 6]
4,683,105
4,683,106
How do I detect what invoked a jquery script
<p>Apologies for no code. But I don't have a starting point for this question.</p> <p>I have searched jquery and javascript documentation but I must be using the wrong terms because I am not getting anywhere.</p> <p>I wish to take action within a jquery script dependant on what invoked the script.</p> <p>i.e. I have the same jquery script in several php files. I don't want to create a separate script for each php file. I want to know which php file invoked that script and alter it's behaviour accordingly.</p> <p>It seems like a perfectly reasonable thing to want to do so I am hoping that it is a really easy question.</p>
javascript jquery
[3, 5]
426,048
426,049
Why does .html() method of jQuery not persist using .hover() to push HTML to container?
<p>I'm wondering why in this example: <a href="http://jsfiddle.net/ZdPry/2/" rel="nofollow">http://jsfiddle.net/ZdPry/2/</a> the HTML within the <code>&lt;ul&gt;</code> of the hovered parent item gets pushed to the container I want but on mouseleave and subsequent hovers, no HTML is pushed to the container of the same element that was first hovered. Other elements that are hovered do push the HTML in question but only once, on the first mouseover. I've copied some of the code in question below. </p> <pre><code>$('#superfish-1 li').hover(function(e) { e.stopPropagation(); $('.menuarea').html($('ul', this)).slideDown(); }, function() { // do something else });​ </code></pre>
javascript jquery
[3, 5]
4,811,471
4,811,472
How do I parse xml with jQuery?
<p>What is the jQuery alternative to the following JavaScript code?</p> <pre><code>var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml"); </code></pre> <p>I believe a jQuery alternative would be more cross-browser compatible?</p>
javascript jquery
[3, 5]
395,621
395,622
Jquery to javascript keypress event
<p>I have the following in jquery code:</p> <pre><code>$(document).keypress(function (e) { if (e.keyCode == 13) { } }); </code></pre> <p>How can I make this into javascript so I do not need to load jquery everyime?</p>
javascript jquery
[3, 5]
1,053,507
1,053,508
jsquery get all elements contained by a div with given name
<p>So I'll start off by saying I'm completely new to JS and JSQuery. So I'm in the following situation. The page has a structure like:</p> <pre><code>&lt;div id="id1"&gt; &lt;input name="input1" .... &gt; ..... &lt;/div&gt; &lt;div id="id2" disabled="disabled"&gt; &lt;input name="input1" ....&gt; &lt;/div&gt; ..... </code></pre> <p>So the names of the inputs will repeat themselves, only on different divs and only one div will not be disabled at a given moment. I need to be able to get a input element with a given name from a div with a given ID. My approach after reading a bit:</p> <pre><code>var inputs = $('div[id="' + parent_div +'"] input').filter(function() { return (this.hasOwnProperty('name') &amp;&amp; (typeof this.name != "undefined") &amp;&amp; this.name == component_name); });; for (input in inputs){ alert(inputs[input]); alert(inputs[input].name); } </code></pre> <p>Now I would expect this to return only my given component. However the result is very strange to me as a beginner. The alerts will be return something like the following:</p> <p>objectHTMLInputElement component_name ---- so the first one is the correct one, but after:</p> <p>1 undefined</p> <p>object Object undefined</p> <p>object HTMLDocument undefined</p> <p>div[id="data_modelHR"] input.filter(function () { return (this.hasOwnProperty('name') &amp;&amp; (typeof this.name != "undefined") &amp;&amp; this.name == component_name); }) undefined</p> <p>And this goes on for a while with different functions. Any suggestions?</p> <p>Regards, Bogdan</p>
javascript jquery
[3, 5]
1,443,765
1,443,766
Check if a list contains items in other list
<p>i have two lists.Say</p> <pre><code>list1 ="a,b,c"; list2="d,a,c"; </code></pre> <p>How to check if list1 contains items in list2 .I mean how to check if list2 has a</p>
c# asp.net
[0, 9]
5,414,241
5,414,242
jQuery: Executing multiple actions on the same event on the same element but at two different points in time
<p>We know that multiple calls to $(document).ready(); in the same page is possible. I need something similar for click events.</p> <p>Situation: Another team implemented this somewhere in an external JS file:</p> <pre><code>$('#element').live('click', function() { /* Do this */} ); </code></pre> <p>It's a live() click listener on #element. I cannot modify this code or that file, but I need to take an additional action on the same element on the same event. So, two actions will occur when #element is clicked. In other words, I need this equivalent:</p> <pre><code>$('#element').live('click', function() { /* Do this */} ); /* Some code later... */ $('#element').live('click', function() { /* Add another action */} ); </code></pre> <p>I tried doing the above, but the second call does not fire. It needs to be .live() since #element is being dynamically added.</p> <p>Is there any way to add more actions to the same event on #element? Thanks.</p>
javascript jquery
[3, 5]
3,234,319
3,234,320
How to read excel 2007 in c#
<p>My server does't have any Microsoft Office and I dont want to install Microsoft office. </p> <p>When I use this code for reading an Excel 2007 file</p> <pre><code>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls; Extended Properties="Excel 8.0;HDR=YES"; </code></pre> <p>It cannot read the Excel file. Does anyone know what is wrong?</p>
c# asp.net
[0, 9]
737,108
737,109
"search" field to filter content
<p>I'm trying to create a simple "search field", what it does is it searches if typed in text is equal to any data-attr of the boxes in the content and if so, hide everything but what found, something similar (this ain't working):</p> <p>css:</p> <pre><code>.filter-div { display: none; } </code></pre> <p>html:</p> <pre><code> &lt;label for="search"&gt;Search Input:&lt;/label&gt; &lt;input type="search" name="filter" id="search" value="" /&gt; &lt;div class="filter-div" data-filter="one"&gt;one&lt;/div&gt; &lt;div class="filter-div" data-filter="two"&gt;two&lt;/div&gt; &lt;div class="filter-div" data-filter="three"&gt;three&lt;/div&gt; &lt;div class="filter-div" data-filter="four"&gt;four&lt;/div&gt; &lt;div class="filter-div" data-filter="five"&gt;five&lt;/div&gt; </code></pre> <p>jquery:</p> <pre><code> // save the default value on page load var filter = $('.input').val(); // on submit, compare if ( $('.input').val() = $("data-filter") { $(this).show(); } ​ </code></pre> <p>I am also not sure if the content should be filtered with a button click or found content should pop up as click-able text in the search, or should all happen auto? Finally probably I will have to check it against more than one data-attr.</p> <p>Anyone?</p>
javascript jquery
[3, 5]
2,478,793
2,478,794
How to get values from database, and insert inside javascript function
<p>i have my facebook share scritp:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ $('#share_button').click(function(e){ e.preventDefault(); FB.ui( { method: 'feed', name: 'This is the content of the "name" field.', link: ' http://www.hyperarts.com/', picture: 'http://www.hyperarts.com/external-xfbml/share-image.gif', caption: 'This is the content of the "caption" field.', description: 'This is the content of the "description" field, below the caption.', message: '' }); }); }); &lt;/script&gt; </code></pre> <p>But, i want to get the values of "name", "link", "picture" and others from a database, maybe an simple access mbd file. I will use Classic ASP for the conection with this database...</p> <p>There is a way to do that?</p>
javascript jquery
[3, 5]
3,391,735
3,391,736
Why Viewstate can contain only serializable object?
<p>I have a simple class with some properties and other data. Untill i stick serializable attribute to the class, i cannot save the object of the class into the viewstate.</p> <p>Why Viewstate can contain only serializable objects?</p>
c# asp.net
[0, 9]
606,721
606,722
Dynamically creating controls inside a repeater
<p>I have 2 Drop down controls inside a repeater and i have to repeat those with a button click how can i achieve it??</p> <pre><code>if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { TextBox t = new TextBox(); t.ID = e.Item.ItemIndex.ToString(); e.Item.Controls.Add(t); } </code></pre> <p>is this is the correct way but how can i find the button inside a repeater and fire it.</p>
c# asp.net
[0, 9]
4,702,883
4,702,884
how to convert the data stored in string to string array
<p>I'm parsing an url using json. I'm getting the value of each tag and storing it in a string using <code>getString</code> in a <code>for</code>-loop. </p> <p>What I want is to store the <code>String</code> value into a <code>String</code> array. I'm a noob as far as android development is concerned.</p> <p>Below is the code:</p> <pre><code>JSONObject json = JsonFunctions.getJSONfromURL("http://www.skytel.mobi/stepheniphone/iphone/stephenFlickr.json"); try { JSONArray boombaby=json.getJSONArray("items"); for(int i=0;i&lt;boombaby.length();i++) { JSONObject e = boombaby.getJSONObject(i); mTitleName=e.getString("title"); String mTitleImage=e.getString("image"); } } </code></pre>
java android
[1, 4]
1,431,685
1,431,686
jQuery: .each how to reference matched object
<p>how do i get a reference to the element that matched? 'this' is not correct. </p> <p>For example here I am trying to alert with the elements value.</p> <pre><code>//how do i get this to reference the object it matches. $("#txtFirstName,#txtLastName,#txtDOB").each( function() { alert(this.val()); } ); </code></pre>
javascript jquery
[3, 5]
3,454,512
3,454,513
recursive jquery function and check afterwards
<p>I deploy two functions on my gallery page. One to display -one by one- the list items with images, and two to check and remove those items where the images (external) won't load. </p> <p>The first one works excellent, but the second does not. Can't figure out why. Does anyone knows this one?</p> <pre><code>var r = 0, selector = "ul.display li:hidden:first"; function fadeIn($item) { $item.fadeIn(200, function() { var n = $(selector); if (n.length &gt; 0) { fadeIn($(selector)); } else { // add a div $(".navigate").show("fast"); $("#downunder").show("slow"); } }) } fadeIn($(selector)); function myFunc() { $("ul.display li img").each(function(index) { if ((!this.width || !this.height)) { pos3 = $(this).attr("id"); reportrefcam(); $(this).parent().parent().remove(); } $(this).error(function() { pos3 = $(this).attr("id"); reportrefcam(); $(this).parent().parent().remove(); }); }); }; myFunc(); </code></pre>
javascript jquery
[3, 5]
1,954,503
1,954,504
Javascript parseInt always returns NaN
<p>Can someone tell me why my <code>parseInt</code> function always retuns <code>NaN</code> in the Firebug console despite the string value always returns a number?</p> <p>This is my debug script:</p> <pre><code>console.log($(this).val()+" - "+typeof($(this).val())+" - "+parseInt($(this).val)); </code></pre> <p>Which yields:</p> <pre><code>1 - string - NaN 2 - string - NaN 5 - string - NaN </code></pre>
javascript jquery
[3, 5]
2,272,081
2,272,082
How to use content place holders with dynamic master page
<p>I have written a content system which allows a user to edit pages for a website. When they edit a page they can select a template to use for the page. All of the content and selections are in a database.</p> <p>When I display a page, I call just one file (DisplayPage.aspx), passing the page ID. This uses the page ID to select the chosen template, to display the page.</p> <p>Each template has it's own set of content placeholders, some are common amongst all the templates and some are unique for that template. My question is, how can I reference and populate all of the content placeholders for a template, given that the master page is chosen dynamically and the amount / names of the placeholders will be different.</p>
c# asp.net
[0, 9]
2,813,619
2,813,620
Creating a "fake AI" chat program
<p>Hey everyone, I've been creating a little chat bot (for fun and practice).</p> <p>I have the following function which isn't working correctly (<a href="http://jsfiddle.net/hNUej/" rel="nofollow">FULL CODE HERE</a>):</p> <pre><code>function runAI() { if (i.val().length &gt; 0) { if ($.inArray(i.val(), helloInputArray)) { r = Math.floor(Math.random()*4); o.html(o.html()+helloOutputArray[r]); i.val(''); i.focus(); } else if ($.inArray(i.val(), byeInputArray)) { r = Math.floor(Math.random()*4); o.html(o.html()+byeOutputArray[r]); i.val(''); i.focus(); } else { o.html(o.html()+"I don't know what that means...&lt;br /&gt;"); i.val(''); i.focus(); } } } </code></pre> <p>It always seems to return the <code>helloOutputArray</code>...</p>
javascript jquery
[3, 5]
3,993,544
3,993,545
Finish threads in the order in wich they were started
<p>I am downloading simultaneously several images in separate threads.I need to set these images to adapter. I need to finish these threads in the order in which they were started because I am using callbacks to inform adapter and.... How can I do this(finish threads in the order in which they were started)?</p>
java android
[1, 4]
502,313
502,314
Difference between .jar and .dll file
<p>I am learning Java these days and I've spent a lot of time with .NET so when I want to export or import libraries, they are usually be in .dll format which is called assembly in .Net environment and they are compiled to IL and they can have resources like images, xml, audio and son on, any ways.</p> <p>I am wondering same process in Java as well. I've read documents but they actually confused me little bit and to clarify things out I need your help guys.</p> <p><strong>Questions:</strong></p> <ol> <li>.NET Assembly is same thing as java .jar?</li> <li>.dll contains compiled IL code and .jar contains complied .class/byte code files?</li> <li><p>They say resources, what kind of resources we are talking about here? Images, .txt files, etc. or all of them possible?</p></li> <li><p>I've examined AWS (Amazon Web Service API for java) and I saw three .jar file and they are </p> <ol> <li>aws-java-sdk-1.1.1.jar</li> <li>aws-java-sdk-1.1.1-javadoc.jar</li> <li>aws-java-sdk-1.1.1-sources.jar</li> </ol></li> </ol> <p>and they contain .class files - java documentation in html format and .java files which are still not compiled. So then I've realized .jar doesn't just include compiled byte codes (.class) and also other things.</p> <ol> <li>When I want to import java libraries, will I always need to import .jar files?</li> <li>When I want to export my own java libraries, should I need to export in .jar file.</li> </ol> <p>Thanks for help in advance.</p>
c# java
[0, 1]
2,760,902
2,760,903
paypal sandbox processing error-
<p>Over the weekend, our paypal sandbox environment used in our asp.net application suddenly stopped working. It had begun returning a <code>Could not create SSL/TLS secure channel.</code> error when attempting to simulate a customer charge, on the <code>GetTransactionDetails</code> call (which is after the actual charge occurs). </p> <p>I thought that perhaps the test API signature expires or something, so I went and reset our test account on the API website, and got new api values. </p> <p>Now, when attempting to simulate a customer charge, I get a <code>10001 internal exception</code> on <code>DoReferenceTransaction</code>, where the actual charge occurs, and cannot even reproduce the ssl error. </p> <p>I have verified that the sandbox username, password, and signature are correct, and that the test credit card numbers are valid, and of course that the environment is set to sandbox.</p> <p>I have also verified that the test account is set up as a verified seller. Did anything change that could cause all these sudden problems?</p> <p>Our live payments still work, but this greatly affects our testing environment. </p>
c# asp.net
[0, 9]
519,547
519,548
How to extract a specific input field value from external webpage using Javascript
<p>i get the webpage content from an external website using ajax but now i want a function which extract a specific input field value which is already autofilled.</p> <p>the webpage content is like this:</p> <pre><code>......... &lt;input name="fullname" id="fullname" size="20" value="David Smith" type="text"&gt; &lt;input name="age" id="age" size="2" value="32" type="text"&gt; &lt;input name="income" id="income" size="20" value="22000$" type="text"&gt; ......... </code></pre> <p>I only want to get the value of <code>fullname</code>, maybe with some javascript regex, or some jQuery dom parser, i know i can do it easily with php but i want it using Javascript or jQuery.</p> <p>Note: this inputs are not hosted in my page, they are just pulled from other website through Ajax.</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,867,898
4,867,899
calling php on js
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7165395/call-php-function-from-javascript">Call php function from javascript</a> </p> </blockquote> <p>can anyone help me on how can I call the php function on JS function?</p> <p>Here is the event:</p> <p>I have 2 selection box (e.g projects and task) when selecting on project selection box, the task selection box will be populated. values populated on the task selection box is in my PHP DAO.</p> <p>Here is my javascript but it doesn't work but my idea is like that</p> <pre><code>function getProjTask() { var taskList = &lt;?php $projTask-&gt;getProjectTask("ProjectName"); ?&gt; //values for task selection box has been populated here } </code></pre>
php javascript
[2, 3]
1,587,639
1,587,640
Need help on architecting iPhone/Android App
<p>Could someone please help me with how should I go about architecting a iPhone or Android application? I am into enterprise java development for many years and have architected many solutions in it. However, I have never been involved with mobile development. I have a good application idea that I would like to implement. My initial thought is, I am looking to utilize db + NoSQL, implement services and want to have iPhone/Android app make calls to the web services for different needs.</p> <p>How should I architect this? Any pointers to help me started on it? Most of the search I am doing online is all about gaming in iPhone/Android and I am not able to find any solid pattern/architecture that would guide me on how to implement. Could anyone please help?</p> <p>Also, is there any good link for implementing enterprise applications on iPhone and Android?</p>
java iphone android
[1, 8, 4]
2,209,361
2,209,362
javascript to click a row and fire off that rows "onclick" event
<p>I have a table:</p> <pre><code>&lt;table&gt; &lt;th&gt;Title&lt;/th&gt; &lt;th&gt;Artist&lt;/th&gt; &lt;th&gt;Length&lt;/th&gt; &lt;tbody&gt; &lt;?php foreach ($lib as $name) { echo "&lt;tr onmouseover=\"ChangeColor(this, true);\" onmouseout=\"ChangeColor(this, false);\" onclick=\"dispSong('".$name-&gt;title. "','".$name-&gt;url."', this);\"&gt;&lt;td&gt;".$name-&gt;title."&lt;/td&gt;&lt;td&gt;".$name-&gt;artist."&lt;/td&gt;&lt;td&gt;".$name-&gt;time."&lt;/td&gt;&lt;/tr&gt;"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>In javascript I can find the next row:</p> <pre><code> function dispSong(theSong, url, elem) { document.getElementById('currSong').innerHTML = theSong; row = elem.rowIndex; var song = document.getElementById('mp3'); song.src = url; song.load(); } function nextSong() { if (row == null) row = 1; else{ alert(row+1); } document.getElementById('tr')[row].click; var song = document.getElementById('mp3'); alert(song); song.src = url; song.load(); } </code></pre> <p>I have a button called next that calls the nextSong function when it is clicked. I am wondering if I can some how programatically click the next row when the next button is pressed.</p>
php javascript
[2, 3]
896,200
896,201
why is my jquery selecting all text values
<p>So I want to be able to fetch a number from a table cell and multiply it by an input on focusout, however the selector is grabbing all the table cells with the name front in the front. here is the code:</p> <p>jquery</p> <pre><code>$(document).ready(function(){ $(".percent").focusout(function(){ var val2 = $(this).val(); if (val2==="") { val2=0; } var crew2 = $(this).attr("name"), front = $(".front, td[name='front"+crew2+"']").text(); console.log(crew2); console.log(front); }); }); </code></pre> <p>html:</p> <pre><code>&lt;tr&gt; &lt;td class='front' name='frontI210'&gt;$176.00&lt;/td&gt; &lt;td&gt;&lt;input type='text' class='percent' name='I210' style='' size='4' /&gt;&lt;/td&gt; &lt;td&gt;=&lt;/td&gt; &lt;td class='total' id='I210'&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='front' name='frontI250'&gt;$225.00&lt;/td&gt; &lt;td&gt;&lt;input type='text' class='percent' name='I250' style='' size='4' /&gt;&lt;/td&gt; &lt;td&gt;=&lt;/td&gt; &lt;td class='total' id='I250'&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>and console.log(front) is returning all the text of fronti210 and fronti250 as such:</p> <pre><code>$176.00$225.00 </code></pre> <p>I want to only receive the information from the table cell that matches the input field name i just finished with, how do i do that?</p>
javascript jquery
[3, 5]
3,484,597
3,484,598
Span manipulation in jQuery
<p>Can you please explain the term "span manipulation: in jQuery and give a small example?</p>
javascript jquery
[3, 5]
3,474,426
3,474,427
Specific Button Click
<p>I got a quick question:</p> <p>I want every link in the div to alert a message, but only the anchors. I dont want the div to initiate the alert function. </p> <p>Html:</p> <pre><code>&lt;div id="abc"&gt; &lt;a href='#'&gt; Button 1 &lt;/a&gt; &lt;a href='#'&gt; Button 2&lt;/a&gt; &lt;/div&gt; </code></pre> <p>Javascript:</p> <pre><code>$(document).ready(function(){ $('#abc').click(function(){ alert('a'); }); }); </code></pre> <p>How do I modify the above code?</p>
javascript jquery
[3, 5]
2,278,196
2,278,197
"on" event not firing with dynamic content
<p>I have the below code which using jquery <em>on</em> event.</p> <pre><code> $(document).on('click', 'a.test', function (event) { alert(''); }); </code></pre> <p>My issue is that this is not firing for the content which is added dynamically via ajax:</p> <pre><code>$.ajax({ url: ..., ... .. success: function(response) { var dom = $(response.d.html); myContainer.html(dom.find('#ajaxcontainer')); } }); </code></pre> <p>Can you help me fixing this? I am using jquery.1.7.2.min.js</p>
javascript jquery
[3, 5]
4,755,099
4,755,100
Open 2 URLs on click from option select
<p>In my form there is a drop down list, and on button click I need to open 2 URLs, if user select option 1 then after button click a thank you page appear and another URL should be open.</p> <p>I am able to open only one URL at current time. Please have a look at my fiddle.</p> <p><a href="http://jsfiddle.net/ty65E/5/" rel="nofollow">http://jsfiddle.net/ty65E/5/</a></p> <p>In addition in my page there are few buttons and I want they should initally disabled so they don't worj anymore. and I want to force user to fillup the form first then only he can access the other buttons.</p> <p>Guys thanks for your Support.</p>
javascript jquery
[3, 5]
1,818,789
1,818,790
dynamic collection of text from text field
<p>this is html code</p> <pre><code>&lt;div id="domTxtEntry"&gt; &lt;strong&gt;Your Name:&lt;/strong&gt; &lt;input type="text" name="txtdisplay" id="txtdisplay" value="" class="input" /&gt; &lt;br /&gt; &lt;br /&gt; &lt;div id="domPrv"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>this jquery code</p> <pre><code>$(document).ready(function () { var nameNode = $('#domPrv'), name = $('#txtdisplay'); //comment...easy $('#domTxtEntry input').bind('blur keyup', function () { //name if ($('#txtdisplay').val()) { nameNode.text(name.val() + ' modifies this'); } }); }); </code></pre> <p>this is here in this fiddle. <a href="http://jsfiddle.net/qSq37/1/" rel="nofollow">http://jsfiddle.net/qSq37/1/</a></p> <p>two problems</p> <ol> <li>on deletion of values from textfield the output windows does not update it or leaves at the last word.</li> <li>i tried many things to add the output to float on the right of the text field but it is displayed at the bottom of the text field.</li> </ol> <p>Help needed.</p>
javascript jquery
[3, 5]
5,541,670
5,541,671
How can I show the image when the mouse hovers in an image?
<p>I am trying to find a way using jQuery and fancybox to show a picture when the mouse hovers on it. I know that there is the .hover but don't know how to use it.</p> <p>This is how I show the image on click.</p> <pre><code>$("a#single_image").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over' }); </code></pre>
javascript jquery
[3, 5]
3,701,149
3,701,150
Download txt file make app crash
<p>I try to download file from the internet with this method:</p> <pre><code>try { URL url = new URL("http://sites.google.com/site/androidersite/text.txt"); BufferedReader in =new BufferedReader(new InputStreamReader(url.openStream())); String str; while ((str = in.readLine()) != null) { newline character(s) } in.close(); } catch (MalformedURLException e) { } catch (IOException e) { } </code></pre> <p>I also update my Android Manifest and add this lines:</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt; </code></pre> <p>and the app crash in this line :</p> <pre><code>BufferedReader in =new BufferedReader(new InputStreamReader(url.openStream())); </code></pre> <p>and popup a log file that wrote: <code>Source not found</code></p>
java android
[1, 4]
2,137,925
2,137,926
Dot Net Charting - Stack two series, leave the other as normal bar chart
<p>I have a dotnetcharting graph with 3 series. I can change the style of the whole graph to stacked.</p> <pre><code>ChartIn.YAxis.Scale = Scale.Stacked; </code></pre> <p>But I want to just stack two out of the three series. So that for each there are two bars combined into one stack with another whole bar next to it.</p> <p>Can this be done?</p>
c# asp.net
[0, 9]
3,799,766
3,799,767
make changes to html before append with jquery
<p>I m calling a page using ajax and making changes to it using jquery</p> <p>but the changes are not reflected after appending(append) it to a div</p> <p>as the changes are done to the html but the html var remains the same.</p> <p>how do i make the changes to the html var and then append to the DOM</p> <p>if i use the code directly to the DOM then there will be changes in the previous elements in the DOM</p> <p>the code</p> <pre><code>$.ajax({ type: "POST", url: 'more_images.jsp', data: ({uid:uid, aid:aid, imgid:imgid}) , cache: false, success: function(html) { html = $.trim(html); $(html).filter('.corner-all').corner('5px'); $(html).filter('ol.c_album &gt; li .img_c').corner('3px'); $(html).filter("ol.c_album &gt; li ").find('a').attr('target', '_blank'); $('#images_list').append(html); } }); </code></pre> <p>thanks</p> <p>Pradyut</p>
javascript jquery
[3, 5]
841,769
841,770
De-Anonymizing an Anonymous Function in jQuery
<p>This is probably quite a simple problem, but it's causing me to scratch my head, so I'm posting it here.</p> <p>I have some jQuery in the following form:</p> <pre><code>if (jQuery('.SearchRegions:checked').length == 0) { jQuery('.SearchRegions').each(function(){ //code }); } else { jQuery('.SearchRegions:checked').each(function(){ //the same code }); } </code></pre> <p>Obviously it seems ridiculous to repeat a big block of code inside each of these functions. But when I tried to name and move the function, it all seemed to break down - perhaps because of issues with scope and/or jQuery(this) inside the function no longer referring to the same object?</p> <p>Can anyone help me by posting a general idea of what my code should look like? (Or any other optimisings or recastings to make it work would be much appreciated!)</p>
javascript jquery
[3, 5]
3,181,692
3,181,693
How to Re-Direct from Jquery modal pop up to the different page in a parent's frame
<p>I have a problem where I have one page containing a login link. When selected I'm opening a Jquery modal pop up(color box) containing a login page. </p> <p>In login page a login control is placed and on successful login it should redirect to Home page. But currently when i successfully login to the application the new page is opening in the modal pop up itself. </p> <p>Is there any solution to open the page in the same window of the parent of modal pop up?</p>
c# jquery asp.net
[0, 5, 9]
3,673,907
3,673,908
javascript iframe trouble
<p>After adding iframe tag in html of dashcode(web application IDE for iphone), i am getting an error which says "For Security reasons framing is not allowed"</p>
javascript iphone
[3, 8]
2,243,410
2,243,411
what is the difference between $(document).ready(initialize) and $(document).on('ready',initialize)
<p>what is the difference between: </p> <pre><code> $(document).ready(initialize); </code></pre> <p>and </p> <pre><code> $(document).on('ready',initialize); </code></pre> <p>To me they seem to work in the same way.</p>
javascript jquery
[3, 5]
722,494
722,495
How do i get attribute values from html inputs?
<p>I have a radio button that looks like this:</p> <pre><code>&lt;input class="MCQRadio" id="MCQ" mcq-id="1" name="MCQ" question-id="1" type="radio" value="MCQ" /&gt; MCQ </code></pre> <p><strong>[EDIT]</strong></p> <p>When i click the radiobutton, and several radio buttons have the same class name, how do i retrive the question-id value and mcq-id value from the specific button? Preferably with jQuery. </p> <p>I have already set up a click handler like this:</p> <pre><code>$(document).ready(function () { $('.MCQRadio').click(function () { </code></pre>
javascript jquery
[3, 5]
3,494,729
3,494,730
NumberFormatException error from String to integer
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/13638938/string-to-integer-convertion">String to integer convertion</a> </p> </blockquote> <p>For one of my project I have to pass ineger value in this format "16:45:10". this format is in String. I am converting this to ineger like <code>int i = Integer.parseInt(string)</code> but it;s giving me error saying NumberFormatException error;</p> <p>How to solve this.</p> <p>Thanks</p>
java android
[1, 4]
2,347,624
2,347,625
Why should $.click() be enclosed within $(document).ready()?
<p>I am going through <a href="http://docs.jquery.com/How_jQuery_Works" rel="nofollow">http://docs.jquery.com/How_jQuery_Works</a> and find the requirement of enclosing <code>$.click()</code> event in <code>$(document).ready()</code> even a little strange. My difficulties are as follows:</p> <ul> <li>When the document loads, the control will enter <code>$(document).ready()</code> function but will it proceed to execute <code>$.click()</code>? (Based on the behavior it wouldn't. But when the control enters a normal function, why wouldn't it enter <code>$.click()</code> function?)</li> <li>Since the user can see the url only after the document is ready, is it really required to embed <code>$.click()</code> within <code>$(document).ready()</code>?</li> </ul>
javascript jquery
[3, 5]
288,887
288,888
jQuery: On document load check if checkbox is selected and do function
<p>I have few <code>&lt;li&gt;</code>'s with a checkbox on each <code>&lt;li&gt;</code> which the value of it is saved into a database. On document load, the <code>&lt;li&gt;</code>'s that have the checkbox selected, I want to add a class <strong>'.done'</strong>.</p> <p>I tried this:</p> <pre><code>if (currentTODO.find('.status').is(":checked")) { currentTODO.find('.text').addClass("done"); alert('Test.'); } </code></pre> <p>but it works only if it used under click function, mousemove etc but not on document load. Also, If I have that piece of code under on Document load, nothing else works. </p> <p>I hope someone can help me out.</p> <p>Thanks alot</p>
javascript jquery
[3, 5]
411,886
411,887
Do I use fadeIn() wrong?
<p>Looking at <a href="http://api.jquery.com/fadeIn/" rel="nofollow">fadeIn()</a> I get the impression that I just have to add <code>.fadeIn("slow")</code> to an element like so</p> <pre><code>$('#template').tmpl(data).prependTo('#content').fadeIn("slow"); </code></pre> <p>but it appears instantaneously and doesn't even give an error.</p> <p>It can be seen here</p> <p><a href="http://jsfiddle.net/HYLYq/8/" rel="nofollow">http://jsfiddle.net/HYLYq/8/</a></p> <p>Any idea what's wrong?</p>
javascript jquery
[3, 5]
655,962
655,963
Difference between object and function object | How to test for?
<p>See this fiddle for a good example of a function object and the object that <code>$()</code> returns.</p> <p><a href="http://jsfiddle.net/tFhFD/3/" rel="nofollow">http://jsfiddle.net/tFhFD/3/</a></p> <p>Reference:</p> <p><a href="http://code.jquery.com/jquery-latest.js" rel="nofollow">http://code.jquery.com/jquery-latest.js</a></p>
javascript jquery
[3, 5]
21,179
21,180
Update panel and jQuery
<p>I have a paged data-source in an update panel. I have it set up that when i click a next button the next page is returned via a partial post-back. The problem is that i am using the dreaded moo-tools lightface's / update-panel combo. Using this, the update panel and moo-tools wont work.</p> <p>Is there some way around using the update panel, like some sort of jQuery Ajax paged data source?</p> <p>I hope i have been clear and someone can help.</p> <p>Thanks</p>
jquery asp.net
[5, 9]
3,075,676
3,075,677
How to timestamp with jQuery based off user's selection
<p>I'm attempting to produced a timestamp based off user's selection.</p> <p>I have a form with an input value that will be empty:</p> <pre><code>&lt;input type="hidden" name="sub_enddate" value=" " /&gt; </code></pre> <p>I need to have the empty value filled in with a time stamp based a certain value of time in the future off a user's selection:</p> <pre><code>&lt;select name="Membership Duration"&gt; &lt;option value=""&gt;Select A Membership Duration&lt;/option&gt; &lt;option class="6" value="6 Months"&gt;6 Month Membership&lt;/option&gt; &lt;option class="3" value="3 Months"&gt;3 Month Membership&lt;/option&gt; &lt;option class="1" value="1 Months"&gt;1 Month Membership&lt;/option&gt; &lt;/select&gt; </code></pre> <p>The format will be the following: 20110325 (2011-03-25). So if the user chooses from the drop down menu:</p> <ul> <li>"6 Month Membership" the value in the hidden input field will be: 20110925 (6 months in the future from today, March 25th, 2011).</li> <li>"3 Month Membership" the value in the hidden input field will be: 20110625 (3 months in the future from today, March 25th, 2011).</li> <li>"1 Month Membership" the value in the hidden input field will be: 20110425 (1 month in the future from today, March 25th, 2011).</li> </ul>
javascript jquery
[3, 5]
5,892,946
5,892,947
ASP.NET Page_Unload to stop user from leaving page
<blockquote> <p><strong>Possible Duplicate:</strong><br /> <a href="http://stackoverflow.com/questions/147636/best-way-to-detect-when-user-leaves-a-web-page">Best way to detect when user leaves a web page</a> </p> </blockquote> <p>I'm attemping to give a user the option to stay on the current page when they attempt to navigate away from it (if they have not saved changes to their progress). I'm unsure how to approach this as I have tried and failed JavaScript.</p> <p>I'm hoping there is a way inside the Page_Unload function in ASP.NET C# code.</p> <p>any help would be much appreciated.</p>
c# asp.net
[0, 9]
1,278,859
1,278,860
How to call an action after click() in Jquery?
<p>I want to load an image and some other actions after I click a certain DOM element, but I want to load them AFTER the clicking action finished.</p> <p>Here is a code example:</p> <pre><code> $("#message_link").click(function(){ if (some_conditions...){ $("#header").append("&lt;div&gt;&lt;img alt=\"Loader\"src=\"/images/ajax-loader.gif\" /&gt;&lt;/div&gt;"); } }); </code></pre> <p>The problem is that the if condition executes before the click action have finished(Or at least that is my impression). I need that the If condition executes after the click action has finished. Can some one please tell me a solution?</p> <p>Thanks :)</p>
javascript jquery
[3, 5]
2,352,108
2,352,109
response.redirect giving bad request
<p>I have a simple Jquery dialog box, that dialog contains a button which sends the page to the server. After some checking, the server redirects the page to another page. </p> <p>When I call response.redirect(url+params), it appends the HTML in the URL and displays a bad-request on the browser.</p> <p>What am I doing wrong here?</p> <p>I don't have any update panels or non-asp controls on the page.</p> <p>I am not sure if its important but I am using .Net 1.1</p> <p>Edit: Sorry guys, I just found the bug, I was sending the page to the server using ajax call, and the querystring had two "?". Thanks all. </p> <p>Thanks, Ali</p>
jquery asp.net
[5, 9]
3,454,188
3,454,189
How do C++ and Java communicate with each other?
<p>Is there any program/software which uses both C++ and Java?</p> <p>If so the how do they communicate with each other?</p> <p>The theory and the program please.</p> <p>Example: Supposing I want to run a C++ file with a Java applet or something like that.</p>
java c++
[1, 6]
2,582,632
2,582,633
jQuery: trying to retrieve an object by it's ID string
<p>I have five $_POST hidden fields in my form that hold the id's names of the icons the user has chosen. I want to make these icons marked back again if the user goes back to the page. I don't seem to understand how to do this, (marked as PROBLEM).</p> <pre><code>var i=0; while($('#field' + i + 1 + '_icon_id').val() != '') { $('img.selectable').filter(function() { // PROBLEM IS HERE (I THINK) return $(this).attr('id') == $('#field' + i + 1 +'_icon_id').val(); }).css('border','3px solid ' + BLACK_COLOR); i++; } </code></pre> <p>Besides, could anyone give me some advice as for how do I go about investigating my jQueries ? Can these be debugged ?</p> <p>Thanks in advance !!</p>
javascript jquery
[3, 5]
4,706,061
4,706,062
Get textbox value in a GridView templatefield using Jquery
<p>I am using a text box inside a GridView as ItemTemplate field. I have a requirement to get the value of the text box usingJquery. How can I do that? How can I get the textbox object under a GridView in Jquery. </p> <p>Thanks in advance</p>
javascript asp.net jquery
[3, 9, 5]
1,026,547
1,026,548
open and close or return if already open nav
<p>I have a nav which on a click i expand it, but if it's already expanded and we click on the item again it shouldn't do anything (return). I have this code but it is not working properly, currently if I click on the item it expands it but if i click again it closes the nav and if i click once again it expands it but it behaves funny. I basically only need to be able to click and open and do nothing if already opened as I will have a close button anyway. p.s. "item" is a var i defined before in the code.</p> <pre><code>var item = $(".nav a"); &lt;div class="nav"&gt; &lt;a href="#"&gt;Trigger&lt;/a&gt; &lt;div class="wrapSubContent"&gt; &lt;div class="wrapNavtoShowHide"&gt; ..content.. &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; item.click(function(e) { e.preventDefault(); $(".wrapSubContent").slideToggle("slow", "linear", function(){ $(".wrapNavtoShowHide").slideToggle("slow", "linear"); }); }); </code></pre> <p>Anyone?</p>
javascript jquery
[3, 5]
1,900,073
1,900,074
How to get a table cell value from another site (same domain) using jquery/js?
<p>I am looking for a very similar solution described under Q: How to get a table cell value using jquery? but in case where table is actually on another website within same domain (no server side scripting is available).</p> <p>I will appreaciate your help.</p>
javascript jquery
[3, 5]
3,179,264
3,179,265
How do I fill and submit a form remotely?
<p>How can I fill out and submit this form remotely: <a href="http://mta-nyc.custhelp.com/cgi-bin/mta_nyc.cfg/php/enduser/ask.php" rel="nofollow">http://mta-nyc.custhelp.com/cgi-bin/mta_nyc.cfg/php/enduser/ask.php</a></p> <p>The form asks for email and then it has a pull down menu and fields for Subject and Question.</p> <p>Clicking the Next button takes you to a new page and in that page you click submit.</p> <p>Can I fill this form and submit with one click from my site? </p> <p>I will have a form in my site where the user will fill out his email and I will have pre-populated fields for Subject and Question and when the user will click the submit button the remote form will be filled and submitted.</p> <p>How can I do this (with python and javascript)?</p>
javascript python
[3, 7]
225,612
225,613
ASP.Net masterpage Response.Redirect before child call
<p>I have a masterpage and inside that masterpage I have to check if a session is null or not. If the session is null, then there has to be a redirect to a login page.</p> <p>That is no problem, but the problem is that the masterpage also have controls using the session and the child also uses the session so I get a nullreferenceexception.</p> <p>I now have this:</p> <pre><code>protected void Page_init(object sender, EventArgs e) { var session = (ServiceSession)Session["serviceSession"]; if (session == null) { Response.Redirect("login.aspx", false); } } </code></pre> <p>But the problem is that the controls on the masterpage are also called instead of redirecting immediatly.</p> <p>So the main question:</p> <p>How can I redirect immediatly, without loading further things. Because the page_init gets called as first method the redirect should solve my nullreferenceexception, but than I don't need to load all components etc.</p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
5,800,836
5,800,837
pdf download functionality asp.net
<p>I am making a web site in asp.net with c sharp. I need to place a download file functionality(pdf, doc, xls) on one of my web page.</p> <p>How can I do that?</p>
c# asp.net
[0, 9]
5,552,210
5,552,211
jQuery response is text string. How do I make this a PHP variable?
<p>I am using a file upload utility that renames files on the backend, then I use a jQuery script to append the file path to a div. </p> <pre><code>'onComplete': function(event, queueID, fileObj, response, data) { $('#filesUploaded').append(''+response+''); } </code></pre> <p>I want to take this response and turn it into a PHP variable that I can use with a form submission. Any assistance is greatly appreciated.</p>
php jquery
[2, 5]
6,013,168
6,013,169
Access String Resource in AppWidget?
<p>Normally, I'd do getString(R.string.myString), however it doesn't seem to work in a widget.</p>
java android
[1, 4]
1,138,989
1,138,990
How JS file can be download programatically
<p>most of the time we include script tag in html head tag. like</p> <pre><code> &lt;Head&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; </code></pre> <p>i want that i dont want to include js file path rather i need to download js programatically by jquery. like i will download js file programatically from <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" rel="nofollow">http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js</a> and check if the file can not be download or does not exist then i will download the same file from my site like www.my-site.com/js/1.5.2/jquery.min.js.</p> <p>please help me to do it using jquery.</p>
javascript jquery
[3, 5]
4,367,544
4,367,545
nodes of network connected in a mesh
<p>how do we write a code for "n" nodes which are connected in a mesh network(nxn). </p> <p>I appreciate your effort for the help.</p> <p>Thank you.</p>
java c++
[1, 6]
1,318,979
1,318,980
Is it possible to append 2 jQuery objects?
<p>For example, here i get an error </p> <pre><code>jQuery([jQuery('&lt;td/&gt;').text('Component'), jQuery('&lt;td/&gt;').text('Value')]).appendTo(my_table) </code></pre> <p>Is it possible append two element to <code>my_table</code> object with one action?</p> <p>Also FYI</p> <pre><code>var my_table = jQuery('&lt;table/&gt;').attr({'class': 'table table-hover table-bordered', 'id': 'parse-result'}); </code></pre>
javascript jquery
[3, 5]
4,170,965
4,170,966
Double loop in JQuery Statement
<p>I have this following Jquery code in my website, </p> <pre><code> $("#nav-tabs").on("click", "a", function(e) { e.preventDefault(); $(this).tab('show'); }); var counter = 1; $('.plus').click(function(e) { if(counter &lt;= 3){ $('#nav-tabs').append('&lt;a href="#tab' +&lt;/button&gt;&lt;/a&gt;&lt;/li&gt;'); } else { alert("Only 3 Tabs Allowed!")}; $('.tab-content').append('&lt;div class="tab-pane" id="tab' + counter + '"&gt;&lt;/div&gt;'); if (counter &lt;= 3) { counter++; } else {}; $('.close').click(function(e) { var panelId = $(this).closest("li").remove().attr("aria-controls"); $("#tab" + panelId).remove(); if(counter &lt; 1){ counter = 1 }else if (counter &gt;= 1) { counter--; } else if (counter == 0) { counter = 1 }; }) }); </code></pre> <p>My question is once i click .close instead of going once in the function, it again repeats itself an decrements my counter...</p>
javascript jquery
[3, 5]
87,354
87,355
How to do this equivalent C# OOP in python?
<p>I need following structure in python.</p> <pre><code>public class Circle { int member1; int member2; int member3; public Circle(member1) { this.member1 = member1; initializeRest(); } private intializeRest() { //do lot of computation to get result1 &amp; result2 this.member2 = result2; this.member3 = result2; } } </code></pre>
c# python
[0, 7]