Unnamed: 0
int64 302
6.03M
| Id
int64 303
6.03M
| Title
stringlengths 12
149
| input
stringlengths 25
3.08k
| output
stringclasses 181
values | Tag_Number
stringclasses 181
values |
---|---|---|---|---|---|
1,363,044 | 1,363,045 | Jquery: shake effect not working | <p>Sorry to be a pain, but im really frustrated this isn't working for me at all</p>
<pre><code>$(document).ready(function(){
$('.wrap').effect("shake", { times:3 }, 300);
});
</code></pre>
| javascript jquery | [3, 5] |
607,110 | 607,111 | How to separate data received from $.get() callback function | <p>I have this:</p>
<pre><code><div ><span id="compareResult"></span>&nbsp;&nbsp;<span id="result"></span></div>
$.get(
'data.php',
{ valA: $(this,'option:selected').val() , valB:$(this,'option:selected').val()},
function(childData){
$('#result').html(childData).css('display', 'none')});>
</code></pre>
<p>PHP:</p>
<pre><code>function getData($names,$id,$flag){
if($flag==0){
$strResult = '<select multiple class="sel" id="selectname" size='.count($names).'>';
}
if($flag==1){
$strResult = '<select multiple class="sel" id="selname" size='.count($names).'>';
}
for($i=0; $i<count($names); $i++)
{
$strResult.= '<option value='.$id[$i].'>'.$names[$i].'</option>';
}
echo $strResult.= '</select>';}
</code></pre>
<p>How do I break apart/parse the response inside .html(childData) so I can put it in different span(i.e. id="compareResult")?</p>
<p>Thanks in advance.</p>
| php jquery | [2, 5] |
4,109,114 | 4,109,115 | Setting a time for flicker animation on img | <p>I'm using this code to make my logo flicker on my website. But It becomes annoying when it continues to flicker while browsing, how can I set a time to allow it to flicker for something like the first 15seconds on page load, then stops?</p>
<p><strong>JS code I'm using:</strong></p>
<pre><code>$(document).ready(
function(){
var t;
const fparam = 100;
const uparam = 100;
window.flickr = function(){
if(Math.round(Math.random())){
$("#logodcoi").css("visibility","hidden");
t = setTimeout('window.unflickr()',uparam);
}
else
t = setTimeout('window.flickr()',fparam);
}
window.unflickr = function(){
if(Math.round(Math.random())){
$("#logodcoi").css("visibility","visible");
t = setTimeout('window.flickr()',fparam);
}
else
t = setTimeout('window.unflickr()',uparam);
}
t = setTimeout('window.flickr()',fparam);
});
</code></pre>
| javascript jquery | [3, 5] |
1,612,421 | 1,612,422 | How can I load static configuration information | <p>In my code, I use JavaScript for UI and PHP for back end. I also use PHP to store application settings and sometimes my UI code needs to access this information. My configuration file looks something like this (config.php):</p>
<pre><code>$resolution_x = 1920;
$resolution_y = 1080;
etc...
</code></pre>
<p>When I need to access any of these settings form JavaScript, i simply use</p>
<pre><code><?php echo ... ?>
</code></pre>
<p>to substitute the value directly, but it just doesn't strike me as very robust.</p>
<p>Are they any dangers of doing this that I am not aware of? Is there a better way of doing this? </p>
<p>Thank you,</p>
| php javascript | [2, 3] |
974,686 | 974,687 | Get select selected value | <p>I have a url like this:
<code>index.php/home/lista_modelo_ajax?id="+$('#colecoes').val(),</code></p>
<p>The thing is that the: <code>$('#colecoes').val()</code> is always the first item of the select, not the one I choose.</p>
<p>Any ideas?</p>
<p>Thanks in advance.</p>
<p><strong>EDIT</strong></p>
<pre><code><script>
$(function() {
$( "#modelos" ).autocomplete({
source: "<?php echo base_url();?>index.php/home/lista_modelo_ajax?id="+$('#colecoes').val(),
minLength: 2
});
});
</script>
<label for="colecoes">Coleções</label>
<select name="colecoes" id="colecoes">
<option value="16">-</option>
<?php foreach($lista_colecao as $colecao){?>
<option value="<?php echo $colecao->idColecao;?>"><?php echo $colecao->nomeColecao;?></option>
<?php }?>
</select>
<label for="modelos">Modelo</label>
<input type="text" name="modelos" id="modelos" />
</code></pre>
<p>All php is working fine, generating the IDs on the value of options objects, the problem is only with JS</p>
| javascript jquery | [3, 5] |
3,884,505 | 3,884,506 | Video converting into mp3 on Java, Android | <p>I need to convert mp4/flv files info mp3 in my Android application, but I don't know C/C++ and Android NDK. Do you know libraries/methods for easy converting on Java? Thank you for anyway. </p>
| java android | [1, 4] |
5,675,557 | 5,675,558 | What's the most native way to connect android app to a webserver? | <p>I'm new to android developing but I have an app in mind, that needs to be connected to a Webserver (implemented as a java servlet if it makes a difference) in order to receive data (both real-time ajax-like and not real-time). What's the best way to perform such communication in the android interfaces ? </p>
<p>Thanks In Advance,
Chris</p>
| java android | [1, 4] |
5,347,375 | 5,347,376 | C# ASP.NET cs0246 issue | <p>I'm having an issue where I keep getting error message CS0246 on my web server, but not in my visual studio environment. The issue is coming from a dll I reference in my project. The server cannot find my namespace for my dll.</p>
<p>To solve this I tried copying every file in my project directory to my web server, adding a tag in my web.config file, and adding an import statement in my aspx page. I have also tried adding an assembly reference in my aspx page, but that seems to require a change in the registry which I don't think I have access to.</p>
<p>I should also note my dll and namespace name are different, but changing the names of either did nothing. I also completely removed the dll and copied the code files directly into my project, but it still could not find the namespace.</p>
<p>I thus think I'm supposed to register the namespace and dll somewhere else, but I cannot figure out where. Any help will be appreciated. </p>
<p>If it matters, both my web project and dll are using .NET2.0</p>
| c# asp.net | [0, 9] |
5,584,168 | 5,584,169 | jquery slider - animating timeline | <p>I'm using the jquery slider function for a timeline</p>
<pre><code>$("#content-slider").slider({
min: 0,
max: 300,
step: 1,
change: handleSliderChange,
//start: getImageWidth,
slide: handleSliderSlide
});
function handleSliderSlide(event, ui) {
$("#content-scroll").prop({scrollLeft: ui.value * (maxScroll / 300) });
if (ui.value >= 7 && ui.value <= 13) {
$('#marker_10').animate({opacity: 'hide'}, 100, function () { $(this).parent('div').animate({marginTop: '100px'}, {duration:1000, queue:false }).addClass('up').find('p').animate({opacity: 'show'} ) })
}
if (ui.value > 13 || ui.value < 7 && ($('div#container_10').hasClass('up'))) {
$('div.up').stop(true)
$('#container_10').removeClass('up').find('p').fadeOut('fast').end().animate({marginTop:'165px'}, {duration:500, complete:function() {$(this).find('img.marker').fadeIn() }, queue:false})
}
}
</code></pre>
<p><a href="http://asla.dev.1over0.com/html/slider/bacardi_last.html" rel="nofollow">http://asla.dev.1over0.com/html/slider/bacardi_last.html</a> </p>
<p>It animates ok when I scroll left to right but when I scroll right to left then I get some issues where elements are fading out and displaying correctly
any information would be appreciated; this is all done on the front end currently
Thank you</p>
| javascript jquery | [3, 5] |
5,172,753 | 5,172,754 | Reset number to 1 if number is over than 10 | <p><code>num</code> is a variable which is dynamically changed within 1 to 9.</p>
<p>I must update the value in HTML for example let say the <code>num</code> is 6,</p>
<p>i need to set 1st field as 6, second field as 7, third field as 8 and so on</p>
<p>in simple version, <strong>6, 7, 8, 9, 1, 2, 3, 4, 5</strong></p>
<pre><code>$("#one").text(num);
....
$("#nine").text(num+8);
</code></pre>
<p>EDIT: Sorry for confusion</p>
<pre><code>$("#one").text(num);
$("#two").text(num+1);
....
$("#nine").text(num+8);
</code></pre>
<p>so for example, the value on <code>$("#nine")</code> is 6+8 = 14, whereas it should be 5</p>
| javascript jquery | [3, 5] |
5,400,555 | 5,400,556 | Sorting Jquery Tab Panel | <p>I have a tab panel. </p>
<p>It can add tabs dynamically by clicking the <code>add tab</code> button. </p>
<p>A typical use case scenario will be this: </p>
<ul>
<li>I have multiple tabs open Tab-1, Tab2, Tab-3, and Tab-4 in the panel </li>
<li>and remove some of them Tab-2 and Tab-3 from the panel by closing the tabs. </li>
</ul>
<p>This will leave Tab-1 and Tab-4 in the panel. </p>
<p>Now, if i try to add new tabs, order in which the tabs are is Tab-1, Tab-4, Tab-2, Tab-3.</p>
<p>I want to sort the panel in jquery and make it Tab-1, Tab-2, Tab-3, and Tab-4</p>
<p>Please Help!!</p>
| javascript jquery | [3, 5] |
5,458,527 | 5,458,528 | iPhone development - what do i need to get started? | <p>I'm looking to start developing an iPhone app. I have zero experience in objective C but have expeirence in C#. I'm just wondering what do I need to develop an iPhone app? Where do i start? What is the best tool to develop in? Do I need a Mac to develop the app or can I do it on a PC with a low amount of pain?</p>
<p>many thanks!</p>
| c# iphone | [0, 8] |
941,644 | 941,645 | choose the selected value in a item template | <p>I have a method called BindItems() and this method gets the values to a DataTable and then a GridView is bound to it.</p>
<p>Then I have an itemtemplate in that gridview which contains a drop down, this drop down gets populated from 1 -14 from code behind under Gridview_RowDataBound, now I need to figure a way to get the Quantity value in the DataTable on the other function "BindItems()" and for each Row in the gridview so a SelectedValue = datatable["Quantity"] or something.. how can I do this?</p>
<pre><code>protected void BinItems(int myId)
{
//this data table contains a value "Quantity"
DataTable dt = MyClass.getItems(myId);
uxGrid.DataSource = dt;
uxGrid.DataBind();
}
protected void Gridview1_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType.Equals(DataControlRowType.DataRow))
{
DropDownList Myddl = e.Row.FindControl("MyQuantity") as DropDownList;
if (Myddl != null)
{
for (int i = 1; i < 15; i++)
{
Myddl.Items.Add(i.ToString());
}
}
}
//Some how i need to do a SelectedValue = datatable where field = Quantity for each row
}
</code></pre>
| c# asp.net | [0, 9] |
1,980,361 | 1,980,362 | jQuery - Best way to populate a hidden field with list data? | <p>I have two unordered lists populated with users. The idea is to drag users from one list to add them to a group in the other list. Each user also has a dropdown to select a role in the group.</p>
<p>I'd like to add to/remove from a hidden field with the values of the "added" users and their role. I'm not really sure though how to do that.</p>
<p>I have a jsfiddle showing the general idea here: <a href="http://jsfiddle.net/KPdAX/" rel="nofollow">http://jsfiddle.net/KPdAX/</a></p>
| javascript jquery | [3, 5] |
5,084,933 | 5,084,934 | getting image width and height from javascript when using asp.net FileUpload | <p>that's my code :</p>
<pre><code> <script type="text/javascript">
$(document).ready(function(){
$("#<%=fileUpload.ClientID%>").change(function () {
alert(// width + height );
});
});
</script>
<asp:FileUpload ID="fileUpload" runat="server" class="upload" />
</code></pre>
<p>Can i get the width and height of uploaded image from client side ??</p>
| javascript asp.net | [3, 9] |
298,027 | 298,028 | Making table rows but not table headers clickable in jquery | <p>Currently I am using</p>
<pre><code>$('#mytable tr').click(function() {
blah blah
});
</code></pre>
<p>This makes all rows, including the headers clickable. How can I exclude the headers or <code><th></code>'s?</p>
| javascript jquery | [3, 5] |
2,774,417 | 2,774,418 | Detect finger drag using Javascript on touch phones? | <p>Is there a way to detect finger drags using Javascript on touch phones? I'm currently using jQuery and the mousemove() method doesn't appear to work on my Andorid phone.</p>
<p><strong>EDIT:</strong> I suppose I should clarify that this is for a web application.</p>
<p><strong>EDIT 2:</strong> I found a duplicate of my question a few moments ago: <a href="http://stackoverflow.com/questions/2264072/detect-a-finger-swipe-through-javascript-on-the-iphone-and-android">Detect a finger swipe through JavaScript on the iPhone and Android</a>. Although, it does not have an accepted answer.</p>
| javascript iphone android | [3, 8, 4] |
1,554,914 | 1,554,915 | PHP JQuery cross domain | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/752319/cross-domain-ajax-request-with-jquery-php">Cross Domain Ajax Request with JQuery/PHP</a> </p>
</blockquote>
<p>I hope you can help
I have a php page on a subdomain which onclick needs to execute a PHP script on the main domain with a GET request. For some reason </p>
<pre><code>$.get("http://www.domain.com/page", {param: param}, function(data){alert(data);});
</code></pre>
<p>Is returning a 404 error. The page is definiately there and will run when the url is entered directed.</p>
<p>Any help would be much appreciated.
Thanks
Mark</p>
| php jquery | [2, 5] |
5,061,067 | 5,061,068 | Get element value and then subtract by 1? | <pre><code><span id="tcount-1">100</span>
<span id="tcount-2">100</span>
<span id="tcount-3">100</span>
</code></pre>
<p>What I am trying to do is grab the value within span id=tcount-X (where X can be any ID value) and then subtract 1 from it. </p>
<p>So I know I can easily hide the value by doing...</p>
<pre><code>$('span#tcount-' + com_id).hide();
</code></pre>
<p>but as soon as I do something like...</p>
<pre><code>var countit = $('span#tcount-' + com_id).val();
</code></pre>
<p>... it breaks. Any ideas what I'm doing wrong?</p>
| javascript jquery | [3, 5] |
1,900,804 | 1,900,805 | How to avoid the checkbox 'Stop execute scripts on this page' in the Javasript message box? | <p>How can I avoid the checkbox 'Stop execute scripts on this page' in the Javasript message box?
<img src="http://i.stack.imgur.com/3ZvNQ.png" alt="enter image description here"></p>
<p>Regards,
David</p>
| javascript asp.net | [3, 9] |
537,855 | 537,856 | ASP.NET - How to load page via server-side code (C#) with MVC Pattern in place? | <p>I am trying to use more server-side code (MVC pattern in place) and one of the methods that I am thinking of implementing is something like: LoadWebPage(). If a user is on a page, say Page1.aspx, and they click on a hyperlink, I would like to call the above method, LoadWebPage(). But the problem is, I do not know how to load another page as a subwindow (modal form), say Page2.aspx via server-side? Do I use Server.Transfer(), Response.Redirect(), or JavaScript (e.g. jQuery) to load the page? I want to persist session of course. </p>
<p>By the way, is there a way to call JavaScript via server-side code (C#)?</p>
<p>Any advice will be greatly appreciated.</p>
| c# asp.net javascript | [0, 9, 3] |
1,201,082 | 1,201,083 | create hour live(online)? | <p>How do I create a local hour(<code>time zone -> UTC + 3:30</code>) with seconds?<br>
<strong>I not want use of plugin.</strong><p></p>
<p>I don't use of the following example because it gets the time of computer. It is only for display of what I want.<br>
<strong>EXAMPLE</strong>: <a href="http://jsfiddle.net/HZmPg/" rel="nofollow">http://jsfiddle.net/HZmPg/</a></p>
<p>With respect<p></p>
| javascript jquery | [3, 5] |
5,671,914 | 5,671,915 | Is there any way I could auto-fill the fields on this registration page? | <p>I have a link to a registration page:
<a href="https://www.website.ws/orderflow/index.dhtml?sponsor=gditraffic&src=DSP_66&last_page=DSP_66" rel="nofollow">Registration Page</a></p>
<p>When I take users to the page, I'd like to save them a load of time, frustration and calories to burn, by filling in the fields automatically.</p>
<p>The whole form is ran in JavaScript and JQuery by the looks of things, but I have no idea where I would start to actually do something like this. I have the users details (to input into the fields) in a SQL db, so some PHP parsing to start off with.</p>
<p>Any ideas where I'd go from there?</p>
<p>SORRY,forgot to mention: I don't have any moderation access to the Reg page.</p>
| javascript jquery | [3, 5] |
1,740,757 | 1,740,758 | jQuery and ASP.NET Control issue | <p>If I have a custom ASP.NET control that renders as an html control with an ID, I'm trying to add an attribute to the input control with jQuery.</p>
<p>However, I'm running into some issues:</p>
<p>First, my jQuery is not able to select it.</p>
<p>I have so far:</p>
<pre><code>$(document).ready(function() {
$(client id of the input control).attr('onclick', function () { alert('hey!'); });
});
</code></pre>
<p>It seems as if the jQuery is trying to find the input control but cannot.</p>
<p>Any ideas?</p>
<p><strong>UPDATE:</strong></p>
<p>Normally, the solutions presented would work but since this is a SharePoint Publishing .aspx page, Code blocks are not allowed... Trying other work arounds.</p>
| asp.net javascript jquery | [9, 3, 5] |
4,900,027 | 4,900,028 | Call jQuery function from ASP.NET code behind C# | <p>I have the following jquery function</p>
<pre><code>> <script type="text/javascript">
>
> $(document).ready(function() {
>
> $('#callGrowel').click(function() {
> $.growlUI('Email Received', 'from Joe Bloggs');
> });
> });
>
> </script>
</code></pre>
<p>and in my aspx page I have a div</p>
<pre><code><div id="callGrowel" >Run Growe l</div>
</code></pre>
<p>but I need a way of calling the growlUI jquery function from my code behind file in C# rather than clicking on a div in the UI.</p>
<p>Is this possible??</p>
| c# asp.net jquery | [0, 9, 5] |
5,211,033 | 5,211,034 | Passing c# function as parameters to Javascript | <p>Im trying to call a javascript function on a onclick method on a hyperlink, im also trying to pass a c# function as the parameters of the javascript function but it doesn't work. Any suggestions?</p>
<pre><code><a href='#' onclick='ShowTrack(<%#getTopHREF(Container.DataItem)%>); '>
</code></pre>
<p>Firebug tells me the following error: <em>missing exponent</em></p>
| c# javascript asp.net | [0, 3, 9] |
229,981 | 229,982 | FileUpload method for asp.net website | <p>net and am just wondering if there is a method for the
file upload tag in a library anywhere ?</p>
<p>Thanks guys heres my code</p>
<pre><code><asp:FileUpload ID="FileUpload1" runat="server" ForeColor="white" />
</code></pre>
| c# asp.net | [0, 9] |
3,300,072 | 3,300,073 | How to hide sub-menu when other menu clicked JQuery | <p>I'm trying to figure out one thing, I have a one page website and want hide sub-menus under portfolio when other menu links cliked <a href="http://jsfiddle.net/kuuwj/15/" rel="nofollow">http://jsfiddle.net/kuuwj/15/</a></p>
<h1>HTML</h1>
<pre><code><ul id="navbar">
<li><a href="#home" id="nav-home">Home</a></li>
<li><a href="#portfolio" id="nav-portfolio">Portfolio</a>
<div class="portfolio-apps">
<section id="website">
<span class="button">AAAAAAAAAAAAAAAAAAAAAA</span>
</section>
<section id="gterminal">
<span class="button">BBBBBBBBBBBBBBBBBBBBBB</span>
</section>
<section>
<span class="button">CCCCCCCCCCCCCCCCCCCCCC</span>
</section>
</div>
</li>
<li><a href="#about" id="nav-about">About Me</a></li>
<li><a href="#contact" id="nav-contact">Contact</a></li>
</ul>
</code></pre>
<h1>JS</h1>
<pre><code>$(document).ready(function () {
var portf_apps = $('.portfolio-apps');
portf_apps.hide();
$('#nav-portfolio').click(function() {
portf_apps.show();
});
});
</code></pre>
| javascript jquery | [3, 5] |
4,320,669 | 4,320,670 | regular expression mobile and landline number | <p>i want to have a mobile phone number in this format (021)123-4567 or (027)123-4567 or landline number in this format (04)970-0676. i have a regular expression which does that except it doesn't contain the '-' and the first 3 or 2 digits are wrapped in the curly brackets (027) or (04) character.<br>
what I want also is after the brackets is to have a hypen after the third digit e.g (04)970- < or (027)635- <</p>
<p>this is what I have.</p>
<pre><code>(^\([0][2]\d{1}\))(\d{6,8}$)
</code></pre>
<p>or this one which shows the possible codes and possible number of characters in phone number this one here is what i kinda want except for the hypen is missing. </p>
<pre><code>'/^(\((03|04|06|07|09)\)\d{7})|(\((021|022|025|027|028|029)\)\d{6,8})|((0508|0800|0900)\d{5,8})$/'
</code></pre>
| javascript jquery | [3, 5] |
3,484,486 | 3,484,487 | need to get id of current element | <p>So, I have several tables that I iterate over using jQuery based on the class, but my behavior needs to change just slightly depending on the id of the element I'm in. Here's my code:</p>
<pre><code><table id="Brokers" class="nodeTable" border=1 />
<table id="Controllers" class="nodeTable" border=1 />
<table id="Cluster-Drivers" class="nodeTable" border=1 />
jQuery(".nodeTable").html(nodeHealthTable({
Role: jQuery(this).attr("id")
}))
</code></pre>
<p>this ends up populating Role with the empty string. How do I access the id of the current element?</p>
| javascript jquery | [3, 5] |
5,623,504 | 5,623,505 | How to implement search option within my website | <p>I am developing a website.</p>
<p>I want to implement searching features within my website with <code>C#</code> and <code>ASP.NET</code></p>
<p>that means suppose anybody enter a keyword into <code>textbox</code> and that keyword will be searched within my website.</p>
| c# asp.net | [0, 9] |
1,342,445 | 1,342,446 | JQuery selector for (ASP.NET) ButtonField in GridView | <p>I have a couple of ButtonFields in my gridview, corresponding to "Edit" and "Delete".</p>
<p>I'd like to use JQuery in my code for a delete confirmation popup.</p>
<p>ButtonField renders as "a href"'s in HTML, but I'm at a loss in forming a JQuery selector that targets only the "Delete" link, since ButtonField doesn't accept ID nor Name. I'm considering using TemplateField instead, but I'd like to check for other alternatives as I'd like to keep my OnRowCommand attribute in the GridView tag.</p>
| asp.net jquery | [9, 5] |
1,143,273 | 1,143,274 | jquery executes declared function without me clicking | <p>i wonder why the browser displays "logged in" without me having clicked on the link i id-tagged with clickhere. it displays it everytime i refreshes the page.</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
function login(){
alert("logged in");
}
$("#clickhere").click(login());
});
</script>
</code></pre>
<p>i just want it to be displayed when i click on the link.</p>
<p>what is the problem?</p>
| javascript jquery | [3, 5] |
148,946 | 148,947 | jQuery delay: Speeding up queue? | <p>I have a slideshow which basically changes the src attribute of an image and fading it in and out.</p>
<pre><code>function startSlideshow() {
if (i >= images.length) { i = 0 }
var path = images[i].path;
var name = images[i].name;
i++;
image.attr('src', path)
image.animate({opacity:1}, 1000)
.delay(5000)
.animate({opacity:0}, 500, startSlideshow);
}
</code></pre>
<p>This works. </p>
<p>I also have something I call an image picker. It looks something like this:</p>
<pre><code><ul id="ImagePicker">
<li>•</li>
<li>•</li>
<li>•</li>
</ul>
</code></pre>
<p>When you click on one of the li items the slideshow should show the corresponding image.</p>
<pre><code>$('#ImagePicker li').click(function () {
image.stop(true, false)
.animate({ opacity: 0 }, 10, startSlideshow);
});
</code></pre>
<p>The problem is that it sometimes gets bugging and I am not sure why it happens. If you click during the fadeout(I think) <code>.animate({opacity:0}, 500, startSlideshow)</code> it starts going faster.</p>
<p>Anybody know why this might happen?</p>
<p><strong>Update</strong></p>
<p>Actually it seems that it's happening during delay and not during the animate.</p>
<p><strong>Update 2</strong></p>
<p>I could fix it like this but it feels a little hacky:</p>
<pre><code>image.animate({ opacity: 1 }, 1000)
.animate({ opacity: 1 }, 5000)
.animate({opacity:0}, 1000, startSlideshow);
</code></pre>
| javascript jquery | [3, 5] |
4,971,928 | 4,971,929 | Listview with multiple strings | <p>I am trying to create a Listview with multiple strings. </p>
<p>Right now I have a function that it will do</p>
<pre><code> while(i <= 10){
//GETS DATA FROM WEBPAGE ETC
a = DATAFROMWEBPAGE1;
b = DATAFROMWEBPAGE2;
c = DATAFROMWEBPAGE3
}
</code></pre>
<p>10 times with 10 different sections from the webpage and I wanted to put this in a list view with 3 textviews showing a, b, c. But I'm having a very hard time doing so.</p>
| java android | [1, 4] |
5,032,981 | 5,032,982 | What are the major differences between Python and PHP? | <p>I know PHP a little. But Python is totally new for me. I only know it's something "similar", right? Or wrong? What are the differences I should know?</p>
| php python | [2, 7] |
3,570,682 | 3,570,683 | Caching the blur event using jQuery | <p>I need to do something when a blur event is fired from a text box.</p>
<p>The problem is the blur event is also fired when the user presses the "Enter" key
and when the mouse is clicked somewhere else.</p>
<p>I need to do some specific action when the mouse is clicked somewhere else; how would I do it?</p>
| javascript jquery | [3, 5] |
4,635,188 | 4,635,189 | How to implement Open ID as per in the start of Stack overflow | <p>Can any one give me a live example to implement Open Id concept as per in used in Stack overflow means when i click on Login i would like to have the same behaviour as per in the site</p>
| c# asp.net | [0, 9] |
3,597,148 | 3,597,149 | Render a byte[] as Bitmap in Android | <p>I'm getting a byte array from a JNI call, and trying to construct a Bitmap object with it.</p>
<p>My problem is, the following code, returns null.</p>
<pre><code> byte[] image = services.getImageBuffer(1024, 600);
Bitmap bmp = BitmapFactory.decodeByteArray(image, 0, image.length);
</code></pre>
<p>Any tips about it?</p>
<p>PS: The pixel layout is BGR, not a RGB.</p>
| java android | [1, 4] |
5,162,030 | 5,162,031 | Locale country Android problem ISO | <p>What give you this in return</p>
<pre><code>getSimCountryIso()
</code></pre>
<p>Returns for USA for example "USA" "US" or something else????
Help me guys!!!
Thank you in advance</p>
| java android | [1, 4] |
5,413,876 | 5,413,877 | jQuery $.each multiple div names | <p>Hello following problem,
i need the id attribute string for each div in a loop how i can make this ?</p>
<pre><code><div id="3r23r32_ProgressBar" class="upload-progress-bar"></div>
<div id="gfdgfdgfd_ProgressBar" class="upload-progress-bar"></div>
</code></pre>
<p>Here is my sample jquery code which does nothing -.-</p>
<pre><code>$.each("div.upload-progress-bar", function (index,value) {
alert(index);
$('#' + value + 'ProgressBar').animate({
'width': 10 + '%'
}, 250).animate({
'width': 25 + '%'
}, 250).animate({
'width': 65 + '%'
}, 250).animate({
'width': 95 + '%'
}, 250).animate({
'width': 100 + '%'
}, 250);
});
</code></pre>
| javascript jquery | [3, 5] |
2,888,934 | 2,888,935 | Passing data between PHP webpages from a dynamically generated list | <p>I have a PHP code which generates a dynamic list inside a form like the following, note that the list is built dynamically from database:</p>
<pre><code>echo '<form name="List" action="checkList.php" method="post">';
while($rows=mysqli_fetch_array($sql))
{
echo "<input type='password' name='code' id='code'>";
echo "<input type='hidden' name='SessionID' id='SessionID' value='$rows[0]' />";
echo "<input type='submit' value='Take Survey'>";
}
</code></pre>
<p>What I need is to POST the data corresponding to the user choice when he clicks on the button for that row to another page.
If we use hyperlinks with query strings there will be no problem as I'll receive the data from the other page using a GET request and the hyperlinks would be static when showed to the user.
Also I need to obtain the user input from a textbox which is only possible with POST request.</p>
<p>Simply from the other page (checkList.php) I need these data for further processing:</p>
<pre><code>$SessionID=$_POST['SessionID'];
$Code=$_POST['code'];
</code></pre>
<p>As I have a while loop that generates the fields, I always receive the last entry form the database and not the one corresponding to the line (row) that the user chosed from the LIST.</p>
| php javascript jquery | [2, 3, 5] |
2,436,847 | 2,436,848 | Problem while animating boxes using jQuery | <p>On my webpage, I have a few boxes one below the other, on the right side. Each box has a '+' and '-' button which maximizes/minimizes to the specified size, similar to that in portlets. But, for some reason, it is not working as it is suppose to.
Here is the code for '-' button:</p>
<pre><code><script type="text/javascript">
$(function() {
<?php for($i=0;$i<count($modules);$i++) : ?>
$( "#minusbtn<?=$modules[$i]["title"]?>").click(
function() {
$( "#effect<?=$modules[$i] ["title"]?>").animate({
height: 35,
}, "slow" );
<?php $count=0; $top=0; ?>
<?php for($j=$i;$j<count($modules);$j++): ?>
<?php if($i==$j) continue; ?>
$( "#effect<?=$modules[$j]["title"]?>" ).animate({
top: <?=($top)?>,
}, "slow" );
<?php $count++; $top = (210*$count); ?>
<?php endfor; ?>
});
</code></pre>
<p>Please help!</p>
| php javascript jquery | [2, 3, 5] |
609,359 | 609,360 | Double quotes breaking jQuery (Very simple) | <pre><code> <?
//SQL SELECT HERE
$result = mysql_query($sql);
$options = '';
while ($row = mysql_fetch_array($result)) {
$options .= '<option>Data: ' . $row['data'] .'</option>';
}
?>
$("#multiSelect").html("<?=$options?>");
</code></pre>
<p>The above is a PHP query inlined in a javascript function. It's goal is to populate a multiselect. The issue is that when $row['data'] contains something with double quotes jQuery doesn't like it and complains. When I remove the row containing double quotes it works fine.</p>
<p>How can I get around this? Is this normal behavior of jQuery.</p>
| php javascript jquery | [2, 3, 5] |
2,887,753 | 2,887,754 | how can i do this codes work only in a specific div tags | <pre><code>$(document).ready(function()
{
$(":input").focusout(function () {
var a= $(this).closest("tr").attr('id');
var b= $(this).closest("td").attr('id');
var c = $(this).attr("value");
$.post("database.php", { trAdress:a , tdAdress:b, value:c});
});
});
</code></pre>
<p>could this code work only between <code><div i="bab"> </div></code> tags... can you help me!</p>
| javascript jquery | [3, 5] |
1,446,129 | 1,446,130 | How to set readonly property of a textbox in javascript | <p>i have a textbox whose property i need to set as readonly...
how to set that?
I tried </p>
<pre><code>document.getElementbyid("txtbox").readonly=true;
document.getElementbyid("txtbox").disable=true;
document.getElementbyid("txtbox").setattribute("readonly","readonly");
</code></pre>
<p>all these are not working for me.
Disable is working but that is passing the control values as null to the database...again that is a problem for me..</p>
| javascript asp.net | [3, 9] |
5,927,085 | 5,927,086 | Get full html instead of just innner html | <p>I want to get the html including the selector that I am using to get the html</p>
<p>let's say I have</p>
<pre><code><div id="foo">
<div id="bar">content</div>
</div>
</code></pre>
<p>when I do <code>$('#foo').html()</code> I get</p>
<pre><code><div id="bar">content</div>
</code></pre>
<p>Is there a way in jquery to get the whole html including the parent(selector div)</p>
<p>I want this whole html</p>
<pre><code><div id="foo">
<div id="bar">content</div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
315,327 | 315,328 | Waiting values from child window | <p><code><Asp:Button ID=... onclick="openChildWindow()"</code></p>
<pre><code><asp:label ID="label1" ....>
</code></pre>
<p>I have a web page containing a button and a label. When I click the button, openCHildWindow() execute:</p>
<pre><code>openChildWindow()
{ //open child window...
//some other functions....
}
</code></pre>
<p>in the child windows, there is a textbox where I can enter some thing.
And my problem is: IF i need the child window to transmit the value in textbox to parent window, is it possible for
<code>//some other functions</code>
wait until parent window gets the value from child window?</p>
<p>Thanks.</p>
| javascript asp.net | [3, 9] |
3,986,281 | 3,986,282 | How to reload page every 5 second? | <p>Hi I am converting one layout to html , once I make the changes in code html/css then every time I have to hit F5. is there any simple javascript/ jQuery solution for this. </p>
<p>like i add the script and its reload the whole page every 5(or specific time)</p>
<p>thanks</p>
| javascript jquery | [3, 5] |
4,418,328 | 4,418,329 | C# Programmer would like to develop first website | <p>I am a C# Programmer and I want to develop my first website.</p>
<p>I have a C# Application, methods of which I would like to use on a back end Server.</p>
<p>Am I correct in thinking I can use a ASP.NET front end and hook it up to a C# back end?</p>
<p>The website objective is to select a file on the front end, pass this to the back end, do some processing with the file, then email the results to the user.</p>
<p>I don't mind what I use for the front end, but am keen to use a C# backend (this will send data to a SQL server database).</p>
<p>Is this possible?</p>
<p>In terms of current knowledge, I have a basic website that I administrate with cPanel, but this will be my first 'proper' web development.</p>
<p>Any guidance or suggestions greatly appreciated, Thanks.</p>
| c# asp.net | [0, 9] |
6,004,147 | 6,004,148 | Fill list from different table based on primary id | <p>I have 3 table which have relation with each others... In 1st table, i have student details contains studentid (PK), studentname, dob, etc... </p>
<p>Table 2 contain course consist of coursecodeid(PK), studentid(FK), coursename, teachername and etc..</p>
<p>Table 3 contain grade consist of studentid(fk), courseid(fk), id(pk_autoincrement) and grade.</p>
<p>When system starts, studentid will be load into a dropmenu. Onchange this dropmenu, second dropmenu will be shown and load with courseid take by selected student (based on studentid) </p>
<p>When user select courseid onchange a label will be visible to show student grade. </p>
<p>Everything done in 1 page... Anybody can give me sample code either in php or javascript since i am using php and mysql database.</p>
| php javascript | [2, 3] |
2,270,022 | 2,270,023 | Is there any way to redirect to a new page and write some content with jquery on that page? | <p>I am making a function which searches the database for flight information. I want user to be redirected on "ticket.php" if the response is true. I want to update the content of the page "ticket.php" using jquery. But jquery doesn't work. Am I doing something wrong here ? Here's part of javascript. It's an external javascript. It's included in both "search.php" and "ticket.php" page. This function gets invoked by clicking on search button in "search.php" page. </p>
<pre><code>if(data){
setTimeout("location.href = 'ticket.php';",3000); // Redirect to new page
//Change content of "ticket.php" using jquery.
$("#source").text(x);
$("#destination").text(y);
$("#date").text(z);
$("#no_person").text(person);
$("#trip_type").text(type);
}
else
$("#alert").text("Oops! No Flight matches your criteria ! ");
</code></pre>
| javascript jquery | [3, 5] |
1,538,239 | 1,538,240 | Javascript - Want to jump to new div at scroll event | <p>I'm building a one-page site with the content area as large content boxes stacked down the page. </p>
<p><a href="http://salondoreen.com/lowercasemenu.html" rel="nofollow">http://salondoreen.com/lowercasemenu.html</a></p>
<p>I'm looking for ideas on a way to use javascript to jump to each content box. With a one-page site like this, it takes a lot of scrolling to get to the bottom.</p>
<p>My idea is to somehow make this easier. If you are in one box, and you scroll down just a single click, I want the next box to scroll all the way up the page in one jump. That way the content stays easy and readable, and a box will never be half-on half-off the page. Theoretically you could scroll to the bottom of the page in less than ten clicks.</p>
<p>Does that make sense? I'm thinking of something similar to the home screen on android phones. It jumps horizontally between screens, no matter how little you swipe. There will only be one box on the page at time.</p>
<p>Disclaimer: I am a noob web developer, any and all help is appreciated. Thanks!</p>
| javascript jquery | [3, 5] |
4,974,761 | 4,974,762 | Adding other items in toolbox from dll, do I still need the dll if I give someone the source? | <p>I have AjaxControlToolkit.dll , I've added the dll items into my toolbox and I've worked with some items in my asp.net project.</p>
<p>My question is : If I give someone the entire source without the dll located on my desktop , and in my project I used some items from the dll , are they still working(the items) on his pc ?</p>
<p>Thanks</p>
| c# asp.net | [0, 9] |
281,175 | 281,176 | how to check a array of imgs is fully loaded | <p>i got the code here
a array like this var pics = ['1.jpg','2.jpg','3,jpg'];</p>
<p>loop throught the array</p>
<pre><code>var j = 0;
var(var i in pics){
$(document.createElement(img)).attr('src',pics[i]).load(function(){
alert(pics[i]+'is loaded');
j++;
})}
if(j == pics.length){
alert('fully loaded');}
</code></pre>
<p>but all i got is 3,jpg is loaded all the time,
how to solve this? where am i wrong?</p>
| javascript jquery | [3, 5] |
1,254,811 | 1,254,812 | Convert JSON into uri-encoded string | <p>I got a JSON/javascript object which I would like to get <code>x-www-form-urlencoded</code>.</p>
<p>Something like <code>$('#myform').serialize()</code> but for objects.</p>
<p>The following object:</p>
<pre><code>{
firstName: "Jonas",
lastName: "Gauffin"
}
</code></pre>
<p>would get encoded to:</p>
<p><code>firstName=Jonas&lastName=Gauffin</code> (do note that special characters should get encoded properly)</p>
| javascript jquery | [3, 5] |
52,503 | 52,504 | How to read the width and the height of a flash file in C# or JS? | <p>What will i do to read the width and the height of a flash file (*.swf) in C# or JS?</p>
<p>I tried a solution in CodeProject.com but return value of height is incorrect.</p>
| c# javascript | [0, 3] |
4,647,010 | 4,647,011 | window.open and sending form data not working | <p>I'm trying to open new window and send form data
with <strong>javascript</strong> and <strong>jquery-1.8.3</strong>. But, It's not woriking.</p>
<p>This is source code.</p>
<pre><code><a href="#" onclick="printPage()">Print this</a>
<script type="text/javascript" src="/common/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function printPage(){
var form = $("<form method='post' action='/common/print.jsp' target='printWindow'></form>");
var input = $("<input type='hidden' name='view'/>");
input.val($("#ctn").html());
form.append(input);
var printWindow = window.open(form.attr("action"), "printWindow", "width=700px,height=800px");
form.submit();
}
</script>
</code></pre>
<p>window was opened. But <code>request.getParameter("name")</code> is null.</p>
<p>Here is <code>/common/print.jsp</code> page</p>
<pre><code><%@ page contentType="text/html; charset=utf-8"%>
<% request.setCharacterEncoding("UTF-8"); %>
<div id="ctn">
<%
out.print(request.getParameter("view"));
%>
</div>
</code></pre>
<p>What's the problem in this code? </p>
| javascript jquery | [3, 5] |
5,892,759 | 5,892,760 | Check all check boxes and check specific check box in an array | <p>I am using this <strong>javascript</strong> function for checking all check box...it's working fine but if I want to check a specific check box 1 or 2 or more then I get an array of all but I didn't get specific check box value please tell me if any function in javascript or jQuery exists to do this. </p>
<pre><code>var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;
}
checkflag = "true";
return "Uncheck All";
} else {
for (i = 0; i < field.length; i++) {
field[i].checked = false;
}
checkflag = "false";
return "Check All";
}
}
</code></pre>
| javascript jquery | [3, 5] |
4,425,940 | 4,425,941 | call vimeo video using ajax? | <p>I have this example code, but i believe when i call the ajax function that is not loaded. How can i load an external script as below? Thanks</p>
<pre><code> <?php if (is_ajax_request()): ?>
<div id="movie5" class="movie"></div>
<script>
var swf = swfobject.embedSWF("http://vimeo.com/moogaloop.swf?clip_id=35014154&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ffffff&amp;fullscreen=1&amp;autoplay=0&amp;loop=0", "movie5", "500", "281", "9.0.0","expressInstall.swf", { api:1, player_id:"movie5" }, { allowfullscreen:true, allowscriptaccess:'always' });
</script>
</code></pre>
| php javascript jquery | [2, 3, 5] |
5,442,559 | 5,442,560 | Java FilePath Android | <p>I have an android app that I am trying to get a file path for a SAX parser. I have the following structure:</p>
<pre><code>assets:(Where my xml file is)
src(same level as assets)
com
msi
androidrss(The calling java file is in here)
</code></pre>
<p>I tried several variations of this:</p>
<pre><code>InputSource is = new InputSource("file://../../../../assets/Rss.xml");
</code></pre>
<p>But I always get a <code>FNF Exception</code></p>
<p>Any suggestions?</p>
| java android | [1, 4] |
2,173,220 | 2,173,221 | How to get the current state of the page in C#? | <p>I have a page which contains many links and upon expansion of each link i have grid and button.The button when clicked will be redirected to an new page where some process is done and returns a message via querystring.My problem is how to show the message returned from new page exactly in the previous state(example: the toggling/expansion showing grid and button).How to do that??</p>
| c# asp.net | [0, 9] |
916,554 | 916,555 | How can i do button on hold for two second call function1 if less then two second call function2? | <p>I have this button which is not working correctly for hold button for a period (but it works like click only). </p>
<p>Where i was trying to do if the button is <code>hold</code> for greater/equal then 2 seconds then <code>callfunction1</code>, if the button was pressed less then 2 seconds then <code>callfuntion2</code>.</p>
<pre><code>var clickDisabled = false;
function clickLocker() {
/* @Button: 2 seconds */
clickDisabled = true;
setTimeout(function(){clickDisabled = false;}, 2000);
}
function callfunction1() { // you have hold he button for greater then or equal 2 second }
function callfunction2() { // you have hold the button less then 2 second }
$('.button').live("click",function()
{
if (clickDisabled) {
alert("locked for 2 second");
return;
}
clickLocker();
});
</code></pre>
| javascript jquery | [3, 5] |
3,832,764 | 3,832,765 | Uncaught ReferenceError: $ is not defined? | <p>How come this code throws an "Uncaught ReferenceError: $ is not defined" - when it was OK before? </p>
<pre class="lang-js prettyprint-override"><code>$(document).ready(function() {
$('#tabs > ul').tabs({ fx: { opacity: 'toggle' } });
$('#featuredvid > ul').tabs();
});
</code></pre>
<p>Results in tabs don't close anymore.</p>
<p>jQuery is referenced in the header:</p>
<pre class="lang-php prettyprint-override"><code><script language="JavaScript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/js/sprinkle.js"></script>
<script language="JavaScript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/js/jquery-1.2.6.min.js"></script>
<script language="JavaScript" type="text/javascript" src="<?php echo get_option('siteurl') ?>/js/jquery-ui-personalized-1.5.2.packed.js"></script>
</code></pre>
| javascript jquery | [3, 5] |
338,133 | 338,134 | setTimeout adding +1 to for loop "i" during elapsed time | <p>I have 3 sequential or subordinates drop-down menus that could be either selected by the user ( which works fine ) or, in some instances, need to be selected via js.</p>
<p>I have set a timeout to give time to js to populate the first drop-down before the options are available to be selected in the sequence. It does not work otherwise.</p>
<p>The problem is that somehow during the elapsed time of the setTimeout, var "i" is being added of one, which throws off the script.</p>
<p>If I force "i" to be equal to zero in the case where I have only one input to consider, this will work fine. As this is dynamic and I cannot do that, I am looking on ways to stop this behavior.</p>
<p>The code below stops at the 2nd drop-down. </p>
<p>Is setTimeout the good solution in this case?
Thanks.</p>
<pre><code>$( document ).ready(function() {
var ctvid = <?php echo $ctvid ;?>;
if(ctvid !=""){
var info = <?php echo json_encode ($info);?>;
for (var i=0;i<ctvid;i++){
$('#brand' + i).val(info['brand_id'][i]).change();
setTimeout(function(){
$('#model' + i).val(info['model_id'][i]).change();
},500);
}
}
});
</code></pre>
| javascript jquery | [3, 5] |
4,812,172 | 4,812,173 | jquery weekcalendar resize/drop variables current div | <p>I am customizing the jquery weekcalendar to use json to read/write data to a mysql database.</p>
<p>What works so far, loading the cal from db, creating and storing new events on cal and deleting events on the calendar.</p>
<p>I run into problems trying to get the time/date variables when you resize an event on the calendar.</p>
<p>Selecting all the values for the events is possible but I don't know how to get the current resized event.</p>
<p>So far I have: </p>
<pre><code>eventResize : function(calEvent, $event) {
var startField = $(".wc-time").text();
alert(startField);
},
</code></pre>
<p>This selects all the calendar event times but I only need the one that I just resized.</p>
<p>Any toughts?</p>
| javascript jquery | [3, 5] |
3,929,326 | 3,929,327 | Jquery Substring Replace | <p>I am building a CMS that uses query strings to show different editors.</p>
<p>Example:</p>
<pre><code>editors.php?editor=Articles
</code></pre>
<p>I need to make the word article singular for a button that say "New Article". I want to use the same query string editor value to avoid a big if statement.</p>
<p>I need to do it with javascript. It is only going to run on my 4 pre-defined strings.</p>
<p>basically this: if(string has s at the end){drop the s}</p>
| php jquery | [2, 5] |
794,680 | 794,681 | Database add item to list view? | <p>I download this database script and i was wondering how can i convert it to instead add a item to a list view.. its a really easy understandable database code..</p>
<p><a href="http://www.anotherandroidblog.com/wp-content/uploads/2010/08/AABDatabase.zip" rel="nofollow">http://www.anotherandroidblog.com/wp-content/uploads/2010/08/AABDatabase.zip</a></p>
<p>Thats the source for it..</p>
<p>also im guessing it could be in here??</p>
<pre><code>/**
* retrieves a row from the database with the id number in the corresponding
* user entry field
*/
private void retrieveRow()
{
try
{
// The ArrayList that holds the row data
ArrayList<Object> row;
// ask the database manager to retrieve the row with the given rowID
row = db.getRowAsArray(Long.parseLong(updateIDField.getText().toString()));
// update the form fields to hold the retrieved data
updateTextFieldOne.setText((String)row.get(1));
updateTextFieldTwo.setText((String)row.get(2));
}
catch (Exception e)
{
Log.e("Retrieve Error", e.toString());
e.printStackTrace();
}
}
</code></pre>
| java android | [1, 4] |
1,450,798 | 1,450,799 | Match method doesnt work in a user function | <p>I have this function:</p>
<pre><code>function checkMobile(){
return $('#js-mobile').val().trim().match(/^09[0-9]{9}$/);
}
</code></pre>
<p>And this in-line code:</p>
<pre><code> $('#js-mobile').val().trim().match(/^09[0-9]{9}$/);
</code></pre>
<p>I dont know why this code doesnt work in my function but work without function!</p>
<p>See the Attachment</p>
<p><img src="http://i.stack.imgur.com/ER8yW.png" alt="firefox - firebug console"></p>
| javascript jquery | [3, 5] |
5,443,798 | 5,443,799 | PHP Variables inside JQuery/Javascript | <p>I have some javascript/jquery code and need to some php into it be the syntax seems to be wrong...</p>
<p>This is what I'm doing:</p>
<pre><code>$.post("myphp.php?something=$phpvariablehere",{ etc....
</code></pre>
<p>The result right now is that it's taking <strong><em>$phpvariablehere</em></strong> as a string and not the value of it.</p>
<p>Anyone know the right syntax?</p>
| php javascript jquery | [2, 3, 5] |
5,386,933 | 5,386,934 | jQuery/JS for different pages - best way of doing this? | <p>Apologies if this is a silly question, and I'm not even sure of the best way of wording it...</p>
<p>At the moment I have a site with maybe 20+ different uses of jQuery, all varying from page to page. I'm just wondering what the best way is to store this code?</p>
<ul>
<li>Everything in one big jquery.myfunctions.js file? And check if the element exists for each statement?</li>
<li>Embed script tags into each individual page?</li>
<li>Use PHP to deliver different content into script tags kinda like the above?</li>
<li>Separate .js files per page? ims I don't like the sound of this at all</li>
</ul>
<p>To be honest, I'm not even sure if jQuery does this for you, so it's okay to have multiple <code>$('#whatever').function()</code> loaded onto each page without any noticeable performance issues?</p>
<p>Any advice on this would be fantastic, probably a silly question but I want to do things the 'proper' way you know?</p>
<p>Thanks :-)</p>
| javascript jquery | [3, 5] |
2,174,803 | 2,174,804 | passing php variable to javascript syntax issue | <p>trying to upload pictures to a users folder /uploads/$uid i think i have the variable syntax right maybe the syntax in file path is incorrect /uploads/user/ </p>
<pre><code>(function($){
$.simpleuploader = {version: '0.1'};
$.fn.simpleuploader = function(options){
// the container to inject the form into
var $this = $(this);
var user = '<?php echo $uid; ?>'; //is users id from session
// set defults
var defaults = {
prefix: 'simpleuploader-',
latency: 500,
reuse: true,
when: 'onchange',
submitText: 'Submit',
disabledOpacity: .3,
settings: {
fullPath: 'http://www.mysite.com/image_upload/uploads/user/',
relPath: '../uploads/user/',
},
</code></pre>
| php javascript | [2, 3] |
5,580,424 | 5,580,425 | Understanding javascript function calls in format of myFunc(arg).something() | <p>I'm trying to understand the format of the Javascript functions that jQuery, among other people, use.</p>
<p>For instance <code>jQuery(arg).hide()</code> or <code>$("#obj").hide</code></p>
<p>I'd like to write similar format functions but I don't understand how.</p>
<p>I know how to write</p>
<pre><code>function myFunc(args) {
}
</code></pre>
<p>but I don't understand the second part ie the .hide()
is that a function within a function?</p>
<p>thanks for any help</p>
| javascript jquery | [3, 5] |
478,393 | 478,394 | How to get the user authentication in Splash Activity | <p>I'm working on a small app that has a Splash Screen and a User Login. </p>
<p>I want to launch different tab menu based on the user's ID. </p>
<p>Let say I have an Admin who has ID == "100" will get AdminTabActivity and rest of others will get UserTabActivity. so I wrote it like this. I'm simply passing the user ID from here to the MainActivity.</p>
<p>SplashActivity.java </p>
<pre><code>public void run(){
try{
sleep(1000);
Intent in = new Intent(getApplicationContext(), MainActivity.class);
startActivity(in);
finish();
} catch (InterruptedException e){
e.printStackTrace();
}finally {
}
}
</code></pre>
<p>LoginActivity.java</p>
<pre><code>//Stores and Grabs the user ID from sqlite db
db.addUser(json_user.getString(KEY_ID),
json_user.getString(KEY_NAME));
Intent i = new Intent(getApplicationContext(), MainActivity.class);
i.putExtra(KEY_ID, id);
startActivity(i);
finish();
</code></pre>
<p>MainActivity.java</p>
<pre><code>Intent i = getIntent();
String id = i.getStringExtra(KEY_ID);
if("001".equals(id)){
/* Launch Admin Screen if ID == 100 */
Intent in = new Intent(getApplicationContext(), AdminTabActivity.class);
startActivity(in);
finish();
}else{
/* Launch User Screen if ID !== 100 */
Intent in = new Intent(getApplicationContext(), UserTabActivity.class);
startActivity(in);
finish();
}
</code></pre>
<p>If the user exits out of the app and returns back, it will skips the LoginActivity and go straight from Splash to MainActivity (which I want it to be), but the <strong>if block</strong> will skip this time even if the user has the ID == "100". Hope it makes sense, if not please kindly let me know so I can explain more. Thank you!</p>
| java android | [1, 4] |
5,146,017 | 5,146,018 | How do I find all elements with a specific attribute? | <p>I have a number of elements on my page that have a <code>lang</code> attribute. How do I select only the elements with a <code>lang</code> attribute? </p>
<p>i.e.</p>
<pre><code><div lang="english">Test</div>
<span lang="english">is cool</span>
<span lang="anotherlanguage">is also good</span>
</code></pre>
| javascript jquery | [3, 5] |
2,439,500 | 2,439,501 | Android-Simulate mouseover/hover | <p>How can you simulate a mouseover event in an android app?
I have to detect if the user is touching/hovering over a particular part of the screen for more than 2 seconds.</p>
| java android | [1, 4] |
4,036,102 | 4,036,103 | ASP.NET C# DataTable DropDownList Issue | <p>I have a datatable/source binded to a drop down list in ASP.NET C#.</p>
<p>I am trying to return the selected drop down list value using:</p>
<pre><code>dropdownlist.Text
</code></pre>
<p>However, this just returns the first list value. How can i get it to return the selected drop down list value?</p>
| c# asp.net | [0, 9] |
3,927,825 | 3,927,826 | How to pass TextBox value to DynamicPopulateExtender query? | <p>Hi I am trying to do DynamicPopulate on DropDownList2 when the value of textbox2 changes, how can I pass the value to TextBox2 to the sql query of DynamicPopulate. </p>
<pre><code><asp:DropDownList ID="DropDownList2" runat="server"
DataSourceID="SqlDataSource1"
onselectedindexchanged="DropDownList2_SelectedIndexChanged">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MYDB %>"
SelectCommand="SELECT Time FROM Tour WHERE (Date = TextBox2 )">
</asp:SqlDataSource>
<asp:DynamicPopulateExtender ID="DropDownList2_DynamicPopulateExtender"
runat="server" Enabled="True" PopulateTriggerControlID=""
TargetControlID="DropDownList2">
</asp:DynamicPopulateExtender>
</code></pre>
| c# javascript asp.net | [0, 3, 9] |
1,631,809 | 1,631,810 | Reset setTimeout every button click? | <p>Here is My Code</p>
<blockquote>
<p>var sec = 10 var timer = setInterval(function() {<br>
$('#timer span').text(sec--);
}, 1000);</p>
</blockquote>
<p>it setTimeout for 10seconds and if I click reset button will setTimeout again with 10seconds</p>
| javascript jquery | [3, 5] |
5,266,224 | 5,266,225 | Setting Custom Attributes For Item using GCheckout | <p>I am using .net google checkout utility GCheckout.dll to setup various shopping cart settings and product attributes. every thing is ok but i want to sent custom field information like shirt color, size etc via google checkout button. sample code below</p>
<pre><code>GCheckout.Checkout.ShoppingCartItem item = new GCheckout.Checkout.ShoppingCartItem();
item.Name = "PayCircuit T-shirt";
item.Description = "The best shirt ever";
item.Price = (decimal)9.99;
item.Quantity = 3;
</code></pre>
<p>I can't find how to setup custom field attributes with ShoppingCartItem class.</p>
| c# asp.net | [0, 9] |
1,755,528 | 1,755,529 | ASP.Net: GridView control and combobox woes part 2 | <p>This is a follow up to: <a href="http://stackoverflow.com/questions/7637920/asp-net-gridview-control-and-combobox-woes">ASP.Net: GridView control and combobox woes</a></p>
<p>I've implemented my code as kd7 has answered but I'm getting a "System.NullReferenceException: Object reference not set to an instance of an object." I've simplified the code as follows:</p>
<p>Event handler for the button click:</p>
<pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
{
ViewState["MyKey"] = "Test";
}
</code></pre>
<p>The Page_Load now has:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
txtDisplay.Text = ViewState["MyKey"].ToString();
}
}
</code></pre>
<p><strong>My question is:</strong> Why is ViewState["MyKey"] coming back as null and causing a NullReference exception?</p>
<p><strong>Please note that the code above is only a simplified version of what I'm trying to do. Please see the previous question given in the first line of this question to see full details.</strong></p>
<p>Any suggestions?</p>
| c# asp.net | [0, 9] |
3,606,330 | 3,606,331 | Send information from javascript to php file | <p>I have this function <code>onEdit()</code> and now I want to send the value of variable id to a php file (let's call it <code>test.php</code>) so that using that value I can auto fill the popup called <code>modtemplate</code> which is located in <code>test.php</code> file.</p>
<p>Is there any way to accomplish this?</p>
<p>Any help on this will be greatly appreciated!</p>
<pre><code>function onEdit() {
var checkboxs = document.getElementsByTagName("input");
var id='';
for (var b=0; b<checkboxs.length; b++) {
if( (checkboxs[b].type == "checkbox") && (checkboxs[b].checked) ) {
id = checkboxs[b].value;
break;
}
}
if(!id)
alert("Please select a record to edit");
else
document.getElementById('modtemplate').style.visibility = 'visible';
}
</code></pre>
| php javascript | [2, 3] |
476,874 | 476,875 | Adding extra parameters to url src with jquery? | <p>I cant think in how i can do this some help please.
I get some json objects and one of the values has html tags, some images, of course i cant fetch the images because they have relative urls, and the site it is host in a sub-domain.
Is there any way to add the <a href="http://example.com/" rel="nofollow">http://example.com/</a> to the already existing images/image.png</p>
<p>thanks</p>
<p>this is my json response:</p>
<pre><code>description": "<img src=\"images/stories/Icons/Vacuum.png\" mce_src=\"images/stories/Icons/Vacuum.png\" border=\"0\" alt=\"Vacuum\" title=\"Vacuum\"> <img src=\"images/stories/Icons/Washing_Machine.png\" mce_src=\"images/stories/Icons/Washing_Machine.png\" border=\"0\" alt=\"Washing Machine\" title=\"Washing Machine\"></p>"
for(var i = 0; i < objJsonA.length; i++){
var ap = objJsonA[i];
var lot = ap.lot;
$('.myclass').html(lot);
}
</code></pre>
<p>this returns 404 errors, the content i'm fetching it is on www.mysite.com and i am on m.mysite.com</p>
| javascript jquery | [3, 5] |
2,555,841 | 2,555,842 | Drop Down Problems | <p>I am trying to create a drop down list. I have it working but not fully, using this code:</p>
<pre><code>$(document).ready(function(){
$("#zone-bar li em").hover(function() {
var hidden = $(this).parents("li").children("ul").is(":hidden");
$("#zone-bar>ul>li>ul").hide()
$("#zone-bar>ul>li>a").removeClass();
if (hidden) {
$(this).parents("li").children("ul").toggle()
.parents("li").children("a").addClass("zoneCur");
}
});
});
</code></pre>
<p>I managed to make it work so on hover the drop down list will appear, but when you move to select one of the items from the drop down list the drop down list closes. How do I fix that?</p>
<p>It works if I put it to <code>onclick</code> but then you have to click the arrow to close it again. You can see a live example at <a href="http://doctorwhohd.com" rel="nofollow">http://doctorwhohd.com</a> (currently using <code>onclick</code>)</p>
| javascript jquery | [3, 5] |
3,957,390 | 3,957,391 | jquery image slider gallery | <p>I'm trying to add images dynamically im my preview element.So when I click a thumbnails image will load and slide.</p>
<pre><code><div id="imageGallery">
<div id="loading"></div>
<a class="thumbnail"><img alt="Image 1" src="../../baContent/image1.jpg" /></a>
<a class="thumbnail"><img alt="Image 2" src="../../baContent/image2.jpg" /></a>
<div id="preview">
<img id="mainImage" alt="Main Image" src="../../baContent/image1.jpg" />
</div>
</div>
$(document).ready(function () {
$("#loading").show();
var oldImage = $("#preview img:first");
var newImage = $("#mainImage").insertAfter(oldImage).css('position', 'absolute').css('left', 800);
newImage.load(function () {
$("#loading").hide();
oldImage.css({ left: 0 }).animate({ left: -800 });
newImage.css({ left: 800 }).animate({ left: 0 });
oldImage.remove();
});
});
</code></pre>
<p>My idea is to insert image dynamically after the first image and old image will remove. I try to many functions append,insertTo. But it is not working.Thanks advice :)</p>
| javascript jquery | [3, 5] |
5,596,396 | 5,596,397 | Minimize jQuery Function | <p>I have a function that adds change events for form items based on the row name(uses the database to get these).</p>
<p>Heres the current function:</p>
<pre><code> $sql = "SELECT * FROM product WHERE storeno = '1' ORDER BY descript";
$result = mssql_query($sql, $msConnection);
if ($result && mssql_num_rows($result) > 0) {
while ($row = mssql_fetch_object($result)) {
$sku = trim($row->mas90sku);
$JQueryReadyScripts .= "
$('#newCount_" . $sku . "_row .cases').change(function() {
var count = 0;
$('#newCount_" . $sku . "_row .cases').each(function () {
count += parseFloat($(this).val());
});
$('#cases_total_" . $sku . "').text(count);
});
$('#newCount_" . $sku . "_row .units').change(function() {
var count = 0;
$('#newCount_" . $sku . "_row .units').each(function () {
count += parseFloat($(this).val());
});
$('#units_total_" . $sku . "').text(count);
});";
}
mssql_free_result($result);
}
</code></pre>
<p>How can I consolidate this into a call that affects every row so that I can get rid of the DB portion and have just 2 pieces (or 1) of code instead of 2 for every row.</p>
| php javascript jquery | [2, 3, 5] |
5,309,175 | 5,309,176 | Reset number to 1 if number is over than 10 | <p><code>num</code> is a variable which is dynamically changed within 1 to 9.</p>
<p>I must update the value in HTML for example let say the <code>num</code> is 6,</p>
<p>i need to set 1st field as 6, second field as 7, third field as 8 and so on</p>
<p>in simple version, <strong>6, 7, 8, 9, 1, 2, 3, 4, 5</strong></p>
<pre><code>$("#one").text(num);
....
$("#nine").text(num+8);
</code></pre>
<p>EDIT: Sorry for confusion</p>
<pre><code>$("#one").text(num);
$("#two").text(num+1);
....
$("#nine").text(num+8);
</code></pre>
<p>so for example, the value on <code>$("#nine")</code> is 6+8 = 14, whereas it should be 5</p>
| javascript jquery | [3, 5] |
3,196,339 | 3,196,340 | selecting textViews and getting their values | <p>I am trying to accomplish following things</p>
<p>Suppose I have 5-6 <code>TextViews</code> with values <code>S N A K E</code> </p>
<p>Now, I want to press <code>S</code> textView then slide my finger over <code>N</code> to select it too and then move my way to E. I want to do that so that i can get "<code>SNAKE</code>" in my string or char sequence etc</p>
<p>If there is any idea do share me. I can't get it how to use <code>onTouch</code> here.
Also, i am adding <code>textViews</code> dynamically so i am setting their ids dynamically too
Best Regards</p>
| java android | [1, 4] |
2,193,559 | 2,193,560 | How to get different string values depending on the locale? | <p>I have an app which shows html files from assets folder. I would like to translate some files.
For example I have files in folder assets/fr for french users and in assets/en for others.</p>
<p>Here is the line which I want to change:</p>
<pre><code>String htmlFileName = "m" + bundle.getString("defStrID") + ".html";
</code></pre>
<p>So I want to get language of phone, if it's french I want to show files from /fr and if it's other show /en.</p>
<p>The modified version of this line will look like</p>
<pre><code>String locale = java.util.Locale.getDefault().getDisplayName();
if locale=french
String htmlFileName = "m" + bundle.getString("defStrID") + ".html";
else
String htmlFileName = "mn" + bundle.getString("defStrID") + ".html";
endif
</code></pre>
<p>Syntax is incorrect because I don't know how to do that. Help, please.</p>
| java android | [1, 4] |
5,554,864 | 5,554,865 | History.go(-1) not working in IE | <p>I have a go back button and i have used the following piece of code in my aspx page</p>
<p><code><input type="button" runat="server" value="Back" onclick="Javascript:history.go(-1); return=false;" /></code></p>
<p>The prob is its working fine in Firefox but when i am trying it in IE its not working. Can someone share their Idea.</p>
<h2>Update</h2>
<p>By mistake I write <code>return=false;</code> the actually code is:</p>
<p><code><input type="button" runat="server" value="Back" onclick="Javascript:history.go(-1); return false;" /></code> and still not working.</p>
| javascript asp.net | [3, 9] |
1,993,595 | 1,993,596 | syntax error T_PAAMAYIM_NEKUDOTAYIM! | <p>buy.php:</p>
<pre><code><form action="cart.php" method="post">
<?php foreach($product['varieties'] as $variety): ?>
<input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="<?php echo $variety['price'] . '_' . $variety['size']; ?>" />';
<?php end foreach; ?>
</form>
</code></pre>
<p>cart.php:</p>
<pre><code>list($aDoor, size) = split('_', $_POST['price']); // line 207
if(empty($aDoor))
{
echo("You didn't select any buildings.");
}
else
{
echo "Sum of vlues = ".array_sum($aDoor);
}
</code></pre>
<p>In cart.php there is the following syntax error:</p>
<blockquote>
<p>syntax error, unexpected ')',
expecting T_PAAMAYIM_NEKUDOTAYIM in
store/cart.php on line 207</p>
</blockquote>
<p>I am expecting in cart.php to receive the two index values size and price independetly so I can use it and CSS it where ever i want. I am expecting that with the function list() and split() the variables variety and $aDoor with the price value will able to separate this two variables to be use wherever I want in cart.php</p>
<p>Help.</p>
| php javascript | [2, 3] |
2,550,926 | 2,550,927 | Can I give a 'web address format' to my local host application | <p>I host a local application on my machine which i provide access on network by normally type "http://computername/app". Can I change it to a real web address format "www.myapplication.org" for my local hosting.</p>
<p>I would appriciate for every of your suggestion.</p>
<p>vic,</p>
| c# asp.net | [0, 9] |
875,182 | 875,183 | Why is this JS variable being run on page load | <p>I don't understand why <code>MC.caro.myTimer()</code> is being run on a page load, its a variable. So how is this getting run without me calling it.</p>
<p>I thought it might be something to do with my auto executing function? </p>
<pre><code> var MC = {};
(function($){
"use strict";
MC.init = function (){
//disable to turn off carousel
MC.caro.init();
};
MC.caro = {
init: function(){
//Build carousel for us to use
MC.caro.build();
//Bind click events to buttons
$('.mc-carousel--nav--buttons').on('click','li',function(){
MC.caro.advance($(this));
//stop the current ticking
MC.caro.stopMyTimer();
//Start up movement after 15seconds
setInterval(function(){MC.caro.myTimer()},10000);
console.info('running');
});
},
build: function(){
MC.caro.jsonRun(function(){
console.info('running1');
});
},
myTimer: function(){
console.info('running2');
MC.caro.advance(nextItem,'slow');
},
//Sets up the timer
timer:setInterval(function(){MC.caro.myTimer()},5000),
stopMyTimer: function(){
clearInterval(MC.caro.timer);
}
}
})(jQuery);
MC.init();
</code></pre>
<p>There is another problem:</p>
<p>when i click on <code>$('.mc-carousel--nav--buttons').on('click','li',function(){</code> the code will wait 15 seconds then run. As expected. but if i click it 5 times really quickly it will wait those 15seconds then run in exactly the same time and order i clicked, meaning that <code>MC.caro.stopMyTimer();</code> isn't working which is called inside my click event.</p>
<p>Also, this isn't the complete code, i can't put it into fiddle either as it has big dependencies on an intranet. </p>
<p>So appoligies that you can't see a working example.</p>
| javascript jquery | [3, 5] |
4,119,920 | 4,119,921 | How to Hide page Header and page footer in reportviewer (RDLC) with visual Studio 2010 | <p>In my .rdlc report I need to hide the page header and footer on my web page. But when i print the report , i want to display the page header and in footerin my report(.rdlc).</p>
| c# asp.net | [0, 9] |
4,197,570 | 4,197,571 | How to hide an ACTIVITY to call another ACTIVITY and run it on background and show it again? | <p><em>*</em>*I'm working on an android project, where I have to give a facility of reading eBook while listening audio songs on Samsung tab(Android 3.2 and above). For that I need to hide the audio player view to go to the file browser to select eBook. </p>
<p>I need your help to find out, how to hide the <strong>AudioPlayer</strong> activity and again show the same(player view) from any place. </p>
<p>In short I want to make make AudioPlayer view similar to minimize option in Windows platform.</p>
| java android | [1, 4] |
3,296,560 | 3,296,561 | Add <br> tag in asp.net gridview column data | <p>I am working on gridview and I am binding the data from code behind</p>
<p>Dim dataTblRep As New DataTable
Dim dataRowRep As DataRowdataRowRep = dataTblRep.NewRow</p>
<pre><code>dataRowRep("Batch Number") = "Totals : "
dataRowRep("Batch details") = "A" & <br/> & "B"
dataRowRep("Completed Docs") = TotEntryCount
dataRowRep("Received Docs") = TotSrcCount
dataTblRep.Rows.Add(dataRowRep)
gvRepOutput.DataSource = dataTblRep
gvRepOutput.DataBind()
</code></pre>
<p>So, in Batch details I am adding the two values from datatable and I want the "A" and "B" on seperate lines within the cell. But in the output I am getting "<code>A <br/> B</code>"</p>
<p>I have tried HtmlDecode but it is not working. Also, I am not using any Template Fields and I have the gridviews AutoGenerateColumns option set to True.</p>
| c# asp.net | [0, 9] |
2,251,706 | 2,251,707 | Request.Url.Port giving wrong port | <p>I am given a Live IP from my support team something like <code>http://201.121.152.168:68/</code>. Now in normal circumstances you would think 68 is the port. However when I do a Request.Host I get <code>201.121.152.168</code> and when I do Request.Port I get <code>80</code>. So where did the number 68 go? It's neither coming in Host nor in port. That is why my whole application is breaking. Can anybody suggest what is going wrong and how can I correct this?</p>
<p>What am I missing here?</p>
<p><strong>Update:</strong> If I do <code>request.Headers["Host"].ToString()</code> I get full host with port i.e 201.121.152.168:68</p>
| c# asp.net | [0, 9] |
1,345,637 | 1,345,638 | Get values of multiple buttons via JQuery | <p>I want to do something when a certain button is pressed via JQuery and PHP. The problem is however, the buttons on my page are dynamically generated, all with different values. So it could be three, four buttons,...etc.</p>
<p>The two main problems are:</p>
<p>1) Only the first button is recognized by Javascript, the other don't do anything.</p>
<p>2) I can't find a way to pass the variable id with JavaScript to my PHP code.</p>
<p>An example will hopefully make the problem clear:</p>
<p><strong>HTML, the amount of buttons is unknown, all with different values:</strong></p>
<pre><code><button id='button' value='$variableid1'>Do something</button>
<button id='button' value='$variableid6'>Do something</button>
<button id='button' value='$variableid11'>Do something</button>
...
</code></pre>
<p><strong>When pressed, I tried to activate this Javascript code:</strong></p>
<pre><code> $(document).ready(function() {
$("#button").click(function() {
$.ajax({
type:"POST",
data: {clicked: ?},
});
});
});
</code></pre>
<p><strong>PHP code, on the same page:</strong></p>
<pre><code>if(isset($_POST['clicked'])){
//do some stuff with the variable id.
}
</code></pre>
| php jquery | [2, 5] |
5,047,956 | 5,047,957 | How to hide my dynamicly created divs? | <p>I have created a script that creates divs based on number of li elements and that part is working fine. Now what I would like to do is to <b>hide these div's</b> (dynamicly created) but it is not working. Can someone tell me what I am doing wrong here? THX!!
<br/><a href="http://jsfiddle.net/utTre/" rel="nofollow">Fiddle here</a></p>
<p>My code:</p>
<pre><code>$(document).ready(function(){
$(".create").click(function(){
i='';
var count = $("li").length;
for(var i=0;i<count;i++){
$('<div class="mydiv" style="width:100px;height:100px;background-color:red;border:1px solid #000000;"></div>').appendTo('body');
}
});
$('.check').click(function(){
var getDivs= $('div').length;
alert(getDivs);
});
//Why is this not working?
$('div').click(function(){
$(this).hide();
});
});
</code></pre>
| javascript jquery | [3, 5] |
796,725 | 796,726 | Is it possible to send response from php server to iphone? | <p>i am posting form from iphone to php, where data is collected and inserted to database.how should i get response from server that data is success fully inserted in tables?</p>
| php iphone | [2, 8] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.