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 |
---|---|---|---|---|---|
442,796 | 442,797 | problem with window scrolling with asp.net button control | <p>In web application, i tried scrolling the window vertically by increasing a y axis height to 500 with a javascript that is attached to OnClientClick event of a asp.net button control with id Button1.</p>
<p>The script i have used is</p>
<pre><code><script language="JavaScript">
function scrollToWindow()
{
window.scrollTo(0,500);
}
</script>
</code></pre>
<p>and the button code is as follows</p>
<pre><code><asp:Button ID="Button1" runat="server"
Text="Scroll to bottom" OnClientClick="scrollToWindow()" />
</code></pre>
<p>If i run this page and click that button, the page scroll is not working properly. when i put alert inside that script and debug, i found that the page is actually scrolling to 0,500 but again its rendering to its normal position because of some reasons. could someone help to overcome this issue and let me know the reason behind that??</p>
| javascript asp.net | [3, 9] |
2,437,740 | 2,437,741 | More convert jquery object to string | <p>Yes I have see the post <a href="http://jquery-howto.blogspot.com/2009/02/how-to-get-full-html-string-including.html" rel="nofollow">here</a></p>
<p>And I tried that but the problem is, my jquery object looks more like this:</p>
<pre><code>var $foo = $('<ul><li id="' + line.id + '" label="' + label + '" rel="file"><a href="#">' + line.title + '</a></li></ul>');
$foo.click(function() { openLink(line.url) });
$foo.appendTo($myDiv);
</code></pre>
<p>When $myDiv is fully populated I can do this:</p>
<pre><code>var html = $('<div>').append($('#foo').clone()).remove().html();
</code></pre>
<p>And I will see all of the lovely HTML, but I don't know if the click stuff will be preserved. See, I want to save the entire DOM modification to localStorage so I can retrieve it quickly since it's pretty static. I need to be able to store it and all its attributes, then yank it back out and restore it, clicks and all.</p>
<p>Does that make sense?</p>
| javascript jquery | [3, 5] |
2,472,695 | 2,472,696 | Jquery click function effect | <p>I have a jquery code, but I'm a little bit confused on how can I put a css on this:</p>
<pre>
$(document).ready(function () {
$('span.account-menu').click(function () {
$('ul.menu').slideToggle('medium');
});
});
</pre>
<p>I wanted to add this css in the click function.</p>
<pre>
border: 1px solid #999999;
background-color: #333333;
</pre>
<p>This style, I wanted to effect only in 'span.account-menu' and not affecting ul.menu. I try the code that you have given but the problem is when I click back the menu the style will not disappear.</p>
| javascript jquery | [3, 5] |
880,114 | 880,115 | How to extend ListItem to be able to have childs inside BulletList | <p>Using asp.net C#.
I have BulletList, and I would like to add ListItem that will render with childs.
That is, inside every <code><li></code> I can add more controls to be rendered.</p>
<p>How can I achieve that?</p>
<p>thanks</p>
| c# asp.net | [0, 9] |
2,293,190 | 2,293,191 | Cleaner way of checking values of textboxes | <p>I have a table that lists items and has a quantity textbox column that starts with an initial value of 0.</p>
<pre><code>item name | price | quantity
item1 | $1.00 | 0
item2 | $1.00 | 0
item3 | $1.00 | 0
</code></pre>
<p>I want to check if all of the rows have 0 as their value.</p>
<p>I'm currently thinking of using this:</p>
<pre><code>var all_zeros = true;
$('input.item-quantity').each(function () {
//Check for 0 quantity and update all_zeros var
}
</code></pre>
<p>Is there a cleaner and hopefully better way of doing this?</p>
| javascript jquery | [3, 5] |
2,066,707 | 2,066,708 | Using Page.ClientScript.RegisterClientScriptBlock not working | <p>I am trying to fire a pop up as shown below, but it is not working. Please help</p>
<pre><code>public void btnSubmit_Click(Object o, EventArgs e)
{
if (checkFileExists(Convert.ToString(fileInfo)))
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Msg", "<script type=\"text/javascript\" language=\"javascript\">function showMsg(){return confirm(\"This image name already exists, do you want to replace it?\");}</script>", true);
btnSubmit.OnClientClick = "return showMsg()";
}
if (something else)
{
// It does whatever is here but never pops the question above
}
}
</code></pre>
<p>and on the button I have</p>
<pre><code> <asp:Button class="Button" ID="btnSubmit" CausesValidation="True" Text="SUBMIT" runat="server"
OnClick="btnSubmit_Click"></asp:Button>
</code></pre>
| c# asp.net | [0, 9] |
2,779,595 | 2,779,596 | How to access the upper and lower element of a given element in jquery | <p>I have some div elements in a sequence, like :</p>
<pre><code> <div id="a"></div>
<div id="b"></div>
<div id="c"></div>
<div id="d"></div>
</code></pre>
<p>Suppose i have id of 3rd position div which is <code>c</code>. Now i want to access the div element which placed just above and below ( in this case b & d respectively ) of div whose id is <code>c</code>. How can i do this in jquery?</p>
| javascript jquery | [3, 5] |
2,841,904 | 2,841,905 | Call Javascript from code behind function in asp.net | <p>How to Call Javascript function from code behind after button click event;</p>
<pre><code> string popupScript = "<script language='javascript'>" +
"alert('hai');" +
"</script>";
ClientScript.RegisterStartupScript(Page.GetType(), "script", popupScript, true);
</code></pre>
<p>I tried above script but not working</p>
| c# javascript asp.net | [0, 3, 9] |
3,921,195 | 3,921,196 | In my android project there are two classes and there is a button on first class,i need to view next page when i click on the button. | <p>In my android project there are two classes and there is a button on first class,i need to view next page when i click on the button. </p>
<p>package com.example.restaurantapp;</p>
<pre><code>import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.view.View.OnClickListener;
import android.support.v4.app.NavUtils;
public class RestaurantActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_first);
Button orderbutton=(Button)findviewById(R.layout.activity_first);
orderbutton.setOnClickListener(new View.OnClickListener());
}
private Button findviewById(int activityFirst) {
// TODO Auto-generated method stub
return null;
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_first, menu);
{
public void onClick(View v) {
Intent intent = new Intent(RestaurantActivity.this,SecondActivity.class);
startActivity(intent);
}
return true;
</code></pre>
| java android | [1, 4] |
5,068,504 | 5,068,505 | C#: Is there a faster way to check if an external web page exists? | <p>I wrote this method to check if a page exists or not:</p>
<pre><code>protected bool PageExists(string url)
{
try
{
Uri u = new Uri(url);
WebRequest w = WebRequest.Create(u);
w.Method = WebRequestMethods.Http.Head;
using (StreamReader s = new StreamReader(w.GetResponse().GetResponseStream()))
{
return (s.ReadToEnd().Length >= 0);
}
}
catch
{
return false;
}
}
</code></pre>
<p>I am using it to check a set of pages (iterates from AAAA-AAAZ), and it takes between 3 and 7 seconds to run the entire loop. Is there a faster or more efficient way to do this?</p>
<p>Thanks!</p>
| c# asp.net | [0, 9] |
5,650,346 | 5,650,347 | GridView ASP if the table is empty | <p>How can I display a message in the place of the GridView if there is no results come from the database ? </p>
<p>Thanks in advance .. </p>
| c# asp.net | [0, 9] |
3,760,420 | 3,760,421 | Uploading video content whilst still recording | <p>This is a bit of a weird question but, with the functionalities of C++, c# and objective C as we speak is there any possible way for video content to be uploaded whilst its recording. So as you record the video it would be being compressed and uploaded to a website.</p>
<p>Would this involve cutting the video into small parts as you record, hardly noticeable stops and starts during the recording?</p>
<p>If anyone knows if this is at all possible, please let me know.</p>
<p>Sorry for the odd question.</p>
| c# c++ | [0, 6] |
4,556,512 | 4,556,513 | how to upgrade ajaxcontroltoolkit version from 3.0.20820.0 to version 3.5.40412.2 | <p>i am working in webapplication in asp.net using c#.
I have a problem that currently i am using ajaxcontroltoolkit version 3.0.20820.0
but in this toolkit i don't have Editor Ajax control so i want to upgrade it with new version ajaxcontroltoolkit version 3.5.40412.2</p>
<p>When i upgrade it then my old ajax control is not working like validatorcalloutextender and requiredfieldvalidator etc.</p>
<p>so please tell me how can i upgrade ajaxcontroltoolkit version from 3.0.20820.0 to version 3.5.40412.2 </p>
<p>i also use in web.config file but not successfull.</p>
<p>please help as soon as possible because i am in the mid</p>
| c# asp.net | [0, 9] |
1,155,864 | 1,155,865 | jquery selects returning undefined value - asp.net webform | <p>simple bit of jquery. I have a div with clss linklist, inside it has several linkbuttons</p>
<pre><code><script type="text/javascript">
$(function () {
$('#linklist a').each(function () {
alert(this.text);
});
});
</script>
</code></pre>
<p>I would assume that it should alert the text inside each rendered hyperlink. instead I am getting the value "undefined"</p>
<p>if i change it to </p>
<pre><code>alert(this.id);
</code></pre>
<p>i am getting the correct client id - therefore i know at least that I am selecting correct.
why is this value undefined? same goes for this.text and this.value</p>
<p>Thanks</p>
| jquery asp.net | [5, 9] |
4,375,079 | 4,375,080 | Issue with %0A replace in android | <p>how can i remove %0A from this string :- this is enter key code, which i need to remove from entire string. so how can i do this? </p>
<p><strong>input:-</strong></p>
<p>"NA%0A%0AJKhell this is test %0A"</p>
<p><strong>Output:-</strong></p>
<p>NAJKhell this is test </p>
<p>i have tried</p>
<pre><code> String input = "NA%0A%0AJKhell this is test %0A";
String output = input.replaceAll("%0A","");
</code></pre>
<p>but still not get the output.</p>
| java android | [1, 4] |
118,780 | 118,781 | efficiency of cloning dom nodes | <p>I'm building an application where I end up with a fairly long list of repeated elements that need to be configured based on some objects I'm getting via AJAX. I'm thinking about creating one of these elements in html and leaving it hidden on the page and then cloning this element and using jQuery to modify it based on the object I'm getting back (ie set its text, href etc...) From a performance standpoint would this be faster or slower than more traditional dom generation (where I would create the entire element in javascript rather than starting with a cloned element)?</p>
| javascript jquery | [3, 5] |
1,708,326 | 1,708,327 | Loading complete Html-page in contentpane of aspx-page | <p>here at home I have different projects and libraries for which I've created an helpfile with Sandcastle.
Now Sandcastle provides also the possibility to create a website.</p>
<p>What I would like to do is to create an aspx-page where I can dynamically create a menu and where the existing helpfile-websites can be sollicited. All in one place.</p>
<p>Is it possible to accomplish this? Maybe some control that I can use to view an entire webpage?</p>
<p>Thank you.</p>
<p><strong>EDIT:</strong></p>
<p>Seems I can't get it to work in an ASP-page for whatever reason, but probably because of the way Sandcastle creates the help-pages.
I've now tried it with a WinForm-application with a webbrowser-control and this approach works, so I guess this will be the way I have to go here.</p>
<p>But I do need to say thanks to Alison (and Leon) for their help regarding this issue.
Their solution works for "normal" html-pages, but (unfortunately) not for the ones I have.
For that reason, I've accepted the answer so others could benefit from it.</p>
| c# jquery asp.net | [0, 5, 9] |
1,970,451 | 1,970,452 | Add external javascript to user control... but put the file reference at the bottom of the page | <p>I need to be able to add an external js file for a user control (using</p>
<pre><code> this.Page.ClientScript.RegisterClientScriptInclude("SuggestionSearch",
"~/Secure/Shared/SuggestionSearch.js");
</code></pre>
<p>syntax)</p>
<p>But it puts the javascript file on the page too early... is there a way to put the file at the bottom of the page?</p>
| javascript asp.net | [3, 9] |
841,929 | 841,930 | remove text from string array with javascript/jquery | <p>Using <code>.each()</code> to go through an array, and trying to use <code>replace()</code> to find all the "<code><br></code>" and replace with " " (pretty simple) but nothing happens - no errors, it just doesn't replace.</p>
<pre><code>//get values of each td in row
var values = '';
var tds = $(this).find('td');
$.each(tds, function(index, tditem) {
values = values + "td" + ':' + tditem.innerHTML + '\n';
values = values.replace(/<br>/i, " ");
});
</code></pre>
<p>Acknowledging that it would be better to manipulate a DOM element (and selecting one of those answers as the correct answer) I ended up adding this to my function as it just makes my life easier in the short-term:</p>
<pre><code>values = values.replace(/<br>/i, " ");
</code></pre>
<p>Thanks @all</p>
| javascript jquery | [3, 5] |
823,658 | 823,659 | jQuery.inArray not behaving as expected | <p>I'm trying to loop through a list of numbers and check if that number is part of another list of numbers using jQuery.each and jQuery.inArray. jQuery.inArray does not seem to be behaving as expected.</p>
<p>Here is my code:</p>
<pre><code>var some_numbers = [1, 2];
var more_numbers = [0, 1, 2];
$.each(more_numbers, function(index, value) {
if($.inArray(value, some_numbers)) {
console.log(value);
}
});
console.log('Some Numbers:');
console.log(some_numbers);
</code></pre>
<p>Here is the resulting console output:</p>
<pre><code>0
2
Some Numbers:
[1, 2]
</code></pre>
<p>Will someone please help? This is maddening.</p>
<p><strong>Edit:</strong> Problem solved! Changed my condition to this:</p>
<pre><code>if($.inArray(value, some_numbers) !== -1)
</code></pre>
<p>Thanks everyone!</p>
| javascript jquery | [3, 5] |
950,360 | 950,361 | Replacing commas in textareas with jquery or javascript | <p>I have a form with multiple text areas. </p>
<pre><code><textarea name="datasetname_1" cols="40" rows="5" id="datasetname_1" class="validate[required] text-input"></textarea><br>
<textarea name="datasetname_2" cols="40" rows="5" id="datasetname_2" class="validate[required] text-input"></textarea><br>
<textarea name="datasetname_3" cols="40" rows="5" id="datasetname_3" class="validate[required] text-input"></textarea><br>
</code></pre>
<p>I would like to replace any text that contains commas with dashes. This should work for text that's typed directly in the text areas or text that is pasted over. The text should be replaced before the form is submitted. How can I accommplish this with jquery or javascript?</p>
<p>I have tried this</p>
<pre><code> $("#formID").submit(function() {
$("textarea").each(function() {
($(this).val().replace(',','-'));
});
});
</code></pre>
<p>with no luck.</p>
| javascript jquery | [3, 5] |
5,007,813 | 5,007,814 | how to do a relative path redirection using javascript? | <p>I'm working on javascript/jquery in a php based site, and I have to redirect the page upon an event in the page.</p>
<p>lets say, on clicking the button "click me" in <code>"page1.php"</code>, the page should be redirected to "<code>page2.php</code>". This redirection has to be done using javascript/ jquery. Both pages are in the same folder, and the redirection code should use <strong>'RELATIVE LINKS'</strong>.</p>
<p>Now, I am able to redirect if I give the absolute link to <code>page2.php</code>, but could someone let me know how to do the same with a relative link?</p>
<p>something like: </p>
<pre><code>window.location.href = 'page2.php';
</code></pre>
<p>thanks.</p>
| javascript jquery | [3, 5] |
2,342,890 | 2,342,891 | PHP __call equivalent for java | <p>Is there a Java equivalent for the <a href="http://www.php.net/__call#language.oop5.overloading.methods">__call of PHP</a>?</p>
<p>It would make sense to me if that's not the case, because it would probably result in compiler errors.</p>
<p>From the <a href="http://de3.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods">PHP manual on magic methods</a>:</p>
<blockquote>
<p><code>__call()</code> is triggered when invoking inaccessible methods in an object context. </p>
</blockquote>
| java php | [1, 2] |
5,960,092 | 5,960,093 | Layout orientation? | <p>I made 2 layout , the first one for android 2.1 ( I need it only in <code>portrait</code>) and second one for android 3 ( I need it only in <code>landscape</code>) and these 2 layout use one class . now how can i set these two layout on landscape and portrait? if i set it in <code>AndroidManifest</code> , i can just use one of these mode <code>portrait</code> or <code>landscape</code> , just it ,</p>
<p>we can't use:</p>
<pre><code><activity android:name=".activity" android:screenOrientation="portrait"></activity>
</code></pre>
<p>now which method is true?</p>
<p>Thanks</p>
| java android | [1, 4] |
56,311 | 56,312 | For a DIV with scrollbars, is it possible to make that div scroll all the way to the bottom, using JQuery? | <p>How would you do that using JQuery?</p>
| javascript jquery | [3, 5] |
2,175,056 | 2,175,057 | Database Transactions in Java on Android | <p>I am trying to translate some of the code of Objective C in Java...</p>
<pre><code>[_db beginTransaction];
Date now = [[NSDate alloc] init];
boolean result = [_db executeUpdate:updateQuery, [self stringToDB:account.userId],
[self integerToDB:account.accountId],
[self integerToDB:account.accountType],
[self stringToDB:account.accountName],
];
[_db commit];
return true;
</code></pre>
<p>Can anyone tell me how can i implement <code>BeginTransaction and Commit</code> in Java?</p>
| java android | [1, 4] |
2,197,693 | 2,197,694 | Calling global variables in the AppSettings from a Javascript function | <p>In my javascript function I am trying to call my global variable that is currently defined in the webconfig file of my Asp.net project. What is the syntax for this? I've looked around and nothing seems to work so far. I've tried the following but I am not getting anything from it:</p>
<p>web.config:</p>
<pre><code><appSettings>
<add key="var1" value="123456"/>
</appSettings>
</code></pre>
<p>default.aspx:</p>
<pre><code><script type="text/javascript">
function doSomething() {"<%= System.Configuration.ConfigurationManager.AppSettings['var1'].ToString(); %>"
};
</script>
</code></pre>
| c# asp.net javascript | [0, 9, 3] |
1,170,283 | 1,170,284 | javascript event when you hit 'back' onto the page? | <p>What event can i use to run code when a user visits another page then hits back to load my page again?</p>
<p>I wrote <code>window.onload = function() { ...</code> and it works when i hit refresh but not forward then back.</p>
| javascript jquery | [3, 5] |
5,607,235 | 5,607,236 | Force jQuery content slider to pause on hover | <p>I would be grateful if someone can help with with some javascript code. I have a content slider which can be found here:-</p>
<p><a href="http://metalbuildinggroup.ca/humphreybuildings/" rel="nofollow">link text</a></p>
<p>This works fine but I would like to change the following code so that it pauses on hover. Any ideas?</p>
<pre><code><script type="text/javascript">
$(document).ready(function(){
$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true);
});
</code></pre>
<p></p>
<p>Thanks in advance of your help.</p>
<p>Kind regards</p>
<p>Jonathan</p>
| javascript jquery | [3, 5] |
1,582,124 | 1,582,125 | JScript error: Cannot assign to a function result | <p>In my application I am trying to hide a table based on a condition.
I am using simple javascript function to hide the table.</p>
<p>the function is failing on the following line</p>
<pre><code>if ((image1.trim() = '') && (image2 != '1')) {
</code></pre>
<p>giving error </p>
<blockquote>
<p>'Microsoft JScript runtime error: Cannot assign to a function result'.</p>
</blockquote>
<p>Here is the code.</p>
<p>Html code:</p>
<pre><code> <table id="tblImage" cellpadding="0" cellspacing="0" style="padding:2px 0px">
<tr>
<td>
<div id="otherImages"></div>
</td>
</tr>
</table>
</code></pre>
<p>Javascript function: </p>
<pre><code>function DisplayTable() {
var image1 = document.getElementById('ctl00_ContentPlaceHolder1_image1').value;
var image2 = document.getElementById('ctl00_ContentPlaceHolder1_image2').value;
if ((image1.trim() = '') && (image2 != '')) {
jQuery('#tblImage').hide();
}
}
</code></pre>
| javascript jquery asp.net | [3, 5, 9] |
2,627,731 | 2,627,732 | Add active state to <li> tag | <p>I am not sure if this is possible. If not I could add an data-state or class, right?</p>
<p>Ok so my first question is... How can I add an active state on hover of <code><li></code> and remove it from previously hovered tag if new one is selected. I assume I need to use siblings for that but how do I make it go to :active I have no clues. If it's not possible any option from above seems fine... I just wanna learn how.</p>
<pre><code>#menubar li {
background: rgba(20, 20, 20, .3);
margin: 10px 0;
padding: 5px 0;
width: 50%;
cursor: pointer;
}
#menubar li:active {
width: 100%;
}
<ul id="menubar">
<li><a href="head.php">Head</a></li>
<li><a href="body.php">Body</a></li>
<li><a href="settings.php">Settings</a></li>
<li><a href="">None</a></li>
<li><a href="">None</a></li>
</ul> <!-- menubar CLOSE -->
</code></pre>
<p>so as mentioned im not sure if it is possible to add active state to <code><li></code> but still I need to ask.</p>
<p>If not something like this is more then welcome.</p>
<pre><code><li data-state="active"></li>
</code></pre>
<p>or</p>
<pre><code><li class="activeItem"></li>
</code></pre>
| javascript jquery | [3, 5] |
2,354,114 | 2,354,115 | In Internet Explorer 7 preview images are not shown | <p>My code is working fine in Firefox and Internet Explorer 6 but Internet Explorer 7 is not showing images.</p>
<p>Here is the code,</p>
<pre><code><script type="text/javascript">
function ShowImage()
{
//document.getElementById('videoupload').valuedocument.getElementById('videoupload').value.replace( "file:///", "")
var img = document.createElement("IMG");
if(document.all)
img.src = document.getElementById('videoupload').value;
else if(window.sidebar)
{
// solution for FF
img.src = document.getElementById('videoupload').files.item(0).getAsDataURL();
}
else
img.src = document.getElementById('videoupload').value;
document.getElementById('show').appendChild(img);
//alert(img.src);
}
</script>
<form name="frmlist" enctype="multipart/form-data" method="post">
Filename: <INPUT type="file" id="videoupload">
<INPUT type="button" id="btn_video" onClick="ShowImage();" value="Upload">
</form>
<div id="show"></div>
</code></pre>
| php javascript | [2, 3] |
5,279,041 | 5,279,042 | Conditionally passing options to a jquery function | <pre><code>$.fn.demo = function(options) {
var defaults = {
opacity: 50,
width: '250px',
height: '100px',
color: 'red'
}
}
</code></pre>
<p><strong>Is there any way to conditionally pass options to a function, like such:</strong></p>
<pre><code>$().demo({
opacity: 60,
if (div.length){
width: '350px'
}
height: '100px'
});
</code></pre>
<p>Just curious what would be the best way to handle a situation where you may want to pass different options depending on circumstances. Thanks!</p>
| javascript jquery | [3, 5] |
150,081 | 150,082 | Calling javascript and C# on button/link click | <p>I currently have a Gridview with a itemTemplate which acts as a link which calls a javascript function:</p>
<pre><code> <ItemTemplate>
<a href="javascript:;" onclick="simpleCart.add( 'name=<%# Eval("Name") %>' , 'price=<%# Eval("Price") %>' , 'quantity=1' );">Add To Cart</a>
</ItemTemplate>
</code></pre>
<p>I need to add some functionality which I can only do in C#, so I was thinking of replacing the link with a button and when the button is clicked it calls both the C# function and the javascript function (they don't need to interact/share any data). Is this even possible?</p>
| c# javascript asp.net | [0, 3, 9] |
3,124,978 | 3,124,979 | Bitmap getWidth returns wrong value | <p>I have a jpg image in my android application drawable folder which resolution is 1000x600.
I load that image to bitmap like this</p>
<pre><code> Bitmap bitMap = BitmapFactory.decodeResource(getResources(), R.drawable.image);
</code></pre>
<p>After this I call <code>bitMap .getWidth()</code> which returns 1500. How it can be? And how to get the right width and height of image?</p>
| java android | [1, 4] |
5,945,059 | 5,945,060 | Javascript Jquery doesn't work. $(this) | <pre><code>$(document).ready(function() {
$(".delete_user_button").click(function(){
var username_to_delete = $(this).attr('rel');
$.ajax({
type:"POST",
url:"/delete/",
data:{'username_to_delete':username_to_delete},
beforeSend:function() {
$(this).val("Removing...");
},
success:function(html){
$("div.delete_div[rel=" + username_to_delete + "]").remove();
}
});
return false;
});
});
</code></pre>
<p>Why doesn't $(this).val() work?
I'm trying to change the text of the button when the user clicks remove.</p>
| javascript jquery | [3, 5] |
1,768,119 | 1,768,120 | JQuery Selector - Finding an img in a table | <p>Cant seem to get the following to find the 'skull' button when the 'heart' button is clicked...</p>
<p>Here is the JQuery...</p>
<pre><code> $(".voteup").click(function() {
var id = $(this).attr("title");
var userID = $('[id$=HiddenFieldUserID]').val();
var ipAddress = $('[id$=HiddenFieldIPAddress]').val();
var skullButton = $(this).parent().siblings(".votedowntd").children("votedown");
registerUpVote("up", id, $(this), skullButton, userID, ipAddress);
});
</code></pre>
<p>And the HTML...</p>
<pre><code> <table width="200px">
<td width="35px" class="votedowntd">
<img src='<%# (bool)Eval("skull") ? "images/skull.png" : "images/skull-bw.png" %>' alt="Vote Down" class="votedown" title='<%# Eval("entry.ID") %>' />
</td>
<td width="130px" style="text-align: center;">
Num Votes Goes Here
</td>
<td width="35px" class="voteuptd">
<img src='<%# (bool)Eval("heart") ? "images/heart.png" : "images/heart-bw.png" %>' alt="Vote Up" class="voteup" title='<%# Eval("entry.ID") %>' />
</td>
<tr>
</tr>
</table>
</code></pre>
<p>So basically what I need to do is when one img is clicked, I need to find the other one. </p>
<p><strong>Why is what I have not working? Is there a better way to do this?</strong></p>
| asp.net jquery | [9, 5] |
1,108,746 | 1,108,747 | When am I ready to start using Jquery for Javascript? | <p>I was told not to use Jquery as a beginner because it would hamper my learning of Javascript. Now I've read a couple books on Javascript, read loads of sites, and made a Javascript web app. Am I ready for Jquery? If not, then how will I know when I'm ready?</p>
| javascript jquery | [3, 5] |
120,067 | 120,068 | javascript: Defining "this" in the context of a function | <p>When jQuery calls a function as an event handler for a raised event, jQuery is somehow able to define "this" in the context of a function that it calls. In the following example, jQuery define this as the dom element that was clicked on.</p>
<pre><code><input id="someButton" type="button" value="click me!"/>
<script type="text/javascript">
$("#someButton").click(EventHandler);
function EventHandler()
{
alert($(this).attr("id")); //This raises an alert message "someButton"
}
</script>
</code></pre>
<p>How does jQuery do this? I would like replicate this behaviour for my own custom framework.</p>
| javascript jquery | [3, 5] |
1,371,216 | 1,371,217 | Is there a way I can get many attributes of an object all at the same time? | <p>I have the following:</p>
<pre><code> link = {
action: $link.attr('data-action') || '',
dialogType: $link.attr('data-dialogType') || '',
params: $link.attr('data-params') || '',
title: $link.attr('title') || '',
viewURL: $link.attr('data-href') || '',
entity: $link.attr('data-entity') || '',
row: $link.attr('data-row')
};
</code></pre>
<p>I am just wondering. Is there a more clean way that I can do this or am I stuck with having to get the attributes like this. </p>
| javascript jquery | [3, 5] |
1,454,386 | 1,454,387 | Creating a generic data editing user control | <p>I have a user control which has a Gridview and a listview, I want to make this control generic so that I can just pass the type of the class I want to edit, which would be a linq entity, and then it would automatically do the rest, so far I havent had any success and I was wondering if anybody knows a tutorial or some info about doing this?</p>
| c# asp.net | [0, 9] |
1,605,569 | 1,605,570 | Remove class using index | <p>This might be easy but I am having trouble in getting it to work. I am using .each() to iterate through a list. I was wondering if it is possible to remove a class using the index.</p>
<p>eg. If there were 10 items in the list and I want to remove the class from the 5th element when I click the 8th element for example.</p>
<pre><code>$(function () {
var items = $('#v-nav>ul>li').each(function (index) {
$(this).click(function () {
if (index = 8)
{
$(#5).removeClass('class');
}
});
});
</code></pre>
<p>Anyone with any ideas? Thank you</p>
| javascript jquery | [3, 5] |
3,798,392 | 3,798,393 | Jquery and PHP rating function problem | <p>I know that I was already posted similar question but I just can't find the answer and figure it out how to solve this problem.</p>
<p>I'm trying to customize Jquery Star Rating plugin (<a href="http://php.scripts.psu.edu/rja171/widgets/rating.php" rel="nofollow">link text</a>) but I do not know what to do to show the message based on response of PHP script.</p>
<p>Jquery script successfully send rating data to PHP scripts that query the database and based on that echo message of proper or improper rating.</p>
<p>What should I add to an existing JS code so I can get echo from PHP and base on that write a message on some DIV beside rating star?</p>
<p>Jquery:</p>
<pre><code>$('#gal').rating('gl.php?gal_no=<?=$gal_no;?>&id=<?=$id;?>', {maxvalue:10,increment:.5, curvalue: <?=$cur;?>});
</code></pre>
<p>Simplified PHP code:</p>
<pre><code>$br=mysql_query("SELECT count(gal) as total FROM ...")
if ... {
echo '0';
}
else echo '1';
}
</code></pre>
<p>Jquery code successfully transmitted data to PHP script and when the PHP done with checking data echo the result ('1' or '0'). How can I get this PHP result back to Jquery and based on them write a message? Something like:</p>
<pre><code>if(data=="1")
{
$("#error").show("fast").html('not correct').css({'background-color':'#F5F5F5','border-color' : '#F69'});
}else{
$("#error").show("fast").html('correct').css({'background-color' : '#FFF','border-color' : '#3b5998'});
}
</code></pre>
<p>If someone has an idea...I would appreciate it.</p>
| php jquery | [2, 5] |
5,901,058 | 5,901,059 | text inputs don't change when option changes | <p>I have a fiddle here: <a href="http://jsfiddle.net/ybZvv/43/" rel="nofollow">http://jsfiddle.net/ybZvv/43/</a></p>
<p>The problem I have is with the text inputs not changing. Please follow steps in fiddle below so you can see what is happening:</p>
<ol>
<li><p>When you open fiddle, click on the "Add Question" button, this will add a table row copying the controls from the top into the table row.</p></li>
<li><p>In the table row click on the "Open Grid" and select button 5. You will see 5 letter buttons appear underneath from A-E.</p></li>
<li><p>Turn on all of the letter buttons by clicking on them (They should turn green to symbolize that the button is turned on)</p></li>
<li><p>You will see right at the bottom of the fiddle that it shows all of the text inputs of each value of the buttons which are turned on. This is fine.</p></li>
<li><p>The problem is here. If you go back into the table row and click on the "Open Grid" link again but this time choose "3", you will see the letters buttons change to A-C. Now letters D and E are not shown so they are turned off. But problem is that if you go to the bottom of the fiddle, the text input form D and E are still shown, they should be removed.</p></li>
</ol>
<p>So my question is: <strong>what needs to be changed in the fiddle so that when the user changes their option type, it only displays the text inputs of those buttons which are still on after option has changed?</strong></p>
| javascript jquery | [3, 5] |
4,865,731 | 4,865,732 | Jquery slide in div keeps moving on scroll | <p>I have aa div that I want to slide in once the user scrolls down a specified amount. It initially works but after than the div keeps moving to the left a little on every scroll action instead of staying in place. Anyone has an idea why is this happening?</p>
<pre><code> var opening = false;
var closing = false;
$(window).scroll(function(){
var windowHeight = $(window).height();
var windowScroll = $(window).scrollTop();
var position1 = $("#Support").offset().top;
if ( windowScroll > (position1 - (windowHeight/2)) )
{
if (!opening) {
opening = true;
closing = false;
$("#SupportImage1").stop().animate({
left: "1200px"
}, 1500, function(){
opening = false;
});
}
}
else
{
if (!closing) {
closing = true;
opening = false;
$("#SupportImage1").stop().animate({
left: "100%"
}, 1400, function() {
closing = false;
});
}
}
});
</code></pre>
| javascript jquery | [3, 5] |
1,015,783 | 1,015,784 | JQuery onchange in tabs event | <p>Does anyone know how to fire an event when I change from one tab to the other in JQuery?</p>
<p>for example:</p>
<pre><code><li><a href="#tab-1" onclick="submitForm();" onchange="myJSHere();">Tab</a></li>
</code></pre>
| javascript jquery | [3, 5] |
1,722,504 | 1,722,505 | Change CSS for parent div when child element (input field) is selected | <p>I'm looking to change the class of a parent div when a child input text field is selected or the mouse moves over any of the other elements in the container. I've tried using both jQuery and some of the pseudo classes in CSS to no avail.</p>
<p>Javascript:</p>
<pre><code>$("input").focus(function () {
$(this).parent().parent("div").css('background-color','#666');
});
</code></pre>
<p>HTML:</p>
<pre><code> <div class="container_to_change">
<div class="box1">
&nbsp;
</div>
<div class="box2">
<input type="text" class="data-entry">
</div>
<div class="box3">
&nbsp;
</div>
</div>
</code></pre>
| javascript jquery | [3, 5] |
511,185 | 511,186 | is it a good idea to put all javascript file's content into one file to reduce server request and keep at bottom to increase performance? | <p>I use simple javascripts, jquery library and many plugins , should i make one file for all if yes then what we need to "just copy and paste and code from all file into one in needed order" or any thing else need to be considerd.</p>
<p>as stated here <a href="http://developer.yahoo.com/performance/rules.html#num_http" rel="nofollow">http://developer.yahoo.com/performance/rules.html#num_http</a></p>
<blockquote>
<p>Combined files are a way to reduce the
number of HTTP requests by combining
all scripts into a single script, and
similarly combining all CSS into a
single stylesheet. Combining files is
more challenging when the scripts and
stylesheets vary from page to page,
but making this part of your release
process improves response times.</p>
</blockquote>
<p>and this <a href="http://developer.yahoo.com/performance/rules.html#js_bottom" rel="nofollow">http://developer.yahoo.com/performance/rules.html#js_bottom</a></p>
<blockquote>
<p>The problem caused by scripts is that
they block parallel downloads. The
HTTP/1.1 specification suggests that
browsers download no more than two
components in parallel per hostname.
If you serve your images from multiple
hostnames, you can get more than two
downloads to occur in parallel. While
a script is downloading, however, the
browser won't start any other
downloads, even on different hostname</p>
</blockquote>
<p>It these are god practices then </p>
<h2>How to combine multiple javascript ito one without getting any conflict?</h2>
<p><strong>Is it just same as i copy all css code from all files into one or it's tricky?</strong></p>
| asp.net javascript jquery | [9, 3, 5] |
2,145,559 | 2,145,560 | Declare variable in C# | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/41479/use-of-var-keyword-in-c">Use of var keyword in C#</a> </p>
</blockquote>
<p>Hi, I am pretty new in C#,</p>
<p>I would like to know the best practices in declaring variables.</p>
<p>I know it is possible to use VAR (explicit declaration) or the DataType when declaring a variable (implicit).</p>
<p>I would appreciate your opinions thanks</p>
| c# asp.net | [0, 9] |
2,149,697 | 2,149,698 | populate document using javascript pattern | <pre><code><table id="session">
<thead>
<tr>
<div class="borderContainer">
<div></div>
</div>
<script type="template" id="thead">
<div class="borderContainer">
<div></div>
<h3>{ColName}</h3>
</div>
</script>
</tr>
</thead>
<tbody>
<script type="template" id="tbody">
<tr>
<td class="row">
<div class="borderContainer">
<div></div>
<h3>Row I</h3>
</div>
</td>
<!--
When the parent pattern is appended to the DOM
populate the table additionally.
-->
</tr>
</script>
</tbody>
</table>
</code></pre>
<p>There are two questions that I really would like two find the answer:</p>
<p>1.How to trigger event that tells me that since this pattern is populated it tells that:
Now the page is ready for a second addition of content.
Or to paraphrase it : How to load dynamically content on two stages without DOM loading events affect the speed?</p>
<p>2.Is there a way to nest patterns or any other approach allowing to load contents dynamically on different levels of document hierarchy on one stage?</p>
<p>10x for your kind help</p>
| javascript jquery | [3, 5] |
753,531 | 753,532 | Why can't I remove an attribute of all children? | <p>I have a cloned div containing input elements, all of which are disabled. I am trying to use the following JQuery code to remove the disabled attribute of each of the div's children.</p>
<pre><code>clonedElement.children().removeAttr('disabled');
</code></pre>
<p>I do not have a ton of JQuery experience, so I am probably misunderstanding the way this is supposed to work. How should I be going about removing the "disabled" attribute from all children of the cloned node?</p>
<p>If it helps, clonedElement was created with the JQuery .clone() method.</p>
<p>HTML I AM USING TO TEST---</p>
<pre><code> <div id="original_item" class="hidden">
<div class="row_submit">
<div class="med_field">
<p>Product:</p>
<select name="product[]">
<option></option>
</select>
</div>
<div class="small_field">
<p>Type:</p>
<select name="type[]">
<option></option>
</select>
</div>
<div class="small_field">
<p>Price:</p>
<input type="text" name="price[]" value="test" disabled="disabled" />
</div>
<div class="small_field">
<p>Quantity:</p>
<input type="text" name="quantity[]" />
</div>
<img onclick="removeItem(this);" title="Remove Item" style="margin: 18px 0 0 12px;" src="icons/cancel.gif" />
</div>
<input type="hidden" name="warehouse_data[]" />
</div>
</code></pre>
| javascript jquery | [3, 5] |
1,849,735 | 1,849,736 | Execute function every nth second | <p>Total JavaScript n00b question right here:</p>
<p>I've made this snippet that clicks a link after 10th second:</p>
<pre><code>function timeout() {
window.setTimeout(function() {
$('img.left').click();
}, 1000);
setTimeout("timeout()", 1000);
}
timeout();
</code></pre>
<p>My question is, how do I execute this function every 10th second, instead of just once?</p>
<p>Is this the best way to do this, or is there some kind of nifty jQuery method that you prefer?</p>
| javascript jquery | [3, 5] |
150,056 | 150,057 | Extending a UserControl | <p>I would like to extend a usercontrol by another user control. </p>
<p>Say I have a user control A - Which displays text - "Control A"</p>
<p>User control B : A and displays "Control B". </p>
<p>When I load user control B, dynamically, only "Control B" is written on the page. </p>
<p>Im using the following code to load them dynamically:</p>
<pre><code>B myControl = (B)Page.LoadControl("~/UC/B.ascx");
myPage.Controls.Add(myControl);
</code></pre>
<p>Here's the code for the user control B:</p>
<pre><code><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="B.ascx.cs" Inherits="A" %>
<div>Control B</div>
</code></pre>
<p>Any ideas, what I might be doing wrong? </p>
| c# asp.net | [0, 9] |
2,002,897 | 2,002,898 | how to open android Music Player using Jquery,html5 | <p>i am developing an application using html5,jquery which opens android builtin musicplayer.
but i dont know the code to how to open the player.</p>
<p>i tried many things in jqery file like this:</p>
<pre><code>function music()
{
window.open("Music_player:");
}
function music(){
window.open("MediaStorage:");
}
function music(){
window.open("Music");
}
function music(){
window.open("Media");
}
</code></pre>
<p>but nothig is worked.please help me.</p>
| android jquery | [4, 5] |
2,005,134 | 2,005,135 | ASP.Net conditional databinding | <pre><code><% if(Convert.ToInt32(Eval("NbrOrders"))>=Config.MAX_ENQUIRY_SALES) { %>
...
<% } else { %>
...
<% } %>
</code></pre>
<p>Gives me a InvalidOperationException? How do I write conditional html generation in ASP?</p>
| c# asp.net | [0, 9] |
740,570 | 740,571 | Checkbox to Control Button Enabled Property - ASP.NET | <p>I would like to know how I can control the 'Enabled' property of a button based on the 'checked' value of a checkbox:</p>
<pre><code><asp:CheckBox ID="chkEnableButton" runat="server" />
<asp:Button ID="btnLoadForm" runat="server" />
</code></pre>
<p>I can do this very easily on the server side - but I require this to be done on client side only, meaning JavaScript. Would the OnCheckedChanged attribute allow me to call some JavaScript to do this....or is it strictly for calling a handler in the code-behind?</p>
<p>Just to clarify, when the checkbox is checked, the button is enabled... when the checkbox is unchecked the button is disabled.</p>
| c# asp.net javascript | [0, 9, 3] |
4,543,834 | 4,543,835 | Using JQuery/Javascript arrays to form two sided fading layout | <p>When I do sites for clients I constantly get the request to have a two sided layout, where buttons on the left cause divs on the right to fade in and fade out appropriately. For a long while I've been writing each case. (which is a bit silly and time consuming). I want to systematize that, but I've been having a hard time since I don't understand how javascript/jquery works with .click() and arrays.</p>
<pre><code>$(document).ready(function(){
var left = new Array($('#a'),$('#b'), $('#c'),$('#d'), $('#e'));
var right = new Array($('#1'),$('#2'),$('#3'),$('#4'),$('#5'));
// left[0].click(function(){right[0].fadeIn('fast');})
var numbers = new Array(1,2,3,4,5);
function fadey(x){
left[x].click(function(){
right[x].fadeIn('fast');
})
}
for (var i = 0; i < left.length; i++) {
fadey(i);
};
})
</code></pre>
<p>This code gets it so that the left hand side buttons cause the corresponding right hand div to appear. The problem is that I can't seem to get the other divs to disappear without causing all the divs to disappear.</p>
<p>Ideally it would be dope if I could have one line of code that simply checks when the left-hand jquery object array is clicked, gets its index value, and causes the corresponding right hand side jquery object array to appear, while also hiding the other ones.</p>
<p>This way I can just plug elements into each array and then never have to worry about writing these cases one by one. </p>
<p>Thank you so much for your help! </p>
| javascript jquery | [3, 5] |
5,489,321 | 5,489,322 | Android Drag, Pinch Scale, and Rotate Objects | <p>Does anyone have a resource or suggestion on how to learn how to do pinch scale, drag/pan, and rotation of objects on Android. I have completed an app for iOS and all of these features were seamless integrated, but I'm not sure where to start with Android.</p>
<p>The purpose of the app is to simply drag images from a menu onto a "canvas" and rotate/scale those images.</p>
<p>Do I use a surface view and simply drag on ImageViews? Does Android have pre built gestures (like pinch)? How do I work with the point coordinate system to have objects move where the finger is touching? </p>
<p>Could someone point me in the right direction so I can learn how to do this?</p>
| java android | [1, 4] |
1,681,222 | 1,681,223 | Embed a windows media player in a web page during runtime in c# and asp.net | <p>i want to embed windows media player in my own created web page. can any one please guide me how can i do it in c# and Asp.net. that also should be supported in all browsers.</p>
<p>Thanks in advance,
Arun</p>
| c# asp.net | [0, 9] |
5,461,043 | 5,461,044 | Jquery related problem | <p>I have only one button and I mention what to do when user click on the button with the help of jQuery. but when I click then nothing happen just only postback happen. I don't want a postback.</p>
<p>Here is my code:</p>
<pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="BBAWeb.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.6.2.min.js" type="text/javascript"/>
<script type="text/javascript">
$(document).ready(function () {
$('#btn').click(showMessage);
return false;
});
function showMessage() {
$('#message').fadeIn('slow').html("Hello");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="btn" runat="server" Text="Click Me" />
<div id="message">welcome to kolkata</div>
</div>
</form>
</body>
</html>
</code></pre>
<p>Please see my code and tell me what is wrong in it. I would like a suggestion.</p>
| jquery asp.net | [5, 9] |
5,984,340 | 5,984,341 | How do I get the value of an input field with jQuery | <p>I am trying to set the inner html value of a field and that works fine but when I try to retrieve it it fails.</p>
<p>My code:</p>
<pre><code> var butId = buttonPressed.getAttribute('id');
$('#will'+butId).remove();
$('#hidDelete').html(butId); //THIS WORKS FINE
var temp = $('#hidDelete').html(); //THIS DOESNT
alert (temp); //THIS PRINTS NOTHING
</code></pre>
<p>My input field:</p>
<pre><code> <input id="hidDelete" type="hidden" name="hidDelete"/>
</code></pre>
<p>Can anyone see whats wrong with it?</p>
| javascript jquery | [3, 5] |
4,348,409 | 4,348,410 | Suppose I have this HTML code...how do I bold the text inside onclick? | <pre><code><a href="" onclick="runstuff();return false;">Item</a>
</code></pre>
<p>After executing runstuff(), I want to use JQuery to make Item <strong>bold</strong>.
Will I need an "id"? What about "self"?</p>
| javascript jquery | [3, 5] |
1,978,033 | 1,978,034 | Resetting countdown in javascript | <p>I want after user typing every time in input run resetting countdown, i add <code>clearTimeout</code> but it don't work. What do i do? (Please help me in my code, i don't want new code.)</p>
<p><strong>DEMO:</strong> <a href="http://jsfiddle.net/qySNq/" rel="nofollow">http://jsfiddle.net/qySNq/</a></p>
<p>Html:</p>
<pre><code><input id="MizMah">
<div id="Seconds" style="font-size: 80px;">5</div>
</code></pre>
<p><br>
Js code:</p>
<pre><code>$('#MizMah').live('keyup', function () {
function render(n) {
var digits = [],
r;
do {
r = n % 10;
n = (n - r) / 10;
digits.unshift([r].join(''));
} while (n > 0);
$('#Seconds').html(digits.join(''));
}
(function timer(current) {
render(current);
if (current > 0) {
myTimeout = setTimeout(function () {
timer(current - 1);
}, 1100);
clearTimeout(myTimeout);
}
}(5));
})
</code></pre>
| javascript jquery | [3, 5] |
3,584,122 | 3,584,123 | Calling a Function From a String With the Function’s Name in C++ | <p>How can I call a C++ function from a string?</p>
<p>Instead of doing this, call the method straight from string:</p>
<pre><code>void callfunction(const char* callthis, int []params)
{
if (callthis == "callA"
{
callA();
}
else if (callthis == "callB")
{
callB(params[0], params[1]);
}
else if (callthis == "callC")
{
callC(params[0]);
}
}
</code></pre>
<p>In C# we'd use typeof() and then get the method info and call from there... anything we can use in C++? ~ Thanks!</p>
| c# c++ | [0, 6] |
2,632,989 | 2,632,990 | timedout function in jquery | <p>What is the timed out function in jquery ?</p>
<pre><code>setTimeout("searchClusterAction(action)",3000);
function searchClusterAction(action)
{
var url = action
$(location).attr('href',url);
}
</code></pre>
<p>on using timedout I'm getting error on line2</p>
<pre><code>var action = "/search/perform/1584/xyz/["1","2","3","4,5,6"]/json
setTimeout('searchClusterAction('+action+')',3000);
</code></pre>
| javascript jquery | [3, 5] |
1,572,703 | 1,572,704 | How to use the .on() in jquery with multiple event handlers? | <p>here is my current function:</p>
<pre><code>$('.EmailAddresses').on('keypress', 'focusout', $('input:text[name^="Customers[0].EmailAddresses"]'), function (e) {
emailRadioBtns(e);
});
</code></pre>
<p>But this is not working. Does anyone know how to call the same function with multiple events using the .on()?</p>
| javascript jquery | [3, 5] |
3,223,482 | 3,223,483 | What is the best way to keep track of the id of an element selected from an auto-suggest textbox? | <p>I have an auto-suggest textbox. A user can either pick an already existing item in the database of type in a new one.</p>
<p>How do i keep track of the id if item was selected (Store the id of the list of items coming from the db)?</p>
| javascript jquery | [3, 5] |
2,551,942 | 2,551,943 | How to restore the sms backup taken to sms.db in android | <p>I have taken the backup of all sms in inbox.After that I stored the backup in JSON format in the SD card creting a file SMSJSON.txt. Now I am reading the file from the SD card and parsing the data successfully, but how to write those data again to sms.db . Plz guide me. Thanks in advance... </p>
| java android | [1, 4] |
1,802,470 | 1,802,471 | hide on second click | <p>I have a bubble that pops up when you select some text on a document. Now when you select some text, the body click event fires too. On body event, I have code to hide the bubble that pops up when you select some text. The problem is, I want to show the bubble when the text is selected (even though body event has fired) but I want to hide it when clicked anywhere except inside the bubble.</p>
<pre><code>$('body').live('click', function(e) {
if($(e.target).parents('.discuss').length == 0) {
$('.discuss').fadeOut(150);
}
});
</code></pre>
<p>... there is the body event code, now the discuss bubble shows up when some text is selected on the body, the discuss bubble is positioned near the selected text </p>
| javascript jquery | [3, 5] |
4,797,879 | 4,797,880 | Jquery Frontier Calendar | <p>I'm using <a href="http://code.google.com/p/jquery-frontier-calendar/downloads/list" rel="nofollow">Frontier Jquery Calendar</a>. This calendar is using for creating events/agenda. Now I want when user create event from calendar, then these event store in DB. I don't do how to do that. Any one can guide me? thanks,</p>
| php jquery | [2, 5] |
4,275,190 | 4,275,191 | Is there such a thing as 'if (!Page.IsPostBack)' in jQuery or javascript? | <p>Is there a way to detect if when the page loads it is a postback or just the page loading?</p>
| javascript jquery asp.net | [3, 5, 9] |
3,613,174 | 3,613,175 | What is the most efficient way to include many javascript functions (with PHP in them) in a PHP page? | <p>In one of my sites, I need to use PHP 'foreach' to keep including some Javascript code. In this code contains PHP $variables that change within the foreach loop. </p>
<pre><code>foreach ($a as $b) {
include("javascript.php");
}
</code></pre>
<p>javascript.php contains codes like this: </p>
<pre><code><script>
$(".<?php echo $somevariable?>").something;
</script>
</code></pre>
<p>My question is: What is the most efficient (if any) way to load javascript that contains PHP variables?</p>
<p>I keep reading that it's better to call large javascript codes in a .js script rather than writing it on the page, But apparently .js files can not have PHP.</p>
<p>Thanks for your insight.</p>
| php javascript | [2, 3] |
4,256,957 | 4,256,958 | finding if the selected item is in a set | <p>I am using a bit of jquery and javascript mashed up in this weird hodgepodge of code.</p>
<pre><code>var SELECTED_ELEMENT; //this ends up being a JS array of ELEMENTS like the following line.
SELECTED_ELEMENT.push($(this).closest(".draggable"));
//Now i wanted to select stuff
$(".draggable").click(function(){
var found = 0;
for (var i = 0; i < SELECTED_ELEMENT.length; i++){
if(SELECTED_ELEMENT[i] == this){
found = 1;
}
}
if(found == 1){
alert("yep");
}else{
alert("nope");
}
});
//this doesnt seem to do what i want.
</code></pre>
<p>The question at hand is that this is never returning true, even when it is. I was just trying to find a way to in javascript search the array for it. You would think that a simple search through the array would figure it out, but possibly an improper reference to 'this'</p>
| javascript jquery | [3, 5] |
4,525,458 | 4,525,459 | Handling page-specific JavaScript in PHP header files | <p>When designing a website in PHP, you typically have a <code>header.php</code> file that you include in every page on the site. The <code>header.php</code> file would include the <code><head></code> tag (among other things). However, I often find that I need to put page-specific JavaScript within the <code><head></code> tag.</p>
<p>The way I've handled this in the past is by adding IF statements to my header to determine what pieces of JavaScript should be outputted (i.e. IF this is the <em>home</em> page, output the JavaScript needed for the <em>home</em> page, IF this is the <em>about</em> page, output the JavaScript needed for the <em>about</em> page, etc.).</p>
<p>This is probably a terrible way to do it. What is the standard practice?</p>
| php javascript | [2, 3] |
5,332,311 | 5,332,312 | How can I get returned value from JavaScript function that contain jQuery.get()? | <p>I have a JavaScript method that call JQuery.get() and i want to return value from itto callee function .. the following is the code :</p>
<pre><code>function CheckExistance(userName) {
$.get(
"JQueryPage.aspx", { name: userName },
function(result) {
if (result == "1") {
value = true;
}
else if (result == "0") {
value = false;
}
else if (result == "error") {
value = false;
}
}
);
return value;
}
</code></pre>
<p>i want <code>return value;</code> return the value setted in <code>get()</code> function ... i know that <code>get()</code> is asynchronous operation anf i want a solution to do that ?</p>
| javascript jquery | [3, 5] |
889,943 | 889,944 | Android [string array] cannot be resolved or is not a field | <p>I'm getting an error about a string array (located in <code>strings.xml</code>) not being able to be resolved.</p>
<p>I've done everything the internet says:</p>
<ol>
<li>Restarted Eclipse</li>
<li>Deleted my R.java file inside the <code>gen</code> folder</li>
<li>My <code>values</code> folder is still inside the <code>res</code> folder, not moved</li>
<li>None of my XML files have erros</li>
<li>Ran <code>Project -> Clean</code></li>
<li>I don't have <code>android.R</code> imported in my class.</li>
<li>Checked the <code>R.java</code> class, it indeed doesn't have an <code>app_categories</code> property (my array's name)</li>
</ol>
<p>The relevant part of the XML:</p>
<pre><code><string-array name="app_categories">
<item >Cat 1</item>
<item >Cat 2</item>
<item >Cat 3</item>
<item >Cat 4</item>
<item >Cat 5</item>
<item >Cat 6</item>
<item >Cat 7</item>
<item >Cat 8</item>
<item >Cat 9</item>
</string-array>
</code></pre>
<p>The Java code:</p>
<pre><code>String[] categoryNames = getResources().getStringArray(R.string.app_categories);
</code></pre>
<p>All my other strings are visible. I have another array defined just like this one, and that one isn't visible either.</p>
<p>Exact error below:</p>
<pre><code>app_categories cannot be resolved or is not a field [class_name].java [path] line 45 Java Problem
</code></pre>
| java android | [1, 4] |
4,202,561 | 4,202,562 | How to perform multiple page hyperlink clicks with ctrl key | <p>I would like to know how (if there's a way) to handle multiple link clicks via the ctrl key.</p>
<p>So for example the user would go to a web page with about 3 hyperlinks on it. Then the user would hold down the ctrl key, then click one link then another. Then when the ctrl key is released, an event will occur (maybe a search based on the combination of both hyperlinks' values).</p>
<p>I am using C# and assume the solution will probably be done in jQuery?</p>
<p>The selection should work similar to how windows explorer does. Where you hold down the ctrl key, then select a file, then another and then cut or paste it somewhere.</p>
<p>I appreciate any help that you could provide as I am struggling to find help elsewhere.
M </p>
| c# javascript jquery asp.net | [0, 3, 5, 9] |
5,693,994 | 5,693,995 | Javascript, jQuery pattern to create HTML document | <p>I'm not sure if I'm asking the right question or not. But my application heavily relies on Javascript and jQuery to create HTML document. So I have a lot of this "jQuery(") and then a lot of div.attr("id","123"). </p>
<p>So, is there a better way to do this, or some design pattern to deal with this? </p>
<p>Thanks a lot. </p>
| javascript jquery | [3, 5] |
5,917,589 | 5,917,590 | If statement not triggering alert box | <p>I am trying to create a if statement that triggers a alert box if there is text in the div.</p>
<p>My Jsfiddle: <a href="http://jsfiddle.net/D7cPT/21/" rel="nofollow">http://jsfiddle.net/D7cPT/21/</a></p>
<p>My HTML:</p>
<pre><code><div id="post-preview">aasasdasd</div>
</code></pre>
<p>MY JQUERY:</p>
<pre><code>$(document).ready(function() {
// Bind it to some action.
if{$('#post_body_html').html();) {
alert('asdasda');
}
});
</code></pre>
| javascript jquery | [3, 5] |
3,105,381 | 3,105,382 | I need to condense this javascript code | <p>I need to get the javascript code below to work with any of the following links:</p>
<pre><code><a href="#" class="example1">http://example.com</a>
<a href="#" class="test">Doesnt work now</a>
</code></pre>
<p>The code that is displayed after the link is clicked:</p>
<pre><code><div style='display:none'>
<div id='example1' style='padding:10px; background:#fff;'>
<a href="http://example.com" target="_blank">Link</a>
</div>
</div>
</code></pre>
<p>The javascript code I need condensed to work with any class/id values I give:</p>
<pre><code><script>
$(document).ready(function(){
$(".example1").colorbox({width:"50%", inline:true, href:"#example1"});
$(".example2").colorbox({width:"50%", inline:true, href:"#example2"});
$(".example3").colorbox({width:"50%", inline:true, href:"#example3"});
$(".example4").colorbox({width:"50%", inline:true, href:"#example4"});
$(".example5").colorbox({width:"50%", inline:true, href:"#example5"});
});
</code></pre>
<p></p>
| javascript jquery | [3, 5] |
1,820,907 | 1,820,908 | clone table row, append random or sequential number to ID | <p>So i have this code</p>
<pre><code>$('input.clone').live('click', function(){
//put jquery this context into a var
var $btn = $(this);
//use .closest() to navigate from the buttno to the closest row and clone it
var $clonedRow = $btn.closest('tr').clone();
//append the cloned row to end of the table
//clean ids if you need to
$clonedRow.find('*').andSelf().filter('[id]').each( function(){
//clear id or change to something else
this.id += '_clone';
});
//finally append new row to end of table
$btn.closest('tbody').append( $clonedRow );
});
</code></pre>
<p>Problem is, each row i clone gets named whatever _clone
How would i write this so that each time i run the function, it picks either a random or more idealy sequential number to append to the id isntead of "_clone"</p>
| javascript jquery | [3, 5] |
5,656,460 | 5,656,461 | Intent new Instance private variable | <p>when I use
<code>intentMap.putExtra ("id", id). addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP)</code> -
I have a new instance of my class IntentMap and lose all the private variables.</p>
<pre><code>public class MapaActivity extends MapActivity {
...
private ArrayList<Wplatomat> list; //null
@Override
public void onCreate(Bundle savedInstanceState) {...}
...
}
</code></pre>
<p>Can I use the same instance always?
I do not want every time to send my list //ArrayList//</p>
| java android | [1, 4] |
2,439,337 | 2,439,338 | iPhone & Android: how to take a picture and upload it to a website? | <p>I'm building an asp.net website using c# and .net 2.0. One of the pages requires to take a picture (or choose from already existing pictures), upload it to the server, add other info and save everything in the database.</p>
<p>I'm using a FileUpload control and everything is working fine on a PC.</p>
<p>Android gives me the options to choose a file from Gallery, File system, Music Track etc. but there is no option to take a picture from the camera.
The FileUpload control is disabled in iPhone.</p>
<p>I want to click on a button or use something else and be able to choose to upload an image from the gallery or start the camera and take one. Is there a way to do it?</p>
<p>Thanks!</p>
| c# android iphone asp.net | [0, 4, 8, 9] |
3,838,761 | 3,838,762 | validation of an 8 digit number | <p>I want to validate for a number in jquery . my requirement is first two digits and 3rd digit must be 9 and remaining 5 are digits.`</p>
<pre><code><div>
number: <input type="text" class=' posint-numeric' id="number" />
</div></span>
</code></pre>
| javascript jquery | [3, 5] |
3,836,516 | 3,836,517 | What is the best way to validate that a specific option has been selected in an asp:ListBox? | <p>I have an asp:ListBox that contains multiple values. A user is required to always select one specific item in this box as well as optionally selecting others.</p>
<p>What is the best way to do this?</p>
<p>Thanks in advance!</p>
| c# asp.net | [0, 9] |
2,085,380 | 2,085,381 | From the last slide to the first slide with slideUp/slideDown | <p>I made my slider but it's acting wierd when it reach the last slide and have to start again on the first. Until getting to the last slide it slides <strong>upwards</strong>, but when it has to go to the first it does it <strong>downwards</strong>. And it kind a misses the first one. I mean - it shows it (even downwards), but on my pagination dots it doestn't add class .selected to the first one. After that it acts normally again until the next cycle.</p>
<p>Why is that two things happening. I've tried to change the <code>if(active_slide.index() == last_slide.index())</code> with <code>if(active_slide.next().length == 0)</code> /and <code><</code> /; <code>if(active_slide.is(last_slide))</code> ... it didn;t help.</p>
<p>Here is jsfiddle <a href="http://jsbin.com/iwiroq/4/edit" rel="nofollow">http://jsbin.com/iwiroq/4/edit</a>.</p>
| javascript jquery | [3, 5] |
724,532 | 724,533 | ajax "busy" indicator but only for longer requests | <p>Is it possible to specify time after which I can show busy indicator?</p>
<p>My code for busy indicator is quite simple:</p>
<pre><code>jQuery.ajaxSetup( {
beforeSend:function ()
{
jQuery( "#busy-indicator" ).show();
}, complete:function ()
{
jQuery( "#busy-indicator" ).hide();
}
} );
</code></pre>
<p>But often Ajax request is faster then appearing indicator, therefore I'd like to show it for request which take lets say at least 1 second, is it possible? Or Do you have idea how to do it?</p>
| javascript jquery | [3, 5] |
5,565,499 | 5,565,500 | Cannot save data from pop window to database | <p>I have a screen from which a user can click on a button that brings up a popup
window. When the user clicks on save from the pop up window, the data is to be
save. It doesn't save anything, it is as if it does not see the database. This cannot be because I'm able to call data from it and display it.</p>
<p>jQuery on user page:</p>
<pre><code>$(".up").click(function(){
var code = '1234';
var id = '24';
var who = 'someone';
$("#ui").html('loading...').show();
var url = "box.php";
$.post(url, {code: str, g:id, u:who} ,function(data) {
$("#ui").html(data).show();
});
});
</code></pre>
<p>php on popup bx:</p>
<pre><code>//link db {...........}
// grab post
$click = $_POST[code];
$id = $_POST['g'];
$u = $_POST['u'];
// query php {........}
</code></pre>
<p>jQuery on popup box:</p>
<pre><code>$("#process").click(function(){
var ID = '24';
var who = "someone";
var pla = "place";
$.ajax({
type: "POST",
url: "member.php", //contains function
data: 'user='+ who+ '&dept='+ pla+ '&sure='+ ID,
cache: false,
success: function(html) {
//do something
}
});
});
</code></pre>
<p>When I hit submit it doesn't post to the database. Maybe it's not passing the data to the member.php page.</p>
| php jquery | [2, 5] |
4,149,629 | 4,149,630 | Pass option text instead of option value to a text field | <p>I will pass value for multiple fields to a text field. There is a problem, select options, its value are 0 and 1, my question is how to make sure that it pass option text instead of 0 and 1? That mean pass MYR instead of 0 and SGD instead of 1?</p>
<p><a href="http://jsfiddle.net/e2ScF/64/" rel="nofollow">http://jsfiddle.net/e2ScF/64/</a></p>
<p>HTML:</p>
<pre><code><select id="Salary_para1">
<option value="">Choose...</option>
<option value="0" selected>MYR</option>
<option value="1" >SGD</option>
</select>
<input id="Salary_value" type="text"/>
+ <input type="checkbox" id="Salary_para2" name="Salary_para2" value=" + Allowance" />Allowance<br/>
<input type="text" id="targetTextField" name="targetTextField" size="31" tabindex="0" maxlength="99" value="">
</code></pre>
<p>CODE:</p>
<pre><code>$(function() {
setTarget();
$("#Salary_para1,#Salary_para2").change(setTarget);
$("#Salary_value").keyup(setTarget);
function setTarget() {
var tmp = $("#Salary_para1").val();
tmp += $("#Salary_value").val();
tmp += $("#Salary_para2:checked").val() || '';
$('#targetTextField').val(tmp);
}
});
</code></pre>
| javascript jquery | [3, 5] |
4,812,468 | 4,812,469 | Importing multiple XML files that have varying fields - check isset() or some Java equiv? | <p>I'm importing multiple XML files that have the same tag names, but some of the files are without a few of the tags.</p>
<p>My imports work great for all files that have every "field" (ie <code><title></title></code>), but I get <code>java.lang.NullPointerException</code> when I try to set a value of my class to an item that doesn't exist in the XML file.</p>
<p>For example:</p>
<pre><code>for(NewsItem item : parser.getParsedItems())
{
Article a1 = new Article();
a1.title = item.title.trim();
a1.subtitle = item.subhead.trim();
//...
}
</code></pre>
<p>This works great for most, but if one of them doesn't have a "subhead" tag, then I get the error.</p>
<p>Is there some way I can check IF it's been set or has value prior to trying to set it to the "title" value of my Article? (as an example).</p>
<p>I tried <code>if(!item.title.isEmpty())</code> but that still gives the error.</p>
<p>(or is there a better way that I'm overlooking?)</p>
| java android | [1, 4] |
713,911 | 713,912 | Calling a javascript function from Page_Load in code-behind | <p>How can I call a javascript function, that is in the aspx page, from the Page_Load method, in the code-behind?</p>
| c# asp.net javascript | [0, 9, 3] |
4,081,472 | 4,081,473 | Android adding Listener with resources to many buttons | <p>I have a very weird problem with my Android project. I have a 2d array of buttons and i am trying to add action listener to those. So this is what i have:</p>
<pre><code>for ( i = 0; i<buttons.length;i++)
{
for ( k = 0; k<buttons[i].length;k++)
{
String but = "mtp" + i + k;
buttons[i][k] = (Button)v.findViewWithTag(but);
if (k%2 == 0)
{
buttons[i][k].setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
text.setText(words[w]);
w++;
}
});
}
else
{
buttons[i][k].setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
int res = getResources().getIdentifier(icons[p],"drawable", getPackageName());
buttons[i][k].setBackgroundResource(res);
p++;
}
});
}
}
}
</code></pre>
<p>The weird thing is that my first action Listener works fine. It changes the TextView correctly. But the second one crashes my app. Moreover when i set an action listener not in a loop but outside of it like:</p>
<pre><code>buttons[0][1].setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
int res = getResources().getIdentifier(icons[p],"drawable", getPackageName());
buttons[0][1].setBackgroundResource(res);
p++;
}
});
</code></pre>
<p>It works just fine.
What do i do? How can i fix this?</p>
| java android | [1, 4] |
3,184,314 | 3,184,315 | Refresh child window on parent window | <p>how can i refresh child page if parent window reloads? </p>
<p>Suppose <strong>A.html</strong> has a link that opens <strong>B.html</strong>. <strong>B.html</strong> will automatically refresh if <strong>A.html</strong> reloads.</p>
<p>Any javascript/jQuery way?</p>
| javascript jquery | [3, 5] |
5,256,348 | 5,256,349 | passing values to pages | <p>What i am trying here is to pass values to other pages. When i include the following code</p>
<pre><code>private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("WebForm5.aspx?Name="+txtName.Text);
}
if (Request.QueryString["Name"]!= null)
Response.write( Request.QueryString["Name"]);
</code></pre>
<p>everything works fine the name gets displayed. Now if use <strong>MemberId</strong> instead, though i can see the Id in the Url, but while checking for Null in other page, its true i.e.
if (Request.QueryString["MemberId"]!= null)
Response.write( Request.QueryString["MemberId"]); doesnt gets printed. Whats wrong??</p>
<p>Now I tried the same thing using session i.e.</p>
<pre><code>Session["MemberId"] = this.TxtEnterMemberId.Text;
if (MemberSex.Equals("M"))
Response.Redirect("PatientDetailsMale.aspx",false );
</code></pre>
<p>Page_load event of the other page</p>
<pre><code>if (Session["MemberId"] != null)
mid = Session["MemberId"].ToString();
</code></pre>
<p>IT Works..Could u guys explain the behaviour please?</p>
<p>P.S. Can anyone give a breif in layman words about SessionId and its usage.</p>
<p>Thanking you,</p>
<p>Indranil</p>
| c# asp.net | [0, 9] |
5,000,348 | 5,000,349 | Something is overriding some of my jigoshop widgets | <p>I'm creating my first eCommerce wordpress website which I have work on for weeks now, I'm nearly at finished but some of the jigoshop widgets and features are not working for example the price filter is not showing up and the fancy box feature isn't showing up too.</p>
<p>I have a demo of the site up at <a href="http://demo.remi-niscenthair.com/shop/" rel="nofollow">http://demo.remi-niscenthair.com/shop/</a> I would be very grateful for any advice on how to get these issues sorted. </p>
| php jquery | [2, 5] |
67,782 | 67,783 | Reconcile Firefox slash handling and key codes | <p>I have a webpage where users should be able to type anywhere and have their input tracked. One problem is that the slash key, "/," in firefox is a shortcut for opening the search. This is undesirable for me. I have not found a way to trap the search functionality <em>and</em> still add the input to my tracking. I add the input to the stack on <code>keypress</code>.</p>
<p><code>keydown</code>...<code>preventDefault</code> works best in FireFox, but the problem is that in Chrome, <code>keypress</code> does not fire for some reason (not sure why <code>preventDefault</code> would stop that, but it does). This would be okay if I could add the slash on my own to the input stack..but Firefox is already adding it because <code>keypress</code> is still triggered. <code>stopPropagation</code> does not prevent <code>keypress</code> from triggering in FireFox either. <code>$(document).keypress(e)</code> in the <code>keydown</code> method also does nothing.</p>
<p>Another issue I have is that "backspace" is supposed to remove from the stack, but I add to the stack with <code>String.fromCharCode(e.which)</code> and add the data to an <code>input type="text"</code> field that the user can see. In Chrome this works perfectly, but in FireFox, it adds a character representing the backspace and then immediately removes it, preventing another character from being removed. Having "backspace" and "f5," etc. characters in the input is also undesirable. Is there a way to tell if the <code>fromCharCode</code> value is valid for a text field? I think what's happening is that Chrome just does that automatically.</p>
<p>EDIT: This may help, but FireFox apparently triggers <code>keypress</code> before <code>keydown</code> (Chrome does the opposite) on my webpage. This is unusual.</p>
| javascript jquery | [3, 5] |
944,912 | 944,913 | sliding the divs accroding to url | <p>I am having a page here.</p>
<p><a href="http://www.kharota.com/cantsay/index.html" rel="nofollow">http://www.kharota.com/cantsay/index.html</a></p>
<p>What I wanted was to div slide up and down as url changes for example index.html#thisweek will slide the div which contains data of this week. Sometimes it works sometimes its not. I am big confused there is no error but still not working. The code is following</p>
<pre><code>var loc = window.location.href;
if(loc.indexOf( '#' ) >= 0 ) {
var hash = loc.substr( loc.indexOf('#') + 1 );
}else{
var hash = "";
}
if(!hash){
$("#ca").slideDown("fast");
}else{
switch(hash){
case "iwantagig":
$("#cd").slideDown("fast");
$("#ca").slideUp("fast");
$("#cb").slideUp("fast");
$("#cc").slideUp("fast");
break;
case "jointhecrew":
$("#cc").slideDown("fast");
$("#ca").slideUp("fast");
$("#cb").slideUp("fast");
$("#cd").slideUp("fast");
break;
case "birthdayGuestlist":
$("#cb").slideDown("fast");
$("#ca").slideUp("fast");
$("#cc").slideUp("fast");
$("#cd").slideUp("fast");
break;
case "thisweek":
$("#ca").slideDown("fast");
$("#cb").slideUp("fast");
$("#cc").slideUp("fast");
$("#cd").slideUp("fast");
break;
}
}
</code></pre>
<p>The page is here. I would be thankful if someone help.</p>
<p><a href="http://www.kharota.com/cantsay/index.html" rel="nofollow">http://www.kharota.com/cantsay/index.html</a></p>
| javascript jquery | [3, 5] |
4,625,164 | 4,625,165 | How to refer to currently selected element in jQuery? | <p>I'm trying to make a script that would insert <code>img</code> element after each link to a certain site with source equal to value of <code>href</code> attribute of given link. This is what I came up with:</p>
<pre><code>$("a[href*=site.com/img/]").after("<img src="+$(this).attr("href")+">");
</code></pre>
<p>Problem is, <code>$(this)</code> doesn't work (attr() returns <code>undefined</code>). Why is it? How to refer to selected link and its argument <code>href</code>?</p>
| javascript jquery | [3, 5] |
4,202,050 | 4,202,051 | how to create a gui using extended java script? | <p>how to create a gui using extended java script?</p>
| java javascript | [1, 3] |
1,771,067 | 1,771,068 | call iframe function from parent window | <p>How to call a javascript function in ifram from parent window.
i have a jsp page which contains an iframe.
jsp page is served by "a.yenama.net" server and iframe is served "b.yenama.net" server.</p>
<pre><code><iframe width="1200" height="640" name="data" id="dataId" >
</iframe>
<br/>
<input type="button" name="data" value="Save data" onclick="callSaveData();" />
</code></pre>
<p>tried below code from parent jsp page and recieved permission denied error in IE</p>
<pre><code>window.frames['data'].callData();
</code></pre>
<p>also tried</p>
<pre><code>document.getElementById('dataId').contentWindow.callData(); //didn't work
</code></pre>
<h2>Function in iframe</h2>
<pre><code>window.callData = function(){
alert('Iframe function');
}
</code></pre>
<p>your help is truly appreciated.</p>
| javascript jquery | [3, 5] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.