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
2,907,960
2,907,961
High performance JS map for int-string pairs
<p>I need a high performance map in Javascript (hashmap or whatever) that maps <code>int</code>(s) to <code>string</code>(s). The map would be used to build some sections of the webpage after dom is ready. I know simple javascript object also works like a map but I need to work with best performance. </p> <p>I would like to initialize the map with all data pairs just at once by appending a string to the webpage while generating the response page from server.</p> <p>Any ways how to improve performance of javascript map for int- string pairs or are there any implementations for the same ?</p> <p>--</p> <p>Using jQuery 1.7</p>
javascript jquery
[3, 5]
2,015,727
2,015,728
Using ADB to make a phone call after a time out
<p>Can the pc use ADB command android to make call?If it can,How to?</p> <p>I have a text file containing a telephone number and a time.</p> <p>How can I use JavaScript to count down from this time,and then use ADB to make an Android phone call to that number?</p> <p>Thanks</p>
javascript android
[3, 4]
2,626,696
2,626,697
How to get real object from Jquery?
<p>How to get real object from Jquery selector result? Example:</p> <pre><code> $("form").first().id != $("form").first().attr("id") </code></pre> <p>so this mean result somehow wrapped/delegated with jquery how to unwrap it?</p>
javascript jquery
[3, 5]
3,668,809
3,668,810
How to bind a classes property to a TextBox?
<p>I have a Customer class with a string property comments and I am trying to bind it like this:</p> <pre><code>&lt;asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" Text=&lt;%=customer.Comments %&gt;&gt; &lt;/asp:TextBox&gt; </code></pre> <p>However, it gives me the error:</p> <p>Server tags cannot contain &lt;% ... %> constructs.</p> <p>I also have a method in the class called GetCreatedDate and in the aspx page, I am doing &lt;%=GetCreatedDate()%> and &lt;%GetCreatedDate();%>. What is the difference?</p>
c# asp.net
[0, 9]
2,173,287
2,173,288
C#, ASP.NET - NullReferenceException - Object reference not set to an instance of an object
<p>Definition of variables in use:</p> <pre><code>Guid fldProId = (Guid)ffdPro.GetProperty("FieldId"); string fldProValue = (string)ffdPro.GetProperty("FieldValue"); FormFieldDef fmProFldDef = new FormFieldDef(); fmProFldDef.Key = fldProId; fmProFldDef.Retrieve(); string fldProName = (string)fmProFldDef.GetProperty("FieldName"); string fldProType = (string)fmProFldDef.GetProperty("FieldType"); </code></pre> <p>Lines giving the problem (specifically line 4 (hTxtBox.Text = ...)):</p> <pre><code>if (fldProType.ToLower() == "textbox") { Label hTxtBox = (Label)findControl(fldProName); hTxtBox.Text = fldProValue; } </code></pre> <p>All data is gathered from the database correctly, however the label goes screwy. Any ideas?</p>
c# asp.net
[0, 9]
75,226
75,227
Hide navigation bar in master page depend on my user role
<p>Hi i having a question when using web form, and i have a master page that contain my navigation, and i would like to ask is it possible after i login, my navigation bar can be customize base on different role (admin, student, staff)..</p> <pre><code> &lt;asp:ContentPlaceHolder runat="server" ID="FeaturedContent" &gt; &lt;nav&gt; &lt;ul id="menu" style="text-align:center;"&gt; &lt;li&gt;&lt;a href="~/"&gt;Moderator&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="~/About.aspx"&gt;Supervisor&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="~/Contact.aspx"&gt;Student&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/asp:ContentPlaceHolder&gt; </code></pre> <p>so that is sample of contentplaceholder in my sitemaster, my idea is to hide moderator and supervisor when i log in with student, and i wish to use check the roles "student" then the sitemaster navigation bar of moderator and supervisor can hide from users, please do advice me there there are better solutions as this is only i know.. thanks..</p>
c# asp.net
[0, 9]
2,137,112
2,137,113
Why this very simple javascript/jquery code won't work correctly
<p>I have a very simple JavaScript/jquery code which won't just work correctly. The problem seems to be that positioning of the div with id 'circle' does not seem to get calculated when the loop is run. Just need to know why the problem is occurring and if any fixes available.</p> <p>Here is the link <a href="http://jsfiddle.net/TDRyS/" rel="nofollow">http://jsfiddle.net/TDRyS/</a> Basically what I am trying to do is trying to move the ball up once it is at a distance of 500px from the top.</p> <p><strong>The code:</strong></p> <pre><code>var maxa = document.width; var maxb = document.height; $(document).ready(function() { dothis(); }); function dothis() { var left = parseInt(document.getElementById('circle').style.left); var top = parseInt(document.getElementById('circle').style.top); if (top &gt;= 500) { $("#circle").animate({ top: "-=" + Math.floor(Math.random() * 100 + 1) + "px", left: "-=" + Math.floor(Math.random() * 100 + 1) + "px" }, 1000); } else { $("#circle").animate({ top: "+=" + Math.floor(Math.random() * 100 + 1) + "px", left: "+=" + Math.floor(Math.random() * 100 + 1) + "px" }, 1000); } dothis(); }​ </code></pre>
javascript jquery
[3, 5]
1,905,943
1,905,944
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]
1,421,502
1,421,503
Accept the input and check the mask in the reverse way
<p>I need to develop an javascript function to check the mask reversely. It means, if I set the mask "###:##",</p> <ul> <li>When I type "1" it shows, "1"<br> When I type "2" it shows, "21" <br> When I type "3" it shows ,"3:21"<br> etc..</li> </ul> <p>Is it possible to develop like that?? I have no idea how to start it? Can anyone put me on the right direction?</p>
javascript jquery
[3, 5]
5,055,592
5,055,593
Android querying external MySQL database
<p>I had some problem understanding the following line of code. What exactly does it do and how does it help me query the database from android </p> <pre><code>$q=mysql_query("SELECT * FROM people WHERE birthyear&gt;'".$_REQUEST['year']."'"); while($e=mysql_fetch_assoc($q)) $output[]=$e; print(json_encode($output)); </code></pre> <p>I know the initial part of it means select every record from table people where birthyear...</p> <p>But after that I get confused. I am calling this php function from android using http post</p> <pre><code>ArrayList&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(); nameValuePairs.add(new BasicNameValuePair("year","1980")); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://10.0.2.2/retrieve.php"); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); </code></pre> <p>Where is an input stream. Can someone help me out? </p>
php android
[2, 4]
5,319,007
5,319,008
how to kill a phonefacade in between in android through python?
<p>I am using "phoneDialNumber ApI" it makes a call of near around 45 seconds to other mobile , how i can kill it in between? </p>
android python
[4, 7]
671,853
671,854
What do I need to do to show the calendar when button is clicked?
<p>I am trying to do a calendar which pops out when a button (...)is clicked, but I am stuck and don't know what I have to do. Below is the code I am using. I am using visual studio 2010 and C# as my programming langauge.</p> <pre><code>&lt;asp:textbox id="TextBox1" runat="server"&gt;&lt;/asp:textbox&gt; &lt;input type="button" id="Button2" runat="server" value="...."&gt;&lt;br&gt; &lt;asp:Panel id="pnlCalendar" runat="server" style="POSITION: absolute"&gt; &lt;asp:calendar id="Calendar3" runat="server" CellPadding="4" BorderColor="#999999" Font-Names="Verdana" Font-Size="8pt" Height="180px" ForeColor="Black" DayNameFormat="FirstLetter" Width="200px" BackColor="White"&gt; &lt;TodayDayStyle ForeColor="Black" BackColor="#CCCCCC"&gt;&lt;/TodayDayStyle&gt; &lt;SelectorStyle BackColor="#CCCCCC"&gt;&lt;/SelectorStyle&gt; &lt;NextPrevStyle VerticalAlign="Bottom"&gt;&lt;/NextPrevStyle&gt; &lt;DayHeaderStyle Font-Size="7pt" Font-Bold="True" BackColor="#CCCCCC"&gt; &lt;/DayHeaderStyle&gt; &lt;SelectedDayStyle Font-Bold="True" ForeColor="White" BackColor="#666666"&gt; &lt;/SelectedDayStyle&gt; &lt;TitleStyle Font-Bold="True" BorderColor="Black" BackColor="#999999"&gt; &lt;/TitleStyle&gt; &lt;WeekendDayStyle BackColor="LightSteelBlue"&gt;&lt;/WeekendDayStyle&gt; &lt;OtherMonthDayStyle ForeColor="#808080"&gt;&lt;/OtherMonthDayStyle&gt; &lt;/asp:calendar&gt; &lt;/asp:Panel&gt; </code></pre> <p><img src="http://i.stack.imgur.com/L20tT.jpg" alt="This is generated with my code"></p>
c# asp.net
[0, 9]
3,024,663
3,024,664
Grabbing param value from #id=3333
<p>I have this,</p> <pre><code>var stateObj = { foo: "foo" }; function change_my_url() { if (window.history &amp;&amp; window.history.pushState){ history.pushState(stateObj, "page 2", "foo.html?id=3333"); }else{ location.hash = '#id=3333' } } </code></pre> <p>In case window.history isnt supported, it will be #id=3333. Now if you load the page and it has a location.hash, it $.post request to file.php with it:</p> <pre><code>$.post('do_something.php', { hash: hash }, function(result) { $('#photos').html(result); }); </code></pre> <p>in do_something im grabbing it with $_POST['hash'];. Now $_POST['hash'] will contain #id=3333. How can i divide in params and grab the value, '3333' ?</p>
php javascript
[2, 3]
2,860,950
2,860,951
what exactly does the keyword prototype do in jquery?
<p>Is the keyword (or method?) prototype in jquery kind of like extension methods?</p> <p>i.e. all classes will have this functionality available to it going forward?</p>
javascript jquery
[3, 5]
2,672,601
2,672,602
How I can create an extension method for asp.net page
<p>How I can create an extension method like "Html.DisplayTextFor" in Asp.net mvc ? I mean I need an extension for my page class in asp.net like "Page.DisplayTextFor" how I can implement it. I have created this :</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace System.Web.UI { public static class PageExtension { public static void DisplayTextFor(this string text) { /*some operation*/ } } } </code></pre> <p>but it doesn't work.</p>
c# asp.net
[0, 9]
466,104
466,105
What is the difference between those two statements?
<p>What is the difference between those two statements?</p> <p>A:</p> <pre><code>$(document.getElementById('timer-' + endTimes[i].nid)).removeClass('hidden-timer').text(''); </code></pre> <p>B:</p> <pre><code>$('#timer-' + endTimes[i].nid).removeClass('hidden-timer').text(''); </code></pre> <p><strong>[EDIT]</strong></p> <p>Thanks for all responses.</p> <p><code>endTimes[i].nid</code> is numeric, ex <code>340</code>.</p> <p>The most important difference for me was that line A is causing a WSOD, but line B works fine.</p>
javascript jquery
[3, 5]
3,222,423
3,222,424
How to get Tab Index of active/focused control on page using javascript
<p>I have controls on my page, is there any way I can get the tabIndex of active control or focused control?</p> <p>Thanx</p>
javascript asp.net
[3, 9]
5,722,672
5,722,673
How Login page is working in Jquery mobile?
<p>I made a login page, i got the jquery code Can anybody explain me this CODE!?? Line by line! so that i know how the hell it is working! i have the code but i dont know how its work.. i am not that good in service integration and stuff</p> <pre><code>$(document).ready(function() { $('#loginForm').submit(function() { $('#output').html('Connecting....'); var postTo = 'login.php'; $.post(postTo,{username: $('[name=username]').val() , password: $('[name=password]').val()} , ` function(data) { if(data.message) { $('#output').html(data.message); } else { $('#output').html('Could not connect'); } },'json'); return false; }); }); </code></pre> <p>` In my html :</p> <pre><code>&lt;!-- Start of first page --&gt; </code></pre> <p></p> <pre><code>&lt;div data-role="header"&gt; &lt;h1&gt;Foo&lt;/h1&gt; &lt;/div&gt;&lt;!-- /header --&gt; &lt;div data-role="content"&gt; &lt;p id="output"&gt;&lt;/p&gt; &lt;p&gt; &lt;form method="post" id="loginForm"&gt; Username: &lt;input type="text" name="username"&gt;&lt;br /&gt;&lt;br /&gt; Password: &lt;input type="password" name="password"&gt;&lt;br /&gt; &lt;input type="submit" value="Login"&gt; &lt;/form&gt; &lt;/p&gt; &lt;/div&gt;&lt;!-- /content --&gt; &lt;div data-role="footer"&gt; &lt;h4&gt;Page Footer&lt;/h4&gt; &lt;/div&gt;&lt;!-- /header --&gt; </code></pre> <p></p> <p>I basically wanna know what $.post is doing? and how?</p>
javascript jquery
[3, 5]
5,629,124
5,629,125
data import from excel facing an issue
<p>I am importing data from MS Excel. The code i have written is,</p> <pre><code>var ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + uploadfile.PostedFile.FileName + ";" + "Extended Properties=Excel 12.0;"; OleDbConnection objConn = new OleDbConnection(sConnectionString); objConn.Open(); try { var objCmdSelect = new OleDbCommand("select * from [Sheet1$]", objConn); } </code></pre> <p>and so on.</p> <p>I got an error which looks very generic to me</p> <p><strong>The Microsoft Office Access database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly</strong></p> <p>*</p> <blockquote> <p>My worksheet name is spelled correclty but for my confirmation, i did below code dt = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);</p> </blockquote> <pre><code>if(dt == null) { return null; } var excelSheets = new String[dt.Rows.Count]; int i = 0; // Add the sheet name to the string array. foreach(DataRow row in dt.Rows) { excelSheets[i] = row["TABLE_NAME"].ToString(); i++; } </code></pre> <p>* but i got my Data Table null. My question is the connection is open successfully but i can't read data from the excel file. <strong>Is there any special Authentication required.?</strong> because i am getting the above error.</p>
c# asp.net
[0, 9]
4,443,215
4,443,216
will php/apache ever support multi threading?
<p>i mainly focus on the web, i think i will never create desktop applications.</p> <p>so i think it's better for me to focus on typical web languages like php.</p> <p>i know an advantage java has over php is multi threading though.</p> <p>will php ever support this feature in the future?</p> <p>thanks</p>
java php
[1, 2]
5,573,982
5,573,983
onchange without click on another location
<p>I used onchange on an input element, but the event handler function won't run until the field loses focus.</p> <p>I want the function in onchange to run in real time. Onkeyup doesn't seem to be a solution, because it will trigger the function when any key is pressed, even if it doesn't change the field contents (for example, <kbd>SHIFT</kbd> and <kbd>CTRL</kbd>).</p> <p>What should I do?</p>
javascript jquery
[3, 5]
266,948
266,949
Image size validation
<p>is it possible to validate file image size with jquery class orjavascript ? </p> <p>Can i do that ? I made some research but did not reach anything</p> <p>Thank you</p>
javascript jquery
[3, 5]
5,238,651
5,238,652
getting data from child window
<p>I an working on a project and has encountered a problem. please view the following code. </p> <pre><code>&lt;iframe name="stus" id="stus" style="display:none;"&gt;&lt;/iframe&gt; &lt;form name="water" id="water" method="post" autocomplete="off" action="components/com_pocketsea/assets/new/water.php" target="stus"&gt; &lt;input type="hidden" id="newwatermark" name="newwatermark"&gt; &lt;/form&gt; &lt;div id="posting"&gt;&lt;/div&gt; </code></pre> <p>and the code for water.php is </p> <pre><code>&lt;?php $newwat = $_POST['newwatermark']; ?&gt; &lt;script type="text/javascript" src="../../js2/jquery.min.js" &gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $("#posting", window.parent.document).html("&lt;?php echo $newwat; ?&gt;").fadeIn('slow'); }); &lt;/script&gt; </code></pre> <p>plz help</p>
php javascript jquery
[2, 3, 5]
811,173
811,174
Translating or Interpreting JavaScript from PHP
<p>Any tips on running JavaScript code from PHP? I'm trying to run a javascript function and get its return value. This is a LOT easier in this case than translating it myself into PHP. Would <a href="http://pecl.php.net/package/spidermonkey" rel="nofollow">Spidermonkey</a> be good for this task, or something else? </p> <p>UPDATE: On the other hand, if there's an app for translating the JavaSCcript into PHP once instead of just interpreting it, that might be better. So I'd be interested in recommendations on that front..</p> <p>Thanks much</p>
php javascript
[2, 3]
1,308,166
1,308,167
Java Class Declaration Grammar
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/745756/java-generics-wildcarding-with-multiple-classes">Java Generics Wildcarding With Multiple Classes</a> </p> </blockquote> <p>I was reading an Android app's source code and I came across a grammar problem. Being a Java newbie, I've no idea what one specific part actually means. The code looks like.</p> <pre><code>public abstract class TabPagerActivity&lt;V extends PagerAdapter &amp; FragmentProvider&gt; extends PagerActivity implements OnTabChangeListener, TabContentFactory { </code></pre> <p>What I feel confused about is this part:</p> <pre><code>&lt;V extends PagerAdapter &amp; FragmentProvider&gt; </code></pre> <p>Please help.</p>
java android
[1, 4]
4,182,460
4,182,461
Cannot get disable button to work
<p>Hey guys, quick question, I have this javascript/jquery function that basically wraps an input in image brackets, and the first part of the function works, but the button does not disable after and I cannot figure out why (last line does not work). If anyone has an idea, let me know. Thanks in advance.</p> <pre><code>&lt;input id="2image" type="button" value="Attach" onclick="imageid('message')"&gt; &lt;script&gt; function imageid(input) { var obj=document.getElementById(input); obj.value+="[image]image[/image]"; $("#2image").attr({ disabled:true, value:"Inserted" }); } &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
1,312,750
1,312,751
How to do repeated actions in Android?
<p><strong>I use such code:</strong> </p> <pre><code>t = new Timer(); t.schedule(new TimerTask() { @Override public void run() { //some action } }, 30000, 30000); </code></pre> <p>If I wrap up application(click Home) and after that recover application then task is canceled. How to solve that problem?</p>
java android
[1, 4]
2,235,605
2,235,606
How to use method get value in "input[type=radio]"
<pre><code>&lt;script&gt; $(document).ready(function(){ $('#btnSubmit').bind('click', function(){ var option = $('#form input[type=radio]').val(); if(!option){ alert('Answer empty'); return false; } $('#form').submit(); }); }); &lt;/script&gt; &lt;form id="form" method="post"&gt; &lt;input type="radio" id="option1" name="option1" /&gt; &lt;input type="submit" name="btnSubmit" id="btnSubmit" value="submit" /&gt; &lt;/form&gt; </code></pre> <p>I think it wrong in function call <code>$('#form input[type=radio]').val();</code></p>
php jquery
[2, 5]
1,519,929
1,519,930
Using PHP and C++ for data exchange?
<p>Is it possible to send data from C++ to PHP? I have wrote a server in C++ that connects to a database, and I was wondering if it is possible at all to use the socket library built into PHP to connect to the socket server written in C++. Would it just be PHP itself? I mean, would I not use JavaScript (AJAX) to call a PHP script that might do the socket work?</p> <p>Basically, how do Google do this? I know some of their applications use C++/Java as their back-end, but is there any performance at all?</p> <p>For those wondering why I am asking this question, then the answer is I don't want to rely on PHP to handle data as I am writing a game. I would like PHP to handle the web part, but not necessarily the game client so-to-speak; and I just think C++ would be a lot efficient at sending and receiving data to store in the database.</p> <p>Has anyone done something like this and if so did you run into problems; and is this a practical solution at all?</p> <p>Thanks.</p>
php c++
[2, 6]
323,514
323,515
I want both values before and after submitting a form
<p>I have a simple form and inside there are two input fields text type. for example if input has initially value like "Hello" and later on I have changed it to "Hi" and then I submit this form. </p> <p>I want to see this both values, anyone suggest me please </p> <p>markup</p> <pre><code> &lt;form action="index_submit" method="get" name="anil" &gt; &lt;label for="first_name"&gt;first name&lt;/label&gt;&lt;input type="text" name="first_name" value="" id="first_name"&gt; &lt;label for="last_name"&gt;last name&lt;/label&gt;&lt;input type="text" name="last_name" value="" id="last_name"&gt; &lt;label for="user_name"&gt;user name&lt;/label&gt;&lt;input type="text" name="user_name" value="" id="user_name"&gt; &lt;input type="submit" name="submit" value="submit" id="submit"&gt; &lt;input type="reset" name="reset" value="reset" id="reset"&gt; &lt;/form&gt; </code></pre> <p>js </p> <pre><code>$(document).ready(function(){ $('form #submit').click(function(){ var oldValue var newValue }); }) </code></pre>
javascript jquery
[3, 5]
2,981,379
2,981,380
How can I get my Web application to communicate with my Desktop application?
<p>I have developed a Web and windows application, both in C#.NET. Now, what I would like to do is when a button is clicked on a particular page in the web application, a signal has to be sent to the windows app saying a link has been clicked. How could I do this really easily? I would like to stay away from socket programming...</p> <p>I thought of the web app storing cookies and the desktop application monitoring the cookies folder but that seems a bit clumsy.</p>
c# asp.net
[0, 9]
1,583,546
1,583,547
How can I select with jQuery elements that have been included using Javascript?
<p>So I have a menu that gets added using this function:</p> <pre><code>function loadContent() { $(".navbar").load("navigation.html"); } </code></pre> <p>navigation.html looks like this:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a href="home.html" class="first"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="calendar.html"&gt;Calendar&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="profile.html"&gt;Profile&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="charts.html" class="last"&gt;Energy Charts&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>but when I try to select something in that menu and add a class, let's say:</p> <pre><code>$('.navbar a').addClass('activeState'); </code></pre> <p>it doesn't work in Chrome, I think because the DOM needs to be refreshed or something, I really don't know...</p>
javascript jquery
[3, 5]
971,807
971,808
Allow value -1 when clicking on a button and link, but just one time (the first time clicked upon) without disabling the button/link
<p>I have the following script:</p> <pre><code>&lt;script language=javascript&gt; function process(v){ var value = parseInt(document.getElementById('v').value); value+=v; document.getElementById('v').value = value; } &lt;/script&gt; &lt;input type=test size=10 id='v' name='v' value='3'&gt; &lt;input type=button value='-' onclick='javascript:process(-1)'&gt; &lt;a id="v" href="#" onclick='javascript:process(-1)'&gt;minus&lt;/a&gt; </code></pre> <p>If you click the button, it will deduct 1 from the total amount (3). The same applies for the minus-link. Now this all works great. </p> <p>The problem is that I want to allow each one to deduct 1, just one time. Without disabling the button/link.</p> <p>Example what I need: So I click the button: 3 -> 2. Now I click the button again, nothing will happen 2 stays 2. Now I click the minus-link, 2 -> 1. Clicking the link again, nothing will happen 1 stays 1</p> <p>This can all be mixed of course. The main thing is, they each are allowed to do the -1 just one time (the first time clicked upon).</p> <p>How to do this?</p> <p>Kind regards, Maurice</p>
javascript jquery
[3, 5]
4,437,206
4,437,207
How to combine PHP and Javascript together?
<p>I have a function in my Javascript script that needs to talk with the PHP to get the data in my database. But I'm having a small problem because I start the PHP in the for loop in Javascript, and then inside that for loop I get the data in my database. But the pointer in the for loop inside the PHP code is not working.. I guess the problem is in escaping? Or maybe it's not possible at all.</p> <p>Here's my code:</p> <pre><code>(function() { var data = []; for(var i = 0; i &lt; 25; i++) { data[i] = { data1: "&lt;a href='&lt;?= $latest[?&gt;i&lt;?=]-&gt;file; ?&gt;'&gt;&lt;?= $latest[?&gt;i&lt;?=]-&gt;title; ?&gt;&lt;/a&gt;", // The problems data2: .... }; }; }); </code></pre>
php javascript
[2, 3]
440,653
440,654
Jquery working with two or more variables at the same time
<p>I am having code like this:</p> <pre><code> var input = $('input'); var select = $('select'); var text = $('textarea'); var name = $('#name'); var email = $('#email'); var phone = $('#phone'); var subject = $('#subject'); var message = $('#message'); var sum = $('#sum'); (input, select, text).focus(function(){ $(this).css('z-index', 100) }); </code></pre> <p>When input element is focus, it needs to change z-index to a 100, and non focused elements need to change their z-index to 1. How can I do this?</p>
javascript jquery
[3, 5]
4,987,883
4,987,884
Replacing Data in a Field (3 Page Form)
<p>OK, I'm trying to do something within a 3 Page Active 4D form powered by Javascript, and it is this...</p> <p>On page 1 a user selects a value from a pull down menu.</p> <p>Page 2 is where all the functionality I need happens, and here is what I need to happen.</p> <p>I have to use something along the lines of Getsession_Item to get the value from the pop up box compare it to a value entered within a text box in step, and compared to the 3 separate values in the pull down in step 1.</p> <p>If the value of the pull down is larger than the amount in the text box than I need it to reduce the value using updateSession. I've written some code that I think should work, but for the life of me I cannot get it working, and firebug isn't detecting errors.</p> <p>The data that goes and gets published in a review page.</p> <pre><code>$("#DeliveryMethod_T").click(function(){ var Amount_T = getSessionItem("Amount_T"); var shortAdv = 0; temp = $("#NetEC_R").val(); var netEarned = parseInt(temp.replace(/\,/g,'')); if(("#Amount_t").val()!=""){ shortAdv = parseInt($("Amount_t").val()); } if($("#Amount_t").val()&gt; netEarned ){ if (netEarned &gt;= 3000) { Amount_t = 3000 } else if (netEarned &gt;= 2000){ Amount_t = 2000 } else if (netEarned &gt;= 1000){ Amount_t = 1000 } $("#Button_Continue").click(function(){ updateSession('Amount_T', $("#Amount_T").val()); window.location.href = "/step3.a4d" }); } }); </code></pre>
javascript jquery
[3, 5]
5,768,985
5,768,986
dynamic table in android
<p>Click on below Link</p> <p>I giving you small example for it, but first you want to retrieve data from webservice and it in your arraylist.</p> <p>Right?</p> <p>now you want to follow this link which will help you lot.</p> <p><a href="http://www.4shared.com/file/BGDgBv1q/TableLayoutDynamic.html" rel="nofollow">http://www.4shared.com/file/BGDgBv1q/TableLayoutDynamic.html</a></p> <p>Here i give you two files 1. abc.xml (layout file for desgining in android) 2. AbcActivity.java (this is activity file which handle the tablelayout dynamic)</p> <p>and if you have any query and doubt for that then give me comment</p> <p>Thanks &amp; Regards, Prashant Adesara</p>
java android
[1, 4]
647,895
647,896
jQuery: Javascript throws Error "The operation is insecure" when setting value
<p>I am trying to find a fallback solution for browsers who do not interpret the placeholder attribute for input elements. I have this simple jQuery Script but it throws an Error </p> <pre><code>SecurityError: "The operation is insecure. this.value = val;" </code></pre> <p>Here's my script:</p> <pre><code>$('document').ready(function(){ $('input').each(function() { if ($(this).val() === '' || $(this).val() === undefined) { $(this).val($(this).attr('placeholder')); } }); }); </code></pre> <p>Anyone any ideas what i can do? Or what i am doing wrong? Or what this error means? It happens in Firefox, haven't tested it in other Browsers yet.</p>
javascript jquery
[3, 5]
962,371
962,372
accessing php array in js using json_encode
<p>I am using php and JS in my code.My requirement is I need to fetch the value from my-sql database and display into drop down list dynamically.I am populating the dropdown with JS but fetching the value with php(a usual thing). So the problem I am facing is once I get the value from php code and encode it using json_encode to access that array in JS it shows me value like [object Object].</p> <p>Please help.. Thanks.</p> <p>Sample Code:-</p> <pre><code>&lt;?php $result=mysql_query("select Location from servicelist")or die (mysql_error()); while($row = mysql_fetch_array($result)) $output[]=$row; $row=mysql_fetch_assoc($result); $output[]=$row; ?&gt; &lt;script language="javascript"&gt; function addOption_list(selectbox){ &lt;?php echo 'var month='.json_encode($output);?&gt; for (var i=0; i &lt; month.length;++i){ addOption(document.drop_list.AreaList, month[i], month[i]); //Once the value of the area will get selected we will call sub area based //on the area selected from the db } addSubAreaList(); } </code></pre>
php javascript
[2, 3]
195,083
195,084
JQuery: How to properly indent a string when looping over dom elements
<p>Code is here <a href="http://jsfiddle.net/Ea7hd/1/" rel="nofollow">http://jsfiddle.net/Ea7hd/1/</a></p> <p>Basically my output needs to match the indentation of the html elements as they appear in the textarea. </p> <p>The problem is that when I am looping through all the elements in the textarea I have no way of adding proper indentation because the I have no way of setting where one element is in relation to its parent.</p>
javascript jquery
[3, 5]
2,719,651
2,719,652
getting root folder of application
<p>I am trying to get the root folder of the application. I have used the following code, but this gives the bin folder, but what I need is the root folder of the application. Is it possible to get this?</p> <pre><code>// This is the full directory and exe name String fullAppName = Assembly.GetExecutingAssembly().GetName().CodeBase; // This strips off the exe name String fullAppPath = Path.GetDirectoryName(fullAppName); </code></pre>
c# asp.net
[0, 9]
1,100,071
1,100,072
Android onTouchListener on LinearLayout
<p>I have a linear layout with few child components in it. I have onTouchListener on the linearlayout. I want onTouch event to trigger when I touch child components of the linear layout too.</p>
java android
[1, 4]
5,086,080
5,086,081
Empty input type file doesn't work in IE
<p>I wrote this simple javascript code:</p> <pre><code>$("input[type='file']").attr("value", ""); </code></pre> <p>It works in Firefox and Chrome but not in IE (I tried in IE9)</p> <p>What's the good approach to empty the input type file value ?</p> <p>Thank you</p>
javascript jquery
[3, 5]
4,003,238
4,003,239
JQuery Lightbox compatible with IE6,7,8 and easy to customize?
<p>Looking for a Lightbox which is jQuery based, compatible with IEr (and naturally all major browsers), lightweight and easy to customize (like border thickness and color) and be used for submitting forms. The form is in the lightbox. Planning to use with ASP.NET (not that it matters but a plus if it works well with it).</p> <p>Please don't post a link to a list of lightboxes. I can Google that. Need specific ones which meet my requirements and you know they do.</p>
asp.net javascript jquery
[9, 3, 5]
2,638,709
2,638,710
Wait for a function to finish before if()else()
<p>I have this:</p> <pre><code>var myError; function getNames(user,location){ myError=null; //Make an Ajax Call (this takes some time) //On Success do this: if(//Some Condition){ myError=false; }else{ myError=true } } function first(){ getNames(user, location); if(myError==false){ //MYCONDITION //do some custom stuff just for first(); }else{ alert("Failed"); } } function second(){ getNames(user, location); if(myError==false){ //MYCONDITION //do some custom stuff just for second(); }else{ alert("Failed"); } } </code></pre> <p>Now, when I call first() or second() it always gives me alert message "FAILED". The problem is that //MYCONDITION is being executed before the getNames() function finishes. I want to wait for getNames() to execute before I can check //MYCONDITION.</p> <p>I cannot set a delay since I don't know how much time getNames() is going to take. I was thinking about using some jQquery function but I cannot seem to find one.</p> <p>And, I am trying to keep the getNames() as generic as possible. So, I am thinking of a way to not disturb the getNames().</p> <p>The last option I see is adding callback() to getNames(). But, this function is being called by other functions too that won't need callback().</p> <p>Any thoughts guys?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
4,534,367
4,534,368
paginate_links not work in child theme
<p>i am using that code. its show the pagination but when i click on second page its show not found.</p> <pre><code>$big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' =&gt; str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' =&gt; '?paged=%#s%', 'current' =&gt; max( 1, get_query_var('paged') ), 'total' =&gt; $query-&gt;max_num_pages ) ); </code></pre> <p>i am using that code. its show the pagination but when i click on second page its show not found.</p>
php jquery
[2, 5]
1,516,065
1,516,066
how to get page html in httpmodule?
<p>I want to replace commented html token with text in httpmodule endrequest. How to get the page html in httpmodule?</p>
c# asp.net
[0, 9]
4,198,920
4,198,921
Flashing Page For Split Second Before Fade In
<p>Below is my code, it flashed the site for about a split second before it loads the page how do I stop it from doing this so it just fade in the Divs smoothly when the new page is loaded?</p> <pre><code>$('#home').animate({'opacity' : 0}, 0); fadeInDivs(['#home']); function fadeInDivs(els) { e = els.pop(); $(e).delay(750).animate({'opacity' : 1}, 1000, function(){ if (els.length) fadeInDivs(els); }); </code></pre> <p>};</p>
javascript jquery
[3, 5]
5,130,122
5,130,123
Change image source if file exists
<p>I have <a href="http://jsfiddle.net/rcebw/3/">http://jsfiddle.net/rcebw/3/</a></p> <p>The point of this is I will have numerous of these <code>inlinediv</code> divs. Each one has 2 divs inside it, one which holds an image and one which holds a link. These are generated dynamically from a list of the subsites on another site.</p> <p>What I want it to do is check each div with the class <code>inlinediv</code>. Get the inner text of the link in div <code>iconLinkText</code> and search for a file with that name at the site. (http://www.mojopin.co.uk/images/ for this test.) If it exists then change the image src to it.</p> <p>I am probably taking the absolutely wrong route for this but I can't seem to get it to work. When testing it can't even find the <code>inlinediv</code> div! Says it's null.</p> <p>I'm pretty new to jQuery but does anyone have any advice? (I don't even know if I've explained myself well!)</p>
javascript jquery
[3, 5]
5,372,870
5,372,871
Label showing "System.Web.UI.WebControls.Label"
<pre><code>double peratusE = ((double)(bilanganE / calonAmbil)) * 100.00; Label peratusELabel = row.Cells[16].FindControl("peratusELabel") as Label; peratusELabel.Text = String.Format("{0:0.00}", peratusELabel); </code></pre> <p>i use that particular code to calculate the percentage and to assign the percentage value to a label. however, when running it, it displays "System.Web.UI.WebControls.Label" instead of the value.</p> <p>for your information: i use </p> <pre><code>double peratusD = ((double)(bilanganD / calonAmbil)) * 100.00; Label peratusDLabel = row.Cells[14].FindControl("peratusDLabel") as Label; peratusDLabel.Text = String.Format("{0:0.00}", peratusD); </code></pre> <p>but this time it works just fine. i'm stucked.</p>
c# asp.net
[0, 9]
5,452,899
5,452,900
jQuery validate only validates one field
<p>I am using jQuery validate to validate a form. I have two text boxes on my form and only the first one will add the "This field is required." message. If I remove the "required" class from the first one the second will have the message.</p> <p>html:</p> <pre><code>&lt;form id="questionForm"&gt; &lt;div&gt;&lt;input class="required" id="value" type="text" /&gt;&lt;/div&gt; &lt;div&gt;&lt;textarea class="required" id="description"&gt;&lt;/textarea&gt;&lt;/div&gt; &lt;button type="submit"&gt;Save&lt;/button&gt; &lt;/form&gt; </code></pre> <p>javascript:</p> <pre><code>$("#questionForm").validate({ submitHandler: function() { alert("valid"); } }); </code></pre> <p>Why is only one being validated?</p> <p>Edit: I'm using jQuery validation plug-in 1.7</p> <ul> <li><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">http://bassistance.de/jquery-plugins/jquery-plugin-validation/</a></li> <li><a href="http://docs.jquery.com/Plugins/Validation">http://docs.jquery.com/Plugins/Validation</a></li> </ul> <p>Edit 2: I'm using MVC 3</p>
javascript jquery
[3, 5]
2,680,381
2,680,382
PHP pagination for unordered list
<p>item1 item2 item3</p> <p>I've three items arranged in this order,i've used unordered list to arrange the items in this order. I did n't find a pagination plug in for items arranged in unordered list ,How do i implement pagination for this.</p> <p>Any help would be appreciated!</p>
php jquery
[2, 5]
3,695,063
3,695,064
jquery: $.post success handler does not take else {}
<p>Please help me in this weird situation. This is the first time I see, when else{} does not work after if(){}. =)))</p> <pre><code>onClick="$.post('itemupdate.php', { itemname: 'test' }, function(data) { if(data.status == 'error'){alert('error')} else {alert('OK')} }, 'json');" </code></pre> <p>Alert 'OK' never shows up. Everything else is in order.</p>
javascript jquery
[3, 5]
14,366
14,367
Recording audio not to file on Android
<p>I want android.media.MediaRecorder. to record audio not into file, but into same variable, for example char[ ] or byte[ ] or some other datta buffer structure. I want to send it to the remote server via Wi-Fi, can android.media.MediaRecorder provide this functionality?</p>
java android
[1, 4]
5,321,627
5,321,628
filestream fileshare access by 2 process to read and write at the same time
<p>I got a primitive website, where the aspx webform and socket server access flat files, which stores the data. The socketserver will be accessing the same exact files to write, which is accessed by the aspx c# code for reading. I think there may be an issue with locking the files. I think it is the higher priority for the server to quick write to the file and release any lock on the file. The webform should be able to read without interrupting the writing process of the server. What is the best way to do this? Is it with the using streamwriter?</p> <p>The server used this call, to only share file for reading while it is writing to the file.</p> <pre><code> if (!File.Exists(filepath)) { using (FileStream fileStream = new FileStream(filepath, FileMode.CreateNew, FileAccess.Write, FileShare.Read)) { using (TextWriter writer = new StreamWriter(fileStream)) { writer.WriteLine(data); m_clientSocket.Send(BitConverter.GetBytes(data.Length)); } } } else { using (FileStream fileStream = new FileStream(filepath, FileMode.Append, FileAccess.Write, FileShare.Read)) { using (TextWriter writer = new StreamWriter(fileStream)) { writer.WriteLine(data); m_clientSocket.Send(BitConverter.GetBytes(data.Length)); } } } </code></pre> <p>The webform read with the following command</p> <pre><code> using (FileStream stream = new FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read)) { using (TextReader reader = new StreamReader(stream)) { //string fileContents = tr.ReadToEnd(); while ((line = reader.ReadLine()) != null) { if (!string.IsNullOrEmpty(line)) { lines.Add(line); } } } } </code></pre> <p>I am hoping this may work without having to lock the file and manage access, which I am not sure how to do. I want to be able to for the server to lock the file for writing at anytime but also allow the same file to be read by the aspx webpage c# code.</p> <p>Any help is appreciated.</p>
c# asp.net
[0, 9]
4,101,285
4,101,286
Using $.get to print page Elements
<p>I'm trying to print the elements of a page using this code:</p> <pre><code>$('#some_button').click(function(){ var url = window.location.href; var contents = $.get(url); alert(contents.responseText); }); </code></pre> <p>but this returns a blank string, and trying to print <code>contents.status</code> gives me the error:</p> <pre><code>Uncaught Error: INVALID_STATE_ERR: DOM Exception 11 </code></pre> <p>This code works just fine from the browser console so it would seem this is a load state issue. But because this is in a click listener I don't know how to solve this.</p>
javascript jquery
[3, 5]
4,592,026
4,592,027
Actions durring OnCommand for GridView Edit not Showing
<p>So I have a method I wrote that will copy the selectedValue from one dropdownbox to another in a specific row. It is called from a button on the row on the OnCommand Event.</p> <pre><code> protected void Copy(String From, String To, GridViewRow CurrentRow) { DropDownList FromList = (DropDownList)CurrentRow.FindControl(From); DropDownList ToList = (DropDownList)CurrentRow.FindControl(To); ToList.SelectedValue = FromList.SelectedValue; } </code></pre> <p>Now When I use this on a footer row everything works fine, however, when I try to call this while editing a row, I can see data if I Debug, however, the dropdown will not populate. No errors, occur.</p> <p>I did step Into thru the process, and it's calling my Grids RowEditing event (Which populates all the dropdowns) again after my OnCommand Event fires. So my guess is that its just wiping out the changes I made by repopulating the dropdowns.</p> <p>Is there a way to prevent the RowEditing event from refiring (even if its just so I can prove myself right or wrong)? Should I be handling this copy in some other way?</p> <p>Thanks</p>
c# asp.net
[0, 9]
2,655,578
2,655,579
adding a class to some images based on the alt text using jquery?
<p>how can i add a class to some images based on the alt text using jquery?</p> <p>here is an example of the image:</p> <pre><code>&lt;img border="0" src="images/Product/icon/26086_1_.jpg" alt="Show Picture 1" onclick="setcolorpicidx_26086(1);" style="cursor:hand;cursor:pointer;"&gt; </code></pre> <p>so if the alt text contains "Show Picture" then add a class of <code>image-nav</code></p>
javascript jquery
[3, 5]
863,990
863,991
What additional I need to convert a Java Application to Android Application?
<p>The title itself is my question.. </p> <p>What additional I need to convert a Java Application to Andriod Application?</p> <p>I have an application developed in Java J2SE with XML as back-end. I want to convert it to Andriod. Thanks in advance.</p>
java android
[1, 4]
403,235
403,236
Creating an object array in jQuery
<p>I want to store an array of latitudes/longitudes. I have these inputs on my page:</p> <pre><code>&lt;input type="hidden" class="latitude" value="-12.3456" /&gt; &lt;input type="hidden" class="longitude" value="12.3456" /&gt; &lt;input type="hidden" class="latitude" value="98.7654" /&gt; &lt;input type="hidden" class="longitude" value="-98.7654" /&gt; </code></pre> <p>And I'm putting them into arrays like so:</p> <pre><code>var latitudes = $('.latitude').map(function () { return this.value; }).get(); var longitudes = $('.longitude').map(function () { return this.value; }).get(); </code></pre> <p>But I'm thinking that it would be better to store them in a single array as objects, so that I can say:</p> <pre><code>$.each(array, function (i, obj) { alert(obj.Latitude); alert(obj.Longitude); }); </code></pre> <p>How can I modify this to create an array of objects?</p>
javascript jquery
[3, 5]
5,078,061
5,078,062
Creating objects in superclass
<p>I have one superclass in my android project that inherits from activity and implements all the necessary interfaces. I then have three different activities that inherit from this superclass. I initialize the variables in the superclass from all the subclasses once the activities are created. Superclass method:</p> <pre><code>protected void initiateVariables(Context c){ dm = new DisplayMetrics(); toasty = new Toast(c); customBuilder = new MyDialog.Builder(c); customDialog = new Dialog(c); customProgress = new MyProgressDialog(c); getWindowManager().getDefaultDisplay().getMetrics(dm); screenWidth = dm.widthPixels; screenHeight = dm.heightPixels; } </code></pre> <p>From the subclasses I do:</p> <pre><code>protected void initiateVariables(Context c) { super.initiateVariables(c); bFavorite = (Button) findViewById(R.id.bFavorite); bSetting = (Button) findViewById(R.id.bSettings); bCompass = (Button) findViewById(R.id.bCompass); bDeparture = (Button) findViewById(R.id.bDeparture); bInfo = (Button) findViewById(R.id.bInfo); bBack = (Button) findViewById(R.id.bBack); bDeparture2 = (Button) findViewById(R.id.bForward); bAdd = (Button) findViewById(R.id.bAdd); tvHeader = (TextView) findViewById(R.id.tvHeaderText); flipp = (ViewFlipper) findViewById(R.id.viewFlipper); colorBackground = (RelativeLayout) findViewById(R.id.homeBackground); dbList = (ListView) findViewById(R.id.dbList); } </code></pre> <p>onCreate method in my subclasses:</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.home); initiateVariables(this); } </code></pre> <p>When I try to use any object that has been initialized in the superclass I get a nullpointerexception. Could anyone explain to me why this is?</p>
java android
[1, 4]
1,554,158
1,554,159
Threading issue in android
<p>I am working on an application in android. And I am trying to update data to UI from the background thread. However, it doesn't work for some reasons. Can any one splot the error or suggest any better solution? I used Thread to read data from the bluetooth socket and update the UI with RunOntheUI. Here is the code:</p> <pre><code>socket = belt.createRfcommSocketToServiceRecord(UUID_SECURE); socket.connect(); stream = socket.getInputStream(); // final int intch; Thread timer2 = new Thread() { // Threads - do multiple things public void run() { try { // read data from input stream if the end has not been reached while ((intch = stream.read()) != -1) { byte ch = (byte) intch; b1.append(ByteToHexString(ch) +"/"); decoder.Decode(b1.toString()); runOnUiThread(new Runnable() { public void run() { // update the uI hRMonitor.SetHeartRateValue((int) decoder.GetHeartRate()); } }); Thread.sleep(1000); } } catch (Exception e) { e.printStackTrace(); } }}; timer2.start(); </code></pre>
java android
[1, 4]
4,029,038
4,029,039
dynamically name varibles in javascript
<p>How can i condense this into a loop and name the variables dynamically?<br/><br/> this works</p> <pre><code>var aMainNav = ['b1', 'b2', 'b3']; aMainNav[0] = $('.mainNav li:nth-child(1)'); aMainNav[1] = $('.mainNav li:nth-child(2)'); aMainNav[2] = $('.mainNav li:nth-child(3)'); </code></pre> <p>this doesnt</p> <pre><code>var aMainNav = ['b1', 'b2', 'b3']; var i = 0; while(i &lt; aMainNav.length){ var j = i++; eval(aMainNav[i] = $('.mainNav li:nth-child('+j+')')); i++; } </code></pre> <p>and the button clicks</p> <pre><code>aMainNav[0].click(function(){ myLocation=='abc'?top.location.href='https://mydomain.com?var=1':window.location.href='./'; return false; }); aMainNav[1].click(function(){ myLocation=='abc'?top.location.href='https://mydomain.com?var=2':window.location.href='./'; return false; }); aMainNav[2].click(function(){ myLocation=='abc'?top.location.href='https://mydomain.com?var=3':window.location.href='./'; return false; }); </code></pre>
javascript jquery
[3, 5]
5,662,791
5,662,792
How can I hyperlink to a file that is not in my Web Application?
<p>Ok, my web application is at <strong>C:\inetpub\wwwroot\website</strong></p> <p>The files I want to link to are in <strong>S:\someFolder</strong></p> <p>Can I make a link in the webapp that will direct to the file in <strong>someFolder</strong>?</p>
c# asp.net
[0, 9]
4,879,293
4,879,294
Is there any standard defined for Javascript showModalDialog method?
<p>I am displaying data in GridView control (Visual Studio 2008). My client has asked to show a dialog once user clicks a cell but he has asked it as a <strong>modal</strong> window. This is to edit a cell. In-cell editing cannot be used because information to be collected is complex and would require lot of controls along with another GridView.</p> <p>After searching on net, I came to know that showModalDialog Javascript method (on Window object) would work - seems that it works in FF and IE and that's sufficient for me.</p> <p>Now my question : Is there any standard body (or recommendation) which defines Javascript Window object (and consequently its showModalDialog method)?</p> <p>I know Standard ECMA-262 ECMAScript Language Specification defines just core Javascript. When I looked at various standards (or recommendations) set by W3C - XHTML, DOM, etc. But I could not find any standard (or recommendation) for Window object.</p>
javascript asp.net
[3, 9]
4,540,914
4,540,915
I cannot get a return code from my javascript function
<p>I assign the following to a button on a modal. When the user clicks on the button it calls submitHandler.</p> <pre><code> var btn = { 'Submit &amp; Close': function (win) { var rc = submitHandler(oLink.$link, $modal); $('#createLink').prop('disabled', false); }, 'Close': function (win) { $modal.closeModal(); $('#createLink').prop('disabled', false); } } </code></pre> <p>My submitHandler looks like this:</p> <pre><code> function submitHandler($link, $modal) { if (!$form.valid || $form.valid()) { $submitBt.disableBt(); $modal.removeBlockMessages() .blockMessage('Contacting Server, please wait ... ', { type: 'loading' }); $.ajax({ url: oSubmit.href, dataType: 'json', type: 'POST', data: $form.serializeArray() }) .done(function (json, textStatus, XMLHttpRequest) { json = json || {}; if (json.success) { submitSuccessModal(oSubmit, json); return true; } else { submitFailModal(oSubmit, json); return false; } return false; }) } </code></pre> <p>When I check in the debugger submitHandler runs but when I look at the value of rc it is undefined. </p> <p>Is there something obvious I am missing. I simply cannot get rc to equal anything other than "undefined". </p> <p><strong>Update:</strong></p> <p>I added in an actual section of the code. I am wondering if it could be the ajax call that's causing this? Note that I can follow the code with the debugger to the return true; line.</p>
javascript jquery
[3, 5]
2,475,519
2,475,520
Need some simple explanation about dialog in jquery?
<p>I just started to learn jquery and JavaScript so i can implement it with my current asp.net project. However i have a hard time to grasp the idea how to make a dialog that will show up when user attempt to push delete button and then if user chose button "Yes" it will go for the delete function in code behind of asp.net or if user chose "No" then it will be terminated and no action will be taken.</p> <p><strong>NOTE:</strong> I don't look for somebody to teach me, I just would like some explanation, code examples and links to information where i can read and understand and try on my own.</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,018,350
2,018,351
jQuery datetime formatter
<p>Is there a working jQuery plugin (or a javascript 'library') for formatting datetimes? I found some, but they were:</p> <ul> <li>not working with hours and minutes (the one from datapicker)</li> <li>not fully functional - can't give you names of months, leading zeroes, etc.</li> <li>are just a piece of code written in some blog.</li> </ul> <p>Of course I can implement it, but it'd be better to reuse one. I seek functionality similar to Java's <a href="http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html" rel="nofollow"><code>SimpleDateFormat</code></a></p>
javascript jquery
[3, 5]
3,952,995
3,952,996
How to elegantly add javascript/css on demand?
<p>In my actual project, the users have the option to click a button in order to enter in an "edit mode" for their websites. After clicking the button, I have to download several JS and CSS files and I was doing it using the following code:</p> <pre><code>//Start edition mode (function(){ $.get('/helpers/edit/v/edit.php',function(data){ $(data).appendTo('body'); var css = '/helpers/edit/css/edit.css'; $.get(css,function(data){ $('&lt;link/&gt;') .attr({ 'rel':'stylesheet', 'href':css }).appendTo('head'); $("body").trigger("editReady"); }); }); })(); </code></pre> <p>It works fine but now I need to insert more JS and CSS files and if I just keep nesting jquery get requests the code will become ugly and hard to mantain, which I want to avoid and shows me that this is probably not the best way to accomplish the task.</p> <p>I also tried to use Yep Nope (which I'm already using in other parts of the project) inside the first get request but it seems not to work (I receive no error messages but it just doesn't work).</p> <p>Does anyone have an idea of how to do this in a way that doesn't get so ugly and, mainly, is easy to mantain (considering that I have to trigger an event when all the JS/CSS are properly included)?</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
3,975,954
3,975,955
Regular expression behaving different on in c# code behind and on aspx
<p>Note: question has been edited to stay in sync with what I have tried from the commenters</p> <p>I am trying to match an email, however when put the same expression in the code behind, vs the aspx, I seem to be getting different matches for email address. The aspx regex validator seems to be working correctly, however I need to validate for my webservice as well. Im sure Im missing something simple here, does anyone have any ideas.</p> <pre><code> Regex regExEmail = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); if (!regExEmail.IsMatch(contact.emailAddress)) { //do something } </code></pre>
c# asp.net
[0, 9]
101,337
101,338
display small modal window on browsers
<p>I use VS2010,C# to develop ASP.NET web app, recently I've seen some sites that display a small window (it is somehow modal) displaying on top of screen, and while it is displayed the whole screen is somehow dimmed (like having a gray alpha layer), so that user can do nothing on the main screen and focus is only on the small window.</p> <p>An example can be found here:</p> <p><a href="http://www.geda.de/Permanentanlagen/Industrieaufzuege/Materialaufzuege" rel="nofollow">http://www.geda.de/Permanentanlagen/Industrieaufzuege/Materialaufzuege</a>, </p> <p>you can click on images to see the window. I've heard that this technique is used in facebook also</p> <p>how can I achieve this effect? I think it is javascript, right? can I design this small window in VS and using toolbox? how can I display it and disable other elements? how to render an alpha layer on top of screen? is there any tips or samples?</p> <p>I'm searching for a cross-browser solution</p>
javascript asp.net
[3, 9]
3,412,039
3,412,040
onclick, how can I hide a <div> and show the content behind it?
<p>How can I make this <code>&lt;div&gt;</code> hide itself when a click occurs outside of it? I would like to be able to hide it and then show the rest of the content of the page that is behind it. </p> <pre><code>&lt;html&gt; &lt;style&gt; .overlay { position: fixed; top: 0; left: 0; height: 100%; width: 100%; background: #fff; opacity: 0.5; filter: alpha(opacity=50); z-index: 80; } .popupContent { background: #fff; padding: 5px; border: 1px solid black; position: fixed; top: 100px; left: 400px; bottom: 365px; right: 300px; z-index: 81; }​ &lt;/style&gt; &lt;div id="initialPopup"&gt; &lt;div class="overlay"&gt;&lt;/div&gt; &lt;div class="popupContent" onclick="hideInitialPopup()"&gt; Good Morning, Please Upload Your File Today! &lt;/div&gt; &lt;/div&gt; ​ &lt;script&gt; function hideInitialPopup() { document.getElementById("initialPopup").style.display = "block"; $("popupContent").mouseup(function(){ if(! mouse_is_inside) $ }​ &lt;/script&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
1,353,472
1,353,473
Android: ExpandableListView and context menus
<p>I'm writing an app utilizing <strong>ExpandableListView</strong>.<br> I use a subclass of <strong>BaseExpandableListAdapter</strong> to provide data to my <strong>ExpandableListView</strong>.</p> <p>Then I try to add context menus to this view, but these menus should be different for group an child items in the expandable list. So in my adapter's <strong>getChildView</strong> and <strong>getGroupView</strong> I call <strong>setOnCreateContextMenuListener</strong> like this:</p> <pre><code>TextView textView = new TextView(TestActivity.this);; textView.setText(getChild(groupPosition, childPosition).toString()); textView.setOnCreateContextMenuListener(new View.OnCreateContextMenuListener() { @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { TestActivity.this.onCreateChildContextMenu(menu, v, menuInfo); } }); return textView; </code></pre> <p><strong>TestActivity.this.onCreateChildContextMenu</strong> simply adds a few string to menu.</p> <p>The problem:<br> This works quite fine - context menu appears and works as expected but group item cannot be expanded anymore. It simply ignores short clicks. I've checked - as expected the textView becomes isLongClickable() after this line but it remains not isClickable() - so I cannot see how this context menu callback can affect short click functionality.<br> I've solved this problem for me by adding this listener at the whole ExpandableListView and then patching the menu for children. But it looks ugly. Do I miss something?</p> <p>Thanks.</p>
java android
[1, 4]
5,179,573
5,179,574
Question about table layouts
<p>I'm working pn an andorid app with a tabbed interface and in each tab I want to display text in grid format along with some controls to manipulate the data. Right now I'm using a single table layout but the problem is getting the formatting to work with displaying both the text and controls. The controls end up affecting the width of the text columns. Here's a screenshot: <a href="http://www.pikefin.com/img/emulator.png" rel="nofollow">http://www.pikefin.com/img/emulator.png</a></p> <p>I was wondering if it's possible to get two table layouts working on the same screen? (I played around with this some but couldn't get it to work)</p> <p>Or should I be looking at taking a completely different approach?</p>
java android
[1, 4]
4,652,967
4,652,968
Template checkbox checked property is getting false in Gridview for delete operation
<p>I have used template CheckBox in gridview for multiple rows deletion, when I select multiple rows by selecting the CheckBox and perform the delete operation it seems to be selected CheckBox is not returning true on the code below.</p> <p>protected void Button6_Click(object sender, EventArgs e) {</p> <pre><code> foreach (GridViewRow row in GridView1.Rows) { LinkButton ch = new LinkButton(); ch = (LinkButton)row.FindControl("l1"); id = Convert.ToInt16(ch.CommandArgument); CheckBox chs = new CheckBox(); chs = ((CheckBox)row.FindControl("c1")); if (chs.Checked == true) { DeleteSelected(id); } } } private void DeleteSelected(short id) { var ch = from a in empd.Employees where (a.ID == id) select a; empd.Employees.DeleteAllOnSubmit(ch); empd.SubmitChanges(); display_emp(); } </code></pre> <p>Could someone please assist me why <code>CheckBox</code> is not returning true value in calling function.</p> <p>Well now I have fixed the connection everything, please just refresh the database.Please get the web application in the below link.</p> <p><a href="http://www.ziddu.com/download/20716096/WebApplication.zip.html" rel="nofollow">http://www.ziddu.com/download/20716096/WebApplication.zip.html</a> Please help me on why selected checkbox are not returning true in the code.</p>
c# asp.net
[0, 9]
1,652,242
1,652,243
Receive output of python script from PHP?
<p>I want to launch a python script similar to <a href="http://www.eventlet.net/doc/examples.html#web-crawler-example" rel="nofollow">this web crawler</a>, wait for it to finish, process the data in php, then return the results to the user.</p> <p>From what I hear, getting the output from python is trivial, but the above script is doing stuff in parallel, so just printing stuff as it finishes won't give me any kind of usable structure.</p> <p>What would you suggest to use to pass an array of html data from the python script to php? A temporary file? mysql? I have no experience whatsoever in python, so you'll need to be pretty explicit.</p> <p>Cheers.</p>
php python
[2, 7]
2,819,796
2,819,797
Android- Image shape changed on screen rotation
<p>I created an app that uses a 9.png file as its background. The problem is, when I rotate the screen, the background shape changes weirdly. </p> <p>I am attaching the screenshot: </p> <p><img src="http://i.stack.imgur.com/J0SfY.png" alt="Application in normal mode"></p> <p><img src="http://i.stack.imgur.com/tbjFS.png" alt="After Screen Rotation"></p> <p>As you can see, the background of the layout containing the name and image takes a weird shape. </p> <p>What can be the possible reason? And how can I make it work?</p> <p>I have checked that the image is perfectly smooth and in perfect shape.</p> <p>EDIT: I am talking about the following background that is not stretching properly(The leftmost part is smaller in height than the rightmost part): <img src="http://i.stack.imgur.com/tHU4k.png" alt="The right portion is larger than the left portion"></p>
java android
[1, 4]
248,593
248,594
Is java still a relevant language?
<p>I want to learn a nice easy to use versatile language. I do know some Java, but is it relevant? Or should I move on too JavaScript with the advent of HTML5?</p>
java javascript
[1, 3]
5,113,442
5,113,443
How to open a popup and send a JSON object to it
<p>I want to send a <a href="http://en.wikipedia.org/wiki/JSON" rel="nofollow">JSON</a> object to a <a href="http://en.wikipedia.org/wiki/PHP" rel="nofollow">PHP</a> file while my script opens that PHP file in a new <strong>popup</strong> window. Is it possible to send it via POST method (by jQuery or without it)? </p> <p>If not, how do I convert JSON to a <a href="http://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow">URL encoded</a> string? Is there any JavaScript function?</p>
javascript jquery
[3, 5]
4,855,224
4,855,225
how to determine if user left our site
<p>We're tryin to implement some kind of feedback, which I saw in MSDN web-site. More concrete when user first enters to our site, I want to show a pop-up which will ask user to leave comment rite before he would leave our web-site, and depending on user's answer( it would be some kind of confirmation box with Yes and No), I want to open a pop-up with TextBox for user to leave a feedback. I've searched for this in internet, but all of 'em was about handling window.onload event, the problem is we have more than one page, so I won't be able to determine if user requests another page in our web-site or redirects to another web-site. So this is my problem, any suggestions? We're using asp.net. Thanx beforehand.</p>
jquery asp.net
[5, 9]
3,257,629
3,257,630
how to upload folder to server in asp.net c#
<p>I think the Folder upload is supported java applet. But how can i use java applets in Asp.net c# Please tell me about this, without the Flash and silverlight.</p>
c# asp.net
[0, 9]
1,044,497
1,044,498
hide toggle div when clicking control in toggle div
<p>I use a toggle div in page. I have a textbox and a dropdownlist in it.</p> <pre><code> &lt;div class="Search" style="display: none" &gt; &lt;table width="100%" style="border: 1px solid #fff; border-radius:5px;padding:15px"&gt; &lt;tr&gt; &lt;td width="60px"&gt;دسته بندی&lt;/td&gt; &lt;td&gt; &lt;asp:DropDownList ID="CategoryDropDownList" runat="server" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;کلمه کلیدی&lt;/td&gt; &lt;td&gt; &lt;asp:TextBox ID="SearchTextBox" runat="server" Width="95%" /&gt; &lt;/td&gt; &lt;td&gt;&lt;asp:ImageButton runat="server" ID="SerachButton" ImageUrl="~/images/btnSearchIcon.png" OnClick="SerachButton_Click" ValidationGroup="Search" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; </code></pre> <p>I hide it when clicking anywhere on the page.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $('#showSreachDiv').click(function (evt) { $(".Search").toggle("slow"); evt.stopPropagation(); }); $(document).click(function () { var $el = $(".Search"); // toggle div if ($el.is(":visible")) { // fade out $(".Search").toggle("slow"); } }); }); &lt;/script&gt; </code></pre> <p>But when i clicking control in toggle div, hide it.</p> <p>I want insert text in textbox but don't it. </p>
javascript asp.net
[3, 9]
3,939,205
3,939,206
how to clear browser cache in asp.net/javascript?
<p>In my program i need to handle with many images.I have to change images dynamically within the page. after change the images i need to refresh the page by clear browser cache.</p> <p>is there any method to clear cache or event for getting <kbd>ctrl</kbd>+<kbd>f5</kbd> or <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>del</kbd> event in javascript or c# by a separate refresh button click. Here I cannot use browser refresh button.</p>
javascript asp.net
[3, 9]
5,889,286
5,889,287
How can I parse a string that lacks delimiters to a DateTime using c#?
<p>Hey. I have, somehow, this string available "20100205 162206". This is a date and time without any delimiter char. </p> <p>I need this back as a DateTime in C#. What is the best way?</p>
c# asp.net
[0, 9]
4,110,429
4,110,430
Jquery closing in click
<p>im having a problem in a script that i download it in the web, basically what i need is a FAQ question whit the collapse panel interaction, but in this case different in the other out there i want when i click in one question it opens, and when i click in another question the question before closes and open the one i clicked.</p> <p>I found this <a href="http://feloliveira.com.br/blog/faq-de-perguntas-e-respostas-com-jquery/" rel="nofollow">Collapse panel script</a></p> <p>It works well, but is missing one detail, if i click in the same link (question), the question doesn´t collapse back to normal normal mode, its only possible to close him chosing another link. I want to be able to close the question when i chose another question and when i click the same question again.</p> <p>the javascript code in the main page:</p> <pre><code>&lt;script type="text/javascript"&gt; &lt;!– $(function() { var $h2; var $answer; $(‘.answer’).hide(); $(‘#faq h2′).bind( ‘click’, function() { if ($h2 &amp;&amp; $h2[0] != this) { $answer.slideUp(); $h2.removeClass(‘open’); } $h2 = $(this); $answer = $h2.next(); $answer.slideDown(); $h2.addClass(‘open’); } ) }); –&gt; &lt;/script&gt; </code></pre> <p>Hope for some help</p>
javascript jquery
[3, 5]
3,957,481
3,957,482
Reducing Output Page Size Perfomance Improvement asp.net
<p>I need to improve the speed of my website and perfomance.</p> <p>I've tried everything under the book from compression handling , whitespace removal , update panels and enable view state false.. but nothing seem to work.</p> <p>The output page size is still 764 kb.. which is quite a lot. So can you guys tell me an out of the box or any other way to approach this to decrease the output page size!</p>
c# asp.net
[0, 9]
3,476,140
3,476,141
Is it possible to call a Javascript function from HTML independent of an event?
<p>I have a condition in php based on some session variables. If condition passes, I want to call a Javascript function which is updating my current webpage. Is it possible to place such a call to Javascript function independent of a button or a link or the window load function?</p>
php javascript
[2, 3]
2,384,998
2,384,999
check if EndExecuteNonQuery was successful
<pre><code> insComment.EndExecuteNonQuery(); </code></pre> <p>Am trying to insert values into a database. What I need is to know if the code was succesfull then I display a success message.</p> <pre><code>if(insComment.EndExecuteNonQuery()){ show some message } </code></pre> <p>Is that a workable option?</p>
c# asp.net
[0, 9]
3,410,153
3,410,154
I have a connection string with AttachDbFilename as a link
<p>I have an ASPNETDB database to manage roles and membership that comes along with application. Well its in the form of link.. Something like this</p> <pre><code>C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL.1\MSSQL\DATA\ASPNETDB.MDF </code></pre> <p>When I used this in web.config file </p> <pre><code>&lt;add name="ApplicationServices" connectionString="Data Source=something;Initial Catalog=[C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL.1\MSSQL\DATA\ASPNETDB.MDF];Integrated Security=True" providerName="System.Data.SqlClient"/&gt; </code></pre> <p>But when I run the app, I still get a error telling:</p> <pre><code>System.Data.SqlClient.SqlException: Cannot open database "[C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL.1\MSSQL\DATA\ASPNETDB.MDF]" requested by the login. The login failed. Login failed for user 'USER-PC\USER'. </code></pre> <p>How do I use the connection string of ASPNETDB? </p>
c# asp.net
[0, 9]
5,110,174
5,110,175
assigning the result of a jsp confirm box to a php variable
<pre><code>//this is in php. function msgbox($msg, $type) { if ($type == "alert") { // Simple alert window ?&gt; &lt;script language="JavaScript"&gt; alert("&lt;? echo $msg; ?&gt;"); &lt;/script&gt; &lt;? } elseif ($type == "confirm") { // Enter Confirm Code Here and assign the $result variable for use // Should include "OK" and "Cancel" buttons. ?&gt; &lt;script language="JavaScript"&gt; if (confirm("&lt;? echo $msg; ?&gt;")) { &lt;? $result == "ok"; ?&gt; } else { &lt;? $result == "cancel"; ?&gt; } &lt;/script&gt; &lt;? } } if ($page_title-&gt;exists()) {msgbox("page exists,do you want to delete", "confirm"); } if ($result == "ok") //code.. </code></pre> <p>The problem is that <code>$result</code> is not reading the value from the confirm box i think because the if clause is not being executed and the program flow is going where it would go without the if clause. </p>
php javascript
[2, 3]
4,358,402
4,358,403
updating and deleting in grid in asp.net
<p>The updating and deleting should be done in grid through the events(on row editing,onrow updating). When we click update it should update related fields in the coresponding web page. This should be achieved using stored procedures. Please give some simple method to implement it. Help me with sample code.</p>
c# asp.net
[0, 9]
2,508,941
2,508,942
How long does the eternal worker thread runs in Android?
<p>hi I have created a thread on the main thread in android which runs for ever to perform some back end operations. so how long does this thread runs? it has been created in "onCreate" method in the activity. so does android kills such threads automatically after some time or does it run until we kill them manually? or it gets killed automatically when we switch to another app?</p>
java android
[1, 4]
1,881,356
1,881,357
how to call a javascript fn in Update panel on Partial postback in asp.net
<pre><code> &lt;asp:UpdatePanel runat="server" ID="Holder" OnLoad="" UpdateMode="Always" ChildrenAsTriggers="True"&gt; &lt;ContentTemplate&gt; ... &lt;asp:Timer ID="Timer1" runat="server" Interval="3000" OnTick="Timer_Tick" /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>JS:</p> <pre><code>window.onload = function () { r.init(); }; </code></pre> <p>when the page loads the r.init() [to draw graph] is executed. But when the page partial post back happens the graph is not drawn again. How to fire the JS when the update panel isFinite updated</p>
javascript asp.net
[3, 9]
4,954,765
4,954,766
Dynamic Div creation asp.net
<p>I am trying to create Div dynamically on the press of button click.</p> <p>For that i refered this link>> <a href="http://forums.asp.net/t/1349244.aspx" rel="nofollow">http://forums.asp.net/t/1349244.aspx</a></p> <p>and made code on server side(.cs page) as follows>></p> <pre><code>public static int i = 0; protected void Button1_Click(object sender, EventArgs e) { i++; HtmlGenericControl newControl = new HtmlGenericControl("div"); newControl.ID = "NEWControl"+i; newControl.InnerHtml = "This is a dynamically created HTML server control."; PlaceHolder1.Controls.Add(newControl); } </code></pre> <p>This code was giving me just one div each time when i press the button., I wanted to have addition of divs.</p> <p>On client side using javascript also i tried>></p> <pre><code>&lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;div&gt; &lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" OnClientClick="addDiv();" /&gt; &lt;/div&gt; &lt;asp:PlaceHolder ID="PlaceHolder1" runat="server"&gt;&lt;/asp:PlaceHolder&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &lt;script type="text/javascript"&gt; function addDiv() { alert("Control comming in function"); var r = document.createElement('Div'); r.style.height = "20px"; r.style.width = "25px"; r.appendChild("div"); alert("Control going out of function"); } &lt;/script&gt; </code></pre> <p>Both of these didnt work.</p> <p>What mistake am i making?</p> <p>Is there any thing wrong?</p>
c# javascript asp.net
[0, 3, 9]
5,655,292
5,655,293
Prevent keyboard from showing character bubble
<p>when typing on the keyboard a bubble appears to display the character that you pressed , I am looking for a way to prevent it from doing that !!</p> <p><img src="http://i.stack.imgur.com/imGQr.png" alt="enter image description here"></p>
java android
[1, 4]
3,913,234
3,913,235
How can I simulate a visit to a url?
<p>I have a page where a user submits an order, and after they submit it, I want to hit a url (<code>http://externalsite.com?id=12345&amp;sessionid=abc123</code>) without actually redirecting them to the external page.</p> <p>Is there a way to do this?</p>
c# asp.net
[0, 9]
789,537
789,538
Project topic help
<p>I want some project ideas for my final year project. I have learnt languages like C,C++,Java,HTML &amp; PHP,VB,MySQL as front ends &amp; back ends. I was thinking of developing an online shopping website but that would be too simple, so if anyone could give me some ideas to work on.. that would be very helpful.</p>
java php
[1, 2]
5,796,290
5,796,291
is there any keyword 'capital' in javascript?
<p>I am calling a funtion named 'capital()' but it is not working and 'capita' is working. is it a keyword in js or wht is this ?</p> <p>here is the code see it, test it</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;HTML Select Element&lt;/title&gt; &lt;script type="text/javascript"&gt; function capita(){ alert('yes'); c = new Array("Islamabad", "Tehran", "Bejing", "New Delhi", "Kabul"); var i; i = document.f1.country.selectedIndex; document.f1.capital.value=c[i]; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h3&gt;Countries and Capital&lt;/h3&gt; &lt;form name="f1" method="post"&gt; The capital of &lt;select name="country" id="country" onChange="capita();"&gt; &lt;option selected&gt;Pakistan &lt;option&gt;Iran &lt;option&gt;China &lt;option&gt;India &lt;option&gt;Afghanistan &lt;/select&gt; is &lt;input type="text" name="capital" value="Islamabad"/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
javascript jquery
[3, 5]
4,846,432
4,846,433
ASP.NET Login Control - Deny login if in a role
<p>Using the standard ASP.NET login control, I'm trying to get it to deny me login, if the user who is trying to login in a member of the cancelled group.</p> <pre><code>&lt;asp:Login ID="Login1" runat="server" OnLoggedIn="Login1_LoggedIn" DestinationPageUrl="~/Default.aspx" FailureText="Whoops - something went wrong with your login. &lt;br /&gt;Please try again. &lt;br /&gt;If you've forgotton you password please click link below and we'll send you a new one" &gt; &lt;LayoutTemplate&gt; &lt;table cellpadding="1" cellspacing="0" style="border-collapse:collapse;"&gt; &lt;tr&gt; </code></pre> <p>and code behind (Pseudo code.. doesn't work)</p> <pre><code>protected void Login1_LoggedIn(object sender, EventArgs e) { var profile = WebProfile.GetProfile(UserManager.GetCurrentUserName()); if User.IsInRole("cancelled") { FormsAuthentication.SignOut(); // write out a message saying you are not allowed to login } } </code></pre>
c# asp.net
[0, 9]
6,017,282
6,017,283
Javascript Date Of Birth Textbox
<p>As a novice, I really don't know much about javascript. Kindly help me in developing a similar work-a-like Date-Of-Birth textbox like here in this link : <a href="http://ojas.guj.nic.in/GFJobApply.aspx?sid=wGvtB4mUGuc=&amp;yr=kckKNSEPFLY=&amp;ano=K3JOsteln/k=" rel="nofollow">http://ojas.guj.nic.in/GFJobApply.aspx?sid=wGvtB4mUGuc=&amp;yr=kckKNSEPFLY=&amp;ano=K3JOsteln/k=</a> </p>
javascript jquery
[3, 5]