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
4,840,532
4,840,533
Get logged in user privileges of a windows client machine from a web application
<p>Is there any possibility to get the user account privileges who have logged in to a windows system from a web application?</p> <p>The web application as such doesn't have any login, and we want to get the client user privileges who have logged into the system.</p> <p>We want to check whether the user have got admin privileges.</p> <p>Is there any possibility to get the details from user agent string or any thing like that?</p> <p>Or can we do anything on the client machine to get currently logged in user privileges like executing a bat file in the client machine to get its current user privileges.</p> <p>Please suggest..</p> <p>Thanks,</p> <p>Mahesh</p>
c# asp.net
[0, 9]
2,906,323
2,906,324
IE7 ignores :not-selector
<p>Internet Explorer 7 seems to ignore the :not-selector in the second line in following example, it shows and then hides the content - instead of showing the content with the right index and hiding the rest.</p> <pre><code>$('.dashboard-module-content:eq(' + indexFoo + ') .expand-collapse').show('fast'); $('.dashboard-module-content:not(:eq(' + indexFoo + ')) .expand-collapse').hide('fast'); </code></pre> <p>Anyone knows who to tackle a problem like this?</p>
javascript jquery
[3, 5]
3,128,146
3,128,147
Javascript reset function won't work after successful submission of a web form
<p>I am new to JavaScript. I am working in Visual Studio with ASP.NET and I have a simple form. I also have a JavaScript function to validate the form and a JavaScript function to reset the form. The validation and submission work fine. However, after submitting the form, I cannot get the JavaScript reset function to work. I have also tried using a regular HTML input button and it does not work. It works fine before a successful submision, but never after. Any help will be greatly appreciated. </p> <pre><code>function resetForm() { document.getElementById("accountForm").reset(); } &lt;asp:Button ID="subBtn" runat="server" Text="Submit" OnClientClick="return validateForm()" onclick="subBtn_Click" /&gt; &lt;asp:Button ID="rstBtn" runat="server" Text="Reset" OnClientClick="resetForm()" oncClick="rstBtn_Click"/&gt; </code></pre>
javascript asp.net
[3, 9]
3,457,933
3,457,934
Calling javascript function from dropdownlist
<p>Is it possible to call a JS function when a <strong>specific</strong> a item is selected from dropdownlist? </p>
c# asp.net javascript
[0, 9, 3]
21,643
21,644
When to use anonymous JavaScript functions?
<p>I'm trying to understand when to use anonymous JavaScript functions.</p> <p>State differences between the functions? Explain when you would use each.</p> <pre><code>var test1 = function(){ $("&lt;div /&gt;").html("test1").appendTo(body) }; function test2() { $("&lt;div /&gt;").html("test2").appendTo(body) } </code></pre> <p>I think the answer is that one uses anonymous function and the other doesn't to replace an empty div element. Does that seem right?</p>
javascript jquery
[3, 5]
3,485,362
3,485,363
Java AccessControlException only with LiveConnect
<p>I'm geting Access Errors, only when I call the functions with Javascript (LiveConnect).</p> <p>The applet calls a function postData and displays the response (this works great). Now if I call this function from Javascript via the applets[] array like <code>document.applets[0].postData</code> i get the Socket/Permissions Error: uncaught exception: java.security.AccessControlException: access denied (java.net.SocketPermission 174.132.167.66:80 connect,resolve)</p> <p>the same function called internally works great, but I get Access Control errors when called from javaScript.</p> <p>Anyone had issues like this before?</p>
java javascript
[1, 3]
4,509,266
4,509,267
Javascript: Detect when move a browser window
<p>Is there any way to know for events when move a window with "window.open"?. </p> <p>It may be with javascript or using jQuery</p> <p>Thank you.</p>
javascript jquery
[3, 5]
1,642,497
1,642,498
Remap a key press in javascript / jquery
<p>Is there an "easy" way to map a keystroke to another key when on a page?</p> <p><strong>Background:</strong></p> <p>We are using a custom javascript grid for handling keyboard entry in a web application. Normally, the [enter] key allows the user to move to the next line, and the [tab] key allows the users to move to the right. The grid handles the keystrokes, and has some rather complicated logic when one is pressed.</p> <p>Our users are requesting that we map the Plus Key [+] on the numeric keypad to [tab] so that they don't need to use two hands while keying. This seems logical (the are keying thousands of numbers in a row while holding papers with their other hand), but I can't figure out to do it.</p>
javascript jquery
[3, 5]
5,870,769
5,870,770
How to count visitor of one website from another website(which are on totally different domain)
<p>I want to count the visitor of a website(which is located totally different domain) from my website.Just like <a href="http://www.alexa.com/" rel="nofollow">Alexa is counting the visitor of all website</a> . How it can be done? Any idea or implementation please. Thanks in advance.</p> <p>For all i clarify my question.</p> <p><em>Suppose I want to count the visitor of www.yahoo.com. The total number of visitor, per day or per month etc. I know this will be very easy if i am the owner of www.yahoo.com, but if i have no connection with www.yahoo.com, then is it possible to know their visitor or any statistics?</em></p>
php javascript asp.net
[2, 3, 9]
1,612,955
1,612,956
Doesn't the append function return the appended object?
<p>Assuming <code>this</code> is some existing block level element in the dom and <code>image</code> is <code>http://www.google.com/images/srpr/nav_logo25.png</code> doing the following does not work:</p> <pre><code>$(this).append('&lt;img&gt;').attr('src', image).load(function() { alert('loaded'); }); </code></pre> <p>Should it be done as follows?:</p> <pre><code>$(this).append($('&lt;img&gt;').attr('src', opts.image).load(function() { alert('loaded'); })); </code></pre> <p>Or it should be done some other way?</p>
javascript jquery
[3, 5]
3,952,643
3,952,644
Obtain static values from C++ .o file using php
<p>I have a compiled C++ object file. And that object file contains a huge list of static constant values (as a matter of fact that .o file contains only static values). Is there any way I can read those static values using php? I can not copy those values into php and need to read them directly.</p> <p>Thanks, to anyone for their response.</p>
php c++
[2, 6]
5,358,100
5,358,101
jquery clone form fields and increment id
<p>I have a block of form elements which I would like to clone and increment their ID's using jQuery clone method. I have tried a number of examples but a lot of them only clone a single field.</p> <p>My block is structured as such:</p> <pre><code>&lt;div id="clonedInput1" class="clonedInput"&gt; &lt;div&gt; &lt;div&gt; &lt;label for="txtCategory" class=""&gt;Learning category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select class="" name="txtCategory[]" id="category1"&gt; &lt;option value=""&gt;Please select&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div&gt; &lt;label for="txtSubCategory" class=""&gt;Sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select class="" name="txtSubCategory[]" id="subcategory1"&gt; &lt;option value=""&gt;Please select category&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div&gt; &lt;label for="txtSubSubCategory"&gt;Sub-sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;select name="txtSubSubCategory[]" id="subsubcategory1"&gt; &lt;option value=""&gt;Please select sub-category&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p></p> <p>Obviously elements are lined up a lot better but you get the idea.</p> <p>I would like to keep the id structure i.e. category1, subcategory1 etc as I use these to dynamically display select options based on the parent selection so if its possible to have each cloned block like category1/category2/category3 etc that would be great.</p>
javascript jquery
[3, 5]
5,392,647
5,392,648
Selecting and wrapping all occurences of a certain string with jQuery
<p>In a list of footnote references for an article, I want to select all occurences of "(en)" and wrap them in some so that I can apply bold style to them as well as a right margin.</p> <p>How to do that with jQuery ?</p>
javascript jquery
[3, 5]
4,544,195
4,544,196
Nested Repeater
<p>I Have a display that needs to be a little more dynamic than what I'm use to and can't seem to quite find the answer I need.</p> <pre><code> Customer a Customer b Customer c (and so on) savings with product a savings with product b (and so on) </code></pre> <p>I know there will always be a minimum of one in each field. Someone said use a nested repeater or something. I looked around and couldn't find out how to use a nested repeater. I am on a deadline and can't really play with things until I find something that works.</p> <p>What asp control should I use to do this? An example would be nice but I just need help in the right direction.</p> <p>I am using sql but getting the data through link. The data ends up in lists.</p> <p>Thank you for your help!</p>
c# asp.net
[0, 9]
852,480
852,481
Jquery blur doesn't work in Firefox and Chrome but works in IE9
<p>I have this HTML code which simulates a dropdown multi-checkbox</p> <pre><code>&lt;div&gt; &lt;div class="select"&gt; &lt;span&gt;Select something&lt;/span&gt; &lt;/div&gt; &lt;div class="no-display select-list"&gt; &lt;div&gt; &lt;label class="unchecked" for="value1"&gt; Value1 &lt;/label&gt; &lt;label class="unchecked" for="value2"&gt; Value2 &lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And javascript:</p> <pre><code> $(".select").live("click", function () { $(".select-list").toggleClass("no-display").focus(); }); $(".select-list").live("blur", function () { $(this).addClass("no-display"); }); </code></pre> <p>But in Firefox and Chrome, the blur event doesn't work, but works in IE9.</p> <p>I want, when clicking outside <code>select-list</code> element, to close it (means make it invisible).</p> <p>I used <code>blur</code> event after assigned <code>focus</code> on that element.</p> <p>Could you show me the good approach to do that ?</p> <p>Thanks</p>
javascript jquery
[3, 5]
4,107,159
4,107,160
javascript how to add a variable to a string
<p>I'm using javascript and jquery, I have a string like</p> <pre><code> var apiUrlAnswer = 'https://api.stackexchange.com/2.0/answers/{ids}?order=desc&amp;sort=activity&amp;site=stackoverflow'; </code></pre> <p>I need replace the <code>{ids}</code> with a variable.</p> <p>In C# is possible to use a method called </p> <pre><code>String.Format(https://api.stackexchange.com/2.0/answers/{0}?order=desc&amp;sort=activity&amp;site=stackoverflow, myVariable); </code></pre> <p>I would like to know if exist something similar in Javascript so I can avoid simple string concatenation.</p> <p>Thanks for your help!</p>
javascript jquery
[3, 5]
230,221
230,222
ASP.NET - SmtpClient - Unable to connect to the remote server
<p>I am working on a project where one of the requirements is to re-write an ASP.NET application. The old ASP.NET application was based on .NET Framework 1.1. The new ASP.NET application is based on .NET Framework 3.5.</p> <p>One of the functions in the old web application was the ability to send email. The old code used the System.Web.Mail.SmtpMail class, whereas the new web application uses the System.Net.Mail.SmtpClient class.</p> <p>In testing this on our development servers, everything worked fine. However, we have two beta clients testing out our software, and they both run into problems sending email in the new web application.</p> <p>The specific exception is as follows:</p> <p>"Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it"</p> <p>Both the old and new ASP.NET application are on the same server (Windows Server 2003). They both are using the same Exchange mail server. Why is it that the old ASP.NET application can successfully send email, but the new one cannot?</p> <p>I looked at the old code, and it did not use any form of authentication, it just specified the sender's email address, the recipient's email address, the subject, body, and server, and sent the message. I did the same thing in the new code, with the only difference being that I used the SmtpClient class.</p> <p>Please help.</p> <p>Chris</p> <p>Below is a code snippet from the new ASP.NET application:</p> <pre><code>System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); mail.To.Add(messageTo); mail.From = new MailAddress(messageFrom); mail.Subject = messageSubject; mail.Body = messageBody; SmtpClient client = new SmtpClient(); client.Host = smtpServer; client.Send(mail); </code></pre>
c# asp.net
[0, 9]
3,960,170
3,960,171
Java Declaration
<p>I am new to android. i know only core java.</p> <p>I saw the declaration </p> <pre><code>ArrayList&lt;ApplicationInfo&gt; mAppInfo; </code></pre> <p>in Android sample project. Can anyone explain what is the meaning of above declaration.</p>
java android
[1, 4]
999,514
999,515
Is there any way to detect the mobile blocked screen in a web app?
<p>Is there any way to detect the mobile blocked screen in a web app? When the screen obscures. To stop a loop of Ajax requests. Another way? I use Javascript and jQuery.</p> <p>Edit: </p> <p>My web app makes Ajax request, started for a loop. This loop doesn't stop because it obtains the state of a lamp. If other window or tab in the browser is visited, the Ajax request stops (using <code>focus</code> and <code>blur</code> methods). Why? To optimize the performance. The problem is in mobile devices. The app may crash if the loop continue for a lot.</p> <p>If the mobile screen is blocked and I unblock it, occurs the next event?</p> <pre><code>$(window).focus(function() { //action code }); </code></pre>
javascript jquery
[3, 5]
1,645,073
1,645,074
how to add Image in Grid View header after header text
<p>I am trying add an filter image in grid view header after header text in same column. I tried adding image to header but it only shows image but not the text along with it.</p> <pre><code>&lt;asp:TemplateField HeaderText="&lt;img src='.../...' alt='my image' /&gt;"&gt; .... &lt;/TemplateField&gt; </code></pre> <p>Can anybody suggest me the way to do it</p>
c# asp.net
[0, 9]
5,613,692
5,613,693
Jquery get attribute of few ul to create another attribute
<p>I have the following HTML:</p> <pre><code>&lt;ul actualpage=0&gt; &lt;li/&gt; &lt;li/&gt; .... &lt;/ul&gt; &lt;ul actualpage=0&gt; &lt;li/&gt; &lt;li/&gt; .... &lt;/ul&gt; </code></pre> <p>Im trying to get the value of actualpage of each ul and create a new attribute. Its easy but not in one jquery sentence... Its possible? Until now i have the following line (between ## simbols the missing part that i need.</p> <pre><code> /* select all uls with attribute actualpage and create a new attribute on each with the current actualpage value */ $('ul[actualpage]').attr('newactualpage',##Current value of actualpage attr of UL##); </code></pre>
javascript jquery
[3, 5]
333,201
333,202
next and prev button for a custom pager using PagedDataSource
<p>I am trying to get the next and prev button on my custom pager. Here is what I have so far and it's working perfect except it needs next and prev button.</p> <p><strong>What I have done</strong></p> <pre><code> PagedDataSource page = new PagedDataSource(); page.AllowCustomPaging = true; page.AllowPaging = true; page.DataSource = query; page.PageSize = 5; QRep.DataSource = page; QRep.DataBind(); </code></pre> <p>*Qrep is a asp.net repeater control and *query is a result of linq to sql query.</p> <p><strong>here is how i create the pager controls and assigned event handlers</strong></p> <pre><code>private void CreatePagingControl() { for (int i = 0; i &lt; (RowCount / 5) + 1; i++) { LinkButton lnk = new LinkButton(); lnk.Click += new EventHandler(lbl_Click); lnk.ID = "lnkPage" + (i + 1).ToString(); lnk.Text = (i + 1).ToString(); plcPaging.Controls.Add(lnk); Label spacer = new Label(); spacer.Text = "&amp;nbsp;"; plcPaging.Controls.Add(spacer); } } void lbl_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; int currentPage = int.Parse(lnk.Text); int take = currentPage * 5; int skip = currentPage == 1 ? 0 : take - 5; FetchData(take, skip); } </code></pre> <p>the row count is stored as below</p> <pre><code>private int RowCount { get { return (int)ViewState["RowCount"]; } set { ViewState["RowCount"] = value; } } </code></pre> <p>This is working fine , except it only displays page numbers and I want to know how the next and prev controls can be integrated with this. Any help appreicated guys. Thanks in advance.</p>
c# asp.net
[0, 9]
3,728,683
3,728,684
Get unique id after the fact?
<p>I want to be able to change a button image on click which isn't the issue. Each button is unique to information that is pulled from the database and on click the button should change and send the appropriate info to the database. What I am unsure about is how I can change the specific button. Say there are five things up, so five buttons. Each button has its unique id to go with its information. How can I find out what the id is so that I can manipulate the button?</p> <p>I use php to grab the info from the database and go through a while loop to get it all displayed. Once it is all displayed it is there for the user to see and then they can click on the button.</p> <p>edit - It just came to me. I can make my onclick function take a variable and feed the variable into it. Right?</p>
php javascript
[2, 3]
1,137,652
1,137,653
ASPX server-side function call after client-side user confirmation?
<p>Maybe I'm searching with the wrong keywords, but I can't find a solution to this.</p> <p>I've got an ASPX page on which, within an <code>&lt;asp:Repeater&gt;</code> I want to insert a button (per item) that will:</p> <ol> <li>ask (JS "confirm") the user if they really want to proceed, then</li> <li>call a method on the page class passing in the ID (Guid) from that item.</li> </ol> <p>I can do 1 or 2, but can't figure out how to call back into the page method from JavaScript.</p> <p>I've tried turning on the EnablePageMethods in the ScriptManager, but that didn't seem to do what I expected -- calling <code>PageMethods.Blah(...)</code> did not seem to have <em>any</em> effect.</p> <p>Are there any ready examples? In fact, the confirmation string is the same for every entry.</p>
c# javascript asp.net
[0, 3, 9]
3,259,241
3,259,242
calculate time difference in javascript
<p>I have a jqurey clock that gives the time from 00:00 to 23:00. Now I want to calculate the time difference between two times. Suppose In time is 11:00 and out time is 16:00 then how to calculate the time difference in javascript. Please help</p>
javascript jquery
[3, 5]
2,609,168
2,609,169
jquery's ready function not working on my laptop
<p>I'm running this simple code on "000webhost" free server:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ alert("something"); }); &lt;/script&gt; &lt;/head&gt; &lt;/html&gt; </code></pre> <p>Thing is, this code works perfectly well if running on localhost. Another weird thing, is that this code works on my mobile phone, and on my PC at home. only when running on my laptop(running windows 8), it just get stucked on "waiting for stats.hosting24.com" I have tried runnig it on latest FF,chrome,IE. - same result on each browser.</p> <p>It feels like the page never finish loading on my laptop.</p> <p>Any ideas on what can cause this issue?</p>
javascript jquery
[3, 5]
1,851,276
1,851,277
Prototype.js creating problems with InfiniteCarousel in jQuery
<p>I have this piece of code that works fine in the webpage: </p> <pre><code>&lt;script src="http://code.jquery.com/jquery-1.7.1.min.js"&gt;&lt;/script&gt; &lt;script src="jquery.infinitecarousel3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="easing.js"&gt;&lt;/script&gt; &lt;script&gt; $(function(){ $('#carousel').infiniteCarousel({ imagePath: 'images/' }); }); &lt;/script&gt; &lt;!--&lt;script src="prototype.js"&gt;&lt;/script&gt;--&gt; </code></pre> <p>However, as soon as I uncomment The <code>prototype.js</code> line it gives an error:</p> <blockquote> <p>Uncaught TypeError: Cannot call method 'infiniteCarousel' of null. </p> </blockquote> <p>The <code>prototype.js</code> file is from <a href="http://prototypejs.org/" rel="nofollow">http://prototypejs.org/</a> and I'm using it for some other function. I have Googled a lot but am unable to come up with a solution - how do I solve this?</p>
javascript jquery
[3, 5]
184,873
184,874
Storing width values before animation records post animation values
<p>Its getting a bit late so excuse me if I am making a stupid mistake. For some reason the following code:</p> <pre><code>$(".myClass").each(function(){ widths[$(this).attr("id")] = $(this).width(); if ($(this).attr("id") != $(clickedExpand).attr("id")) { $(this).animate({ width: '10px' }); } }); </code></pre> <p>The array is initialized as</p> <pre><code>var widths = new Array(); </code></pre> <p>earlier in the code. For some reason, despite the fact that I am recording the the widths before the animation begins, I am getting post-animation values in the array. It seems as though the animation finishes and then the values get recorded. I have tried to take it out of the function and wrap it in another .each but I am getting the same result.</p> <p>Any help is would be greatly appreciated!</p> <p>entire code:</p> <pre><code>var slateWidths = {}; $(".slateExpand").click(function(){ var clickedExpand = $(this).closest(".slate"); $(".slate").each(function(){ slateWidths[$(this).attr("id")] = $(this).outerWidth(); if ($(this).attr("id") != $(clickedExpand).attr("id")) { $(this).animate({ width: '10px' }); $(this).find($('.slateExpand')).hide(); } }); $(this).text("Restore"); $(this).removeClass("slateExpand").addClass("slateRestore"); $(".slateRestore").on("click",function(){ $(".slate").each(function() { alert(slateWidths[$(this).attr("id")]); //var width = slateWidths[$(this).attr("id")]; $(this).animate({ width: slateWidths[$(this).attr("id")] }); }); }); }); </code></pre>
javascript jquery
[3, 5]
3,151,645
3,151,646
Moving Information From ListBox to Another ListBox that are bound to datatables
<p>I have two ListBoxes bound to DataTables. When I try to move information from one ListBox to another listbox using a button click with the following code:</p> <pre><code>protected void btnAdd_Click(object sender, EventArgs e){ ListBox1.Items.Add(ListBox2.SelectedItem); ListBox2.Items.Remove(ListBox2.SelectedItem); } </code></pre> <p>One items is removed from ListBox2 and added to ListBox1 but if I try and click the button again with a newly selected item nothing happens.</p> <p>I'd like to be able to move up to all the items from listbox 1 into listbox 2. </p>
c# asp.net
[0, 9]
3,563,973
3,563,974
Saving file on disk
<p>In Java, while using Glassfish Server, we could only save files relative to our web application root. Thus you cannot directly save file on eg <code>c:\program files\abc.txt</code> whereas with php this is working. Is it valid? One should not be able to refer any location on hard disk outside web application root (unless you are using Virtual directory). Why are there so contradictory principles?</p>
java php
[1, 2]
369,960
369,961
jquery control a dropdown from a checkbox
<p>i have </p> <pre><code>&lt;input type="checkbox" id="checkbox_1" name="artist" value="Yes"&gt; &lt;select id="dropdown"&gt; &lt;option value="All" selected="selected"&gt;- Any -&lt;/option&gt; &lt;option value="0"&gt;No&lt;/option&gt; &lt;option value="1"&gt;Yes&lt;/option&gt; &lt;/select&gt; </code></pre> <p>how can i select option 1 when checkbox is checked and option All when checkbox is unchecked</p>
javascript jquery
[3, 5]
3,482,286
3,482,287
Disable Button from being clicked when pressing enter
<p>I've got a search box at the top of my master page, and when I am trying to submit form on my content pages, the search button from the masterpage gets executed when hitting enter. It even does it when i'm typing in my content pages textfields and hitting enter..</p> <p>It seems to be a problem with the form, as i'm only using one that fills the whole master page, but i can't seem to create multiple forms.</p> <p>Maybe i could just remove the enter function on my search button with javascript, who knows?</p>
c# javascript asp.net
[0, 3, 9]
4,260,657
4,260,658
Files uploading and attaching mess using asp.net
<p>Finally I give up thinking about uploading after trying different ways. Here is the requirement, I have a 3 step process where I implemented them using 3 web forms.</p> <p>In the second step I added 5 file upload control to collect the file names to upload. After submitting 2nd step I create a session to store these upload controls.</p> <p>Finally in 3rd step after submitting finish button, I have to upload all the files that were stored in the session and attach to a mail and send it to respective department.</p> <p>I am able to accomplish this task if the user is uploading 1 or 2 files, but the form is hanging if the upload files count is 3 or more.</p> <p>I am not sure if I have to use threads to upload and wait till the uploading is done. Can some one throw some ideas please?</p> <p>Thank you, Kris.</p>
c# asp.net
[0, 9]
671,430
671,431
Selected Spinner array into TextView
<p>I have my spinner pulling from an array,(that works).. What I want to happen is I have several textviews that will map to whatever is selected from the spinner array... e.g British Columbia. then the Texviews will all say british columbia. I figure i should be using a setText of some kind but have been on able to find an example anyhelp would be appreciated. Here is my spinner code:</p> <pre><code>Spinner spinner = (Spinner) findViewById(R.id.spinner); ArrayAdapter&lt;CharSequence&gt; adapter = ArrayAdapter.createFromResource( this, R.array.material_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); final TextView tv34=(TextView) findViewById(R.id.tv34); spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) { tv34.setText(parent.getItemAtPosition(pos).toString()); } public void onNothingSelected(AdapterView&lt;?&gt; parent) { // Do nothing. } }); </code></pre>
java android
[1, 4]
4,550,855
4,550,856
jQuery: Onclick, open a new div with ID
<p>I'm creating a footer chat bar from this tutorial here: <a href="http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/" rel="nofollow">chat bar tutorial</a></p> <p>I'm trying to make it so when I click a username in the buddylist, it opens up a new chat box div in the chat bar itself. And, when the div is created/opened, it also assigns an ID to it. For example, it assigns the buddy's username to it.</p> <p>I'm not sure if you need anymore information. If so, I'd be glad to provide it. Or if I don't make sense, I'll try to clarify more.</p> <p>Thanks.</p>
php jquery
[2, 5]
1,113,328
1,113,329
How can I get the ID of my Window popup
<p>How can I get the ID of my Window ?</p> <pre><code>$(window).unload(function () { if (alterado == 1) { window.opener.location.reload(); } }); </code></pre> <p>How can I get the ID of my <code>window.opener.location</code> ? </p> <p>I need to put a block in this window like <code>$("#window").block(message:"loading");</code>, or a div that exists in the parent window.</p>
javascript jquery
[3, 5]
5,961,200
5,961,201
button toggles between states
<p>I was wondering if anyone knew of some code which implements two buttons where one is just plain text and the other is say a link. When the user clicks on the link the other text becomes a button and vice versa when the user clicks the link again.</p> <p>Think of it like this: One link is active the other isn't. One is a listview link and the other is a gridview text and when you click listview that link becomes text and the gridview text becomes a link. Does anyone know of an example that implements this kind of behavior or can someone show me an example in jQuery?</p>
javascript jquery
[3, 5]
4,217,306
4,217,307
Dropdown list selected item always set to default value
<p>I wish to pass values of the selected items into a database and however noticed that the selected item is not what is sent into the database you can see in the snap shot below. <img src="http://i.stack.imgur.com/RO7rh.jpg" alt="alt text"> during run time the following value is recorded. <img src="http://i.stack.imgur.com/RIzzL.jpg" alt="alt text"></p> <p>Where did it all go wrong with the dropdown lists selected item? Counting on your intelligence...thanks.</p>
c# asp.net
[0, 9]
3,052,380
3,052,381
OnMouseOver this, show this but OnMouseOut, hide it
<pre><code>&lt;div class="profile-banner" onMouseOver="fadeIn('edit-banner');" onMouseOut="fadeOut('edit-banner');"&gt; &lt;div id="edit-banner"&gt; Edit Banner &lt;/div&gt; &lt;/div&gt; </code></pre> <p>(Formating is being weird on stackoverflow.. so ignore the formating.)</p> <p>Anywho, the problem I'm having is the second I put my mouse over the "Edit banner" area, it recognizes that i'm on another element, so it fades it out. I need it to stay as long as i'm in that profile-banner area.</p>
javascript jquery
[3, 5]
4,755,127
4,755,128
jquery on binding with dynamic div
<p>I have an issue with jquery. Say i have 2 divs in jquery,</p> <pre><code>&lt;div id='1'&gt; //static div &lt;/div&gt; &lt;div id='2'&gt; //dynamic div &lt;/div&gt; </code></pre> <p>The static div is always present in the document, but dynamic div toggle when we click over static div. Now what i want is to place an event on dynamic div something like :</p> <pre><code>$(document).on("show", "#2", {}, function() { alert("div 2 present"); }); </code></pre> <p>so that i can do something when dynamic div is present in the document. How can i do this ?</p>
javascript jquery
[3, 5]
5,180,063
5,180,064
Android dev - TextView won't show up
<p>I just started experimenting with Android app development and so I decided to give Android's own tutorials a go (this one: <a href="http://developer.android.com/training/basics/firstapp/starting-activity.html" rel="nofollow">http://developer.android.com/training/basics/firstapp/starting-activity.html</a> ) </p> <p>The textview in my new activity just won't show. Here's my code:</p> <pre><code>public class DisplayMessageActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* Get the intent and the message sent with it */ Intent intent = getIntent(); String message = intent.getStringExtra(GoogleTutActivity.EXTRA_MESSAGE); /* Create a new textview where we can show the message the user sent */ TextView textView = new TextView(this); textView.setTextSize(40); textView.setText(message); setContentView(R.layout.activity_display_message); } } </code></pre>
java android
[1, 4]
5,304,162
5,304,163
How to change attribute of surrounding div/parent effectively?
<p>I have a table with some radiobuttons in it. When i click on a radiobutton, i want to update two of the sorrounding containers ID attribute (a div and a table). The problem is, i need to go 4 and 6 levels up, and the only way i know how to do this is parent().parent().parent().parent() etc. I am looking for a better solution, and was hoping someone could point me in the right direction. You can see an image of how the "parent-child" tree is here:</p> <p><a href="http://imageshack.us/photo/my-images/834/imgkz.png/" rel="nofollow">http://imageshack.us/photo/my-images/834/imgkz.png/</a></p> <p>I already have a clickhandler etc set up.</p> <p>Basicly i need to check if the table's id attribute is "answeredTable", if not i need to change it. Also i need to check if the div two levels up from the table is "answered", if not, i need to change that too.</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,132,889
2,132,890
Changing the border with of a table with jQuery?
<p>I have a table generated from Sphinx that has a border of width 1.</p> <pre><code>&lt;table border="1" class="docutils"&gt; </code></pre> <p>Can I change the border width to 0 using jQuery/javascript?</p>
javascript jquery
[3, 5]
3,531,603
3,531,604
custom gridview controls that supports paging, sorting, searching
<p>i am looking for custom gridview controls that supports paging, sorting, searching. is there any controls[ that has all builtin functionality] so that i can just drag and drop this control. in the page i ll just send that datatable as paramter to the custom gridview control. all the functionlity will be done at custom gridview control. if there is any control that does this job.</p>
c# asp.net
[0, 9]
4,256,949
4,256,950
Boldening text "Inside" a textarea
<p>I have a textarea <code>#myarea</code> into which I'm typing text. I've typed this text.</p> <blockquote> <p>This is a sentence and only this word will end up being bolded</p> </blockquote> <p>Now I have a button on the side, like a bold button. I want to select the letters I want bolded, click the button, and see those letters turn bold inside the textarea. It's similar to the standard functionality found in many editors, but I'm looking for something much simpler as I described here.</p> <p>So is there a way to do this with jquery? I'm guessing it's a 2-part problem. I need to find the letters selected, then apply bold to them so it shows bold inside the textarea.</p>
javascript jquery
[3, 5]
5,890,267
5,890,268
how to find selected hyperlink in asp.net using C#
<p>I have a list of 10 hyperlink on default1.apx. On selecting any hyperlink it redirects to another page and all hyperlinks redirects to the same page default2.aspx. But how can i now which hyperlink is clicked from 10 hyperlinks list in asp.net using C#.</p>
c# asp.net
[0, 9]
3,989,695
3,989,696
Ajax Call executing twice?
<p>Why is this ajax call giving me back both answers? First, and in a barely noticeable way the correct answer, then the other one?</p> <p><strong>The Form page</strong></p> <pre><code> $(document).on('click','.save-action',function(){ //var text = tinyMCE.get('#action-desc').getContent(); if($("#form-save-action").validationEngine('validate')) { $.ajax({ type: "POST", cache: false, data: $("#form-save-action").serialize(), url:"modules/actions/insertaction.php", success : function (data) { $("#response-message").html(data); } }) } }); </code></pre> Adicionar Acção Nome da acção Descrição <hr> Gravar <p><strong>Insertaction.php</strong></p> <pre><code>$exists = $action-&gt;actionExists($actionName); if($exists == 0) { $action-&gt;insertAction(array($actionName,$action-&gt;clearContent($actionDesc),1)); echo 'Acção adicionada com sucesso!'; } if($exists &gt;= 1) { echo 'Acção já existe!'; } </code></pre> <p>So if I click in the .save-action button, it gives me back first the correct answer, then the other one.</p> <p>PS: the ajax call is wrapped in a <code>$(document).ready</code>function</p>
php jquery
[2, 5]
859,773
859,774
Updating TextBox on the client with Javascript and reading the value from the Server
<p>I used Javascript on the client to update an ASP Textbox control which was rendered as an HTML textbox.</p> <p>When I tried to access the value in the textbox control on the server, I wasn't too surprised that the Textbox's updated value was not accessible through the normal Text property of the TextBox server control, since the state of that value, I assume was probably saved off in the ViewState and the Server was unaware that Client script had changed it.</p> <p>Is the best way to get the updated value using something like:</p> <p>Request.Form(TextBox.UniqueID)?</p> <p>I suspect that because the textbox is populated within a row of a GridView control and the row was added at run time when doing a DataBind, that I may be getting different results than if the TextBox were drawn on the control at Design time. </p> <p>I confirmed that the value placed into the textbox by the client is accessible via this:</p> <pre><code>Request.Form( CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).UniqueID) </code></pre> <p>but not accessible via this:</p> <pre><code>CType(Row.Cells.Item(4).FindControl("txtTotal"), TextBox).Text </code></pre> <p>the latter returning an empty string.</p> <p>I think these two lines tell the whole story.</p> <p>It seems ugly to have two properties to get the value of the textbox and even uglier when you consider that they return different results.</p> <p>Is there a better way or is this just client side development in all its glory?</p> <p>I'm always surprised when people say that web development now days is as easy as client (eg winform) apps now that ASP.NET keeps track of state. To me, web development is always more complex and costly, but I admittedly am not that skilled in web dev.</p>
asp.net javascript
[9, 3]
2,598,475
2,598,476
How can I edit/add to the 'url' inside an 'a' tag's onclick event using javascript/jquery?
<p>I have the below element on my web page:</p> <pre><code>&lt;a target="_blank" href="http://www.fxs.dev/quote/quote.aspx" onclick="javascript:window.location='http://www.fxs.dev/quote/quote.aspx?partnumber=526-NTE3031';" return="" false;=""&gt;Request Delivery Quote&lt;/a&gt; </code></pre> <p>I would like to try and add querystrings to the 'url' in the "<code>onclick</code>" attribute of the element. Is there a jquery function that allows me to do edit just the "URL" part of the <code>onclick</code> event. Or do i just have to write my own custom function to strip and edit the <code>onclick</code> event code?</p> <p>Thanks in advance for your help :)</p>
javascript jquery asp.net
[3, 5, 9]
1,249,575
1,249,576
Append a number if name is already used?
<p>In Javascript, I have a script that allows me to upload files to my server, then retrieve the output. One component of the output is the name of the file that was uploaded. For example, an output name might look like this:</p> <pre><code>test.pdf </code></pre> <p>The contents of <code>test.pdf</code> are then saved to a <code>localStorage</code> key, with the item name being the name of the file: <code>localStorage.setItem(name, data)</code>.</p> <p>This works fine, but not when the name of the file is the same as the name of a file that is being uploaded and retrieved.</p> <p>What I mean by this is that if the user uploads a file with the name <code>Hello 34.pdf</code>, it will save the name of that file and the contents to a LS key. If they upload the same file again, however, or a different file with the same name, then it will replace the current file with the same name.</p> <p>To remedy this, I need to be able to append a number to the end of the document title, so that you can have as many versions of the file with the same name in LS.</p> <p>I know I can check to see if the file has the same name as one already uploaded like this:</p> <pre><code>var title = $('#file')[0].files[0]["name"]; if (localStorage.getItem(title)) { alert("same name"); } localStorage.setItem(title, data); </code></pre> <p>But from there I can't figure out how to add a number to the end. I don't think regex is an appropriate way to do this, as this:</p> <pre><code>if (title.match(/[\.pdf ]\d/g) != null) { var number = title.match(/[\.pdf ]\d/g) + 1; } else { var number = "1"; } </code></pre> <p>Is dependent on the <code>.pdf</code> extension to be at the end, and JS regexes are generally bad.</p> <p>Are there better ways to do this? Should I be indexing the file names a different way? </p>
javascript jquery
[3, 5]
5,812,158
5,812,159
Web page floating pointer
<p>I want to place arrows and small explanations floating over the top of my web page when they first signup to kinda teach them the basics. I want like a tooltip with an integrated pointer/arrow but is not activated on mouseover, it is just loaded on the page when it is loaded and visible. Is there a jQuery or javascript that will do this?</p> <p>Many thanks</p> <p>Paul</p>
javascript jquery
[3, 5]
1,760,345
1,760,346
Is there any javascript library which helps me to create this table layout for viewing, editing, deleting and newing
<p>I came across this kind of table layout once upon a time (Unfortunately, I forget where I had seen this), which enable me to perform viewing, editing, deleting and newing. </p> <p><img src="http://i.stack.imgur.com/7izJf.png" alt="Useful table layout"></p> <p>Note that, click on <code>Edit</code> will turn the static label into an editable text field. Pressing <code>Enter</code> or <code>ESC</code>, with either commit changes to database or cancel the text changes.</p> <ol> <li>Do you know any javascript library which enable me to do this?</li> <li>Do you know any web site which employ this kind of user interface? I surf several of Google web site, but unable to find something similar.</li> </ol>
javascript jquery
[3, 5]
2,840,822
2,840,823
Android On Focus Change
<p>I want to update an EditText when a user changes focus from the edittext to another item I want to check the contents of the edittext eg is the number larger than 10 if so change it to 10.</p> <p>How should I do this.</p>
java android
[1, 4]
5,308,811
5,308,812
Left side frame adding in only in one page
<p>I have 30 jsp in each page. Currently I am calling premade left side frame called "frame_table" as of the code below in xml and If i call the frame from the xml, because of the exsisting jsp mapper the right hand side frame will apper in all 30 pages but my requirement is I only have to display this fram in one page only. How can I do make this possible please. is there any way i call this "add" in Java Scripts or J.Query or is there any diferent ways to make it possible.</p> <pre><code>&lt;mapping&gt; &lt;uri-path&gt;/*&lt;/uri-path&gt; &lt;actionname&gt;MapperAction&lt;/actionname&gt; &lt;container&gt;frame_table&lt;/container&gt; &lt;/mapping&gt; </code></pre>
java javascript
[1, 3]
1,264,197
1,264,198
'Activating' JavaScript for each page in large web sites
<p>I am working on a medium size web site that has plenty of custom JavaScript written for it.</p> <p>At present all the script is stored in seperate JS files for each area of functionality. These are then minified and combined into a single, large JS file during our build process.</p> <p>For each page, the relevant JavaScript is usually executed based on the presence of an element with a particular class on the page. For example:</p> <pre><code>$(document).ready(function() { var foo = $("div.dostufftome") if(foo) { // dostuff } } </code></pre> <p>I'm concerned that this approach seems a little fragile, and also potentially quite slow.</p> <p>The only other alternative I can see is to put the 'activation' code inline in the HTML in a CData section, with the bulk of the code in the attached JS file.</p> <p>Grateful for any advice.</p>
javascript jquery
[3, 5]
1,669,219
1,669,220
Is it not a right way to call my obj function?
<p>I have a function which is return a object. in the object i have two function to show the popup and close it. it works within the parent function, but it's not from out side.. is it not a right way to call that.. else how can i call the obj function from out side?</p> <p>my function :</p> <pre><code>var popupHandler = function(handler,msg,popUp){ msg = msg == "help" ? "help" : "results" $(handler).click(function(){ popObj.showPop(); //works }) $('.cls-how2play').click(function(){ if(msg == 'help') popObj.closePop(); //works }); var popObj = { showPop : function(){ if(!(popUp).is(':visible')) $(popUp).fadeIn().children().find('.'+msg).show().siblings().hide(); }, closePop : function(){ $(popUp).fadeOut() } } return popObj; } </code></pre> <p>from calling ouside like this :</p> <pre><code> $('.ui-footer').click( function(){ var closeIt = popupHandler(); closeIt.popObj.closePop() }) //not works.. why? } </code></pre> <p>any one can help me the right way to call the obj functions from outside of the returning function?</p> <p>thanks.</p>
javascript jquery
[3, 5]
3,137,741
3,137,742
Setting the focus on a element that was hidden
<p>I'm looking for a way to trigger a focus event that occurs after an element is recognised as focusable within the DOM.</p> <p>I'm showing form elements based on previous input. That works. Then I want to set the focus for user input.</p> <p>The following function fails to work unless I set a break point on the line with setTimeout. I've tried using a function callback which also failed.</p> <pre><code>function triggerFocus(id,timeout){ console.log('triggerFocus') ; console.log(id) ; /* the following works if a breakpoint is set*/ setTimeout( function() { $( id ).focus() }, timeout ) ; } /* code used to show the elements from another function */ if ( $('#first').val() == '') { $('#firstRow').show() ; $('#middleRow').show() ; $('#lastRow').show() ; $('#emailRow').show() ; triggerFocus($('#first'),100) ; } else { $('#docket').blur(docketBlur) ; $('#firstRow').show() ; $('#docketRow').show() ; triggerFocus($('#docket'),100) ; } </code></pre> <p>An example showing how to achieve this using a tab keyCode is at <a href="http://jsfiddle.net/pvrSU/" rel="nofollow">http://jsfiddle.net/pvrSU/</a> I discovered that the other element must be focusable before the blur event is fired.</p>
javascript jquery
[3, 5]
453,753
453,754
javascript variable variable names and global scope (pinesnotify)
<p>I'm using pines notify (somewhat irrelevant to my issue, I imagine) to create notifications on the change event of a drop down list. On the server side, the change is saved to a database, then when the save is complete - I wish to remove the notification (or do something else depending on the result).</p> <p>The problem is in creating the notification object in a way that I can later reference it (to remove it).</p> <p>My intended solution would obtain the id of the dropdownlist, prepend 'pn' to it and use that as the variable name, much like</p> <pre><code>var pnid = 'pn' + $('#mydropdown').attr('id'); notifications[pnid] = createNotification(); </code></pre> <p>In the codebehind I can create javascript code knowing what the notification object will be called. However I'm struggling with my 'notifications' object.. I've tried this[notifications], window[notifications] etc. to no avail (ie I cannot later reference this object to interact with it) . I'm creating that object outside of any functions like so</p> <pre><code>var notifications = {}; </code></pre> <p>Am I going about this the completely wrong way?</p>
javascript jquery asp.net
[3, 5, 9]
667,182
667,183
Display the search categories which user selects via checkbox
<p>Am building a search box on my web application. Am allowing the user to search in specific categories. This is done via a checkbox list.</p> <p>for e.g. The user wants to search for 'toyota camry' in category 'Sedans'. The category 'Sedan' is selected by the user through a checkbox. The html is as follows:-</p> <pre><code>&lt;ul class="sb_dropdown" style="display:none;"&gt; &lt;li&gt;&lt;input id="checkbox1" class="ads_Checkbox" type="checkbox" value="Sedans"&gt; &lt;/input&gt; &lt;label for="Sedans"&gt;Sedans&lt;/label&gt;&lt;/li&gt; &lt;li&gt;&lt;input id="checkbox2" class="ads_Checkbox" type="checkbox" value="Trucks"&gt;Trucks&lt;/input&gt;&lt;/li&gt; &lt;li&gt;&lt;input id="checkbox3" class="ads_Checkbox" type="checkbox" value="Hatchbacks"&gt;Hatchbacks&lt;/input&gt;&lt;/li&gt; &lt;li&gt;&lt;input id="checkbox4" class="ads_Checkbox" type="checkbox" value="SUV"&gt;SUV&lt;/input&gt;&lt;/li&gt;&lt;/ul&gt; </code></pre> <p>The user checks the box &amp; the option checked should be displayed. Just as the 'Tags' are displayed when user posts a question in stackoverflow.</p> <p>Any help is appreciated. Thanks in advance.</p>
javascript jquery
[3, 5]
2,426,911
2,426,912
sharing a js functions between code in 2 files
<p>My jquery code is divided file is divided over 2 files. </p> <p>In one of the file, I define a function</p> <pre><code>function something(input){ //does something } </code></pre> <p>calling this function only works when the caller line is in the same file. But I need to call it from both files. </p> <p>If I switch the function to the second file, again I get the same issue. The code in the same file can read it, but not the code in the other file. </p>
javascript jquery
[3, 5]
2,569,106
2,569,107
ScrollView containing TextView does not scroll
<p>I have a textview displaying many individual words, each word is a link using Spans and setMovementMethod(LinkMovementMethod.getInstance()); The textview is wrapped by a ScrollView. </p> <p>However the ScrollView does not work as the links in the TextView are activated instead.</p> <p>Is there a way to combine a ScrollView and TextView so that both the scrolling and links in the text work?</p>
java android
[1, 4]
1,450,368
1,450,369
JavaScript wrong scope
<p>I have the JS scope mixed up. I am trying to assign to values to coordinates and use them later, but for some reason i always get the coordinates as null. </p> <pre><code> var thing = (function($){ var obj = function(config) { $.extend(obj.config, config); obj.init(); }; $.extend(obj, { coordinates: {}, browser_geolocation: function() { if (navigator.geolocation) { var timeoutVal = 10 * 1000 * 1000; navigator.geolocation.getCurrentPosition( obj.browser_coordinates, //set coordinates maps.browser_error, { enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 } ); } else { alert("Geolocation is not supported by this browser"); } }, browser_coordinates: function(position) { obj.coordinates.long = position.coords.longitude; obj.coordinates.lat = position.coords.latitude; }, }); $(function() { maps.browser_geolocation(); maps.browser_geolocation(); console.log(obj.coordinates); }); return obj; }(jQuery)); </code></pre> <p>I cant seem to figure out what I am doing wrong?</p>
javascript jquery
[3, 5]
1,301,519
1,301,520
Load C# app through C++ "Loader"?
<p>Is it possible to write a small "loader" in C++ that should load a C# app? </p> <p>The idea is to make it impossible to see the code in Reflector. </p> <p>Check the following app. The app is written in C# but somehow a loader has been built so its impossible to see the actual source code in Reflector.</p> <pre><code>https://www.dropbox.com/sh/b0enylff5wptd7s/Ingphu4bXK/AccountMaster.0mmo.net.rar </code></pre> <p>Edit: Im not sure if the app is safe to run!</p> <p>But very interesting what happens when you try to put it into Reflector!</p> <p>When i saw it i thought it might be a smart way to keep "newbie" crackers away.. Good way to add more security to a C# app. Thats why im wondering how that is done :)</p>
c# c++
[0, 6]
1,698,351
1,698,352
Convert 24 hr format to 12 hr format
<p>This might be really easy but I can't figure it out. I am trying to convert the 24 hr time to a 12 hr time to display on the UI.</p> <pre><code>var hrs = '&lt;%=Model.Scheduled.Value.Hour%&gt;'; var hrs12 = hrs &gt; 12 ? hrs - 12 : hrs; $("#ScheduledHour").val(hrs12); </code></pre> <p>But the above is not working coz hrs is a string. Any suggestions on how to get this working?</p>
javascript jquery
[3, 5]
5,345,626
5,345,627
Images loading on localhost but not using IP
<p>I am using a PHP script to read some folders in directory and based on their names retrieve their posters. All of this works fine on <code>localhost</code>. However, when opening externally, this does not work and results in <code>blank</code> images.</p> <p>A screenshot from localhost:<img src="http://i.stack.imgur.com/qvqCe.jpg" alt="Screenshot of localhost"> <hr> The problem can be found at <code>89.241.171.100/Prac/</code>. PHP generating <code>img tag</code>:</p> <pre><code>while (false !== ($entry = readdir($handle))) { $counter++; echo "&lt;span class='title'&gt; &lt;img src='holder.js/200x280/text:$entry' alt='$entry' onload='loader(this, \"$entry\")' /&gt; &lt;/span&gt;"; if($counter == 5) break; } </code></pre> <p>PHP fetching the src for the images called via ajax from <code>loader()</code>:</p> <pre><code>if($_POST['title']) { $title = $_POST['title']; $imdb = new Imdb(); $movieArray = $imdb-&gt;getMovieInfo("$title"); $link = $movieArray["poster_large"]; echo $link; } </code></pre> <p><code>Loader()</code> function:</p> <pre><code>$.ajax({ type: 'post', url: 'loader.php', data: 'title='+title, success: function(data) { img.src = data; } }); </code></pre>
php javascript jquery
[2, 3, 5]
4,657,954
4,657,955
How to create sql connection with c# code behind, access the sql server then conditionally redirect?
<p>This is a question from an experienced beginner!</p> <p>Using ASP.NET 4 C# AND SQL server,</p> <p>I have a connection string in web.config to myDatabase named "myCS". I have a database named myDB. I have a table named myTable with a primary key named myPK</p> <p>What are the NECESSARY lines of code behind (minimal code) to create a SQL connection, then select from myTable where myPK=="simpleText"</p> <p>it will probably include:</p> <pre><code>sqlconnection conn = new sqlconnection(??? myCS) string SQLcommand = select * from myDB.myTable where myPK==myTestString; sqlCommand command = new SqlCommand(SQL,conn); conn.Open(); booleanFlag = ???? conn.Close(); conn.Dispose(); </code></pre> <p>then</p> <pre><code>If ( theAnswer != NULL ) // or (if flag) { Response.Redirect("Page1.aspx"); } else { Response.Redirect("Page2.aspx"); } </code></pre>
c# asp.net
[0, 9]
5,557,476
5,557,477
How to include a script tag only if an element exists?
<p>This seems like something that should be straightforward but I'm a newbie with Javascript, so please be patient.</p> <p>I want to include a script file but only if an element exists on the page. I've tried:</p> <pre><code>var element = $('.customelement'); if(element.length() &gt; 0) { $('head').append('&lt;script language="javascript" src="custom.js"&gt;&lt;/script&gt;'); } </code></pre> <p>But this doesn't work and returns the error:</p> <blockquote> <p>Uncaught TypeError: Property 'length' of object [object Object] is not a function</p> </blockquote> <p>I have found many posts which say this should work so I'm a little stumped. I was also wondering if there is a better way to do this?</p>
javascript jquery
[3, 5]
5,227,988
5,227,989
access static variable from aspx page
<pre><code> public partial class Page1 :System.Web.UI.Page { public static LGDP.LDGPSession var1 = null; private void Login(this, EventArgs e) { var1 = new LGDPSession(this, data, data); } public bool IsLoggedIn() { bool login = false; if (var1 != null) { login = true; } return var1; } } </code></pre> <p>How do I access the Page1 static var1 or function IsLoggedIn() from Page2.apsx ?</p> <pre><code> public partial class Page2 :System.Web.UI.Page { Page1.(nothing shows up here) } </code></pre> <p>ANSWER ----- created separate class and accessed public var in pageload / postback</p> <pre><code>private static bool _login = false; public static void SetLoggedIn(object lgdps) { if (lgdps == null) { _login = false; } if (lgdps != null) { _login = true; } } public static bool IsLogin { get { return _login; } } </code></pre>
c# asp.net
[0, 9]
2,645,705
2,645,706
Work with "Whatsapp" with computer
<p>I need to work with whatsapp with the computer, I need to read and send messages with that. does anyone know how i can do that not with an emulator ? </p>
android iphone
[4, 8]
875,458
875,459
How do you use context in classes?
<pre><code>package com.lala.image; import com.lala.ContextStore; import android.R; import android.content.Context; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.View; public class Stationary implements Image{ View v; Context context; String image; Bitmap img; float x; float y; public Stationary(Context context, String image) { // TODO Auto-generated constructor stub this.image = image; this.context = context; this.setImage(image); } public void setImage(String image) { // TODO Auto-generated method stub if(image=="bdfs"){ this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); } else if(image=="ssdfsdf"){ this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); } else if(image=="asfdsdf"){ this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); } else{ this.img = BitmapFactory.decodeResource(context.getResources(), R.id.icon); } } public Bitmap getImage(){ return img; } public float getX() { // TODO Auto-generated method stub return this.x; } public float getY() { // TODO Auto-generated method stub return this.y; } public void setX(float x) { // TODO Auto-generated method stub this.x = x; } public void setY(float y) { // TODO Auto-generated method stub this.y = y; } } </code></pre> <p>I am not sure how to use context and resources in a class when it is called from another activity.</p> <p>I am getting an error message when the context or resources are called.</p> <p>Any code to assist would be very welcome.</p> <p>Thanks for your time</p>
java android
[1, 4]
4,719,791
4,719,792
Updating Data in the gridview
<p>I have a gridview in VS 2005. The grid is displayed in textboxes, so the user can edit. </p> <pre><code> &lt;asp:TemplateField ItemStyle-Width="50"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtSmall" runat="server" Width="45px" Text='&lt;%#DataBinder.Eval(Container.DataItem,"Small") %&gt;' OnTextChanged="TxtSmallChanged"&gt; &lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-Width="50"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtMedium" runat="server" Width="45px" Text='&lt;%#DataBinder.Eval(Container.DataItem,"Medium") %&gt;' OnTextChanged="TxtMediumChanged"&gt; &lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;asp:TemplateField ItemStyle-Width = "50"&gt; &lt;ItemTemplate&gt; &lt;asp:TextBox ID="txtTotal" runat="server" Width="45px" Text='&lt;%#DataBinder.Eval(Container.DataItem,"Total") %&gt;'&gt; &lt;/asp:TextBox&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; </code></pre> <p>Whenever the textbox txtsmall or txtmedium changes(numbers), the Textbox txttotal has to get updated as total of both in txtSmall and txtmedium. I am using a function TxtSmallChanged when text in it is changed. How do i write the codebehind function to update the txtTotal. I hope i am clear. Thank you so much!!</p>
c# asp.net
[0, 9]
5,375,877
5,375,878
edit-in-place problem with sending GET data
<pre><code>$('.textedit').editable('/challenge/skeleton/textedit/textedit/process', { loadurl: '/challenge/skeleton/textedit/textedit/loadraw', loaddata: {id: $(this).attr('id'), client: $(this).data('client')}, submitdata: {id: $(this).attr('id'), client: $(this).data('client')}, .... }); $('#textedit_footer').data('client', 5); $('#textedit_home1').data('client', null); $('#textedit_test').data('client', 3); $('#textedit_userCreate').data('client', null); </code></pre> <p>My problem lies with the GET data being sent. The 'id' data gets sent appropriately, but the 'client' data does not. I think I am using data() the wrong way but can't put my finger on it. Any suggestions? Or any suggestions on how to do this in a better way? Here is an example of one of the divs:</p> <pre><code>&lt;div class="textedit" id="textedit_home1"&gt; &lt;p&gt;test&lt;/p&gt; &lt;/div&gt; </code></pre> <p>All the .textedit elements are edit-in-place features. When the data is submitted (specified in submitdata and loaddata), two data packets should be sent to the server so that it knows how to process it: the first is the id of the edit-in-place, which is stored as the id of the element (this part works). The second piece of data I call the 'client'. The only way I can think of the browser to know which elements have which client is via data(). But some reason my implementation is not working. The 'client' data is simple not sent, that's what's wrong.</p>
javascript jquery
[3, 5]
3,096,585
3,096,586
Is is possible to have two virtual paths for one web application in c# asp.net?
<p>Is it possible to have two or multiple virtual paths for one web application in c# asp.net?</p> <p>e.g. <a href="http://localhost/test1/web.aspx" rel="nofollow">http://localhost/test1/web.aspx</a> and <a href="http://localhost/test2/web.aspx" rel="nofollow">http://localhost/test2/web.aspx</a></p>
c# asp.net
[0, 9]
4,120,118
4,120,119
Jquery if div doesn't exist
<p>I'm using 1 js for 2 different pages. 1 page doesn't have a div which the other does. So when I submit the values, I get a <code>$(</code> js error</p> <p>for</p> <pre><code>$('.description'+save_id+'').html(description_val).show(); //update category description </code></pre> <p>I suspect that I get the error because there is nothing to show(). Is there a short code I can use to detect if the div.description exists otherwise don't do the function?</p>
javascript jquery
[3, 5]
104,036
104,037
Javascript - Load content, callback and loading
<p>Here is my 'getContent' functions which takes a URL:</p> <pre><code>function getContent(url, callback) { var request = new Sys.Net.WebRequest(); request.set_url(url); request.set_httpVerb("GET"); var del = Function.createCallback(getContentResults, callback); request.add_completed(del); request.invoke(); } </code></pre> <p>What I'd like to do is display a loading image when this is called and then hide it when the callback is complete?</p> <p>Can any suggest antying?</p>
javascript jquery
[3, 5]
2,559,740
2,559,741
How to modify javascript in a page using more javascript?
<p>I have a page with some inline javascript in it</p> <pre><code>&lt;script type="text/javascript"&gt; $('#clipboardContainer').hide(); $( '#clipboard' ).click(function() { $("#clipboardContainer").toggle( "slide", {direction: "up", mode: "hide"}, "slow" ); $("#reportsContainer").toggle(); if ($("#clipboard").html() == 'Open Clipboard') $("#clipboard").html('Close Clipboard'); else $("#clipboard").html("Open Clipboard"); }); $('#prev').click(function() { $.ajax({ type: "GET", url: "/teams/change_date", data: { 'id': '&lt;%= @team.id %&gt;', 'date': '&lt;%= @date - 1.day %&gt;' } }); }); $('#next').click(function() { $.ajax({ type: "GET", url: "/teams/change_date", data: { 'id': '&lt;%= @team.id %&gt;', 'date': '&lt;%= @date + 1.day %&gt;' } }); }); &lt;/script&gt; </code></pre> <p>After an ajax call, I want to modify the 'date' attributes using Jquery. How do I reference the javascript functions using the DOM?</p>
javascript jquery
[3, 5]
5,508,816
5,508,817
Keyboard navigation with Jquery
<p>In Jquery, how can I set an event such that when user is browsing some pictures, and presses the left/right arrow key, it calls a function which can be used to show the previous/next photos? I only need to know how to check if the key pressed was the right/left arrrow key and ignore all other key preses.</p> <p>The image will be in its own div.\</p>
javascript jquery
[3, 5]
2,636,877
2,636,878
inline jquery thick box does not close with javascript validation
<p>I am having issues with jquery inline thickbox in the classic asp app. The code looks like this:</p> <p>The properties of the hyperlink tags are as under:</p> <pre><code>&lt;a&gt;href="#TB_inline?height=295&amp;width=604&amp;inlineId=rev-modal" onclick="GetAuth()" id="btnAuthorize" class="thickbox"&gt;Authorize&lt;/a&gt; </code></pre> <p>Now I have created a javascript that makes ajax call and based on the results it either shows error or moves ahead. Inside my javascript I show the error div and close the thick box. It was working fine with the ajax callback items/erros. But now I have added javascript validation to the page. Now my thickbox does not go away when if invalid input is found. I can see the error div and error from the javascript validation but its all inside the gray transparent thickbox thing which I dont want. When I click on the page the thickbox goes away.</p> <p>My javascript is like this :</p> <pre><code>function GetAuth() { if (ValidInputs() == "" ) { } else { $("#errordiv").show(); $("#errordetail").html(ValidInputs()); self.parent.tb_remove(); } return false; } </code></pre>
javascript jquery
[3, 5]
1,916,730
1,916,731
Best way to return duplicate elements in an Array
<p>Here is the way I am using to return duplicate elements.. But I am facing most dangerous performance issues like browser close etc when my array have large number of items with long texts.. </p> <pre><code>var arr = [9, 9, 111, 2, 3, 4, 4, 5, 7]; var sorted_arr = arr.sort(); var results = []; for (var i = 0; i &lt; arr.length - 1; i++) { if (sorted_arr[i + 1] == sorted_arr[i]) { results.push(sorted_arr[i]); } } alert(results); </code></pre> <p>Please suggest me a best way of doing this </p>
javascript jquery
[3, 5]
2,371,229
2,371,230
Is it possible to bind a custom function instead of an event to a div in JQuery?
<p>I wonder if this is possible, I was able to do this with AS3. Is it possible to bind a listener on div that only listens for mouse events. So lets say I have a div called "lion", typically this is how a mouse event is bind:</p> <pre><code> $("#mouse").bind("click", function(e) { alert(e.currentTarget.id); } </code></pre> <p>But as you can see, the mouse event has already been declared as "click". What I would like to do is write a function and then bind that function to "lion" the div. And when lion encounters such mouse events then function is able to capture the mouse event type. Here is the function:</p> <pre><code> $.fn.chkType = function(e) { var evt = e.type; var str = ""; switch(evt) { case "mouseover": str = "MOUSE OVER"; break; case "mouseout": str = "MOUSE OUT"; break; case "click": str = "CLICK"; break; default: break; } alert(str); } </code></pre> <p>And now if I would like to assign this function to "lion", I am not certain how would this be possible? I have done a lot search and the closest I came was at:</p> <p><a href="http://api.jquery.com/bind/" rel="nofollow">http://api.jquery.com/bind/</a></p> <p>I would appreciate your input. Thank you.</p>
javascript jquery
[3, 5]
5,322,963
5,322,964
What does (function($) {})(jQuery); mean?
<p>I am just starting out with writing jQuery plugins. I wrote three small plugins but I have been simply copying the line into all my plugins without actually knowing what it means. Can someone tell me a little more about these? Perhaps an explanation will come in handy someday when writing a framework :)</p> <p>What does this do? (I know it extends jQuery somehow but is there anything else interesting to know about this)</p> <pre><code>(function($) { })(jQuery); </code></pre> <p>What is the difference between the following two ways of writing a plugin:</p> <p><strong>Type 1:</strong></p> <pre><code>(function($) { $.fn.jPluginName = { }, $.fn.jPluginName.defaults = { } })(jQuery); </code></pre> <p><strong>Type 2:</strong></p> <pre><code>(function($) { $.jPluginName = { } })(jQuery); </code></pre> <p><strong>Type 3:</strong></p> <pre><code>(function($){ //Attach this new method to jQuery $.fn.extend({ var defaults = { } var options = $.extend(defaults, options); //This is where you write your plugin's name pluginname: function() { //Iterate over the current set of matched elements return this.each(function() { //code to be inserted here }); } }); })(jQuery); </code></pre> <p>I could be way off here and maybe all mean the same thing. I am confused. In some cases, <strong>this</strong> doesn't seem to be working in a plugin that I was writing using Type 1. So far, Type 3 seems the most elegant to me but I'd like to know about the others as well.</p>
javascript jquery
[3, 5]
2,264,166
2,264,167
Using a rotation vector in Android
<p>Hey, For an application I'm writing, I need the sort of thing <a href="http://developer.android.com/reference/android/hardware/SensorEvent.html#values" rel="nofollow">Sensor.TYPE_ROTATION_VECTOR</a> offers. However, I assume it is from an old version of Android, as I cannot use this variable in my applications (I get a compilation error). I thought about using the gyroscope instead, but I'm not sure if it's equivalent, if it does - how does one get the vector, and another problem: I want to test it on my G1, and it force closes, even though as far as I understood the G1 does have some sort of a gyroscope.</p> <p>Thank you in advance.</p>
java android
[1, 4]
890,880
890,881
Best way to program a server status feature
<p>Some background information. - Running a java server on localhost - Running a webserver on localhost</p> <p>I would like a webpage to have a 'server status' feature which lets me know whether the server is running or not. My question, what is the best way to do this?</p> <ol> <li>When I launch the java server, I write a flag in the database to signify that it is running.</li> <li>Javascript/PHP sockets to try and bind on the same port. (Not sure if possible yet)</li> <li>Shell script to locate the program in the task list.</li> </ol> <p>Thanks!</p>
java php
[1, 2]
2,789,543
2,789,544
preview of another website not thumbnails in php and javascript
<p>I am in the process of creating a site where visitors can preview(not THUMBNAILS!) another url on mypage in an input text box and click on"preview" button-</p> <p>I am using CURL from php to extract the contents of the site and have divided my page into two halves one for accepting url and the other half which will display the previewed content, basically i do not want image of the url site like GOOGLE.</p> <p>though the CURL fetches me the contents and I am able to see the content on the preview half what is annoying is the CSS of the previewed html is getting applied across even my page :( since my knowledge of css is very limited can anyone help me with the following</p> <ol> <li>css of the previewed section must not get applied to my part of the page</li> <li>How to scale down the previewed site just to fit into the preview section of my page.</li> </ol> <p>thanks, Jay</p>
php javascript
[2, 3]
1,814,333
1,814,334
Programmatically View image hash values
<p>How to Programmatically View image hashes in C# or PHP ?</p>
c# php
[0, 2]
5,269,272
5,269,273
Problem with jquery cycle slowing down with a large flash background on site in IE
<p>My problem is that I have a large flash background running in my site, and I want to add a jquery cycle and I did, it suppose to run a text horizontally in the page. But the problem is in IE. Because it has a large flash in the background, browser is slowing down no matter the machine speed is and the text dosen't run smoothly as I want. I just need a text to run horizontally in the page. Any one know a code that dosen`t get stuck and easy to run in IE and FF?</p>
javascript jquery
[3, 5]
633,361
633,362
split string after comma and till string ends- asp.net c#
<p>I have a string of type </p> <blockquote> <p>ishan,training</p> </blockquote> <p>I want to split the string after "," i.e i want the output as</p> <blockquote> <p>training</p> </blockquote> <p>NOTE: "," does not have a fixed index as the string value before "," is different at different times.</p> <p>e.g ishant,marcela OR ishu,ponda OR amnarayan,mapusa etc...</p> <p>From all the above strings i just need the part after ","</p>
c# asp.net
[0, 9]
4,758,782
4,758,783
Lazy loading and dependency resolution
<p>some time ago, I was reading an article(a library built by some guy) about how his library can do </p> <ol> <li>lazy loading of JS</li> <li>resolve dependencies between JS (typically encountered when trying to "include" one js from another)</li> <li>include files only once. thought specified multiple times regardless of how they are called (either directly specifying it as file or specifying it as one of the dependencies)</li> </ol> <p><strong>I forgot to bookmark it, what a mistake</strong>. Can some one point me to something which can do the above. I know DOJO and YUI library have something like this, but I am looking for something which I can use with jQuery</p> <p>I am probably looking for one more feature as well.</p> <ul> <li>My site has asp.net user controls (reusable server side code snippets) which have some JS. Some of them get fired right away, when the page is loading which gives a bad user experience. <a href="http://developer.yahoo.com/performance/rules.html#js_bottom" rel="nofollow">Yahoo performance guidelines</a> specify that JS should be at the bottom of the page, but this is not possible in my case as this would require me to separate the JS and the corresponding server side control into different files and maintenance would be difficult. I definitely can put a jQuery document.ready() in my user control JS to make sure that it fires only after the DOM has loaded, but I am looking for a simpler solution.</li> </ul> <p>Is there anyway that I could say "begin executing <strong>any</strong> JS only after DOM has loaded" in a global way than just writing "document.ready" within every user control ?</p>
javascript jquery
[3, 5]
5,264,299
5,264,300
Get parameters from TD of checked TR
<pre><code>&lt;table id="tab"&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox"&gt;&lt;/td&gt;&lt;td aaa="111"&gt;sdf&lt;/td&gt;&lt;td bbb="222"&gt;sdfsd&lt;/td&gt;&lt;td ccc="333"&gt;trs&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox"&gt;&lt;/td&gt;&lt;td aaa="342"&gt;hjk&lt;/td&gt;&lt;td bbb="274"&gt;sdfsd&lt;/td&gt;&lt;td ccc="337"&gt;sdg&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox"&gt;&lt;/td&gt;&lt;td aaa="432"&gt;hgj&lt;/td&gt;&lt;td bbb="652"&gt;sdfsd&lt;/td&gt;&lt;td ccc="747"&gt;dih&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;span id="show"&gt;show&lt;/span&gt; $("#show").click(function(){ var text = []; $("#tab").each( if($(this).find(input[type=checkbox].is(:checked))){ text.push({ 'aaa': $(this).attr('aaa'), 'bbb': $(this).attr('bbb'), 'ccc': $(this).attr('ccc') }); } ) console.log(text); }) </code></pre> <p>LIVE: <a href="http://jsfiddle.net/KFbbZ/" rel="nofollow">http://jsfiddle.net/KFbbZ/</a></p> <p>If i click <strong>show</strong> i would like get all parameters form checked TR. How can i make it? My example is bad...</p>
javascript jquery
[3, 5]
3,711,624
3,711,625
Make div appear and change the whole html to be darker
<p>I have a div with embedded youtube. After I click some button, I would like the div to appear (I know how to achieve this), but I want the whole background to become darker. (This is inline with overlays.) I've tried using opacity - I change the opacity of the whole html with jquery, i.e. <code>$('html').css('opacity','-0.5');</code> and change back the opacity of the div to normal, but for some reason, the opacity of the div stays the same (0.5). I don't quite like the opacity since actually it doesn't make the background darker (rather lighter). </p> <p>Any ideas how to make the background darker?</p>
javascript jquery
[3, 5]
159,496
159,497
Why am I not able to install Android SDK?
<p>I installed android sdk. When I click the android sdk manager. Then the the following error message is displayed in an alert box </p> <blockquote> <p>Failed to fetch URL <a href="https://dl-ssl.google.com/android/repository/repository.xml" rel="nofollow">https://dl-ssl.google.com/android/repository/repository.xml</a>, reason: sun. Security. Validator. ValidatorException: PKIX path validation failed: java.security.cert.certPathValidatorException: timestamp check failed</p> </blockquote> <p>Please help me to solve the issues.</p>
java android
[1, 4]
854,317
854,318
Image upload script to start other tasks to free up UI
<p>I have an Android application that provides image upload functionality. When a user selects a photo the app initializes a php script on a remote server - while the image is uploading there is a progress dialog giving feedback to the user. The upload script is performed in an AsyncTask.</p> <p>Currently the php processing script pseudoprocess is:</p> <pre><code>do some house keeping upload image image modifications (thumbnails, rotate) send out push notifications exit </code></pre> <p>Upon exit, the UI is freed up and the user has access to the uploaded image.</p> <p>My question is in my script can/should I be doing the image modifications and push notifications outside this script? And if so how? In the Android Java I would start a background task, but is there someway to do this in PHP - and I don't mean by calling another script separately or cron jobbing something.</p> <p>I mean something like:</p> <pre><code>do some housekeeping upload image php call background task for modifications php call background task for push exit </code></pre> <p>So in that example the user interface would be finished processing, but the server may still be doing some stuff on the image. </p>
php android
[2, 4]
3,569,016
3,569,017
jQuery variable shadowing
<p>There is strange pattern in jQuery:</p> <pre><code>var jQuery = (function() { // Define a local copy of jQuery var jQuery = function( selector, context ) { ... return jQuery; })(); </code></pre> <p>What is the practical reason for this? Why not just expose the inner jQuery function? Is it only for name clashes in the inner jQuery and outer jQuery since both are in closures.</p>
javascript jquery
[3, 5]
2,210,817
2,210,818
Toggle control - how to create plus minus button?
<p>My toggle control is working, but I would like to add a plus-minus button: when content appears it becomes "-" and when content is hidden it changes to "+". Can you help please?</p> <pre><code> &lt;div class='toggle'&gt; &lt;h2&gt;Read More&lt;/h2&gt; &lt;div class="togglebox"&gt; &lt;div class="content"&gt; &lt;h3&gt; &lt;p&gt; A new exciting way to broadcast your business to customers A new exciting way to broadcast your business.Lorem ipsum &lt;/p&gt; &lt;/h3&gt; &lt;!--Content Here--&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; $(document).ready(function(){ //Hide the tooglebox when page load $(".togglebox").hide(); //slide up and down when click over heading 2 $("h2").click(function(){ // slide toggle effect set to slow you can set it to fast too. $(this).next(".togglebox").slideToggle("slow"); return true; }); }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,574,880
2,574,881
jQuery and Object Oriented Javascript - How do I do it properly?
<p>I'm quite experienced with jQuery but I'm just getting into object oriented Javascript and want to make sure I'm doing it right.</p> <p>Here's an example of what I'm doing so far... I'd appreciate tips/advice on how I can improve my approach:</p> <pre> // create a class for collapsable fieldsets window.CollapsableFieldset = (function() { function CollapsableFieldset(jQObject) { // look for all the legend tags within this fieldset jQObject.find("legend").click(function(event) { // add or remove the "open" class to the fieldset return jQObject.toggleClass("open"); }); } return CollapsableFieldset; })(); jQuery(document).ready(function() { return $("fieldset.collapsable").each(function(i, element) { return new CollapsableFieldset($(element)); }); }); </pre> <p>So basically I'm creating a class that defines the behaviour I'm looking for and then in the jQuery block, I'm selecting each object that matches and creating a new instance of the class with that object as an argument.</p>
javascript jquery
[3, 5]
1,206,211
1,206,212
javascript: Get value by clicking on current value in loop
<p>I am building datatables and by setting up total records in database I have total count of them.</p> <p>Now I am little confused about click event in JavaScript. This is how i am doing this:</p> <pre><code> for (var cnt = pageno; cnt &lt; pageno + 5; cnt++) { $("#newList").append('&lt;li id="pageno" value=""' + cnt + ' onclick="GetPageno();" &gt; ' + cnt + '&lt;/li&gt;'); } </code></pre> <p>This is my current loop that will set 5 numbers of list. Now if I want to get value of current list then I am doing this:</p> <pre><code>function GetPageno() { //this.val(); alert(document.getElementById('pageno').val()); } </code></pre> <p>I have 1 to 5 numbers list on web page. </p> <p>How do I get value of that number I clicked?</p> <p>Ex. If I clicked "5", then alert should be coming with value "5", same as for all the list elements.</p>
javascript jquery
[3, 5]
1,630,762
1,630,763
how to display image created dynamically in asp.net 3.5 c# on localhost
<p>I have to display image dynamically. I have written code for that, i got the name of the image &amp; path also from database i.e Filename &amp; filepath which i stored earlier, but I didnt get image(not displaying image even i stored path of that image). Please give me idea about how to set imageurl of image here on local host. My code is as follow:</p> <pre><code>//PlaceHolder for adding images i.e inside formview control PlaceHolder PHFilename = (PlaceHolder)FVViewCustData.FindControl("PHFilename"); for (int i = 0; i &lt; dsfile.Tables[0].Rows.Count; i++) { HyperLink hypname = new HyperLink(); hypname.Text = Convert.ToString(dsfile.Tables[0].Rows[i]["FileName"]); PHFilename.Controls.Add(hypname); Image img = new Image(); //IPAddress is my ipaddress img.ImageUrl = "IPAddress" + Convert.ToString( dsfile.Tables[0].Rows[i]["FilePath"]); PHFilename.Controls.Add(img); } </code></pre>
c# asp.net
[0, 9]
692,800
692,801
Removing Warning Image
<p>How to remove The warning image of the alert box in Javascript. I want to delete the warning image from the javascript alert window. Is it Possible?</p>
asp.net javascript
[9, 3]
374,286
374,287
Embedded HTML contains JavaScript function not getting called
<p>In my scenario i am making an ajax request to get some data and then passing its result to some function you can see the code.</p> <pre><code> $.ajaxSetup({ cache: false }); $.ajax({ url: chartUrl, type: 'GET', dataType: 'text', success: function(result){ UpdateChartArea(result, chartType); if(isTextMining){ eval('ShowBreadCrmb_'identifier.substring(1) + '();'); } }, error: function(req, status, error) { } }); </code></pre> <p>After embedding the HTML i want to call a JS function that is in that HTML. the HTML that i am embedding is present in a user control so to have a unique instance this is how my show bread crumb method look like</p> <pre><code> function ShowBreadCrmb_&lt;%= reportScale.ScaleID %&gt;() { alert('LHJLH'); var isTextMining = &lt;%= TextMiningChart %&gt;; if(isTextMining) { CreateTmBreadCrumb('&lt;%= reportScale.NodeLevel %&gt;','&lt;%= reportScale.NodeName %&gt;',topicList) } } </code></pre> <p>for more info what my updatechartarea does is </p> <pre><code>if (parent) { clearChildren(parent); var div = document.createElement("div"); div.innerHTML = html; parent.appendChild(div); } </code></pre> <p>I want to call the bread crumb function after update chart area function is called.</p>
javascript jquery asp.net
[3, 5, 9]
4,634,623
4,634,624
display machine IP in the URL and run the defined web services
<p>I have started learning web services. I got the entire concept. Till now I'm running through <code>localhost:1234/services.asmx</code>. It's working. But now I want to put my machine IP address instead of localhost. I'm having idea of web services. Is there any specific method to run by machine ip? plz help me. I have done lot of search. Please tel me any solution for this.</p> <pre><code>namespace WebService1 { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return "Hello World"; } } } </code></pre>
c# java asp.net
[0, 1, 9]