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,014,009 | 2,014,010 |
Unable to get the Text box value in Javascript
|
<p>I am using Jquery Tokeninput to select multiple values but when i tried to select the values in text box it's always coming blank I am using below Jquery function to retreive the val.
Please refer to to my previous question on stack <a href="http://stackoverflow.com/questions/11613194/how-to-send-json-data-from-aspx-page">Here</a></p>
<pre><code> var values = $("#txtTest").val();
$("#Button1").click(function() {
alert(values);
return false;
});
</code></pre>
<p>Please find the screen shot or same.</p>
<p><img src="http://i.stack.imgur.com/borYV.jpg" alt="enter image description here"></p>
|
javascript jquery asp.net
|
[3, 5, 9]
|
2,839,411 | 2,839,412 |
Open main-activity one time
|
<p>For my news-reader app, I made a widget. Using the widget it is possible to start the news-app. But if the user goes back to the home screen, with the back button, there still is an instance of the application. So if the user goes the applications-list (all the app's) and start the news-app again. There are 2 instances of the news app :S For closing the app, the users needs to push 2 times on the back button (because you see 2 times the same app). Can I do anything about it?</p>
<p>Here my code:</p>
<pre><code>static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
int appWidgetId) {
Intent configIntent = new Intent(context, Main.class);
PendingIntent configPendingIntent = PendingIntent.getActivity(context, 0, configIntent, 0);
RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.widget);
remoteViews.setOnClickPendingIntent(R.id.headlinesBox, configPendingIntent);
// Tell the widget manager
appWidgetManager.updateAppWidget(appWidgetId, remoteViews);
</code></pre>
<p>}</p>
|
java android
|
[1, 4]
|
5,772,173 | 5,772,174 |
Making sure my sliding panel remains centered on window resize?
|
<p>I have created a sliding panel that should appear in the center of any sized window, my problem however is that I have added window.resize around my css calculations which doesnt seem to work, when the page is resized then the window crashes?</p>
<p>My code is as follows:</p>
<pre><code>$(document).ready(function() {
var $userPanel = $('div.panel');
// hide div.panel then show it and slide into view
$userPanel.hide().delay(2000);
$userPanel.show('slide', { direction: 'up' });
// work out the window width / 2 to get the center and the same for div.panel
var windowWidth = $(window).width() / 2;
var panelWidth = $userPanel.width() / 2;
// subtract the div.panel width from the window width / 2
var positionCentered = windowWidth - panelWidth;
// add css to the left property of position absolute
$(window).resize($userPanel.css({ left: windowWidth - panelWidth })); // ???????????????
$('#closeMe').click(function(e) {
e.preventDefault();
$userPanel.hide('slide', { direction: 'up' });
});
});
</code></pre>
<p>Can anyone offer me some advice as to where Im going wrong?</p>
<p>Regards
Kyle</p>
|
javascript jquery
|
[3, 5]
|
123,052 | 123,053 |
How would I add a delay to this JQuery event?
|
<p>This is an event that appends some html:</p>
<pre><code> $("#feed").live("mouseover", function(){
$("#main").append('<div class="help_div" id="feed_help"><p>Your feed shows you information on the users you follow, such as songs added, voting, commenting, following, and the showing of songs between users.</p></div><div class="arrow" id="feed_arrow"></div>');
});
</code></pre>
<p>How would I cause there to be a 2000 millisecond gap between mousing over the selected element and appending the html?</p>
|
javascript jquery
|
[3, 5]
|
2,444,434 | 2,444,435 |
embed jquery themes in asp.net
|
<p>I have a DLL and I'm trying to wrap the jquery progress bar inside an asp.net server control with the jquery lightness theme.
I was able to embed the jquery into the control but the css isn't showing up. Do I have to embed each image into the assembly? Here's what I have right now</p>
<pre><code>[assembly: WebResource("MyNamespace.jquery-ui-1.8.13.custom.css", "text/css")]
[assembly: WebResource("MyNamespace.jquery-1.5.1.min.js", "text/javascript")]
[assembly: WebResource("MyNamespace.jquery-ui-1.8.13.custom.min.js", "text/javascript")]
</code></pre>
<p>The images are in a folder called /images/ in the root of the DLL. the jquery is referencing the images like this.</p>
<pre><code>.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); }
</code></pre>
<p>But none of the images show up. I feel like there should be an easier way then having to add a web resource for each image. What is the best way to do this?</p>
|
jquery asp.net
|
[5, 9]
|
3,961,168 | 3,961,169 |
JavaScript include
|
<p>I have a javascript code that is about 3000 lines long. All of the functions are in one file. I need to know if there is a way to include a function within the same file.</p>
<p>Example:</p>
<pre><code>function renderGameLayout()
</code></pre>
<p>This would include all the layout designs.</p>
<p>Now later on in the code, I will be calling back to that function within another function? I tried:</p>
<pre><code>function getGames()
{
// other js code here
$(document).ready(function()
{
renderGameLayout();
});
// other js code here
}
</code></pre>
<p>within another function, but this didn't work. Any suggestions? NOTE: I do not want to include another .js file, please do not suggest that.</p>
|
javascript jquery
|
[3, 5]
|
1,881,015 | 1,881,016 |
How to pass( Windows credantial) authentication from site A to site B (Publish with Windows authentication)
|
<p>I have 2 publish website A and B.</p>
<p>B site with windows authentication</p>
<p>I want to open B site as new window from A site, so its ask for windows credential. I have credential in A site. I am opening B site using Javascript.window.open.</p>
<p>Can you pls guide me how i can set window credential for B site from A site.</p>
<p>or is any other way to achieve this. </p>
<p>Please guide me</p>
|
c# asp.net
|
[0, 9]
|
1,115,140 | 1,115,141 |
Hitting a word then highlight
|
<p>I have tried in hours to make this work.</p>
<p>I need to have a function which highlights the char if it's correct.</p>
<p>Ex, word is "halluluja" and i have a input field.</p>
<p>When user hitting "h" it has to make "h" red in "halleluja", if user hit "ha" after, it has to highlight the a. and so on.</p>
<p>I have tried something with substr, without any luck.</p>
<pre><code>'typing':function(e){
var c = w.length; //The word length, ex. halleluja
for ( i=0;i<e.length;i++){ //foreach each
var o = e.substr(0, e.length); var l = w.substr(i,i+1); //my typing substr, and the char substr
if ( o.toLowerCase() == l.toLowerCase()){ //correct
//highlight the letter.
}
}
},
</code></pre>
<p>The word container is here which outputs the word in that container.</p>
<pre><code> document.getElementById('wordContainer').innerHTML = w;
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,546,650 | 3,546,651 |
select box manipulation
|
<p>I would like to dynamically change the option value of a select tag. Is this possible? When I say value, I mean the "Change Me" portion. If this is possible, can someone please show me how?</p>
<pre><code><option value="0">Change Me</option>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,438,467 | 1,438,468 |
Encryption of string in Android SDK
|
<p>I need to encrypt String & send to sever which is in php.</p>
<p>Below you will find encryption code and function to encrypt it. </p>
<pre><code>define('SALT', 'whateveryouwant');
function encrypt($text)
{
return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT,
$text, MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND))));
}
function decrypt($text)
{
return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT,
base64_decode($text), MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND)));
}
</code></pre>
<p>I tried out some classes in android but did not work at all.
Anybody having idea about the functions or classes in android which support this functionality?</p>
<p>Thanks in Advance</p>
|
php android
|
[2, 4]
|
5,223,991 | 5,223,992 |
How to detect confirm() choice?
|
<p>I have this jquery code that generates a yes/no dialog box when the user click a button.</p>
<pre><code>$('#btnFinalize').click(function()
{
confirm("Are you sure?");
});
</code></pre>
<p>But how can I detect if the user click yes/no? </p>
|
javascript jquery
|
[3, 5]
|
4,968,390 | 4,968,391 |
How to recognise an enter character in Html
|
<p>I have a HtmlEditor(ajax control) in which i am giving some contents to be modified by the user on click of a button(fetched from the database). </p>
<p>When i fetch the contents into a textbox control the 'spaces' and 'enter' come as it is stored in database but when i use HtmlEditor 'spaces' and 'enter' doesnt come and the text is displayed as a plain paragraph. </p>
<p>My code is as follows:</p>
<pre><code> OdbcConnection casetype = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=localhost;Database=testcase;User=root;Password=root;Option=3;");
casetype.Open();
//*******to get order
string ordequery = "select orde from testcase.orddetpabak where fil_no=? and orderdate=?";
OdbcCommand ordecmd = new OdbcCommand(ordequery, casetype);
ordecmd.Parameters.AddWithValue("?", HiddenField4.Value);
ordecmd.Parameters.AddWithValue("?", TextBox3.Text);
using (OdbcDataReader ordeMyReader = ordecmd.ExecuteReader())
{
while (ordeMyReader.Read())
{
String order = ordeMyReader["orde"].ToString();
}
}
string editorcontents= "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + order ;
Editor1.Content = editorcontents;
</code></pre>
<p>If i simply do</p>
<pre><code>textBox1.Text=order;
</code></pre>
<p>than everything is fine but i want the same output in HtmlEditor control. How can i do it?</p>
|
c# asp.net
|
[0, 9]
|
347,051 | 347,052 |
How to force attach an app to android market?
|
<p>When we install an app (apk file) directly via file, that app is not associated to the market, so does not appear as "installed".</p>
<p>Titanium Backup as an option to force attach to market, which works very well.</p>
<p>My question is: anyone knows how can I do something similar? I want to develop an app just to correct those associations.</p>
|
java android
|
[1, 4]
|
5,435,475 | 5,435,476 |
Legal use of creating a new object on a global namespace
|
<p>Would this be a legal use of creating an object on a global namespace? My goal is to create 1 global namespace for this application. Also how would I alias MYNYTE.app? Could I do something like this with out polluting the Global namespace: <strong>var b = MYNYTE.app;</strong></p>
<pre><code>if( ! MYNYTE ) MYNYTE = {};
if( ! MYNYTE.app ) MYNYTE.app = {};
MYNYTE.app.Playbook = function(){
this.change = '';
this.boo = function(){alert('boo');}
this.setChange = function( v )
{
this.change = v;
}
this.getChange = function( v )
{
return this.change;
}
}
var test = new MYNYTE.app.Playbook();
var test2 = new MYNYTE.app.Playbook();
test.boo();
test.setChange( 'Change is bad' );
test2.boo();
test2.setChange( 'Change is great' );
console.log( test2.getChange() );
console.log( test.getChange() );
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,959,732 | 2,959,733 |
jQuery: Intercept original DOM ready event?
|
<p>Would it be possible to somehow intercept the DOM ready event so that anything normally triggered within, say, <code>$(document).ready(function() { ... }</code> would not be executed? And then later manually trigger the event so that the code <em>was</em> executed?</p>
<p>In my case, I have a large amount of existing code that already relies on <code>$(document).ready(function() { ... }</code> and my hope is that I would not have to do a search/replace to have all of it rely on a custom manually triggered event.</p>
|
javascript jquery
|
[3, 5]
|
3,426,602 | 3,426,603 |
delay images for display purposes not efficiency using javascript?
|
<p>I have run into numerous sites that use a delay in loading images one after the other and am wondering how to do the same.</p>
<p>So i have a portfolio page with a number of images 3 rows of 4, what i want to happen is for the page to load,except for the images in img tags. Once the page has loaded i want images 1 of each row to load then say 0.5 seconds later the next image in the row(s) and so no. I'm going to have a loading gif in each image box prior to the actual image being displayed.</p>
<p>I know its doable but cant seem to find the term for doing this. This is purely for looks as it is a design site.</p>
<p>Thanks for the help.</p>
|
javascript jquery
|
[3, 5]
|
6,031,504 | 6,031,505 |
what is a reactive graph in software development?
|
<p>I guys, can someone explain what a reactive graph is? Links would also be appreciated.</p>
<p>Thanks
A.</p>
|
c# java
|
[0, 1]
|
2,954,426 | 2,954,427 |
Is there a way to set a php variable via JavaScript
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5948314/using-a-javascript-variable-to-set-php-variable">Using a javascript variable to set PHP variable</a> </p>
</blockquote>
<p>I need to do something like this </p>
<pre><code><script type="text/javascript" charset="utf-8">
'<?php $something; ?>' = $(".product_calculation").val();
</script>
<?php
print "from js" . $something;
?>
</code></pre>
<p>so i need to set a variable and then use it in php directly below after i set it</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,344,804 | 1,344,805 |
Java vs Android SDK
|
<p>I want to know how similar Java is to the Android SDK. I am aware that the Android SDK uses Java, but I'm also aware there are many different things like manifest files and XML files and whatnot. I want to know if the SDK is similar enough that if I were to make a simple <code>Swing</code> based GUI program, would I be able to port it within a day? Is this realistic? </p>
|
java android
|
[1, 4]
|
173,311 | 173,312 |
Check if javascript file was loaded
|
<p>I am loading the following javascript files from a CDN. Is there any way I can check if these have been loaded correctly and if not, load them from a local folder?</p>
<p><a href="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js</a>
http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.min.js
<a href="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js" rel="nofollow">http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js</a></p>
<p>I know I can check the jquery file but not sure about the others. Any tips?</p>
|
javascript jquery
|
[3, 5]
|
3,936,677 | 3,936,678 |
How to change a background color in Javascript based on an entered value
|
<p>I am trying to create a page that, upon entering a temperature of or higher than 70, the result page will turn red, and if the temperature is below 70, then it will turn blue. I already have a sample page for the first part of the code for the submit page. I just don't want the words to turn colors, I want the entire page to turn colors based on the temperature. Can anyone help?</p>
<pre><code><html>
<body>
<?php
if (isset($_POST['temperature'])): //isset determines if var has valid contents, even empty string
//if var is set, show what it contains
$myFahrenheit = (int)$_POST['temperature']; //cast value sent via post to an integer
$myCelsius = intval(($myFahrenheit-32) * (5/9)); //calc celsius
echo '<h1><font color="blue">You entered ' . $myFahrenheit . ' in Fahrenheit!!</font><br />';
echo '<h1><font color="red"> It is '. $myCelsius .' in celsius!!</font><br />';
//put link on page to reset form
print '<a href="' . $_SERVER['PHP_SELF'] . '">Reset page</a>';
else:
//show form
?>
<!--Note the server variable indicating the page we are on -->
<form action="<? print $_SERVER['PHP_SELF']; ?>" method="post">
Enter your temperature in Fahrenheit <input type="text" name="temperature"><br>
<input type="submit" value="Show me the temperature in celsius!!">
</form>
<?
endif;
?>
</body>
</html>
</code></pre>
|
php javascript
|
[2, 3]
|
2,794,155 | 2,794,156 |
call a code behind function from jquery in aspx
|
<p>I want to call a codebehind function from jquery.</p>
<p>The aspx file name is group_master.aspx</p>
<p>The jquery is </p>
<pre><code> function populatecontrol(list, control) {
var id = 0;
var GroupName=document.getElementById('<%=hdnGroupNameCheck.ClientID %>');
if (list.length > 0) {
$.each(list, function (key, value) {
var obj = JSON.parse(value);
document.getElementById('<%=hdnGroupNameCheck.ClientID %>').value=obj.Second;
control.html("Group already exist").append('<a id="editclick" href ="edit('+obj.Second+')">Click here to edit or enquire</a>');
});
}
else
control.text="Group does not exist"
}
</code></pre>
<p>The edit('+obj.Second+') is an edit function in codebehind.</p>
<p>Thanks,</p>
|
jquery asp.net
|
[5, 9]
|
5,906,179 | 5,906,180 |
There is no build provider registered for the extension '.rss'
|
<p>I tried to make a .rss file in my ASP.NET application work like a .ashx and although I did everything I was supposed to, I am still getting this error:</p>
<p>There is no build provider registered for the extension '.rss'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.</p>
<p>There IS a build provider registered!</p>
<pre><code><buildProviders>
<add extension="*.rss" type="System.Web.Compilation.WebHandlerBuildProvider"/>
</buildProviders>
<httpHandlers>
<remove verb="*" path="*.rss"/>
<add verb="*" path="*.rss" type="System.Web.UI.SimpleHandlerFactory"/>
...
</code></pre>
<p>I also added .rss in the IIS config. What is left to do?! Using ASP.NET 3.5</p>
|
c# asp.net
|
[0, 9]
|
4,969,572 | 4,969,573 |
how to put validation for radiobuttonlist's radiobutton ?
|
<p>Here i have gridview which contain some values retrieved from database.We put radiobutton list for each row which contain 4 radiobutton in each row.
For particular row , i wish to disable that 4 radiobuttons.
For that , i tried following code ...But It doesn't work....</p>
<pre class="lang-cpp prettyprint-override"><code>if (j == 0) {
dtrelative.Rows.InsertAt(rd3, 0);
// rBtnList.Items[0].Enabled = false;
//rBtnList.Items[0].Attributes.Add("Enabled","False");
////rBtnList.Items[1].Attributes.Add("Enabled", "False");
////rBtnList.Items[2].Attributes.Add("Enabled", "False");
////rBtnList.Items[3].Attributes.Add("Enabled", "False");
//rtButton.Attributes.Add("Enabled", "False");
rBtnList.HasAttributes.Equals(rtButton).GetType();
rtButton.Enabled = false;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
4,660,071 | 4,660,072 |
Calling base constructor in C#
|
<p>I have the following hierarchy:</p>
<pre><code>class Base
{
public Base(string sMessage)
{
//Do stuff
}
}
class Derived : Base
{
public Derived(string someParams)
{
string sMessage = "Blah " + someParams;
//Here I want to call the base constructor
//base(sMessage);
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,383,292 | 2,383,293 |
background to panel in asp.net
|
<p>I m having a imagecontrol in asp.net which has only panel,
i have to set the panel's background through code,
i gave the file path of the image which it has to set
like this,</p>
<p>this.Panel1.BackImageUrl = @"D:\Backup\deepasundari\Asp.net\PhotoSlideShow\PhotoSlideShow\Sample Pictures\15flowers1024.jpg";</p>
<p>but it s not getting set.
Do anyone knows how to set this?</p>
|
c# asp.net
|
[0, 9]
|
1,769,334 | 1,769,335 |
insert array into an array
|
<p>Hello
In my android application i need to insert an array into an array and access its values.
Is there any way that i can get this done.</p>
<p>Please share your valuable suggestions
Thanks in advance :)</p>
|
java android
|
[1, 4]
|
595,936 | 595,937 |
selecting a row value from datagrid should update inside datagrid using jquery?
|
<p>I have a datagrid inside a datagrid like following:</p>
<pre><code><asp:DataGrid id="GV1" Runat="server" >
<asp:BoundColumn HeaderText="Item ID" DataField="item_id" Visible="False"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Item Name">
<ItemTemplate>
<asp:LinkButton id="lbitemName" runat="server" class="list_review" OnClientClick="return false;"/>
<asp:DataGrid id="GV2" Runat="server" AllowPaging="true" UseAccessibleHeader="True" CssClass="list_info" style="display:none;">
<Columns>
<asp:BoundColumn HeaderText="User Name" DataField="user_fullname"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</code></pre>
<p>So when you click on linkbutton "lbitemName" then take the item_id value and bind the GV2 with that item_id in Jquery.Please help</p>
<p>Thanks</p>
|
jquery asp.net
|
[5, 9]
|
2,784,607 | 2,784,608 |
Why does my "if (p.exitValue() != 0)" code run twice?
|
<p>When I execute a shell script using the method below, my "if (p.exitValue() != 0)" code runs TWICE when it is successful... anyone know why? Also, when the shell script fails, the else code runs once, and then the success code runs again anyway. What am I doing wrong? </p>
<pre><code>void exec(String commander){
Process p = null;
try {
p = Runtime.getRuntime().exec(commander);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
StreamGobbler errorGobbler = new
StreamGobbler(p.getErrorStream(), "ERROR");
// any output?
StreamGobbler outputGobbler = new
StreamGobbler(p.getInputStream(), "OUTPUT");
// kick them off
errorGobbler.start();
outputGobbler.start();
// any error???
int exitVal = 1;
try {
exitVal = p.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("ExitValue: " + exitVal);
if (p.exitValue() != 0)
{
//SUCCESS Code RUNS TWICE
}
else {
//FAILURE Code Runs Once, then Success Code Runs anyway!! WHY?
}
}
</code></pre>
|
java android
|
[1, 4]
|
2,246,844 | 2,246,845 |
Wire up button click events after AJAX post
|
<p>I have a HTML table with various rows, each have a delete button with a class. </p>
<p>On the DocumentReady event I wire up all buttons with this class to handle the click event. </p>
<p>On the click event it does a jQuery post which deletes data from the database and returns the table with the removed row. </p>
<p>If I go to click another delete button it doesn't do anything as if the click event is not wired up. I have tried wiring it up in the OnSuccess event as well as DocumentReady but nothing.</p>
|
javascript jquery
|
[3, 5]
|
2,250,901 | 2,250,902 |
BlockUI java script not execting inside of ContentPlacehoder of aspx page Master page
|
<p>I have the following BlockUI javascript set up to run on an aspx page which is in a ContentPlaceholder of a Master page. When the page loads and when I click the ASP button, the javascript fires, and shows the alert boxes 1 and 4, but not 2 and 3.</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
alert('alert1');
$('#Button3').click(function() {
alert('alert2 button clicked');
$.blockUI({ message: '<h1>Just a moment...</h1>' });
alert('alert 3 It clicked!');
});
alert('alert4!');
});
</script>
</code></pre>
<p>I am think it has something to do with finding the button inside of the ContentPlaceholder.</p>
<p>Any Ideas anyone?</p>
<p>Here's the button, no code behind events are set up on it.</p>
<pre><code> <td class="style17">
<asp:Button ID="Button3" runat="server" Text="Button" />
</td>
</code></pre>
|
jquery asp.net
|
[5, 9]
|
3,282,340 | 3,282,341 |
Jquery resizeable issue
|
<p>I am trying to use the alsoResize option.
It works when I write this: </p>
<pre><code>$(obj).resizable({ minHeight: 150, minWidth: 280, alsoResize: '.tab_content'});
</code></pre>
<p>but the problem is that it's resizing all 'tab_content' elements in the page.
I want it to be relative to 'obj' which also contains a 'tab_content',
I tried: <code>alsoResize: $('.tab_content',obj)</code>
but it didn't work,
any suggestions,
Thanks</p>
|
javascript jquery
|
[3, 5]
|
1,625,931 | 1,625,932 |
How to move browser's scrollbar to a class?
|
<p>This script loads 10 more posts from peoples.php in index.php every time the button is pressed (through the loadfeed function).</p>
<pre><code>$("#loadmore").click(function() {
cap += 10;
loadfeed();
$(this).addClass("loading");
that = this
setTimeout(function() {
$(that).removeClass('loading');
}, 3000)
});
</code></pre>
<p>My posts are in this format and the class in number ASC, using <code>$i</code> for every post. The class has nothing to do with my CSS, I added it now to explain my thought.</p>
<pre><code><div id="post" class="p1"></div>
<div id="post" class="p2"></div>
<div id="post" class="p3"></div>
.
.
.
</code></pre>
<p>Every click on "load more" loads +10 posts. When a user enters in the page there is a default of 20 posts. </p>
<p>This is how I add 10 posts.</p>
<pre><code>... .load('people.php?cap='+cap, function () { ...
</code></pre>
<p>When I click on "load more" I want the scrollbar to be in a predefined position and not at the end of the page as it does now.</p>
<p>I tried to use in some places of the index.php but it is not ideal, not working as I want it.</p>
<p>So when a user clicks "load more" at first, the posts loaded are 30 from the default 20. On second click are made 40. For now, the last post shown is the 20th, 30th, 40th....</p>
<p>How can I take the browser to the 21st, 31st, 41st post when the use clicks on <code>#loadmore</code> ?</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,993,320 | 1,993,321 |
Android read text file from end
|
<p>In Android
I have a text file which can be LARGER or SMALLER then 33 lines.
If larger then 33 lines read the LAST 33 lines.
If LESS or equal to 33 lines then read ALL lines.
The fastest way to do it thanks</p>
<p>OK this is what i got</p>
<pre><code>MAXLINECOUNT=33;
File f = new File("file.......");
if (f.exists())
{
String readString = new String();
int i,l;
i=0;
l=0;
LineNumberReader reader = new LineNumberReader(new FileReader(new File("/mnt/sdcard/data.txt")));
while ((readString = reader.readLine()) != null) {}
l= reader.getLineNumber();
if (l>=MAXLINECOUNT) l=l-(MAXLINECOUNT-3);// i realy need only 30
FileInputStream fileIS = new FileInputStream(f);
BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));
while((readString = buf.readLine())!= null){
if (i>l)
{
process hear ...............
}
i++;
</code></pre>
|
java android
|
[1, 4]
|
1,358,976 | 1,358,977 |
Passing value to PHP variable inside script
|
<p>I have some PHP code inside the script so I need
the JavaScript value as a PHP variable, as follows:</p>
<pre><code><script>
;
var js_var = 123;
var php_var = <?php js_var ?>;
alert(php_var);
;
</script>
</code></pre>
<p>Using jQuery to send the value to a PHP page will return the value but not as a PHP variable:</p>
<pre><code>$.get("page.php", {js_var_name: js_var}, function(data) {alert(data)});
</code></pre>
<p>I tried also all jQuery AJAX functions: load(), post() and the ajax() method, none of them pass back the value of PHP as above requested.</p>
<p>Is it possible to implement the above with jQuery?</p>
|
php javascript jquery
|
[2, 3, 5]
|
1,216,865 | 1,216,866 |
string length in java
|
<pre><code>String h;
h=(String) Tok.nextElement();
System.out.println("" + ++n +": "+h);
h.trim();
System.out.println("The length of h :"+n+h.length());
wordlist[now]=h;
System.out.println("Now length is"+wordlist[now].length());
</code></pre>
<p>This "\u0B9A\u0BBF\u0BAF\u0BA9" is the string assigned to h.The output is </p>
<blockquote>
<p>The length of h :128</p>
<p>Now length is 41</p>
</blockquote>
<p>I'm totally confused :( help please. Sorry . the pblm is not with operator but with length also note that the length of h is 128 !! where as the actual length is 28</p>
|
java android
|
[1, 4]
|
3,792,432 | 3,792,433 |
"Build" JS variable
|
<p>I'm having problem for a long time and I would like to solve it now.
In php, if you want to retreive variable $var123, you could do it this way</p>
<pre><code>$varname = "var123";
$var = $$varname;
</code></pre>
<p>How could I do the same in js and/or jquery?</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,754,315 | 4,754,316 |
Jquery click function not working as it should
|
<p>I'm trying to display an alert box through a link and using jQuery but it seems that I didn't have done the things right.</p>
<p>My link : </p>
<pre><code><a class="details_link">Details</a>
</code></pre>
<p>My jQuery function : </p>
<pre><code>$(document).ready(function () {
$(".details_link").click(function () {
alert("test");
});
})
</code></pre>
<p>This code is not working... I've checked other answers on Stack but I think I have followed the instructions. And I'm including the jquery-1.9.1.js file.</p>
|
javascript jquery
|
[3, 5]
|
5,794,062 | 5,794,063 |
How can I remove an element from a list returned by a jQuery selector?
|
<p>I would like to uncheck all checkboxes that have a specific class with the exception of the one just checked.</p>
<pre><code>function PizzaToppings_OptionValueChanged(checkboxElement) {
if ($(checkboxElement).attr("checked")) {
if($(checkboxElement).hasClass('cheese_toppings'))
{
// This will uncheck all other "cheese_toppings" but I want the newly selected item "checkboxElement" to remain checked.
$('input:checkbox.cheese_toppings').attr('checked', false);
}
}
}
</code></pre>
<p>The code above will uncheck all "cheese_toppings" including the one just selected. I don't want to then recheck the one just selected or the event will be recalled.</p>
<p>I thought the best solution would be to remove "checkboxElement" from the list returned by <code>$('input:checkbox.cheese_toppings')</code> and then set the <code>.attr('checked', false)</code> to that list. But I'm not sure how to remove checkboxElement from the list.</p>
|
javascript jquery
|
[3, 5]
|
3,565,838 | 3,565,839 |
GridViewRowCommand keep fire
|
<p>by right my label1.text will be display by each clicks, however my label was fire during page load, and this is not what i want, so any idea can perform fire event per clicks?</p>
<p><strong>gridview property</strong></p>
<p>asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnRowDataBound="abcde"</p>
<p><strong>link button that inside gridview</strong></p>
<p>asp:LinkButton ID="lnkname" runat="server" Text='<%#Eval("movieTitle") %>' Width=500 CommandName="cmdLink">
<p><strong>code behind for link button</strong></p>
<p>protected void abcde(object sender, GridViewRowEventArgs e)</p>
<pre><code>{
Label1.Text = ((LinkButton)e.Row.FindControl("lnkname")).Text;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,145,431 | 5,145,432 |
javascript inside php error ReferenceError: img is not defined
|
<p>photos[] is an array of photos names then,</p>
<pre><code>foreach($photos as $key=>$value)
{
@$blocks .= '<div><img src="'.$value.'" onload="img=this"><img src="remove.png" onclick=remove_image(img)></div>';
}
</code></pre>
<p>so when clicking on the remove icon for the first photo it works just fine, but the others shows this error:</p>
<p><code>ReferenceError: img is not defined</code></p>
|
php javascript
|
[2, 3]
|
623,968 | 623,969 |
How to set width of a html tablerow in C#
|
<p>this is a follow up question to the following question link:</p>
<p><a href="http://stackoverflow.com/questions/11112112/how-to-hide-columns-in-asp-net-webform">how to hide columns in ASP.NET webform</a></p>
<p>following the answer that i got from the above link, i am using </p>
<pre><code> System.Web.UI.HtmlControls.HtmlTableRow
</code></pre>
<p>i want to set the width of the entire row. How can i do this in C#? any other idea/way you can suggest, please let me know.</p>
<p>if you have any more questions, please do not hesitate to ask.</p>
|
c# asp.net
|
[0, 9]
|
281,302 | 281,303 |
How do you write an extra class for often used code and call it from everywhere?
|
<p>In my little app users can have a look at 'more information' or send me feedback when they click on <strong>the menu button</strong> (of the device) at <strong>every xml file</strong> of the app.</p>
<p>This is my code (when you click on the menu button):</p>
<pre><code>@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.impressum:
startActivity(new Intent (this, MoreInformation.class));
break;
case R.id.feedback:
/*
*
*/
break;
}
return super.onOptionsItemSelected(item);
}
</code></pre>
<p>Now I put the code into all java classes. This obviously works but I'd like to create a class (Let's call it <code>isMenuButtonPressed.class</code>) which contains the code above and I'd like to remove the code above from all other java classes and just call <code>isMenuButtonPressed.class</code> (in these java classes when the menu button was pressed). How can you do that? How do you pass the information on that the menu button was pressed? How do you receive it in the <code>isMenuButtonPressed.class</code>?</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
5,402,014 | 5,402,015 |
Hiding search field code only executes one time
|
<p>I'm writing a piece of jQuery to make a search box appear when a user hovers over the search button, displays for five seconds, then disappears if the user hasn't given the search text field focus.</p>
<p>It currently just appears, disappears, then reappears for good. My code is below, you can see it in action at <a href="http://emilysenger.ca" rel="nofollow">http://emilysenger.ca</a></p>
<pre><code>jQuery(document).ready(function(){
jQuery('input').blur(function(){
jQuery('input').removeClass("focus");
})
.focus(function() {
jQuery(this).addClass("focus")
});
jQuery("div#sneakySearch form input#search").css("display", "none");
jQuery("div#sneakySearch form input#searchButton").hover(function(){
jQuery("div#sneakySearch form input#search").fadeIn("slow");
}, function(e){
jQuery(e).delay(5000,
function(e){
if(!jQuery("div#sneakySearch form input#search").hasClass("focus"))
{
jQuery("div#sneakySearch form input#search").fadeOut("slow");
}
});
});
});
</code></pre>
<p>Some help with this would be <em>awesome</em>. Thanks!</p>
|
javascript jquery
|
[3, 5]
|
5,697,987 | 5,697,988 |
jQuery: remove class once element is clicked
|
<p>I am stuck on a little jQuery problem. I have a collection of links (more than 50) generated from a php loop. When a user clicks on a link, the jQuery load event is called, and a php/mysql script (called page.php in the example below) is loaded into an empty div on the page.</p>
<p>I would like the class (".classy") to removed from the < a > tag and replaced with another class (".newclass"). This is so that the information is loaded only on the first click. </p>
<p>The html:</p>
<pre><code><a class='classy' name='marvin'>Click to toggle info</a>
<div id='marvin'></div>
</code></pre>
<p>The jQuery:</p>
<pre><code>$(document).ready(function(){
$(".classy").click(function(){
var foo = $(this).attr("name");
$("#"+foo).load("page.php?id="+foo).slideToggle('fast');
$(this).removeClass('classy');
$(this).addClass('newclass');
return false;
});
});
</code></pre>
<p>Thanks!</p>
|
php jquery
|
[2, 5]
|
5,811,663 | 5,811,664 |
android, how to get directory listing?
|
<p>Just a quick question, how to I get a list of directories inside a specified directory.</p>
<p>for example,</p>
<pre><code>String path = Environment.getExternalStorageDirectory().toString()+"/myApp/";
</code></pre>
<p>now I'd need to get the list of directories that are inside the "path" directory.</p>
<p>Thanks!</p>
|
java android
|
[1, 4]
|
4,967,128 | 4,967,129 |
XML parsing Android
|
<p>I am using JDOM to create XML and during parsing i am getting this exception
"Could not find class 'java.rmi.RemoteException', referenced from method org.jdom.JDOMException.getNestedException
" which cause a crash in program .This exception occurs very frequently but not always
Any body has faced same problem .
Any help would be appreciated
Thanks in advance.</p>
|
java android
|
[1, 4]
|
1,447,342 | 1,447,343 |
Generic jQuery callback?
|
<p>Is there a way to have a callback on a jQuery object that doesn't do anything else. something like:</p>
<pre><code>$("div", this).do(function(){
$(this).hide();
});
</code></pre>
<p>The only way I know how to do that is:</p>
<pre><code>var obj = $("div", this);
$(obj).hide();
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,016,386 | 4,016,387 |
Benefit for jQuery("#item_id").val() over document.getElementById("item_id").value?
|
<p>Is there any benefit to using jQuery over <code>getElementById()</code> to retrieve an input field's value?</p>
<pre><code>jQuery("#item_id").val()
document.getElementById("item_id").value
</code></pre>
<p>In other words, is JQuery necessary to retrieve a value (i.e., does it cover special tricky cases)?</p>
|
javascript jquery
|
[3, 5]
|
1,226,142 | 1,226,143 |
How to get all option values in a multiple select with jquery?
|
<p>I'm trying to get all options values of a multiple select with the following code.</p>
<pre><code>var service_m = $("#SelectRight>option").map(function () { return $(this).val(); });
</code></pre>
<p>When I do this I only get [object Object] in return.</p>
<p>Any suggestions on how to solve this?</p>
|
javascript jquery
|
[3, 5]
|
5,227,394 | 5,227,395 |
onkeyup event slowness
|
<p>I have a aspx page with about 200 textboxes with onkeyup events that some users have complained is really slow.</p>
<p>Would having all of those onkeyup events cause this slowness?</p>
|
javascript asp.net
|
[3, 9]
|
4,508,754 | 4,508,755 |
Adding key/value into array where value is a object
|
<p>Adding key/value into array where value is a object</p>
<p>I want to add some text as a key and Object as a value.</p>
<p>Example</p>
<pre><code>$('#clickme').on('click' , function() {
push to array => "some_text" as (value) and $(this) as key
})
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,656,621 | 1,656,622 |
java to javascript communcation
|
<p>i am trying to pass value from javascript to java (applet ), but everytime its coming out to be null .</p>
<p>my java class :</p>
<pre><code>package com.vaannila.utility;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import prefuse.util.ui.JPrefuseApplet;
public class dynamicTreeApplet extends JPrefuseApplet {
private static final long serialVersionUID = 1L;
public static int i = 1;
public String dieasenameencode;
// System.out.println("asjdjkhcd"+dieasenameencode);
public void init() {
System.out.println("asjdjkhcd"+dieasenameencode);
System.out.println("the value of i is " + i);
URL url = null;
// String ashu=this.getParameter("dieasenmae");
// System.out.println("the value of the dieases is "+ashu);
//Here dieasesname is important to make the page refresh happen
//String dencode = dieasenameencode.trim();
try {
//String dieasename = URLEncoder.encode(dencode, "UTF-8");
// i want this piece of the code to be called
url = new URL("http://localhost:8080/docRuleToolProtocol/appletRefreshAction.do?dieasename="+dieasenameencode);
URLConnection con = url.openConnection();
con.setDoOutput(true);
con.setDoInput(true);
con.setUseCaches(false);
InputStream ois = con.getInputStream();
this.setContentPane(dynamicView.demo(ois, "name"));
ois.close();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (FileNotFoundException f) {
f.printStackTrace();
} catch (IOException io) {
io.printStackTrace();
}
++i;
}
}
</code></pre>
<p>my javascript :</p>
<pre><code>function showSelected(value){
alert("the value given from"+value);
var diseasename=value;
alert(diseasename);
document.decisiontree.dieasenameencode="diseasename";
}
</code></pre>
|
java javascript
|
[1, 3]
|
4,988,752 | 4,988,753 |
How do I create a table dynamically upon getting a successful ajax response?
|
<p>I'm returning data from our database and creating a table dynamically. If the call to page1.php is successful, we create a table with one header row and then loop through the results and make some rows. How do I add a single header row? thx!</p>
<pre><code>$.post("page1.php", {user: "homer"},
function(data){
// output the header row
function(test){
var tblHdr ='<th>'+'Username'+'</th>';
$(tblHdr).appendTo("#tble");
};
// output the user data
$.each(data.userdata,
function(i,details){
var tblRow ='<tr>'+'<td>'details.name+'</td>'+'</tr>';
$(tblRow).appendTo("#tble");
});
}, "json"
);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,127,821 | 2,127,822 |
How do you pass the keystroke event in a $.bind method?
|
<p>I'm not sure how to pass the specific keystroke through the bind method..</p>
<pre><code>$(document).bind('keyup', event, keyup_handler(event));
</code></pre>
<p>This is my lucky failing guess..</p>
<p>This is the method it gets passed too..</p>
<pre><code>var keyup_handler = function(e){
if (e.keyCode == 27) {
close_lightbox();
return false;
};
};
</code></pre>
<p>Another failing variation :</p>
<pre><code> var keyup_handler = function(e){
if (e.keyCode == 27) {
close_lightbox();
return false;
};
};
$(document).bind('keyup', keyup_handler(e));
</code></pre>
<p>Which returns:</p>
<pre><code> e is not defined
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,378,314 | 4,378,315 |
How websites check for user login status?
|
<p>What type of security maintained in any website or web application. After login, Whenever we copy the address from address bar and paste it to the other browser , the page cannot be open or we get redirected directly to login page. But same address can be opened in same browser. So I want to ask that,how the security is maintained and what it called??Thanks in advance.</p>
|
c# asp.net
|
[0, 9]
|
972,079 | 972,080 |
jquery transformable top and left position
|
<p>i have two images in a page first image is a large image and second image is a small image placed in a div on big image small image can be drag and drop and rotate to any degree on big image after that i want to save these two images as one image in php </p>
<p>here is live code </p>
<p><a href="http://jsfiddle.net/cQyvG/" rel="nofollow">http://jsfiddle.net/cQyvG/</a></p>
<p>but problem is that when i drag small image around i cant get the image position on big image where it is placed </p>
<p>here is my php code
photoRotation = $_POST["img_angle"]; </p>
<pre><code>$image_2 = imagecreatefrompng($sec);
$image_2 = imagerotate($image_2,$photoRotation, -1,0);
$image_1 = imagecreatefromjpeg($first);
imagecopy($image_1, $image_2,$_POST["img_left"],$_POST["img_top"], 0, 0, $_POST["img_width"],$_POST["img_hight"]);
</code></pre>
<p>this is working but i always get second image on wrong position </p>
<p>jquery.transformable.js
<a href="http://plugins.jquery.com/plugin-tags/jquerytransformablejs" rel="nofollow">http://plugins.jquery.com/plugin-tags/jquerytransformablejs</a></p>
|
php javascript jquery
|
[2, 3, 5]
|
5,224,482 | 5,224,483 |
Bullet-proof detection of the user's IP Address in ASP.NET
|
<p>I have tried fetching the ip from below mentioned methods</p>
<pre><code>HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] &
Request.UserHostAddress & Request.ServerVariables["REMOTE_ADDR"]
</code></pre>
<p>The problem is this that <code>Request.ServerVariables["REMOTE_ADDR"]</code> return Proxy ip and
<code>HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]</code> can be tampered i want a foolproof method of fetching ip of client which cannot be tampered any help in this regard would be highly appreciated.</p>
|
c# asp.net
|
[0, 9]
|
88,934 | 88,935 |
jQuery is not a function error
|
<p>What is wrong with this statement?</p>
<pre><code>message = $("#contact-form").find(".long-text");
if(message.val().length < 15)
{
message.css("border","2px solid red");
alert("Your message must be more than 15 character long");
}
</code></pre>
<p>I get message.val is not a function error in <a href="http://en.wikipedia.org/wiki/Firebug_%28Firefox_extension%29" rel="nofollow">Firebug</a>? What could be the reason?</p>
<p><strong>NEW</strong></p>
<p>OK, now my form won't submit if I have more or less than 15 characters. Should I open a new question on this or should I continue on this one?</p>
<p>I have this inside:</p>
<pre><code>$("#contact-form").submit(function(){
message = $("#contact-form").find(".long-text");
if(message.val().length < 15)
{
message.css("border","2px solid red");
alert("Your message must be more than 15 character long");
return false;
}
else {
Post form with Ajax ..
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,943,553 | 2,943,554 |
Calling a javascript library from ASP.NET
|
<p>This is a fairly newbie question I'm sure. I'm looking at replacing our server side charting library with the open source javascript library 'flot'. I can use ASP in the javascript used to call the library as per the following example</p>
<pre><code><div id="placeholder" style="width: 600px; height: 300px;">
</div>
<script type="text/javascript">
$(function () {
var d = [<%
for (var i = 0; i < 10; i++) {
if(i > 1)
Response.Write(",");
Response.Write("[" + i + "," + Math.Sin(i) + "]");
}%>];
$.plot($("#placeholder"), [d]);
});
</script>
</code></pre>
<p>This works a charm but what I really need to do is display data from a method in my code behind file (and ultimately a database). A quick Google suggests that I need to use AJAX to accomplish this but I would like to do it on page load.</p>
<p>It strikes me as something that should be simple to do but then I am relatively new to web development (I'm a windows forms developer by trade and an MS Certified one at that so I know my way around C#).</p>
<p>Any help or pointers would be greatly appreciated.</p>
<p>Cheers,</p>
<p>Neil.</p>
|
javascript asp.net
|
[3, 9]
|
3,283,308 | 3,283,309 |
Determine if child of <div> is
|
<p>I need to check whether the contents of a div are either <code>&nbsp;</code> or more <code><div></code>'s and such.</p>
<p>I thought maybe I could do this like $('#right-rail').content or $('#right-rail').value or even $('#right-rail').children(), but it doesn't seem to work.</p>
<p>All I get is either "undefined" or "[object Object]".</p>
<p>Thanks for any help I can get :).</p>
<p>PS, using jQuery if you hadn't guessed by now.</p>
|
javascript jquery
|
[3, 5]
|
2,167,938 | 2,167,939 |
Session Start Custom Function in ASP.Net
|
<p>I am rookie to asp.net . I am developing a application in asp.net 3.5 , on that i need to start a timer ticker whenever the site is requested to open, and ends whenever the page is closed . Heard about the Global.asax file . But , is there any possibility to call the function of another class from Global.asax . Any one help me</p>
|
c# asp.net
|
[0, 9]
|
2,460,120 | 2,460,121 |
Can I access directly to the second value of an array after .split()?
|
<p>I have this code :</p>
<pre><code>var tmp=$(this).attr('id').split("_");
</code></pre>
<p>and I'd like to store on tmp the second value after the split. So if $(this).attr('id') = "hello_marco" I'd like to store in tmp the value marco, not the array.</p>
<p>Of course, I want to do it directly in one line of code, without first store the array and the access to it with array[1].</p>
<p>Is it possible on JS/Jquery?</p>
|
javascript jquery
|
[3, 5]
|
1,755,000 | 1,755,001 |
Control data to display from MySQL by putting them into a group
|
<p>I have a lot of items in my database and I have no problems displaying them. It's just that I want to organize the items that I get from my database by grouping them.</p>
<p>For example I have 50 items and I want to display the first 10 items first, and then hold the rest for later display. So if a user clicked the "view the next items" button or the appropriate number (for example the 10 items are in "1" and so if the "2" has been clicked it should display the 2nd 10 items, until all items are displayed by 10 along with their corresponding number group items holder), then the next 10 items will be displayed and will replace the first 10 items. In short, I want the items to be displayed by 10.</p>
<p>I have this current code:</p>
<h2>PHP</h2>
<pre><code>$result = mysql_query("SELECT * FROM items");
$data = "";
while($row = mysql_fetch_array($result)) {
$data .= "<a href='#' id='".$row['id']."' class='theitem'><img src='media/".$row['picture']."' /></a>";
}
</code></pre>
<h2>HTML</h2>
<pre><code><div id="itemsholder">
<? echo $data; ?>
</div>
</code></pre>
<p>Below the there should be a numerical navigation and that number should correspond to the number of 10-items set beyond 50 items. For example with 50 items, since I want to display only 10 items, I should have 1, 2, 3, 4, 5 links, or a "display next items" button so that whenever a user hits that, it will display the next 10 items and the rest.</p>
<p>PS: I'm open to suggestions, recommendations and ideas.</p>
<p>Thank you, hope someone here can help, thanks.</p>
|
php jquery
|
[2, 5]
|
4,632,605 | 4,632,606 |
JavaScript Library for opening Excel Files on the Web
|
<p>Is there a javascript library that processes an excel file on the client side of the web? </p>
|
javascript jquery
|
[3, 5]
|
1,734,067 | 1,734,068 |
JQuery Cookies Creation...Check if cookie already has a value
|
<p>I am using this code to create a cookie with JQuery:</p>
<pre><code>$.cookie('MyCookieName', 'myValueHere');
</code></pre>
<p>It works fine but as I have the value assign to a random number it's generating a new one every reload.</p>
<p>What I need to do is check if cookie has a value and if it's not empty then don't create a new one or generate any new value.</p>
|
javascript jquery
|
[3, 5]
|
5,431,976 | 5,431,977 |
asp.net periodically send messages to server
|
<p>I'm using VS2010,C# for developing ASP.NET. I want to send periodical messages to server in order that server knows which user is really active (with open windows), so that when a user closes window or changes url (instead of clicking on logout button), my server can detect user sign out and can close his session. what are my options here? I don't think JavaScript would be safe as I should probably update my database (is there any other way? for instance can I call an address in my JS function?)</p>
<p>Another solution would be to use AJAX to send server side messages to server, is it safe and efficient? what is the best way? security is really important for me</p>
|
javascript asp.net
|
[3, 9]
|
237,578 | 237,579 |
check multiple values in an if statement in jquery/javascript
|
<p>I am trying to if the value of an input box is blank or not by doing the below:</p>
<pre><code>var id = $(this).attr('id').substr(3);
var lengthname = $("#input_name_"+id).val().length;
var lengthrss = $("#input_rss_"+id).val().length;
if (lengthrss!=0 || lengthname!=0)
{
// do something
}
else
{
alert('Values cannot be blank');
}
</code></pre>
<p>For some reason it is not doing the OR however if the user enters both values as blanks then the alert comes up?? </p>
|
javascript jquery
|
[3, 5]
|
146,970 | 146,971 |
linking input fields together using listeners in javascript
|
<p>I am trying to bind several input fields to a span element using jQuery. As an example, I have 2 input fields with integer values. The sum of the integer values is shown in a span element. Now the span element should always update when one of the input fields is modified (for this is use .keyup() event in jquery). I have a working solution. But it seems to me a limping solution. So I wonder how you would it. Thank you in advance.</p>
<p>here the code: <a href="http://jsfiddle.net/SJAwb/2/" rel="nofollow">http://jsfiddle.net/SJAwb/2/</a></p>
<p>Cheers
Wolfgang</p>
|
javascript jquery
|
[3, 5]
|
1,849,443 | 1,849,444 |
Looking for a jQuery sortable boxes library
|
<p>I am looking for a jQuery (or pure JS) sortable boxes library.</p>
<p>Functionality should be similar to <a href="http://jqueryui.com/demos/sortable/#display-grid" rel="nofollow">http://jqueryui.com/demos/sortable/#display-grid</a></p>
<p>However, that's not enough. What I need is:</p>
<ul>
<li>Sortability within a grid</li>
<li>Resizable boxes</li>
<li>Taller boxes should not leave blank space on the left side (this is a problem with jUI sortable)</li>
<li>Resizing / dragging should be done on a grid basis e.g. 32x32 not per pixel because that's too precise.</li>
</ul>
<p>The jQuery UI fails with resizability. When I make boxes resizable, and I resize a middle box to become tall, then the leftside of the box is empty (because the other boxes don't float to the left).</p>
|
javascript jquery
|
[3, 5]
|
5,306,707 | 5,306,708 |
jQuery hide/reveal image banner
|
<p>I am hoping someone can provide assistance with a jQuery issue I have. I have been asked to produce a banner which hides/reveals part of an image or div. I am a designer who's skills are limited to HTML and CSS and have no great experience in coding jQuery.</p>
<p>The overall banner is 100% in width split into two equal 50% portions, both images have an overlay caption which doubles as a link.</p>
<p>Upon clicking the linked caption, 75% of the image is then shown, overlaying 25% of the other image, this will be the same for both sides of the banner.</p>
<p>The mark up I have for the banner is:</p>
<pre><code> <div class="home-banner-left">
<img src="home-left.jpg" />
<div class="home-overlay-left">
<h1>
<a href="page.html">This is a link</a>
</h1>
</div>
</div>
<div class="home-banner-right">
<img src="home-right.jpg" />
<div class="home-overlay-right">
<h1>
<a href="page2.html">This is a link</a>
</h1>
</div>
</div>
</code></pre>
<p>Any help would be greatly appreciated. Please ask if further information is needed.</p>
|
javascript jquery
|
[3, 5]
|
5,320,865 | 5,320,866 |
setting checkbox value
|
<p>I have this code:</p>
<pre><code>$('#chkBox').click(function() {
$('#hiddenBox').val($('input').is(':checked'));
});
</code></pre>
<p>I want it to be where if i click on the checkbox, in my hidden field, I set the value to true else if it's not clicked, the value would be false. Can anyone help?</p>
|
javascript jquery
|
[3, 5]
|
3,877,031 | 3,877,032 |
Using javascript to fade a thumbnail image from grayscale to to color
|
<p>I'm relatively new to web development and wouldn't even know where to start in coding a javascript that fades a grayscale thumbnail image into a color thumbnail image on mouseover, and vice versa on mouseoff (<--or whatever this is called). </p>
<p>I've looked all over and can't find a script that does this. Is this possible? Could I use jquery to do this? Other thoughts?</p>
<p>Thanks so much in advance for all your help!</p>
|
javascript jquery
|
[3, 5]
|
2,107,762 | 2,107,763 |
JQuery popup issue in IE
|
<p>IE shows scrollbars when JQuery Dialog pops up. FF doesnt show scrollbars. Whats wrong with IE CSS?</p>
<pre><code><div id="disablebg" style="display: none;overflow:hidden;">
<uc1:CreateInqGeneral ID="CreateInqGeneral1" runat="server" />
</div>
function ShowDialog() {
$("#disablebg").dialog({
resizable: false,
modal: true,
width: "550px"
});
}
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
5,728,599 | 5,728,600 |
jQuery 'if' statement not working
|
<p>This should be a simple <code>if</code> statement, but it's not working for me. Essentially, when you click an element, I want that element to be highlighted and the ID to be put into a the variable <code>value</code>. However, if in the situation the same element is clicked twice, I want to <code>value = NULL</code>. </p>
<pre><code>(function($){
$(".list").click(function() {
$(this).toggleClass("hilite");
var temp = $(this).attr('id');
if (value != temp) {
var value = $(this).attr('id');
} else {
value = NULL;
}
});
})(jQuery);
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,599,751 | 2,599,752 |
Enter is not working in Internet explorer and Firefox
|
<p>This function is not working in Internet Explorer and Firefox. In Firefox, it returns the following error:</p>
<blockquote>
<p>TypeError: e is undefined<br>
[Break On This Error]<br>
...e.which == "number") ? e.which : e.keyCode; keyCodeEntered = (e.which) ? e.which... </p>
</blockquote>
<p>The function:</p>
<pre><code>function onSearchPhraseKeyDown(e) {
var buttonId = '<%=SearchButton.ClientID %>';
if (!e)
var e = (typeof e.which == "number") ? e.which : e.keyCode;
keyCodeEntered = (e.which) ? e.which : window.event.keyCode;
if ((keyCodeEntered == 13) || (keyCodeEntered == 13)) {
document.getElementById(buttonId).click();
return false;
} else {
return true;
}
}
</code></pre>
<p>Can anyone see what's wrong?</p>
|
javascript jquery
|
[3, 5]
|
3,579,864 | 3,579,865 |
Possibility to switch over to Java from .Net
|
<p>I am an MCA fresher and will be working on dot Net for next few months (almost 10-12 months). After that I want to switch over to Java.</p>
<p>How is the possibility that I can switch over to it? What type of preparation I am supposed to do? I am also planning to appear for SCJP but don't have any knowledge how to get registered an registration fees.</p>
<p>Please also guide me what is company's approach towards the candidates switching their technologies. What are the things that companies look for?</p>
|
java asp.net
|
[1, 9]
|
5,616,645 | 5,616,646 |
Window resizing problem
|
<p>When i resize my window popup stays at center position. It show adjust depending on the window size. Whats wrong in my code </p>
<pre><code>.Popup
{
display: none;
height: 400px;
width: 400px;
position: fixed;
background-color: white;
z-index: 9999;
}
</style>
<script type="text/javascript">
onload = function () {
var height = "innerHeight" in window
? window.innerHeight
: document.documentElement.offsetHeight;
$('#popup').css({
'margin-top': (height / 2) - (200),
'margin-left': (document.body.offsetWidth / 2) - (200)
});
document.getElementById("popup").style.display = "inline";
}
</script>
</code></pre>
|
javascript asp.net
|
[3, 9]
|
1,470,647 | 1,470,648 |
Unable to retrieve classes ttd
|
<p>I have a asp website solution where i wish to add some unit tests.</p>
<p>In the solution i have added a new test project.</p>
<p>All my C# classes are located in the folder called 'App_Code'.</p>
<p>But when i try to write <code>Person p = new Person();</code> in my test class it cannot find the class Person.</p>
<p>Its my intention to make that object and fill it up with all sorts of things the person class holds (id, name etc).</p>
<pre><code>//But i wish to directly acces Person, not PersonTest
PersonTest pt = new PersonTest();
pt.IdTest = 1; //error method group only
</code></pre>
<p>How can i exactly put test date into the ID? Ms Test is pretty confusing compared to JUnit where everything seemed alot more straight forward.</p>
<p>Thanks.</p>
|
c# asp.net
|
[0, 9]
|
3,414,024 | 3,414,025 |
when i put (DateTime) in front of a DataBinder.eval what does that do
|
<p>when i put (DateTime) in front of a DataBinder.eval what does that do, and what other functions can i put infornt of a databinder??</p>
|
c# asp.net
|
[0, 9]
|
5,689,309 | 5,689,310 |
Javascript creating an HTML object vs creating an HTML string
|
<p>Pretty simple question that I couldn't find an answer to, maybe because it's a non-issue, but I'm wondering if there is a difference between creating an HTML object using Javascript or using a string to build an element. Like, is it a better practice to declare any HTML elements in JS as JS objects or as strings and let the browser/library/etc parse them? For example:</p>
<pre><code>jQuery('<div />', {'class': 'example'});
</code></pre>
<p>vs</p>
<pre><code>jQuery('<div class="example></div>');
</code></pre>
<p>(Just using jQuery as an example, but same question applies for vanilla JS as well.)</p>
<p>It seems like a non-issue to me but I'm no JS expert, and I want to make sure I'm doing it right. Thanks in advance!</p>
|
javascript jquery
|
[3, 5]
|
2,539,009 | 2,539,010 |
create visitor unique ID?
|
<p>I plan to create visitor unique ID and named as log file, as existing now I use the IP visitor as log file name i.e. logs/127.0.0.1.php but I think this is not <strong>enough</strong> because some visitor using share an IP address for PC's.</p>
<p>The visitor log file itself as setting place of configuration of visitors itself, so I plan to add another unique ID to identify each different visitor so let's say the log file:
logs/127.0.0.0.1-t3451dq.php, -t3451dq as unique ID
so as long as visitor browsing on my website the unique log file as setting configuration for each user (because I use plain text)</p>
<p>Currently I use:</p>
<pre><code><?
$filename = "./logs/".$_SERVER['REMOTE_ADDR'].".php" ; //out put logs/127.0.0.1.php
$data stripcslashes($data);
// each Visitor configuration here...
// bla...bla...
/* Writing file configurations */
$buat = fopen($filename, "w+");
fwrite($buat, "$data");
fclose($buat);
?>
</code></pre>
<p>so I need $filename add the $unique ID as name of their log file. Any ideas how to do that?</p>
|
php javascript
|
[2, 3]
|
1,871,562 | 1,871,563 |
Call to Javascript method
|
<p>I'm a complete beginner in JS, so pls have patience :)</p>
<pre><code>my.hello = function () {
$("#ok").myMethod({
goodbye: function () { },
alividerci: function (event, ui) { },
});
}
</code></pre>
<p>How to call the alividerci method?</p>
<pre><code>my.myMethod = function () {
this.otherMethod();
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,813,313 | 3,813,314 |
Click event is not firing (Or I am not able to see?)
|
<p>I could not find out, I created a new web project and wrote the simplest jquery code but it doesn't work, what can be the reason why below button does not alert "Hello World"? </p>
<pre><code><%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Welcome to ASP.NET!
</h2>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#Button1").click(function () {
alert("Hello world!");
});
});
</script>
<asp:Button ID="Button1" runat="server" Text="Button" />
</asp:Content>
</code></pre>
|
jquery asp.net
|
[5, 9]
|
4,831,826 | 4,831,827 |
External component has thrown an exception
|
<p>I have a ASP.NET website using C# that calls a C++ method using <code>DLLImport</code>. Everything was working fine and suddenly I keep getting this error:</p>
<blockquote>
<p>External component has thrown an exception. Description: An unhandled
exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and
where it originated in the code.</p>
<p>Exception Details: System.Runtime.InteropServices.SEHException:
External component has thrown an exception.</p>
<p>Source Error: An unhandled exception was generated during the
execution of the current web request. Information regarding the origin
and location of the exception can be identified using the exception
stack trace below.</p>
</blockquote>
|
c# asp.net c++
|
[0, 9, 6]
|
1,611,421 | 1,611,422 |
Which thread invokes SensorEventListener.onSensorChanged
|
<p>From my records it seems that SensorEventListener.onSensorChanged callback is
called by the same thread that registered the callback. I.e there must
be some message-queue synchronization going on in the background which
allows the activitys UI-Thread to handle the callbacks. </p>
<p>That leads to my question: Is there a need to synchronize
SensorEventListener.onSensorChanged with the activitys UI-thread,
assuming that the activitys UI-thread registered the
SensorEventListener?</p>
<p>I cannot find any documentation references, but can see various examples calling invalidate() unsychronized or synchronize the entire callback.</p>
<p>I used something along the lines of </p>
<pre><code>Log.i(TAG, "" + Thread.currentThread().getId());
</code></pre>
<p>to retrieve threading information. </p>
<p>I'm running android 2.1 update1. </p>
<p>Best regards,
Christoph </p>
|
java android
|
[1, 4]
|
3,834,741 | 3,834,742 |
how to get the text of selected checkbox from asp.net checkboxlist control using jquery
|
<p>I have asp.net checkboxlist control that bounded to a data source so the number of items in the control are different from one to to another time.</p>
<p>I have this function:</p>
<pre><code> $('#<%=chkListGroups.ClientID %> input:checkbox:checked').siblings('label').text();
</code></pre>
<p>this function will return all texts for all selected items in the control as a one string.</p>
<p>I'm looking for a way that when I check a check box from the ckeckboxlist control will return only last checked checkbox.</p>
<p>Please advice me how to do this using jquery.</p>
|
asp.net jquery
|
[9, 5]
|
364,437 | 364,438 |
Method in options object initialization is only called once per page load
|
<p>I have the following code</p>
<pre><code>$(".datePicker").datepicker({
dateFormat: 'dd/mm/yy',
autoSize: true,
changeYear: true,
changeMonth: true,
yearRange: getYearRange()
});
</code></pre>
<p>The getYearRange function is only called once although there are many .datePickers.
To be clear, the getYearRange function will be called with the $(this) parameter.</p>
|
javascript jquery
|
[3, 5]
|
3,290,019 | 3,290,020 |
JQuery: Help with ".live" and ".scroll"
|
<p>If I have the following JQuery:</p>
<pre><code>$('#div1, #div2').scroll(function() { my_function($(this)); });
</code></pre>
<p>or</p>
<pre><code>$('#div1, #div2').live('mouseover',function(){ my_function($(this)); });
</code></pre>
<p>What does <code>$(this)</code> represent?</p>
<p>Is it the DOM object of either DIV1 or DIV2? Or is it the HTML of that DIV?</p>
<p>What does "this" represent in the code above?</p>
|
javascript jquery
|
[3, 5]
|
2,985,016 | 2,985,017 |
jquery add and remove class problem
|
<p>I'm trying to bind a function with a non-existent class. I will try to explain</p>
<p>my js:</p>
<pre><code>function hidelink()
{
$('#user_form').hide();
$('.selected').text("New User").removeClass('selected').addClass('unselected');
return false;
}
function showlink()
{
$('#user_form').show();
$('.unselected').text("Hide it").removeClass('unselected').addClass('selected');
return false;
}
$(function(){
$('#user_form').hide();
$('.unselected').click(showlink);
$('.selected').click(hidelink);
});
</code></pre>
<p>my html:</p>
<pre><code><div id="user_form">
<a href="/foobar" class="unselected">My Link</a>
</div>
</code></pre>
<p>So basically, when you click in the link it will change the classes (selected/unselected) and hide/show a div. The problem is that, when i click once, it shows the form, but if i click again in the link, the form don't hides again. Maybe because i'm biding the events when the page loads and at this time there is not element that match the selector ".selected".. makes sense?</p>
|
javascript jquery
|
[3, 5]
|
1,898,727 | 1,898,728 |
typecast problem with List class
|
<p>What is the bug here?</p>
<pre><code>private void LoadUsers(List<long> uids, EventUser.EventUserStatus eventUserStatus, IList<user> chkfriends)
{
foreach (var f in chkfriends)
{
long l = f.uid; <-- fails
if (uids.Contains(l)) do it!
}
</code></pre>
<p>Error 1 Cannot implicitly convert type 'long?' to 'long'. An explicit conversion exists (are you missing a cast?)</p>
|
c# asp.net
|
[0, 9]
|
3,968,358 | 3,968,359 |
Getting The Current User Name In ASP.NET Application
|
<p>I am running a webpage that needs to be able to read the login id of the current user. Here is the code I am using:</p>
<pre><code>string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
</code></pre>
<p>Currently this returns the correct login but when I use it in this method:</p>
<pre><code>protected Boolean isPageOwner()
{
string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
alert("User: " + id);
if (id.Equals(pageOwnerID))
{
return true;
}
if (accessPermission.ContainsKey(id))
{
return true;
}
return false;
}
</code></pre>
<p>the method returns false even though the id returned is identical to pageOwnerID. I'm really not sure which part of this I am having a problem with.</p>
<p>On a side note, my login id is of the form string1/string2 but the code retrieves it as string1 + string2 without the slash.</p>
<p>Any advice is appreciated.</p>
<p>Regards.</p>
|
c# asp.net
|
[0, 9]
|
248,525 | 248,526 |
Storing setInterval as object property
|
<p>So I'd like to store setInterval as an object property because I often like to use the phrase "autoPlay" to describe a rotator that starts immediately. When I use "autoPlay" more than once in a series of scripts, my JS gets tripped up when I try to clear them, because it's not sure which one to clear. My remedy is to put it somewhere as a property, so I can access it through an object, like "newsRotator.autoPlay". The problem is, I'm not sure how to store it that way, since it usually gets placed in a basic variable like so:</p>
<pre><code>autoPlay = setInterval(this.forwardSlide, 5000);
</code></pre>
<p>This is an example one of my attempts at storing it as an object property, which fails to clear the interval:</p>
<pre><code>var newsRotator = {
run: function () {
$('.arrow').on('click', function (e) {
e.preventDefault();
clearInterval(newsRotator.autoPlay);
if ($(this).hasClass('back')) {
newsRotator.backSlide();
} else {
newsRotator.forwardSlide();
}
});
},
backSlide: function () {
(goes back one slide)
},
forwardSlide: function () {
(goes forwardone slide)
},
autoPlay: setInterval(this.forwardSlide, 5000),
init: function () {
this.run();
}
}
newsRotator.init()
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,882,024 | 1,882,025 |
How can i know which class was selected via jQuery & JS
|
<p>I have a list with links:</p>
<pre><code><li class="link-1"><a href="#">One</a></li>
<li class="link-2"><a href="#">Two</a></li>
<li class="link-3"><a href="#">Three</a></li>
..
</code></pre>
<p>user clicks on any link, then with jQuery I want to display the content of the link.. somthing like:</p>
<pre><code>$(".link-??? a").click(function() {
alert($(".link-??? a").html());
})
</code></pre>
<p>something like this. I am not going to create X function (as the number of the links), so what can I do? I should replace the <code>???</code> in somtehing else..</p>
|
javascript jquery
|
[3, 5]
|
5,519,326 | 5,519,327 |
call 2 bound field on gridview in same column
|
<p>i am trying to call 2 Data field in same column, it that possible to do so? my date is replace my user name</p>
<pre><code>BoundField userNameBF = new BoundField();
userNameBF.HeaderText = "User Name";
userNameBF.DataField = "userName";
userNameBF.DataField = "PostDate";
userNameBF.ItemStyle.Width = 180;
GridView2.Columns.Add(userNameBF);
</code></pre>
<p><strong>Output</strong></p>
<pre><code>+---------------+
| user Name |
+---------------+
| |
| 22/02/2012 |
+---------------+
| |
| 22/02/2012 |
+---------------+
</code></pre>
<p><strong>Expected Output</strong></p>
<pre><code>+---------------+
| user Name |
+---------------+
| Ken |
| 22/02/2012 |
+---------------+
| Ryu |
| 22/02/2012 |
+---------------+
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,455,358 | 2,455,359 |
JQuery / JS variable to alert text
|
<p>I have this code:</p>
<pre><code>$('#output').html("<strong>id:</strong>"+id);
</code></pre>
<p>then</p>
<pre><code><div id="output">this element will be accessed by jquery and this text replaced</div>
</code></pre>
<p>The above works fine but what I need is for the output to go into an alert so....</p>
<pre><code><a href="#" onclick="alert('OUTPUT GOES HERE')">Alert Me</a> <- See here
</code></pre>
<p>How can this be done?</p>
|
javascript jquery
|
[3, 5]
|
2,911,442 | 2,911,443 |
Is java.util.Scanner that slow?
|
<p>In a Android application I want to use Scanner class to read a list of floats from a text file (it's a list of vertex coordinates for OpenGL). Exact code is:</p>
<pre><code>Scanner in = new Scanner(new BufferedInputStream(getAssets().open("vertexes.off")));
final float[] vertexes = new float[nrVertexes];
for(int i=0;i<nrVertexFloats;i++){
vertexes[i] = in.nextFloat();
}
</code></pre>
<p>It seems however that this is incredibly slow (it took 30 minutes to read 10,000 floats!) - as tested on the 2.1 emulator. What's going on?
I don't remember Scanner to be that slow when I used it on the PC (truth be told I never read more than 100 values before). Or is it something else, like reading from an asset input stream?</p>
<p>Thanks for the help!</p>
|
java android
|
[1, 4]
|
1,038,940 | 1,038,941 |
jquery response is correct but picked up wrong
|
<p>Is there any idea why the code below keeps alerting as <strong>wrong</strong> although the response comes back as <strong>hello</strong>?</p>
<p>It should alert as <strong>correct</strong>!</p>
<p>Tnanks</p>
<p><strong>JQUERY</strong></p>
<pre><code>var term = 'jan';
$.ajax(
{
type : 'POST',
url : 'process.php',
data : 'term=' + term,
dataType : 'text',
timeout : 600000,
success : function(response)
{
if (response == 'hello')
{
alert('Correct');
}
else
{
alert('Wrong');
}
}
});
</code></pre>
<p><strong>PHP</strong></p>
<pre><code>if ($_POST['term'] == 'jan')
{
echo 'hello';
}
else
{
echo 'noooo';
}
</code></pre>
|
php javascript jquery
|
[2, 3, 5]
|
5,179,264 | 5,179,265 |
Problems with list<T> in Asp.Net c#
|
<p>I'm making a web app in Asp.Net using c# that lets you add items into the list.</p>
<p>My problem is that each time that i click the button to add a new item into the list , its just shows me the last item and the list counter shows me only 1 .</p>
<p>What am I doing wrong??</p>
<p>Here is the code : </p>
<pre><code>public partial class home : System.Web.UI.Page
{
List<string> messageboxs = new List<string>();
public string val = "";
public string data = "";
protected void Button1_Click(object sender, EventArgs e)
{
val = "";
messageboxs.Add(text1.Text);
ListBox1.DataSource = messageboxs;
ListBox1.DataBind();
val = messageboxs.Count.ToString();
}
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
587,051 | 587,052 |
Is Short Circuit Evaluation guaranteed In C++ as it is in Java?
|
<p>In Java, I use</p>
<pre><code>if (a != null && a.fun());
</code></pre>
<p>by taking full advantage of short-circuit evaluation and expression are evaluated from left to right?</p>
<p>In C++, can I do the same? Are they guarantee to portable across different platform and compiler?</p>
<pre><code>if (a != 0 && a->fun());
</code></pre>
|
java c++
|
[1, 6]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.