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 |
---|---|---|---|---|---|
3,219,985 | 3,219,986 |
Automatiacally Generating text input and dropdown select on click using javascript/Jquery
|
<p>I am trying to build a system like when any user clicks on an "Add" button, it creates two text fields and two drop down selects automatically. I searched on google for the tutorial but all I have managed to find is only how to add text fields, but I need to add Select drop down with remove option.</p>
<p>I have some knowledge in PHP but little in Javascript or Jquery. </p>
<p>Would you please kindly help? </p>
<p>Here is the code that I have found:</p>
<pre><code><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
function generateRow() {
var d=document.getElementById("div");
d.innerHTML+="<p><input type='text' name='food'>";
var e=document.getElementById("div");
e.innerHTML+="<input type='text' name='food'>";
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>
<input name="food" type="text" id="food" />
</label>
<div id="div"></div>
<p><input type="button" value="Add" onclick="generateRow()"/></p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,659,114 | 4,659,115 |
Can I update data members in one Activity from another Activity in the application?
|
<p>I've tried this and it works, but I didn't know if this was a bad thing or not, as all the help on data transfers between Activities seems to use intents.</p>
<p>In MainActivity I have:</p>
<pre><code>static PilotRecord pilotRecord = new PilotRecord(); //PilotRecord just contains data item declarations
</code></pre>
<p>In MainActivity.onCreate:</p>
<pre><code>pilotRecord.fuel = 100;
</code></pre>
<p>In MainActivity.onClick:</p>
<pre><code>Intent intent = new Intent(this, SubActivity.class);
startActivityForResult(intent, 0);
</code></pre>
<p>In SubActivity.onCreate I have:</p>
<pre><code>MainActivity.pilotRecord.fuel = 200;
</code></pre>
<p>In SubActivity.onClick:</p>
<pre><code>MainActivity.pilotRecord.fuel = 300;
setResult(RESULT_OK);
finish();
</code></pre>
<p>When I start MainActivity, the fuel value is 100</p>
<p>If I click in MainActivity, SubActivity is displayed, as expected</p>
<p>If I click in SubActivity, MainActivity is displayed and the fuel value is now 300</p>
<p>If I press the Back button, MainActivity is displayed and the fuel value is now 200</p>
<p>Does anyone know of any potential issues with this as it seems simpler to me than setting up intents etc.</p>
<ul>
<li>Frink</li>
</ul>
|
java android
|
[1, 4]
|
736,952 | 736,953 |
selecting multiple elements using shift and mouse click - jquery
|
<p>Is it possible to use shift and mouse click to select multiple elements on a page using jquery?</p>
<p>I have several divs that i have given a tabindex to so that i can select them and can do things like delete them etc.</p>
<p>I want to be able to select more than 1 by holding down shift and using the mouse to click on each div and am struggling to do this.</p>
<p>Does anyone know how this can be done?</p>
|
javascript jquery
|
[3, 5]
|
1,276,022 | 1,276,023 |
Organizing javascript code
|
<p>I am making a javascript application. Normally what I do is make different modules and get users inputs or click events in <code>$(document).ready();</code> function. This works fine for small applications. But when I follow the same pattern, I mean getting click events in <code>$(document).ready();</code> then it gets messy. </p>
<p><strong>So how can I organize this file for a huge application?</strong></p>
<p>Thanks in advance</p>
|
javascript jquery
|
[3, 5]
|
2,483,188 | 2,483,189 |
Remove Class from ID if another link is clicked, vise versa
|
<p>I've been working to find a solution for a jQuery problem.
I have a parent container with 2 divs and a link in each. If a link is clicked in one of the divs, a class is added to the parent container (to change the background). If the other link is clicked, I wanted to check if a class has already been added from the other link's click and be removed.</p>
<p>What's going on: When I click the first link, the class <code>inside-office</code> is added. Then I click the second link and it will add that without removing the first link.</p>
<p>Here's the code I have so far with no success:</p>
<pre><code>$("a.in-office").click(function() {
if($('#fullwrap').hasClass('outside-office')) {
$(this).removeClass('outside-office');
}
$('#top_barwrap').parent().addClass('inside-office');
$('.blockcase').fadeIn();
$('.lead-title, .subtitle').fadeOut();
$('#top_barwrap').animate( { height:'150px' }, { queue:false, duration: 500 });
});
$("a.out-office").click(function() {
if($('#fullwrap').hasClass('inside-office')) {
$(this).removeClass('inside-office');
}
$('#top_barwrap').parent().addClass('outside-office');
$('.blockcase').fadeIn();
$('.lead-title, .subtitle').fadeOut();
$('#top_barwrap').animate( { height:'150px' }, { queue:false, duration: 500 });
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,653,486 | 4,653,487 |
Miltitasking and Progress Bar
|
<p>Does Android have multitasking functionality? If yes, then how can we use it to enable a progress bar?</p>
|
java android
|
[1, 4]
|
880,660 | 880,661 |
Place random positioned element into a document in vertical axes
|
<p>I have the following code</p>
<pre><code>function randomizer(start, end)
{
return Math.floor((end - start) * Math.random()) + 1;
}
var top_pos = randomizer(1, $(document).height());
$('.element_selector').css('top', top_pos + 'px');
</code></pre>
<p>but the result is not what I realy expect from. The most of the times the element is places near to top (about 80% of the times).</p>
<p>Is there any better solution to place my random element in realy random position into vertical axes ?</p>
|
javascript jquery
|
[3, 5]
|
5,600,877 | 5,600,878 |
setInterval onclick of #fr_tab div and clear on click of anywhere in document
|
<p>I have this jquery code: </p>
<pre><code> $('#fr_tab').click(function() {
$("#tab2").empty().html('<img src="images/loading.gif" />');
var handle = setInterval(function () {
$('#tab2').load('fr_quests.php');
}, 3000);
});
$('body').click(function() {
if (handle) {
clearInterval(handle);
handle = 0;
}
});
</code></pre>
<p>I was wondering how I can setIneterval when #fr_tab is clicked and how I can clear it if anywhere in the document has been clicked.</p>
|
javascript jquery
|
[3, 5]
|
4,915,163 | 4,915,164 |
Back to previous page without refresh it
|
<p>Is it possible back to previous page without refresh it? </p>
<p>What it takes?</p>
|
php javascript
|
[2, 3]
|
2,707,626 | 2,707,627 |
Find whether a dynamically called url has image in it
|
<p>I have a products sale module in which products are uploaded from cj and saved in to database..today i noticed few records contained image url but returns 404(eg image url:http://www.bridalfashionmall.com/images/satin-2.jpg) hence shows no image in the repeater ..how can i check whether the url called dynamically has image in it</p>
|
c# asp.net
|
[0, 9]
|
3,312,311 | 3,312,312 |
Auto Update of DIV is not working
|
<p>I use this script to reload a DIV whose ID is news,</p>
<pre><code><script type="text/javascript">
var auto_refresh = setInterval(function() {
<? if ($lim >= 5)
$lim = 0;
else
$lim = $lim + 2;
if ($cnt == 1){
$lim = 0;
$cnt += 1;
} ?>
$('#news').load('update.php?lim=<? echo $lim ?>');
}, 10000); // refresh every 10000 milliseconds
</script>
</code></pre>
<p>The update.php containts this code to receive the value for lim,</p>
<pre><code>$lim=$_GET['lim'];
</code></pre>
<p>But after every 10 seconds the 'lim' value is sent as 0. I need to update the 'lim' value based on the condition in the script.</p>
<p>I checked in update.php for $lim value using echo command. Always it is 0. What is the bug in my code?</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,382,071 | 2,382,072 |
Simulate next button click with jQuery
|
<p>Not sure if this is possible but I have a slideshow on my site that when a button is click the relevant slide, slides in. </p>
<p>What I want to do is add a timer so that after 3 seconds the next button is clicked, making my slideshow slide automatically. </p>
<pre><code>$('#button a').click(function(){
var integer = $(this).attr('rel');
$('#myslide .cover').animate({left:-720*(parseInt(integer)-1)}) /*----- Width of div mystuff (here 160) ------ */
$('#button a').each(function(){
$(this).removeClass('active');
if($(this).hasClass('button'+integer)){
$(this).addClass('active')}
});
});
</code></pre>
<hr>
<p>Ive added a Fiddle...
<a href="http://jsfiddle.net/5jVtK/" rel="nofollow">http://jsfiddle.net/5jVtK/</a></p>
|
javascript jquery
|
[3, 5]
|
3,198,376 | 3,198,377 |
how to activate loaddata() from another class
|
<p>i have this code in the Main extends Activity</p>
<pre><code> public void loaddata()
{
Toast.makeText(Main.this, ("Working"),Toast.LENGTH_LONG).show();
}
</code></pre>
<p>i use this in the second extends Activity</p>
<pre><code> public void turnon()
{
Main dp = new Main();
dp.loaddata();
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
okbutton = (Button) findViewById(R.id.okbutton);
okbutton.setOnClickListener(new OnClickListener()
{
public void onClick(View arg0)
{
turnon();
}
});
}
</code></pre>
<p>but it give force close
any idea</p>
|
java android
|
[1, 4]
|
3,630,858 | 3,630,859 |
Jquery: Iterate an array and find nodes with a specific id
|
<p>I have a list of div elements:</p>
<pre><code>var list = $('.divelement').get();
</code></pre>
<p>I want to use jQuery to find a specific element (that has an id that contains "hdnPK") in each of these div elements. Something like:</p>
<pre><code>var elem1 = list[0].$("[id*='hdnPK']").get();
var elem2 = list[1].$("[id*='hdnPK']").get();
</code></pre>
<p>But you cant write it like i do above. How do you iterate through a regular array with jQuery?</p>
|
javascript jquery
|
[3, 5]
|
4,758,187 | 4,758,188 |
Does app could cause phone reboot and how to release variable
|
<p>I write an app which will continuously request data from a sensor board and send data to server. I use a Motorola Droid phone which have not be activated to test my app. I find that sometimes after several hours the phone will reboot. I just want to know does it cause by my app run out of memory. And if an app runs out of phone's memory, should just the app be force closed or the phone be reboot? </p>
<p>If this causes by app running out of memory how could I release and clear variables. Should the system automatically do this? I think the main problem might be that I set a global json variable to receive and send all data. After sending the data, I just user <strong>new JSONObject()</strong> to initiate the variable. I just want to know does the old one will be released automatically? If not, how can I do to release it?</p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
2,592,604 | 2,592,605 |
How to use $(window).delegate('selector','resize',function handler) when selector is into an iFrame?
|
<p>I need to use as a selector an element from DOM inside an iFrame.</p>
<p>Thanx in advance.</p>
|
javascript jquery
|
[3, 5]
|
2,634,391 | 2,634,392 |
Import a class of different project into my project
|
<p>I have a demo project-named A having a class Class AA. and I have another demo project-named B having a class Class BB.
My question is how can I import ClassBB in class AA??????</p>
|
java android
|
[1, 4]
|
218,079 | 218,080 |
button to scroll all the way to the top with click of button
|
<p>i have this javascript so that when a user is scrolling on the page there will be a small icon to the side that will scroll all the way back up the page rather than manually scrolling. The button shows fine but when i click on it it is not going all the way to the top. </p>
<p><strong>html</strong></p>
<pre><code><a href="#" class="scrollup">Scroll</a>
</code></pre>
<p><strong>Script</strong></p>
<pre><code>$(document).ready(function () {
$('#main').scroll(function () {
if ($(this).scrollTop() > 100) {
$('.scrollup').fadeIn();
} else {
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function () {
$("html, body, main_container, main").animate({ scrollTop: 0 }, 600);
return false;
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,466,042 | 2,466,043 |
How do I toggle a table row display?
|
<p>I would like to toggle my table row on an .change function in jquery. The desired row is being displayed in this code, how do I hide the other rows at the same time?</p>
<pre><code>$(document).ready(function() {
$('#ddlSelect').change(function() {
var ddlId = $('#ddlSelect').val();
alert(ddlId);
//$('#displayTable').hide();
$('#' + ddlId).show();
});
});
</code></pre>
|
c# jquery
|
[0, 5]
|
2,988,062 | 2,988,063 |
Dialog Box will not show
|
<p>I created an AlertDialogFragment class and I am trying to show it from another class with the following code but I keep getting an error to change the type from FragmentTranscation to FragmentManager. If I change it to FragmentManager, I get a message to change to FragmentTranscation, whenever I change to FragmentTranscation, I get a message to change to FragmentManager:</p>
<p>Here is the code to show the alertDialog:</p>
<pre><code>FragmentTransaction ft= getFragmentManager().beginTransaction();
AlertDialogFragment newFragment= new AlertDialogFragment();
newFragment.show(ft, "alertDialog");
</code></pre>
<p>Here is the code for the class:</p>
<pre><code>public class AlertDialogFragment extends android.support.v4.app.DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder
= new AlertDialog.Builder(getActivity());
builder.setMessage("Staying in Touch With The Ones You Love");
builder.setTitle("Togetherness");
builder.setCancelable(false);
builder.setPositiveButton("yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
return builder.create();
}
}
</code></pre>
|
java android
|
[1, 4]
|
3,502,003 | 3,502,004 |
jQuery Click event on asp:button
|
<p>I have a server side button as </p>
<pre><code><asp:Button ID="btnSummary" runat="server" OnClick="btnSummary_Click" Text="Next" />
</code></pre>
<p>I want to attach the jQuery Click event using its ID and NOT using the alternative class attribute way.
<br/>
<br/>
I tried to attach the click event as:</p>
<pre><code>$("#btnSummary").click(function()
{
alert("1");
});
</code></pre>
<p>But, its click event is not fired. Also, I have also tried <code>$("id[$btnSummary]")</code>.
<br/><br/>
Is there any way to attach the click event on asp:button using jQuery without the class attribute on the button?</p>
|
asp.net jquery
|
[9, 5]
|
280,316 | 280,317 |
Android Disable all buttons
|
<p>I programmatically am creating buttons as depending on certain factors their will either be 3 or 4 buttons.</p>
<p>In some instances I would like to create all of the buttons but disable them all. At the moment the problem I have is that I cannot access the buttons from outside of this loop</p>
<pre><code> if (4val != null && 4val.length() > 0){
Button b4 = new Button(this);
b4.setText(answer4val);
b4.setTextSize(18);
layout.addView(b4, layoutParams);
b4.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
reason(4);
}
});
}
</code></pre>
<p>I would like to disable / enable all of the buttons outside of these if statements. Is this possible?</p>
|
java android
|
[1, 4]
|
2,203,196 | 2,203,197 |
Asp.net Calendar Event Issue
|
<p>i have an Issue i am developing a reservation management Issue when user Complete his/her reservation by Selecting date from Calendar and when user Click on the same date again the Selection_index change event did't fire please help me out (in Hourly reservation when user click on date the Checkbox list of available hours are displayed but when user click on same date nothing happen event is't fire )</p>
<p>please help me Out.</p>
<p>Thanks</p>
|
c# asp.net
|
[0, 9]
|
921,164 | 921,165 |
How to show Image In GridView?
|
<p>I am working on a live project in which I have to prepare an Admin interface. In this Admin Interface the Admin of the website can manipulate data and user images. Problem is that I am unable to show the image because I have saved image path in database in respect to associate userid. I am also able to show data but I don't know how to show data so that the Admin can make changes upon it.</p>
|
c# asp.net
|
[0, 9]
|
734,475 | 734,476 |
Why can't this simple javascript/jquery code alert selected text?
|
<p>I can't explain the behaviour of the code below. Here's my entire script</p>
<pre><code><html>
<head>
<script type="text/javascript" language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
var tmpText = '';
$(document).ready(function(){
tmpText = '';
$('#btn_bold').click(function(){alert(tmpText);});
$('textarea').bind('mouseup', function(){
tmpText = '';
if(window.getSelection){
tmpText = window.getSelection();
}else if(document.getSelection){
tmpText = document.getSelection();
}else if(document.selection){
tmpText = document.selection.createRange().text;
}
//tmpText = 'hello world';
alert(tmpText);
});
});
</script>
</head>
<body>
<button type="button" id="btn_bold">click</button>
<textarea>This is some text</textarea>
</body>
</html>
</code></pre>
<p>Try the following operations:</p>
<p>1) Use your mouse to high light text in the text area. You will notice that javascript alerts you the selected text.</p>
<p>2) Press the click button. You will notice javascript will alert you an empty string.</p>
<p>No uncomment <code>tmpText = 'hello world';</code> and repeat the above steps. This time, you'll notice both steps 1) and 2) alerts you "hello world".</p>
<p>How come in the first experiment, step 2) does not alert you the same text as step 1)?</p>
<p><strong>I am testing in google chrome</strong></p>
|
javascript jquery
|
[3, 5]
|
4,065,268 | 4,065,269 |
call another activity in class that did not extend Activity class
|
<p>Hi all i have a class name </p>
<pre><code>public class WikipediaDataSource extends NetworkDataSource{.....}
</code></pre>
<p>which extend to NetworkDataSource. what im try to do is from this class i would like to call new activity...</p>
<pre><code>Intent i = new Intent(context, Obj3DView.class);
startActivity(i);
</code></pre>
<p>i got error saying </p>
<pre><code>the method of startActivity(intent) is undefined for the type WikipediaDataSource
</code></pre>
<p>i read a lot on this issue .. it happens because this class do not extend the activity clas.</p>
<p>i try to follow others solutions. but it does not work for my case. </p>
<p>Please help! :) </p>
|
java android
|
[1, 4]
|
971,018 | 971,019 |
Cant access class object variable of javascript in IE and Mozilla
|
<p>I am having a class in javascript , in which i have defined few properties and methods and i have created an array and created and instance values of the class and pushed into it. After that i have iterated the array and checked a property from a particular method, but in IE and mozilla it is showing as undefined. I have given below the code for your details.</p>
<p>Class:</p>
<pre><code>function DateDetail(date, isBefore, isAfter, isNow) {
this.Date = date;
this.MonthNo = this.Date.getMonth();
this.DayNo = this.Date.getDate();
this.Year = this.Date.getFullYear();
this.IsAfter = isAfter;
this.IsBefore = isBefore;
this.IsNow = isNow;
this.GetMonthValue = function () {
return this.Date.toString("MMM-yyyy");
};
}
</code></pre>
<p>Method</p>
<pre><code>function GetTableDataClass(data) {
if (data.IsAfter)
return "after";
else if (data.IsBefore)
return "before";
else if (data.IsNow)
return "now";
else
return " ";
}
</code></pre>
<p>Calling method</p>
<pre><code>GetTableDataClass(item)
</code></pre>
<p>I am getting data is undefined in mozilla and IE. Please let me know any suggestions.</p>
|
javascript jquery
|
[3, 5]
|
2,502,175 | 2,502,176 |
Calling a method or piece of code from another file
|
<p>A have a very large piece of code that I execute multiple times on my webpage, with only a slight difference each time (it uses information from a database. Sometimes it's within a foreach loop, using "row.nameofrow", and other times it's just a single record, using "query.nameofrow").</p>
<p>I'm pretty new to coding, and I'm wondering if there's a way to place that large selection of code into another file and call it each instance I use it (possibly using a parameter for whether it uses "row" or "query") instead of writing out the entire block of code each time. What kind of file would I need to use, and how would I call it?</p>
|
c# asp.net
|
[0, 9]
|
3,333,805 | 3,333,806 |
Sending an array as a server tag's property
|
<p>I am wondering if it's possible to send an array of strings to a tag's property</p>
<pre><code><SampleTag:Form
runat="server"
ID="sampleform1"
Items={item1,item2,item3,item4}
>
</SampleTag:Form>
</code></pre>
<p>This doesn't work since it sends "{item1,item2,item3,item4}" as a string to the class.</p>
|
c# asp.net
|
[0, 9]
|
2,946,202 | 2,946,203 |
What is the simplest way to validate a date in asp.net C#?
|
<p>I'm using DateTime.ParseExact to parse a string from input. What is the simplest way to make sure the date complies to rules like max days in a month or no 0. month?</p>
|
c# asp.net
|
[0, 9]
|
2,286,321 | 2,286,322 |
Adding class as per LI postion
|
<p>I have below markup,</p>
<pre><code><ul>
<li>1</li> //light BG
<li>2</li>
<li>3</li>
<li>4</li> //light BG
<li>5</li>
<li>6</li>
......
</ul>
</code></pre>
<p>I want to add class <code>dark</code> and <code>light</code>, as per position of <code>li</code>.</p>
<ul>
<li>First <code>li</code> should be <code>light</code></li>
<li>2nd,3rd should be <code>dark</code></li>
<li>4th, 5th should be <code>light</code></li>
<li>same pattern....</li>
</ul>
|
javascript jquery
|
[3, 5]
|
1,264,159 | 1,264,160 |
jQuery Datepicker previous complete months
|
<p>I'm using the Datepicker in two input fields to allow users to select a start and end date, respectively. I was curious if there's a setting for jQuery UI's datepicker to initialize the start date field to a period that is two complete months prior to the end date, which defaults to the current date. So when a user opens the page, the end date will be the current date and the start date will display the two complete months prior to the current date, e.g. end date is initialized to 4-3-2012, the start date would be 2-1-12.</p>
<p>I was going to write some custom formula to handle this, but wanted to be sure there wasn't already a setting for this built into the Datepicker.</p>
|
javascript jquery
|
[3, 5]
|
4,043,228 | 4,043,229 |
Javascript: adding the print function to the body element
|
<p>I need to implement a print page functionality with the following restrictions:</p>
<ul>
<li>i cannot have a print view (no print.jsp to point to)</li>
<li>i cannot rely on print.css alone (because i have to move stuff around a lot in the DOM to get the page i want to print)</li>
</ul>
<p>So i implemented this little script that can help clarifying where i'm going with this:</p>
<pre><code>$(document).ready(function(){
$('a#print').click(function(){
var body = $('body');
var pageClone = body.clone(true);
$('div#search, div.chapters, div#footer').hide();
$('div.content').css('width', '100%');
$('div#logo').css('float', 'right');
window.print();
//reset the content and then copy it back
body.html('');
body.html(pageClone);
return false;
});
});
</code></pre>
<p>Now what this prints is the whole page before my DOM changes. So that's not what i want, so i was thinking i could graft the window.print() function to the body element, something like this:</p>
<pre><code>var body = $('body');
jQuery.extend(body, {print:function(){return window.print(); }});
body.print();
</code></pre>
<p>Except this approach still prints the window content, not the body content if that was ever the problem.</p>
<p>Can you help me to print only the body as implemented in the DOM after my changes?</p>
<p>Thanks</p>
|
javascript jquery
|
[3, 5]
|
3,960,267 | 3,960,268 |
thread problem in suspend() and resume()
|
<p>hi all
i doing a stop watch. for pause i use Thread.suspend() and resume i use Thread.resume(). but the resume is not resume the work.
code:</p>
<pre><code>pause(){
shouldRun = false;
currentThread.suspend();
}
resume(){
shouldRun = true;
currentThread.resume();
}
</code></pre>
<p>while(shouldRun){
.......
}</p>
|
java android
|
[1, 4]
|
5,024,720 | 5,024,721 |
Create a class with jQuery/javascript
|
<p>In a page I create an instance of a <code>class (MyClass)</code>, this class has 2 methods. But I'd like to do 2 things :</p>
<ol>
<li>In <strong>(1)</strong>, set the value <code>this.message</code></li>
<li>In <strong>(2)</strong>, call the information method or another method of the class</li>
</ol>
<p>Thank,</p>
<pre><code><script type="text/javascript">
$(document).ready(function () {
var myClass = new MyClass("MyParam");
$('#Target').click(function (event) {
myClass.save("Test");
});
});
</script>
function MyClass(myParam) {
this.myParam = myParam;
this.isError = false;
this.message = "";
}
// Define the class methods.
MyClass.prototype = {
save: function (action) {
**(2)**
},
information: function (action) {
**(1)**
}
};
</code></pre>
<p><strong>Update1</strong></p>
<p>When I execute the code below the <code>data</code> value in <code>information</code> is show as <code>undifined</code></p>
<pre><code>MyClass.prototype = {
click: function (action) {
var myData;
$.post(....., $("form").serialize(),
function (data) {
myData = data;
});
this.isError = this.information(myData);
},
information: function (data) {
alert(data);
return true;
}
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,965,010 | 5,965,011 |
EditText dont grow with content
|
<p>I have a problem with an <code>EditText</code> in Android.
Cause its only for Debug purpose, the visibility of the Layout, the <code>EditText</code> is added, is at start gone.</p>
<p>So i receive infos from an <code>ServiceCall</code> and to find some possible errors, i display in this the string i got as response. </p>
<p>i tried multiple solutions, nothing worked.</p>
<pre><code><RelativeLayout
android:id="@+id/RelativeLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/chbDebug"
android:baselineAligned="false"
android:orientation="vertical"
android:padding="2dp"
android:visibility="gone" >
<someOtherCrazyShitsAndStuff />
<EditText
android:id="@+id/tbDebug"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="someOtherCrazyShitsAndStuff"
android:inputType="textMultiLine" />
</RelativeLayout>
</code></pre>
<p>So i found to setup a min/max count of lines with <code>android:lines/maxLines</code> but nothing happened. Also tried to force it after filling with the text to increase the Linecount through some lines of code, but result was only the the content was deleted.</p>
<p>Some more ideas?</p>
|
java android
|
[1, 4]
|
706,900 | 706,901 |
Delete Confirmation
|
<p>I have a set of records which are displayed in tabular format in a form. On each record there is a delete checkbox - here is the form in simplified format:</p>
<pre><code><form method="post" action="" id="update-history-form">
Item 1 <input type="checkbox" value="1" name="History[0][delete]">
Item 2 <input type="checkbox" value="1" name="History[1][delete]">
Item 3 <input type="checkbox" value="1" name="History[2][delete]">
<input type="submit" value="Update History" name="update">
</form>
</code></pre>
<p>The integer value in the input 'name' attribute helps identify which records have been selected for deletion.</p>
<p>What I want is for a JavaScript alert confirmation to appear if any of the delete checkboxes have been ticked (upon submit).</p>
|
javascript jquery
|
[3, 5]
|
894,757 | 894,758 |
How to fadeout image, then make it appear on another position in jquery?
|
<p>my image is at some div, and it's z-index is the highest</p>
<p>When i click on something, I want it to fade out, and fade in on another, specified position. Below the image of another class : ) It's an "aaa" class.</p>
<p>I was doing it like that:</p>
<pre><code> $('img.classy').fadeOut();
$('img.classy').css('top',$(el).find('img.aaa:last').height()+60);
$('img.classy').fadeIn();
</code></pre>
<p>It's embedded to click event. When I run it and click the area, img.classy FIRSTLY changes it's position, then on new position it fades out and fades in. I want obviously to make it that way: fade out -> change position when invisible -> fadein on new position. how to do it?</p>
|
javascript jquery
|
[3, 5]
|
3,525,195 | 3,525,196 |
jQuery set call back on child elements
|
<p>I am trying to attach an onChange callback to all the input elements under the div <code>#dim</code>. It selects all 3 input elements, but returns an exception: </p>
<pre><code>Uncaught TypeError: Object 0 has no method 'change'
</code></pre>
<p>It may be because <code>x</code> may not be a jQuery object. How would I make this work?</p>
<pre><code>function registercb() {
var sel = $("div.dim > input");
for (x in sel) {
x.change(function() {
dosomething();
});
}
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,779,051 | 2,779,052 |
scrollTop() in HTML5 using firefox
|
<p>I have a website that I would like to build in HMTL 5(as it will become a visual html 5 reference), I have an example set using jQuery when the user clicks a link it will scroll to the appropriate element.</p>
<p>The issue I have is that in chrome it scrolls and retains it's margin top(as the navigation is overlapping and should always be visible. In chrome this is the case in FF it simply goes straight to the top.</p>
<p>see here for example: <a href="http://allhtml5elements.com/" rel="nofollow">http://allhtml5elements.com/</a></p>
<p>click a to go to the first anchor, in chrome it reacts how I want, in firefox it scroll the "first anchor" to the very top.</p>
<p>Any help would be appreciated.</p>
|
javascript jquery
|
[3, 5]
|
2,960,128 | 2,960,129 |
Andriond send event from first activity and receive on the second
|
<p>I have two activities. The first activity display list of the users with short info. And after select some user I go to the second activity for display full info about this user. For send event I used <code>startActivityForResult();</code> for receive event in socond activity and added <code>public void onActivityResult(int requestCode, int resultCode, Intent data)</code>. After start project I send intend from first activity and I do not receive in the second :(. How I can receive sent event in second activity?
Thank you...</p>
|
java android
|
[1, 4]
|
5,332,541 | 5,332,542 |
concate php variable
|
<p>When concatenate php variable result not showing.</p>
<pre><code>$a = 5;
$b = 4;
$o = '+';
echo $a.$o.$b;
result showing 5+4; but i want show result 9
</code></pre>
<p>How can i do this, anybody can help me out.
Thanks in advance. </p>
|
php javascript
|
[2, 3]
|
5,940,769 | 5,940,770 |
How to use modalDialog to display pop-up which can work in all browser
|
<p>I just tried to create pop-up window but its parent window get active while pop-up is still open , in Chome.
My code is as blow</p>
<pre><code><script language="javascript" type="text/javascript">
function showModalWindow() {
window.showModalDialog('URL, "Sample.jpg", "resizable: yes");
}
</script>
how to make this code browser specific.
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,784,226 | 1,784,227 |
validation in asp.net login control
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7213131/validation-problem-in-asp-net-login-control">validation problem in asp.net login control</a> </p>
</blockquote>
<p>I have asp.net login control in my web application. When I give the incorrect username and password and click the login button the failure text will appeared. Then clear the password field then click the login button both failure text and passwordrequirederrormessage validation messages will appeared. But I need only the password requirederrormessage will appeared. Can anyone able to give the solution for that. Thank you</p>
|
c# asp.net
|
[0, 9]
|
5,280,756 | 5,280,757 |
How to Set Null Value In Text Area
|
<p>I want to set null value in onclick() event of textarea, But my code does not work properly..</p>
<pre><code><textarea id="txtwishlistsong1" rows="5" cols="70" runat="server" onclick="return txtwishlistsong1_onclick()">Type Your Message Here...</textarea>
</code></pre>
<p>code behind</p>
<pre><code>function txtwishlistsong1_onclick()
{
document.getElementById('txtwishlistsong1').focus();
document.getElementById('txtwishlistsong1').value=null;
}
</code></pre>
|
c# javascript asp.net
|
[0, 3, 9]
|
3,737,460 | 3,737,461 |
Using apply with jQuery
|
<p>Why does this work...:</p>
<pre><code>$('.foo').hide()
</code></pre>
<p>...and this doesn't?:</p>
<pre><code>$('.foo').hide.apply(this,[])
</code></pre>
<p>I'm trying to write a function that passes arguments into hide().</p>
|
javascript jquery
|
[3, 5]
|
4,109,776 | 4,109,777 |
How to add name value pair to existing query string
|
<p>i need to add new name ,value pair to existing query string when the user click on some button.</p>
<p>i'm using jquery for client side operations.</p>
<p>any idea..?</p>
<p>thank in advance!</p>
|
javascript jquery
|
[3, 5]
|
4,527,606 | 4,527,607 |
Get Values of Dropdown based on First Dropdown selected
|
<p><strong>PHP/MYSQL</strong></p>
<pre><code><div style="width:810px; margin:inherit; padding-left:170px;">
<select style="width:300px;" id="n" name="userListingCateory">
<option disabled="disabled">Category...</option>
<?php while($row = $sth2->fetch(PDO::FETCH_ASSOC))
{echo "<option value=". $row['catID'] . ">" .$row['catName']."</option>";}
unset($sth2);
?>
</select>
<select style="width:340px;" id="n" name="userListingSubCateory">
<option disabled="disabled">Sub-Category...</option>
<?php while($row = $sth3->fetch(PDO::FETCH_ASSOC))
{echo "<option value=". $row['scatID'] . ">" .$row['scatName']."</option>";}
unset($sth3);
?>
</div>
</select>
</code></pre>
<p>This HTML above gets all categories and sub-categories in two tables <code>[Category]</code> and <code>[SubCategory]</code></p>
<p>The php/mysql that needs to run upon clicking the <code>[Category]</code> dropdown would look like:</p>
<pre><code>SELECT scatID, scatName
FROM Category C, SubCategory SC
WHERE C.catID = SC.catID
AND C.catID = $origCatIDSelected;
</code></pre>
<p>How do I get this to get the <code>sub-categories</code> based on which <code>category</code> is chosen?</p>
<p>Is there any easy way to implement in jquery/php?</p>
<p>Thanks</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,746,935 | 4,746,936 |
Upload file without form
|
<p><strong>Upload file without form</strong>
Yes i used the search button but i just couldn't find the solution i need.
Is there any way to upload a file so that user wouldn't need to press any form buttons?</p>
<p>My first idea was to use CURL but then i remembered that CURL is server sided.</p>
<p>I know it's possible thru Java and/or Flash but is there any way to do that using PHP & OR Javascript?</p>
<p><strong>Edit:
Thanks for clearing this for me but...</strong>
<em>But what about PHP based FTP upload?</em>*</p>
|
php javascript
|
[2, 3]
|
5,715,556 | 5,715,557 |
How do you get the current image name from an ASP.Net website?
|
<p>Scenario: You have an ASP.Net webpage that should display the next image in a series of images. If 1.jpg is currently loaded, the refresh should load 2.jpg.<br />
Assuming I would use this code, where do you get the current images name.</p>
<p><code>
string currImage = MainPic.ImageUrl.Replace(".jpg", "");<br />
currImage = currImage.Replace("~/Images/", "");</p>
<p>int num = (Convert.ToInt32(currImage) + 1) % 3;<br />
MainPic.ImageUrl = "~/Images/" + num.ToString() + ".jpg";
</code></p>
<p>The problem with the above code is that the webpage used is the default site with the image set to 1.jpg, so the loaded image is always 2.jpg.<br />
So in the process of loading the page, is it possible to pull the last image used from the pages properties?</p>
|
c# asp.net
|
[0, 9]
|
889,950 | 889,951 |
calling a javascript function within markup created by javascript using Jquery
|
<p>I have form fields which are displayed using Jquery on click of a button.</p>
<pre><code>[select dropdown: conOperator] [textfield: conValue ] [select dropdown: conValuedd]
</code></pre>
<p>conValuedd is hidden by default.</p>
<p>I'm trying to figure out a way so that when I select either Apple or Banana in the first select drop down [conOperator], it hides the textfield conValue and displays drop down conValuedd instead. However, if I were to select Watermelon, it would display conValue and hide conValuedd again. Any ideas would be much appreciated.</p>
<pre><code>$('<select id="conOperator' + num + '" name="conOperator' + num + '" class="standard_select" style="width:147px;">
<option>Watermelon</option>
<option>Apple</option>
<option>Banana</option>
</select>&nbsp;
<input type="text" id="conValue' + num + '" name="conValue' + num + '" class="short_input" value="" style="width:147px;">&nbsp;&nbsp;
<select style="display:none" id="conValuedd' + num +'" multiple="multiple" size="5">
<option value="option1">Blah</option>
<option value="option2">Blah</option>
</select>').appendTo('#addCondition');
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,032,852 | 2,032,853 |
Jquery UI draggable wont drag first time
|
<p>I have an image which when onmousedown is triggered it runs a function that changes its class and makes it draggable, however the first time I drag it it wont drag, it changes the class but will not drag? After the intial failed drag if you then drag again it will drag but why wont it drag at first?</p>
<pre><code>function element_click(element_class){
$("#"+element_class).draggable("enable");
$("."+element_class).addClass("element_select");
$("#"+element_class).draggable({disabled: false, opacity:0.9, revert: true, stop: function(event, ui){$(".element_select").removeClass('element_select'); $("#"+element_class).addClass(element_class); $("#"+element_class).draggable("disable"); } });
}
</code></pre>
<p><code><img id="element_air_1" style="z-index: 5;" class="element_air_1" onmousedown="javascript: element_click('element_air_1')" src="Doodle God Elements/air.png"></code></p>
|
javascript jquery
|
[3, 5]
|
4,714,204 | 4,714,205 |
Help with JavaScript reading checkbox with []
|
<p>i have written/modified a script to count checkboxes checked it works fine but i know need the checkbox name to read r1[] for my php scripts and now it doesn't work please help with java script...</p>
<p>THIS WORKS</p>
<pre><code><input name='r1' type='checkbox' value='' onClick='return GetSelectedItem2()' />
</code></pre>
<p>THIS DOES NOT WORK</p>
<pre><code><input name='r1[]' type='checkbox' value='' onClick='return GetSelectedItem2()' />
</code></pre>
<p>JAVASCRIPT</p>
<pre><code>function GetSelectedItem2() {
chosen = ""
numCheck = 0
len = document.f1.r1.length
for (i = 0; i < len; i++) {
if (document.f1.r1[i].checked) {
numCheck++
if (numCheck == 3) {
alert("Only pick two date")
document.f1;
return false;
}
}
}
}
</code></pre>
|
php javascript
|
[2, 3]
|
3,295,509 | 3,295,510 |
Pinch interface on android
|
<p>I would like to ask this of developers that have more experience than I do. I am only a junior programmer, and have worked with java, C, and VB.net. I have been asked if it is possible to create something similar to the iOS Pinch interface, but for Android. I am pretty sure this is possible, but have no starting point to work with. Some help would be greatly appreciated. </p>
<p><a href="http://www.diginfo.tv/v/12-0202-r-en.php" rel="nofollow">http://www.diginfo.tv/v/12-0202-r-en.php</a></p>
<p>Possible approaches I see are to either have a high end device, like a multicore tablet host the original video or rendering, and then stream parts to other devices via Wifi, or to do this from a PC.</p>
|
java android
|
[1, 4]
|
2,259,307 | 2,259,308 |
Code outputs errors twice even though the request is stopped?
|
<p>I am having an issue. </p>
<p>When I get an error on this code it outputs the error twice even though the function I call kills the response, notice the OutputError:</p>
<pre><code> private dynamic GetOauthTokens(string code)
{
Dictionary<string, string> tokens = new Dictionary<string, string>();
string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}",
myAppId, HttpUtility.UrlEncode(myLoginRedirectUrl), myAppSecret, code);
try
{
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
string retVal = reader.ReadToEnd();
foreach (string token in retVal.Split('&'))
{
tokens.Add(token.Substring(0, token.IndexOf("=")),
token.Substring(token.IndexOf("=") + 1, token.Length - token.IndexOf("=") - 1));
}
}
}
catch (Exception exception)
{
OutputError("Code", exception.Message);
}
return tokens;
}
</code></pre>
<p>and here is where I handle it:</p>
<pre><code> protected void OutputError(string error, string message)
{
object obj = new { Status = false, Error = error, Message = message };
string objJson = JsonConvert.SerializeObject(obj);
myHttpContext.Response.Write("LinkedLook.getJson(" + objJson + ");");
myHttpContext.Response.End();
}
</code></pre>
<p>For some reason it spits it out twice... what am I doing wrong?</p>
|
c# asp.net
|
[0, 9]
|
1,889,351 | 1,889,352 |
add dynamic element into array
|
<pre><code> var x = 0;
var counter = 0 ;
$(function () {
$('#addBtn').click(function () {
x++;
if (counter < 5) {
counter++;
$('#content').append('<input type="text" id="mytxt' + x + '">');
$('#content').append('<input type="button" id="removeBtn' + x + '" value="Remove" onclick="removeRow(' + x + ')" />');
$('#content').append('<div id="br' + x + '"/></div>');
} else {
alert("you cannot added more than 5 element");
}
}
);
});
function removeRow(index) {
$('#mytxt' + index).remove();
$('#removeBtn' + index).remove();
$('#br' + index).remove();
counter--;
alert(counter);
}
</code></pre>
<p>this is my function to create dynamic button, when i clicked "addBtn", new element will be created and id start with 1,eg: mytxt1, and when i clicked "removeBtn" and "addBtn" again,the id will become mytxt2, the result is out of my expected,
what i want is when i clicked "removeBtn" and "addBtn" ,the id will start from 1 again,but not 2</p>
<p>new updated</p>
<p>that is one of my question also, if i added more element let said 4 element,the id i get will be mytxt1,mytxt2,mytxt3 and mytxt4, and if i remove mytxt2, the next element i added will become mytxt1,mytxt3,mytxt4,and mytxt5, and this is not what i want,what i want is mytxt1,mytxt2,mytxt3 and mytxt4</p>
|
javascript jquery
|
[3, 5]
|
4,235,074 | 4,235,075 |
set a code behind property via jquery
|
<p>Is it possible to set the value of a property inside the page class using jquery? I know it's possible to get the value in jquery as long as the property is public but can't seem to set the value.</p>
<p>This is the property in the code behind.</p>
<pre><code>Private inventory_item_id As String = ""
Public Property InventoryItemId() As String
Get
Return inventory_item_id
End Get
Set(ByVal value As String)
inventory_item_id = value
End Set
End Property
</code></pre>
<p><code><%=Me.InventoryItemId %> = 'some value';</code> isn't working</p>
<p>Thank you</p>
|
jquery asp.net
|
[5, 9]
|
423,745 | 423,746 |
How to replace last two cells values in a table with a string using jquery?
|
<pre><code> <table>
<tr>
<td>aaaa</td>
<td>bbbb</td>
<td>cccc</td>
<td>dddd</td>
</tr>
</table>
</code></pre>
<p>In this above table, how can i replace last two cells values with a string "abcd"</p>
|
javascript jquery
|
[3, 5]
|
3,170,278 | 3,170,279 |
Android Speed based on accelerometer values
|
<p>I need to obtain the velocity of an android device, based on the accelerometer values. I made a code that allows me to get the accelerometer values, and then I calculate the velocity, using the formula:
v = v0 + at. (vector calculation)</p>
<p>My problem is that my velocity only increases and never decreases. I think the problem is that the device never gets an negative acceleration. </p>
<p>Can you help me with this?</p>
|
java android
|
[1, 4]
|
3,046,274 | 3,046,275 |
jQuery selector context question
|
<p>I'm trying to do make the following selection:</p>
<pre><code>$(".program", row)
</code></pre>
<p>Where "row" is a jQuery object containing two table rows. One of the tr's has the class 'program". This selector doesn't seem to find it. However the following works: </p>
<pre><code>$(".title", row)
</code></pre>
<p>where div.title is a descendant of tr.program. </p>
<p>If I use a jQuery object as a selector context, am I not able to match top-level elements of that jQuery object? </p>
<p>thanks,</p>
<p>-Morgan</p>
|
javascript jquery
|
[3, 5]
|
1,641,154 | 1,641,155 |
Navigate to a separate browser from Gridview Hyperlink
|
<p>Hello I would like the user to be directed to a separate browser if possible from a HyperLink in a Gridview. How can I do this.. like you know how a href blah blah target:_blank something like that.. but the problem is that I am using this..</p>
<pre><code> <asp:HyperLinkField
DataNavigateUrlFields="myID"
DataNavigateUrlFormatString="../names/view.aspx?myID={0}" //anyway to do it here?
DataTextField="name"
HeaderText="Name"
SortExpression="Name"
ItemStyle-Width="100px"
ItemStyle-Wrap="true"
HeaderStyle-HorizontalAlign="Left" />
</code></pre>
|
c# asp.net
|
[0, 9]
|
889,009 | 889,010 |
Javascript onbeforeunload- Show an image on Exit
|
<p>I am using following code so that if user closes the browser button it shows a confirmation box, whether to stay on page or not.</p>
<p>What I want to do is if someone closes the browser it should show an image, with "yes" or "no" options. When "yes" is clicked it should close the browser and if "no" is clicked it shouldn't close the browser. The Image has to be shown in the same window not in any popup. Is it possible to do it or am I expecting too much from JavaScript?</p>
<pre><code><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var exit=true;
function confirmExit()
{
if(exit)
{
window.location.href = "?p=exit";
}
if(exit)
return "Wait! Don't Leave Empty Handed!\n\nThank you for taking the time to check out our offer! Before you go we have a complimentary crash to help you succeed. Click the 'Cancel' or 'Stay On This Page' button if you're interested!";
}
</script>
</head>
<body onbeforeunload="return confirmExit()">
</body>
</html>
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,664,947 | 2,664,948 |
one item from checkbox list checked should enable a div and viceversa
|
<p>I have a div tag with following checkbox list </p>
<pre><code> <div id="checkboxDiv" class="checkboxDivclass">
<table id="checkBoxList" runat="server">
<tbody>
<tr>
<td><input id="checkBoxList_0" type="checkbox" name="checkBoxList0"></td>
<td><input id="checkBoxList_1" type="checkbox" name="checkBoxList1"></td>
</tr>
</tbody>
</table>
</div>
</code></pre>
<p>And a rssDiv with the following HTML</p>
<pre><code> <div id="rssDiv" runat="server" class="rssDivClass">
Somecontent here
</div>
</code></pre>
<p>So when you select at least one checkbox item select then rssDiv should be displayed, if none is checked then it should be hide.</p>
<p>Please help me, I need to solve this with Jquery.</p>
<p>THanks</p>
|
jquery asp.net
|
[5, 9]
|
5,403,438 | 5,403,439 |
Script to insert data on different domain
|
<p>I am thinking about writing a script that will perform a sort of checkout procedure automatically similar to a program like Ebay snipe.</p>
<p>I will know what the page exactly looks like. All I really want to do is load the page from a different domain than the one that is running my script into an iframe, have jquery insert the data into the appropriate fields and then use javascript so click the submit button. </p>
<p>I have been reading about security issues with accessing information across different domains. On the domain I am trying to submit to I would like to call a few jquery functions such as .find() to get the id of the submit buttons so I can programatically click on them.</p>
<p>This might sound malicious or something which its not there is something going on sale that will sell out quick and I will not be around to click refresh one hundred times to try and buy it. I figured it would be a cool project to make a script that buys it for me.</p>
<p>Anyway my first question is, is this possible? Secondly, what would be the best way to solve this problem? I was going to use PHP/Javascript/Jquery. Will this even work/be allowed. Also if anyone has any other information that might help me out that would be great. Thanks.</p>
|
php javascript jquery
|
[2, 3, 5]
|
4,912,518 | 4,912,519 |
Passing variable into findViewByID
|
<p>I have the following setup. In my xml i have a bunch of image views. I am trying to show only one of them depending on the number set in preferences and the day of week. This must be really easy but i can't find out the correct way to pass variable into findViewByID. Here is code snippet:</p>
<pre><code>String groupName = "R.id."+prefs.getString("groupListKey", "<unset>")+"_"+(Calendar.getInstance().get(Calendar.DAY_OF_WEEK));
ImageView image = (ImageView) findViewById(groupName);
</code></pre>
|
java android
|
[1, 4]
|
3,189,156 | 3,189,157 |
javascript send one way message to php
|
<p>How can I use javascript to send a one way message to php? I would like to get the browser information from javascript and just send it to php in the background. I know I can get some of this from php, but I'd rather use javascript. Is there a way to do this without a framework like jquery?</p>
|
php javascript
|
[2, 3]
|
3,903,200 | 3,903,201 |
Making a method in a plugin accessible globally?
|
<p>Given the jQuery dropdown plugin below. Is there a way to add a method that would allow for a separate function outside of the dropdown to 'hideMenu'? Thanks</p>
<p>For example, if I applied the plugin to a div with an ID like so: </p>
<pre><code>$('#settings.dropdown').dropDownMenu();
</code></pre>
<p>How could I then call to close the dropDownMenu w hideMenu from outside of the plugin? Thanks</p>
<pre><code>jQuery.fn.dropDownMenu = function() {
// Apply the Dropdown
return this.each(function() {
var dropdown = $(this),
menu = dropdown.next('div.dropdown-menu'),
parent = dropdown.parent();
// For keeping track of what's "open"
var activeClass = 'dropdown-active',
showingDropdown = false,
showingMenu,
showingParent,
opening;
// Dropdown Click to Open
dropdown.click(function(e) {
opening = true; // Track opening so that the body click doesn't close. This allows other js views to bind to the click
e.preventDefault();
if (showingDropdown) {
dropdown.removeClass(activeClass);
parent.removeClass(activeClass);
showingMenu.hide();
showingDropdown = false;
} else {
showingDropdown = true;
showingMenu = menu;
showingParent = parent;
menu.show();
dropdown.addClass(activeClass);
parent.addClass(activeClass);
}
});
// When you click anywhere on the page, we detect if we need to blur the Dropdown Menu
$('body').click(function(e) {
if (!opening && showingParent) {
var parentElement = showingParent[0];
if (!$.contains(parentElement, e.target) || !parentElement == e.target) {
hideMenu();
}
}
opening = false;
});
// hides the current menu
var hideMenu = function() {
if(showingDropdown) {
showingDropdown = false;
dropdown.removeClass(activeClass);
parent.removeClass(activeClass);
showingMenu.hide();
}
};
});
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,557,495 | 5,557,496 |
Parsing Date-and-Times from JavaScript to C#
|
<p>I have some JavaScript code that I'm trying to pass to my web service. My JavaScript code is supposed to send a date in UTC format. Locally, the time that I generated my code at was at 12:30:43 pm. When I executed my JavaScript code, the following date/time was generated:</p>
<p><em>2012-06-03T20:30:43.000Z</em></p>
<p>That date/time was generated from this code:</p>
<pre><code>var now = new Date();
var utcDate = new Date(
now.getUTCFullYear(),
now.getUTCMonth(),
now.getUTCDate(),
now.getUTCHours(),
now.getUTCMinutes(),
now.getUTCSeconds()
);
</code></pre>
<p>When I pass the date/time from JavaScript back to my web service, it is serialized as shown here:</p>
<p><em>20120603163043</em></p>
<p>That looks correct to me at this point. I then need to take that string and convert it to a date/time in C#. In an attempt to do that, I'm using the following C# code:</p>
<pre><code>DateTime _value = DateTime.MinValue;
DateTime.TryParseExact(value, "yyyyMMddHHmmss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out _value)
</code></pre>
<p>When that happens, I get the following date/time.
<em>6/3/2012 12:30:43 PM</em></p>
<p>What am I doing wrong? I was expecting the date/time to be 6/3/2012 4:30:43 PM</p>
|
c# javascript
|
[0, 3]
|
3,456,596 | 3,456,597 |
cm to inch converter, two textboxes multply a value
|
<p>I Have a problem to make a cm to foot/inch converter in C#, this is what a got:</p>
<pre><code><asp:textbox id="txtFoot" runat="server"></asp:textbox>
<asp:textbox id="txtInches" runat="server"></asp:textbox>
<asp:Button id="btnAdd" runat="server" text="Count" onclick="btnAdd_Click" />
<br />
<asp:Label ID="lblResult" runat="server"></asp:Label>is<asp:Label ID="lblFootAndInches" runat="server"></asp:Label>cm
<%--I try to get a result "10'1" is 3,939 cm"--%>
protected void btnAdd_Click(object sender, EventArgs e)
{
lblResult = (txtFoot.Text + "," + txtInches.Text) * 0,39; //I would like to get 10,1 * 0,39 = 3,939 (10 foot and 1 inch)
lblFootAndInches = txtFoot.Text + "'" + txtInches.Text + '"'; //I'm looking for a result like 10'1"
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
3,809,203 | 3,809,204 |
How to detect whether an image exists in the server using Javascript or Jquery
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3646914/how-do-i-check-if-file-exists-in-jquery-or-javascript">How do I check if file exists in jQuery or Javascript?</a> </p>
</blockquote>
<p>I need to find out image exists at specific path on server using javascript. </p>
<p>If the image exists at specific path on server in that case I need to display a default image without showing an error. </p>
<p>Thank you very much for your help.</p>
|
php javascript jquery
|
[2, 3, 5]
|
2,259,729 | 2,259,730 |
How do I write PHP within Javascript so that I can load files?
|
<p>How do I write PHP within Javascript so that I can load files? Or is there a better way?
(I am loading text files from the server... so I need to use PHP to load those files. I don't know how to handle call backs in PHP but I can do it in Javascript. And from there if I can do some PHP from within the Javascript, I can solve my problem.)</p>
<p>thx</p>
<pre><code>desired sequence:
SaveButton
LoadButton
When the "load button" is pressed, load a textfile from the server into a textbox.
When the "save button" is pressed, save the textbox text to the server.
</code></pre>
|
php javascript
|
[2, 3]
|
4,205,806 | 4,205,807 |
get parent's siblings number went its child was click
|
<p>Here is my HTML and when tag was click I want to know that what is its <code><li></code> siblings number was. Please Advice me please. </p>
<pre><code> <div id="tabs">
<ul>
<li class="select" ><a href="#" id="tabHotel">Hotel</a></li>
<li ><a href="#" id="tabAirfare">Airfare</a></li>
<li ><a href="#" id="tabPackage">Package</a></li>
</ul>
</div>
</code></pre>
<p>and here is my javascript. </p>
<pre><code>// I don't want to input 1 in the function tabSelector
// I want to get parent's sibling value automatic and
// change somthing in li class.
$('#tabHotel').click(function(){
tabSelector(1);
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
197,193 | 197,194 |
Jquery .span refresh onclick
|
<p>Am I correct in thinking this should work?</p>
<p>I have this jquery:</p>
<pre><code><script>
$(function() {
$(".wpsc_buy_button").click(function(evt) {
$(".counter").load("index.php")
evt.preventDefault();
})
})
</script>
</code></pre>
<p>This .span:</p>
<pre><code><span class="counter">
<?php
$i = 0;
while(wpsc_have_cart_items()): wpsc_the_cart_item();
?>
<?php $i += wpsc_cart_item_quantity(); ?>
<?php endwhile; ?>
<?php print $i ?>
</span>
</code></pre>
<p>And this button:</p>
<pre><code><input type="submit" value="Add To Cart" name="Buy" class="wpsc_buy_button" id="product_16_submit_button"/>
</code></pre>
|
javascript jquery
|
[3, 5]
|
5,299,978 | 5,299,979 |
scroll to selected item in html listbox
|
<p>I have an html listbox :</p>
<pre><code><select id="test" size="5">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
</code></pre>
<p>I am trying to select an item via code and have the listbox automatically scroll to the selected item.</p>
<p>Is this supposed to scroll the listbox automatically to the selected item ?</p>
<pre><code>$('#test option[value="8"]').attr('selected', 'selected');
</code></pre>
<p>I can't seem to get it to do that ... am I missing something ?</p>
|
javascript jquery
|
[3, 5]
|
1,508,302 | 1,508,303 |
Removing array in javascript
|
<p>How we can remove an array entry from :</p>
<pre><code> var a = [],b = [],c = [],d = [];
var multi = {
a: a, b: b, c: c, d: d
};
</code></pre>
<p>Means if i want to remove <code>a</code> array from multi . What should i do?</p>
|
javascript jquery
|
[3, 5]
|
24,309 | 24,310 |
How can I make a div unselectable?
|
<p>I would like to make specific div's unselectable Double-clicks, etc. should be blocked. </p>
<p><a href="http://jsfiddle.net/VYKfL/" rel="nofollow">Here's what I've tried:</a></p>
<pre><code><div id="test" class="unselectable">asd</div>
$(document).ready(function() {
$.ctrl = function(key, callback, args) {
var isCtrl = false;
$(document).keydown(function(e) {
if (!args) args = []; // IE barks when args is null
if (e.ctrlKey) isCtrl = true;
if (e.keyCode == key.charCodeAt(65) && isCtrl) {
callback.apply(this, args);
return false;
}
}).keyup(function(e) {
if (e.ctrlKey) isCtrl = false;
});
};
//Other Method
$(function() {
$(document).keydown(function(objEvent) {
if (objEvent.ctrlKey) {
if (objEvent.keyCode == 65) {
objEvent.disableTextSelect();
return false;
}
}
});
});
});
</code></pre>
<p>But I find, to my chagrin, that this fails to work. How might I modify my code to achieve my objective?</p>
|
javascript jquery
|
[3, 5]
|
4,586,561 | 4,586,562 |
connected list controls
|
<p>sorry for my English google translator. I have three connected lists</p>
<pre><code>$( ".listaAvisosConectados" ).sortable({
connectWith: ".listaAvisosConectados",
dropOnEmpty:true,
}).disableSelection();
</code></pre>
<p>Example online: <a href="http://test.vertudemo.com/" rel="nofollow">http://test.vertudemo.com/</a></p>
<p>and I need to implement any element can be added on the red list but that list items can not be green or blue added in opposing lists. Red accepts all. Green only accepts green and blue only blue. </p>
<p>I've tried several ways but cannot do it. </p>
<p>If I put a different class to each list green and red. Red List and add two classes do not work very well. </p>
|
javascript jquery
|
[3, 5]
|
557,439 | 557,440 |
How to animate an element while using .before in jquery
|
<p>I want to append .item element before .content element but it just simply removes .item from previous location and append before .content. </p>
<p>What i want is to use some animation that slowly remove .item element from its original position and appear slowly on its new position.. how can i do this?</p>
<pre><code>$Item = $('.item');
$('.content').before($Item);
</code></pre>
<p>Regards.</p>
|
javascript jquery
|
[3, 5]
|
54,593 | 54,594 |
Javascript and css file search path while running python SimpleHTTPServer
|
<p>I am running a python SimpleHTTPServer and serving a html file. That html file includes couple of javascript files. When the html file is served by the server I get the following errors.</p>
<pre><code>1.0.0.127.in-addr.arpa - - [15/Jun/2012 13:42:54] code 404, message File not found
1.0.0.127.in-addr.arpa - - [15/Jun/2012 13:42:54] "GET /lib/jquery-ui/jquery-ui.min.js
</code></pre>
<p>Html file contents (only relevant lines shown):</p>
<pre><code><script type="text/javascript" src="../../lib/jquery-ui/jquery-ui.min.js"></script>
</code></pre>
<p>Python command used to run the server. It is run in the directory where index.html is present</p>
<pre><code>python -m SimpleHTTPServer 8000
</code></pre>
<p>I have the files jquery-ui-min.js in my local filesystem. But the search somehow is stripping the ../.. and searching in /lib/jquery-ui/jquery-ui.min.js </p>
|
javascript python
|
[3, 7]
|
1,419,912 | 1,419,913 |
jQuery string split the string after the space using split() method
|
<p>my code </p>
<pre><code> var str =$(this).attr('id');
</code></pre>
<p>this will give me value == <strong>myid 5</strong></p>
<pre><code> var str1 = myid
var str2 = 5
</code></pre>
<p>i want something like this ..</p>
<p>how to achieve this using split method</p>
|
javascript jquery
|
[3, 5]
|
5,049,558 | 5,049,559 |
jquery click function always returns highest value
|
<p>I insert elements to the DOM, after that I want to bind a click function to these elements.
This works, but for some reason the links that were created all return the same value, which
is the highest value 'px_amount' has after looping. Very strange :) The first console.log();
does return the right value, and I can see it increment after each iteration. I added a simple console.log() to the click function, for sake of simplicity.</p>
<pre><code>for(var i=1; i<=bullet_amount; i++)
{
$('<a id="bullet-'+i+'">'+i+' </a>').appendTo('#bullet-nav');
px_amount = (i-1)*ratio*3450;
console.log(px_amount);
$("#bullet-"+i).live('click', function() {
console.log(px_amount);
});
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,350,766 | 2,350,767 |
get an iframe's "src" value in PHP?
|
<p>I have an iframe on my page, where on click (a menu) will update the iframe with a new URL depending on what menuitem they select.</p>
<p>I do that by calling javascript function on 'onclick' passing the URL from the menu :</p>
<pre><code> function frameclick(pageurl)
{
$("#iFrame1").attr('src', pageurl);
}
</code></pre>
<p>What i would like to do whenever they press a menuitem is to store what iframe is loaded, because i have another button (select page language) and when they press that i want to reload the page but pass on the iframe-url that is currently displayed as a variable in the site url.</p>
<p>Since PHP is serverside and JS is clientside, i cannot do ex. "$current_iframe_url = pageurl" - which would have enabled me to pass it on as a variable on refresh.</p>
<p>You know how i could get around this ?</p>
<p>That works fine.</p>
<p>What i want to do now, is to whenever they click a menuitem i want to store that URL </p>
|
php javascript
|
[2, 3]
|
1,758,035 | 1,758,036 |
Javascript never gets called
|
<p>Any reason for the Javascript is NOT firing ? </p>
<pre><code><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
function ChangeDisplay()
{
alert("Changing");
document.getElementById('warningDiv').innerHTML = "<h1>Change Text</h1>";
setTimeout(finalize,6000);
}
function finalize()
{
alert("Done");
document.getElementById('warningDiv').innerHTML="<h1>Done</h1>";
}
</script>
<h2>
Welcome to ASP.NET!
</h2>
<p>
<div id="warningDiv">Hello World</div>
</p>
<script>
window.onload = setTimeout(ChangeDisplay, 3000);
</script>
</code></pre>
<p></p>
|
javascript asp.net
|
[3, 9]
|
2,539,951 | 2,539,952 |
What is Java's interface in C++
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/318064/how-do-you-declare-an-interface-in-c">How do you declare an interface in C++?</a> </p>
</blockquote>
<p>I am reading Head First Design Pattern book. All the code example are in Java, but my main Programming Language is C++. They use Interfaces everywhere I am just not quite sure how it translates in C++. Is it only an pure Abstract class?</p>
|
java c++
|
[1, 6]
|
546,903 | 546,904 |
jQuery.HTML not obeying formating within text
|
<p>Why dose the following not obey formating, the "li"s have no effect</p>
<pre><code><script>
function showENQ() {
jQuery('#enqtext').html("<li>showtext</li>");
}
$('#enq').live('pageshow', function () { showENQ(); });
</script>
<ul data-role="listview" data-filter="true" data-filter-placeholder="Search Enquirylist..."
data-theme="e" data-filter-theme="d" >
<div id="enqtext"></div>
</ul>
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,876,627 | 1,876,628 |
How to Manage Messages of my application
|
<p>I currently use a the databse to store my messages but I guess there should be a better way
any idea can help me ?</p>
<p>I mean thoese messages I provide for user in the UI,</p>
<p>Example :
"Data Saved Successfully"
or
"Are You Sure to delete?"</p>
|
c# asp.net
|
[0, 9]
|
4,155,750 | 4,155,751 |
how can i make screen shot of html div which contains images, and text using php or javascript or jquery?
|
<p>Is it possible to capture the particular div content and div contains images or text or anything? </p>
<p>if any possible ways with script please tell me.</p>
|
php javascript jquery
|
[2, 3, 5]
|
6,013,104 | 6,013,105 |
How could I add some attribute of a pop-up window from the parent window?
|
<p>So I have a pop-up window opened by the following from the parent page:</p>
<pre><code>popitup("foobar.html");
function popitup(url) {
newwindow=window.open(url,'name','height=700,width=1000');
if (window.focus) {newwindow.focus()}
return false;
}
</code></pre>
<p>After the page is popped up, I want to add the following to the <strong>body tag</strong> of the pop-up</p>
<pre><code><body onunload="window.opener.parent.location.reload();">
</code></pre>
<p>How could I reach out and do such modification from the parent window? Do I have to include such code in a function that runs after the pop-up is loaded? </p>
<p>thanks!</p>
<p>P.S. all pages are in the same domain. I want to do the modification after the pop up is loaded.</p>
<p>I understand there is some function that could run after an iframe is loaded, could such function also be applied to a pop up in some variance way?</p>
<pre><code>jQuery("#ifrm").load( function(){})
</code></pre>
|
javascript jquery
|
[3, 5]
|
518,497 | 518,498 |
Get filename(s) where type is defined in asp.net website
|
<p>If I define a class in a file</p>
<pre><code>~/App_Code/Extensions/MyExtension/MyClass.cs
</code></pre>
<p>Is it possible to retrieve the filename by type (or 'MyExtension' part of it) without hard coding it?</p>
<pre><code>var extTypes = getExtensions();
foreach(var extType in extTypes)
{
// something like
var files = extType.GetSourceFiles();
//or maybe asp.net keeps track of types in the dynamically created assembly
var files2 = SomeAspNetClass.WhereDidThisTypeComeFrom(extType);
}
</code></pre>
<p>Or inject it to the class in any way?</p>
<pre><code>[ThisFile]
public class MyClass : MyBase
{
private string _file = <thisfile>;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
5,303,412 | 5,303,413 |
Creating a dynamic array
|
<p>I need to create a dynamic array with a loop.. but I cant seem to get the desired results.</p>
<p>the array I want is: </p>
<pre><code>{
"CategoryName": "somecategoryname",
"Date": "02-17-2012",
"Id": 24,
"ProductToHide": [
{
"IsHide": true,
"ProductId": "someid"
}
],
"ProductsToAdd": [
{
"MealSequence": "S1",
"ProductId": "Someid"
},
{
"MealSequence": "S2",
"ProductId": "Snack_11"
}
],
"UserId": "1"
}
</code></pre>
<p>and I am using the following function to add products: </p>
<pre><code>addProduct: function(id){
var tempArr = [];
$.each(this.mCData.ChildCategories, function(i, item){
$.each(item.PList, function(j, jsonPr){
if (jsonPr.TID == id){
addProduct = new mealTypeProduct();
addProduct.data = jsonPr;
tempArr = addProduct.modifyProduct();
}
})
})
// queryStr = {"add" : tempArr};
// this.modificationArray.push(queryStr);
this.modificationArray['add'].push(tempArr);
console.log(this.modificationArray);
}
</code></pre>
<p>Its giving me the following error: </p>
<pre><code>this.modificationArray.add.push is not a function
this.modificationArray['add'].push(tempArr);
</code></pre>
<p>the initializing is done in the following manner: </p>
<pre><code>var mealType = {
chosenDate: new Date(), tabViewHtml: '',
modificationArray: [], saveArray: [],
}
</code></pre>
<p>What am I doing wrong?</p>
|
javascript jquery
|
[3, 5]
|
2,000,530 | 2,000,531 |
How can i pass an object to a new thread generated anonymously in a button listener
|
<p>I would like to pass an object (docket for printing) to a new thread which will print the docket. My code is:</p>
<pre><code> private final Button.OnClickListener cmdPrintOnClickListener = new Button.OnClickListener() {
public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
enableTestButton(false);
Looper.prepare();
doConnectionTest();
Looper.loop();
Looper.myLooper().quit();
}
}).start();
}
};
</code></pre>
<p>How do I pass the object to it?
Also - I need to generate the object in the UI thread, just before starting the new thread so where could I put this method (e.g. getDocketObject()) in relation to my code below</p>
<p>thanks,</p>
<p>anton</p>
|
java android
|
[1, 4]
|
4,338,689 | 4,338,690 |
What does the Request object do in the following scenario?
|
<p>If I see something like:</p>
<pre><code>if(Request["Email"])
{
}
</code></pre>
<p>What does this actually mean? Where is the Email collection member actually being set?</p>
|
c# asp.net
|
[0, 9]
|
63,972 | 63,973 |
php & .net security issue?
|
<p>I have an old .net application which also contains a vbuletin forum in php.</p>
<p>I have created a <strong>custom handler</strong> to protect access to some files (*.doc etc) for non-autheticated users in .net app. The main problem is that now, <strong>all vbulletin users can no longer access these files.</strong></p>
<p>Is there any setting I can do in order to make those files accessible for these php users? Because, all the requests are going trough my custom handler...</p>
|
php asp.net
|
[2, 9]
|
2,857,654 | 2,857,655 |
POSTing data using for-each with javascript and php?
|
<p>foreach loop only repeating the last element of the arary?</p>
<p><strong>java Script Code :</strong></p>
<pre><code> <?php foreach($_REQUEST["itemprice"] as $itemprice)
{
?>
+ "&itemname_price[]=<?php echo $itemname?>_price=" + <?=$itemname?>_price.value
<?php
}
?>
</code></pre>
<p><strong>Code to request that data</strong></p>
<pre><code> $items_price = array();
foreach($_REQUEST['itemname_price'] as $itemname_pric) {
$items_price[]=$itemname_pric;
}
print_r($items_price);
</code></pre>
|
php javascript
|
[2, 3]
|
4,512,789 | 4,512,790 |
Showing on mouseover a div created dynamically and remove
|
<p>I searched a lot through questions but I did not find the right way. My problem is: I want to create a <code>div</code> dynamically , showing it on <code>mouseover</code> appending it to another <code>div</code>, and remove (through <code>remove()</code> function) on <code>mouseout</code>. I tried couple ways but in any of them , sometimes the <code>div</code> shows up and then disappear, sometimes it doesnt, sometimes it disappear when my mouse goes away from the text in the container <code>div</code>.
Thank you guys .</p>
<h3>This is my code</h3>
<pre><code> var usr = 'username_pre';
var newdiv = $('<div>', {
html: '<a href="#" title="">'+usr+'</a> </br> <a href="#" title="">impostazioni</a> </br> <a href="#" title="">esci</a>'
});
$("#container").mouseover(function(){
$("#options").css('visibility','visible').append(newdiv);
});
$("#options").mouseout(function(){
$(newdiv).remove();
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,494,559 | 4,494,560 |
JavaScript/jQuery to load more from MySQL?
|
<p>I searched Google on how to do this, and I got the following link:
<a href="http://www.9lessons.info/2009/12/twitter-style-load-more-results-with.html" rel="nofollow">http://www.9lessons.info/2009/12/twitter-style-load-more-results-with.html</a></p>
<p>That is exactly what I want to do, however it's rather confusing to me so I can't work out how to implement it properly to my current file.</p>
<p>My current query is as follows.</p>
<pre><code>if (!$query = @mysql_query("SELECT * FROM confessions ORDER BY date DESC LIMIT 10")) {
echo '<strong>Error:</strong> '.mysql_error().'';
} else {
echo '<div id="posts">';
while ($q = mysql_fetch_array($query)) {
$id = $q['id'];
$name = $q['confession'];
$date = date("j M Y", strtotime($q['date']));
echo '<div class="confession" ';
echo '>';
echo '<table>';
echo '<tr style="width:700px;">';
echo '<td style="width:100px;font-weight:lighter;font-style:italic;font-size:95%;">'.$date.'</td>';
echo '<td style="width:600px;">'.$name.'</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
}
echo '</div>';
}
</code></pre>
<p>Obviously that just grabs the data of the last 10 rows in that table, and as far as I know I just need some JavaScript to remember the limit, and how many it grabbed, so it can grab the next lot.</p>
<p>Is it possible somoene can give me a link to help me explain it more, or write up some code (from the link I gave) that'll help?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,872,474 | 3,872,475 |
formated output of JS contents into a HTML table
|
<p>i have a javascript file with the following content and would like to generate a dynamic html table with it's content</p>
<pre>(function($) {
My.Shortcuts = {
a: 'Name',
b: 'Elvis',
c: 'Fun'
};
My.Plugins.extend({
Name: {
url: 'http://www.name.com'
example: 'some example text here'
},
Elvis: {
url: 'http://www.elvis.com'
},
Fun: {
url: 'http://anothersite.com'
}
});
})(jQuery);</pre>
<p>result should be a html table or div list like:</p>
<pre>a | Name | http://www.name.com (some example text here)
b | Elvis | http://www.elvis.com
c | Fun | http://anothersite.com</pre>
<p>unfortunately i have no clue how to do this?</p>
|
javascript jquery
|
[3, 5]
|
3,922,035 | 3,922,036 |
Save WebControls.Image to a file or to system.drawings.image
|
<p>I am generating USPS barcode images so they can be printed to an address label and shipped. I purchased an ASP.Net USPS barcode image creator so It creates the image in an ASP WebControls.Image control. But when its time to print, the only thing i can send to the printer from C# is a system.drawings.image object:</p>
<pre><code>//Get the default printer name.
var prnDocument = new PrintDocument { PrinterSettings = { PrinterName = printer } };
prnDocument.PrintPage += PrintOrderLabels;
prnDocument.Print();
private void PrintOrderLabels(object sender, PrintPageEventArgs e)
{
var fnt = new Font(FontFamily.GenericSerif, 14);
float yPos = 1;
float xPos = 15;
e.Graphics.DrawString("Big D, Tx", fnt, Brushes.Black, 1, yPos);
//barcode is a webcontrols.image so this wont compile
e.Graphics.DrawImage(barcode,xPos,yPos);
}
</code></pre>
<p>The e.Graphics.DrawImage function only accepts an object of type system.drawings.image. So how can I:</p>
<p>A. convert a webcontrols.image control to a system.drawings.image object? (i dont think you can unless the image is physically on the hard drive)</p>
<p>B. Save the webcontrols.image object to a file on the server and retrieve it from there</p>
<p>or</p>
<p>C. send the web image to the printer along with my other string data?</p>
<p>Thanks. </p>
|
c# asp.net
|
[0, 9]
|
5,650,572 | 5,650,573 |
using jquery .find() to get children
|
<p>I have the following markup:</p>
<pre><code><div id="items">
<div class="item">
<div class="item_box" id="id_1">
<div class="one" id="one"></div>
</div>
</div>
<div class="item">
<div class="item_box" id="id_2">
<div class="one" id="two"></div>
</div>
</div>
<div class="item">
<div class="item_box" id="id_3">
<div class="one" id="three"></div>
</div>
</div>
</div>
</code></pre>
<p>Basically, I want to be able to loop through and get the id value in the item_box class.</p>
<p>Here's the code I'm trying to use:</p>
<pre><code>$('#items').find(/[id_]/).each(
function(){
alert($(this).attr('id'));
});
</code></pre>
<p>This doesn't work though... I've tried using .children, however that won't go as deep as these are nested.</p>
<p>Any ideas?</p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
3,182,876 | 3,182,877 |
Better method of retrieving values of checked input boxes via jQuery?
|
<p>I have several checkboxes and a fake submit button to make an AJAX request:</p>
<pre><code><form>
<input type="checkbox" value="1"/>
<input type="checkbox" value="2" checked="checked"/>
<input type="checkbox" value="3"/>
<input type="checkbox" value="4" checked="checked"/>
<input type="button" onclick="return mmSubmit();"/>
</form>
</code></pre>
<p>Within the mmSubmit() method, I would like to retrieve an array of values that have been selected. Here is what I am currently doing.</p>
<pre><code>mmSubmit = function() {
var ids = [];
$('input[type=checkbox]:checked');.each(function(index) {
ids.push($(this).attr('value'));
});
// ids now equals [ 2 , 4 ] based upon the checkbox values in the HTML above
return false;
};
</code></pre>
<p>I'm wondering if there is a shorthand method in jQuery used to retrieve the values into an array, or if what I have is already optimal.</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.