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 |
---|---|---|---|---|---|
4,388,923 | 4,388,924 |
Getting specific objects from a selected list
|
<p>I think I'll have to hit myself in the head after that.</p>
<p>Let's say I have html like this:</p>
<pre><code><div class="some-class"></div>
<span class="some-class"></span>
</code></pre>
<p>Somewhere I select items like this:</p>
<pre><code>var items = $(".some-class");
</code></pre>
<p>And somewhere later I would like to get only the divs from the <code>items</code>. I know I could use:</p>
<pre><code>var divs = $("div.some-class");
</code></pre>
<p>But is there a simple way, without doing more selections or iterating through elements by <code>.each</code>? Something like <code>items.someFunction("div")</code>?</p>
|
javascript jquery
|
[3, 5]
|
1,267,205 | 1,267,206 |
How can I make my inner table show?
|
<p>I have a table like this, all rows have the structure like 1st data row</p>
<pre><code><table id='table1'>
<thead>
<tr>...table headers...</tr>
</thead>
<tr>
<td>xyz</td>
<td>
<table><tr></tr></table>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
...
...
</table>
</code></pre>
<p>All those inside tables have some texts and images.</p>
<p>Initially, I use </p>
<pre><code>$('#table1').find("tr:gt(0)").hide();
</code></pre>
<p>to hide everything except header</p>
<p>Now I want to select say from row 1 to row 15 and unhide them. From another post, I know I can use
<code>$('#table1').children('tr').slice(1,15)</code> to find those rows, but when I want to show them using </p>
<pre><code>$('#table1').children('tr').slice(1,15).show(1000);
</code></pre>
<p>all those inside tables are still not showing, but the text "xyz" is showed Am I missing something here?</p>
|
javascript jquery
|
[3, 5]
|
3,395,982 | 3,395,983 |
border color won't change
|
<p>I'm trying to animate background-color,color and border color to change with jquery but for some reason border color is not changing any idea why? here is the portion of jquery code :</p>
<pre><code>$('#tabbed a').hover(function() {
$(this).animate({
backgroundColor: "#FBFBFB",
color:"#FD7A24",
borderColor:"#000"
}, "fast")
}, function() {
$(this).animate({
backgroundColor: "#FFF",
color:"#65B1D3",
borderColor:"#eee"
}, "fast")
});
</code></pre>
<p>Thank you</p>
|
javascript jquery
|
[3, 5]
|
5,265,545 | 5,265,546 |
Javascript spinning wait hourglass-type thing
|
<p>I'd like to indicate to the user of a web app that a long-running task is being performed. Once upon a time, this concept would have been communicated to the user by displaying an hourglass. Nowadays, it seems to be an animated spinning circle. (e.g., when you are loading a new tab in Firefox, or booting in Mac OS X. Coincidentally, the overflowing stack in the stackoverflow logo looks like one quarter of the circle).</p>
<p>Is there a simple way to create this effect using Javascript (in particular, JQuery)? Ideally, I'd like to have one of these little spinners as elements in a table, to indicate to the user that the system is still active in processing a pending task (i.e., it hasn't forgotten or crashed). (Of course, I realize it's possible that the back-end has crashed and the front-end still show as an animating spinning thing, it's more for the psychological purpose of the user seeing activity).</p>
<p>And what do you call that spinning thing, anyways?</p>
|
javascript jquery
|
[3, 5]
|
5,095,204 | 5,095,205 |
jquery work in json
|
<p>i am new in jquery.<br>
i want to send data in my index.php through ajax. i want to encode it in json and the decode it in normal to work on it. any one help me or suggsest me some helpfull url?<br>
I am using jquery ajax function.
thanks in advanse.</p>
|
php jquery
|
[2, 5]
|
3,631,121 | 3,631,122 |
Prevent form fields from repopulating after clicking the back button in spring
|
<p>I have a login form, when i submit form it redirect me on success page. now I clicked on back button from browser then I got the same login page with fields. So I want empty fields when i clicked on back button from browser.. Any one can help in this..?</p>
|
java javascript
|
[1, 3]
|
5,196,139 | 5,196,140 |
scroll event not firing on div element in IE
|
<p>I have tried everything I can think of to get this event to trigger when scrolling on the div tag. I made sure that it was actually reaching this code and it does. It never triggers when scrolling though. I also tried using .scroll(...) and .bind('scroll'...) Any thoughts on what the issue is?</p>
<pre><code>$('.ScrollIEContainer').scroll(function ()
{
var scrollPos = $(this).scrollTop();
if (scrollPos != null && scrollPos != undefined)
{
$(this).contents('table.GridView').children('thead').children('tr').css({ 'top': scrollPos + 'px' });
}
});
</code></pre>
<p>The goal here is to update the top position of the header in my grid view to implement fixed header scrolling.</p>
<p>UPDATE:
I have been unable to debug any of this code with the exception of alert statements for some inexplicable reason but I was able to debug and use the watch window to check on my selector elements by inserting a a line of code right before it that would result in a Null Reference exception (WTF). Anyways, I looked at the dom inside my element and the onscroll event is null event after the code above is executed.</p>
|
jquery asp.net
|
[5, 9]
|
3,290,198 | 3,290,199 |
Android Use local CSS to display html String
|
<p>Ok so what i do is the following:</p>
<p>i have a html string i show in a WebView like this:</p>
<p><code>webView.loadDataWithBaseURL("",htmlText, "text/html","utf-8", null);</code></p>
<p>i also have a local css file i want to apply to that html String in the webView. </p>
<p>i looked this up for a while but no solution seemed to work. </p>
<p>There should be a way to save the css file in the assets folder and call it from somwhere but i dont have an idea how.</p>
<p>and suggestions?</p>
|
java android
|
[1, 4]
|
5,191,614 | 5,191,615 |
JQuery Drop Down menu wont display drop downs
|
<p>I am using this <a href="http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm" rel="nofollow">Dynamic Drive Script for a smooth drop down menu</a>.</p>
<p>My site with the menu can be seen <a href="http://dgtgroup.co.uk/ascofzco/" rel="nofollow">here</a>. (the menu is the black bar in the middle).</p>
<p>Everything works fine, except when you hover over the navigation links, the drop down menus do not appear.</p>
<p>I'm not sure what is wrong</p>
<p>Any help would be gratefully appreciated. </p>
<p>EDIT: UPDATE
This is the site I am trying to <a href="http://www.ascoengineering.co.uk/" rel="nofollow">reproduce</a>. The menus on that site appear smoothly.</p>
|
javascript jquery
|
[3, 5]
|
5,046,672 | 5,046,673 |
Creating dynaimc controls in c# and placing them in html
|
<p>I have an datatable which I would like to use to generate controls i.e.
<strong>textbox, checkbox, dropdown</strong></p>
<p>From the datatable I need to create those controls using c#, can any one help me out in syntax. How do I go ahead and bind these controls in HTML tags?</p>
|
c# asp.net
|
[0, 9]
|
896,142 | 896,143 |
Popup form using asp.net and javascript
|
<p>Hi I am new for web development. I have an application which consists of a button. On clicking the button a popup window should appear which consists of 2 fields and a button. On clicking button in Popup window 2 fields in popup has to be saved in to database. How to implement this using <strong>ASP.NET and javascript</strong> ?</p>
|
javascript asp.net
|
[3, 9]
|
1,622,439 | 1,622,440 |
min3d and camera view
|
<p>How can I load the 3d object on a live camera view (in my android apps) using the <code>min3d</code> framework? </p>
<p>This is on of the method in Obj3DView class:</p>
<pre><code> public void initScene()
{
scene.lights().add(new Light());
scene.lights().add(new Light());
Light myLight = new Light();
myLight.position.setZ(150);
scene.lights().add(myLight);
IParser myParser = Parser.createParser(Parser.Type.OBJ, getResources(), "com.example.min3dtest:raw/face_obj",true);
myParser.parse();
faceObject3D = myParser.getParsedObject();
faceObject3D.position().x = faceObject3D.position().y = faceObject3D.position().z = 0;
faceObject3D.scale().x = faceObject3D.scale().y = faceObject3D.scale().z = 0.005f;
// Depending on the model you will need to change the scale faceObject3D.scale().x = faceObject3D.scale().y = faceObject3D.scale().z = 0.009f;
scene.addChild(faceObject3D);
}
</code></pre>
<p>The above code will load the 3d object. How I can call it to draw in a new class that will have a camera view as its background? </p>
|
java android
|
[1, 4]
|
975,614 | 975,615 |
Javascript alert box invoked from codebehind does not work
|
<p>I need alert boxes to let the user know of successful entry or data conflicts. I've tried the following and I get no errors and no alerts.</p>
<p>In the Save_Click:</p>
<pre><code> ClientScript.RegisterStartupScript
(GetType(), "Javascript", "javascript: UpdateComplete(); ", true);
</code></pre>
<p>also...</p>
<pre><code> ClientScript.RegisterClientScriptBlock(GetType(), "Javascript",
"<script>alert('Record Added Successfully')</script>");
</code></pre>
<p>also...</p>
<pre><code> Save.Attributes.Add("onclick","return ReqField1Validator()");
</code></pre>
<p>I've used GetType and TypeOf both.</p>
<pre><code> ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", "alert('See me?');", true);
return;
</code></pre>
<p>I've also tried the very popular suggestion </p>
<pre><code> Response.Write("<script>alert('Hello');</script>");
</code></pre>
<p>and nothing works. I've tried many variations on these, moved them to the Updated method and the click method and all over and nothing ever happens.</p>
<p>Can anyone tell me what I'm doing wrong or what I'm overlooking? Thanks for your time and patience.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
5,094,487 | 5,094,488 |
How to check if specified tag is inside in rad editor content
|
<p>I am using Telerik Rad editor. using vs 2010 with c#.</p>
<p>I bind the content to editor during page load.</p>
<p>On button click event ,i need to check if th particular tag (for ex: ) is inside the content in HTML mode.</p>
<p>I am using the following code.</p>
<pre><code> if (Radeditor1.Content.Contains("<title/>"))
{
}
</code></pre>
<p>Tag has value like welcome.</p>
<p>so Content .contains take it like as a string and return false.</p>
<p>How to check it.</p>
<p>Thanks and Regards,
Pooja</p>
|
c# asp.net
|
[0, 9]
|
5,705,844 | 5,705,845 |
Equivalent of strcmp() in Java for comparing byte arrays
|
<p>I use a byte array to fit 1024 bytes. The problem is, at separate times in my code I need to only use SOME of those bits. In C, I have used...</p>
<pre><code>byte buff[] = read();
strcmp( buff, "CMD\r\n" );
</code></pre>
<p>This would ignore all later bytes in the array, and only compare the first 5 bytes. Is there an easy way to do this in Java?</p>
|
java android
|
[1, 4]
|
1,115,584 | 1,115,585 |
$(window).scroll not accurate, when scrolling fast
|
<p>I'm trying to manipulate element's position, so between certain page scroll position, his css is changed.
Take a look at this simple example: <a href="http://jsfiddle.net/6RtTX/8/" rel="nofollow">http://jsfiddle.net/6RtTX/8/</a></p>
<p>The problem is - <code>$(window).scroll</code> is not so accurate, so if i scroll very fast, it becomes really messy.</p>
<p>Is there any way around for this problem? Can I queue those operations in $(window).scroll method?</p>
<p>Thanks in advance.</p>
|
javascript jquery
|
[3, 5]
|
3,255,671 | 3,255,672 |
How to extend an object while ignoring null values?
|
<p>Say for example I have an object of</p>
<pre><code>var user = {
"Name": "Dan",
"Age": 27,
"Hobbies": null
};
</code></pre>
<p>which I would like to merge onto the following base object so that my user object will have all the required properties</p>
<pre><code>var base = {
"Name": null,
"Height": null,
"Age": null,
"Hobbies": [
{ "Name": "Tennis", "Location": null },
{ "Name": "Football", "Location": null },
{ "Name": "Rugby", "Location": null }
]
};
</code></pre>
<p>The easiest way to merge to the two objects would be to extend the base object with the user object as follows</p>
<pre><code>$.extend(true, base, user);
</code></pre>
<p>which would modify the base object to be</p>
<pre><code>{
"Name": "Dan",
"Height": null,
"Age": 27,
"Hobbies": null
};
</code></pre>
<p>My question would be how can I get the extend method to not override null values? For example, in this instance, how can I still obtain a list of hobbies if the users hobby list is null so I end up with the following</p>
<pre><code>{
"Name": "Dan",
"Height": null,
"Age": 27,
"Hobbies": [
{ "Name": "Tennis", "Location": null },
{ "Name": "Football", "Location": null },
{ "Name": "Rugby", "Location": null }
]
};
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,532,430 | 4,532,431 |
Convert a method from java to C#.net
|
<p>I have a method in Java:</p>
<pre><code>public int getInt() {
IntByReference ibr = new IntByReference();
if (CFLib.INSTANCE.CFNumberGetValue(this, 4, ibr))
return ibr.getValue();
return -1; }
</code></pre>
<p>here is the Reference:</p>
<p><a href="http://developer.apple.com/iphone/library/documentation/CoreFoundation/Reference/CFNumberRef/Reference/reference.html" rel="nofollow">http://developer.apple.com/iphone/library/documentation/CoreFoundation/Reference/CFNumberRef/Reference/reference.html</a></p>
<p>How I Can copy this exactly for C#.net?</p>
|
c# java
|
[0, 1]
|
176,277 | 176,278 |
Get selected value dynamically and include that in if condition
|
<p>How to get value from select box dynamically without loading page and use that value in if condition ?</p>
|
php jquery
|
[2, 5]
|
4,454,737 | 4,454,738 |
Sortable list + ability to re-order each item by inputting rank #
|
<p>I've searched and searched about how to do this, but to no avail.</p>
<p>Basically I have a pretty standard jQuery sortable list, using a gripper to allow users to rearrange the list</p>
<p>What I would like to add is an input box to each list item, autofilled with that item's #, that allows users to enter any number (so long as it is <== the total # of items in the list)< and then hit "Enter" or press a button to re-order the list.</p>
<p>Please see the YouTube Playlist tool or Netflix Queue as an example of what I am referring to:
<a href="http://img195.imageshack.us/img195/7715/youtubeplaylistrearrangc.png" rel="nofollow">http://img195.imageshack.us/img195/7715/youtubeplaylistrearrangc.png</a>
http://www.thedigeratilife.com/images/netflix-queue-big.jpg</p>
<p>I cannot figure this out - Any assistance would be greatly appreciated!</p>
<p>Dave</p>
|
javascript jquery
|
[3, 5]
|
1,844,624 | 1,844,625 |
jQuery plugin: plugin methods calling other plugin methods?
|
<p>I have a plugin definedlike so:</p>
<pre><code>(function( $ ){
var mymethods = {
init: function(opts) {
// do some wild awesome magic
if (opts.drawtablefirst) $(this).drawtable(); // This doesn't actually work of course
},
drawtable: function() {
$(this).empty().append($("<table>")); // Empty table, I know...
}
}
// Trackman table
$.fn.myplugin = function(method) {
if (mymethods[method] ) {
return mymethods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method ) {
return mymethods.init.apply(this, arguments);
}
}
})( jQuery );
</code></pre>
<p>I want to be able to call the <code>drawtable</code> method from the <code>init</code> method, but that approach isn't working. I instantiate my plugin mostly like:</p>
<pre><code>$("div#container").myplugin({drawtablefirst: true})
</code></pre>
<p>But sometimes I don't want to pass <code>drawtablefirst</code> and then later call it manually, like:</p>
<pre><code>$("div#container").myplugin('drawtable')
</code></pre>
<p>What is the best way to configure this so <code>drawtable</code> is an accessible plugin method, but also can be called from within the plugin methods themselves such as <code>init</code>?</p>
<p>Also, accessing the original element in <code>drawtable</code> via <code>$(this)</code> doesn't seem to work. What's the proper approach there?</p>
<p>Thanks.</p>
|
javascript jquery
|
[3, 5]
|
1,698,086 | 1,698,087 |
how to prevent select item in dropdowlist using javascipt?
|
<p>I want prevent user to select dropdown list items using javascript methods. Is there anyway use <code>OnMouseKeyDown</code> so I can stop there. I donot want use <code>Enable=false</code>.</p>
<p>Javascripts gurus, help me out.</p>
|
javascript asp.net jquery
|
[3, 9, 5]
|
654,666 | 654,667 |
How to connect http server for every moment using c#?
|
<p>Files are uploading to http server then i need to connect to that server need to check if new file is there need to parse that file.please tell me how to connect to http server using c#?and how to check it's new file or old file?</p>
<p>uploaded url like</p>
<pre><code>http://uploadfiles.com/upload.php
</code></pre>
<p>It's not FTP.</p>
|
c# asp.net
|
[0, 9]
|
4,847,718 | 4,847,719 |
Is it bad practice declaring global variables in a.js file?
|
<p>I have a .js file where I am initialising two parameters which are used
in a seperate function : </p>
<pre><code>var submyvar1;
var submyvar2;
function init(myvar1 , myvar2){
submyvar1= myvar1;
submyvar2= myvar2;
}
function (){
//subvar1 & subvar 2 used here
}
</code></pre>
<p>Is declaring global variables like this a bad practice ?</p>
<p>If so, what is the alternative, wrap the entire .js file in an object ?</p>
|
javascript jquery
|
[3, 5]
|
5,893,418 | 5,893,419 |
Convert Java code to C#
|
<p>Please help convert the following Java code to C# ?</p>
<pre><code>String[] titles = new String[] { "Alpha", "Beta", "Gamma", "Delta" };
List<double[]> x = new ArrayList<double[]>();
for (int i = 0; i < titles.length; i++) {
x.add(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,13,14,15 });
}
</code></pre>
<p>And what is this code doing? </p>
<p>Thanks</p>
|
c# java
|
[0, 1]
|
4,597,067 | 4,597,068 |
How to access x and y values from a jQuery XY pad
|
<p>Im using this jQuery library called jQuery Control. <a href="https://github.com/aterrien/jQuery-Kontrol" rel="nofollow">https://github.com/aterrien/jQuery-Kontrol</a>
the XY pad gives me a value like this :</p>
<pre><code>Object {x: 112, y: 77}
</code></pre>
<p>how can i access x and y separately and use them for different parameters.
here is the complete code : <a href="http://jsfiddle.net/ehsanziya/Hs5ff/2/" rel="nofollow">http://jsfiddle.net/ehsanziya/Hs5ff/2/</a></p>
|
javascript jquery
|
[3, 5]
|
3,025,285 | 3,025,286 |
Adding a link to an image
|
<p>Is there a way to add a link to an image using an input box, let say you have an image uploaded and you have an input, </p>
<pre><code>Image Link: <input type="text" id="image_link"/>
</code></pre>
<p>in this box a user types in www.google.com
and you want the link to append to the image.
Is there a way to do this? </p>
|
javascript jquery
|
[3, 5]
|
1,597,873 | 1,597,874 |
c# asp .net Add column with static text on gridview
|
<p>I am working on an asp .net project.How can i add a static column with static text to a GridView which is loaded with a dataset?. For ex i want a column Check which has values in every row Checked. </p>
|
c# asp.net
|
[0, 9]
|
4,088,308 | 4,088,309 |
how to convert datatable to list?
|
<p>I have a dataset with few rows and columns in it, in the columns state there will be many matching rows, i want all the rows with same state to bind it to some list..how to achieve it.</p>
<p>I need it because i have same capital in all the rows where i have same state, so i don' t want the loop to run each and every time...instead i want to bind all the rows where there is same capital and use that data.</p>
<pre><code> DataSet ds = new DataSet();
da.Fill(ds, "table1");
DataTable dt = new DataTable();
dt = ds.Tables[0];
</code></pre>
<p>let me be more clear</p>
<p>i have a dataset with columns state, capital, population...i want to use this data in some other method so im using loop, when the state is tamilnadu, the capital and population will be same in all the rows..so its unnecessary to loop again and again for the data, so instead i want to bind the data with same state to something and use it..this is my requirement..</p>
|
c# asp.net
|
[0, 9]
|
4,941,518 | 4,941,519 |
stopping jquery animation when not hovering
|
<p>I posted a question earlier about a <code>div</code> animation and I'm trying to modify it a bit. I have a <code>div</code> that rotates when the page loads. When hovering over it, I'd like for it to stop.</p>
<p>Here's the script</p>
<pre><code>rotate(); //the function which rotates the div
$("#div2").hover(function() {
$("#div2").stop();
});โ
</code></pre>
<p>Here's my JS page</p>
<pre><code>var obj = "div2";
var angle = 0;
var interval = 2323;
increment = 5;
function rotate() {
$('#' + obj).css({
'-moz-transform': 'rotate(' + angle + 'deg)',
'msTransform': 'rotate(' + angle + 'deg)',
'-webkit-transform': 'rotate(' + angle + 'deg)',
'-o-transform': 'rotate(' + angle + 'deg)'
});
angle += increment;
setTimeout(rotate, interval);
}โ
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,547,805 | 4,547,806 |
How to hide any row in a table whose third cell value does not match a given string in JQuery
|
<p>If i have a table:</p>
<pre><code><table id="myTable">
<tr>
<td>1</td><td>2</td><td>NoMatch</td><td>4</td>
</tr>
<tr>
<td>1</td><td>2</td><td>Match</td><td>4</td>
</tr>
</table>
</code></pre>
<p>I have been trying:</p>
<pre><code>$(document).ready(function () {
$('input#myInput').keyup(function (val) {
// for each third td of each row, if this value does not contain: this.val() then hide it
});
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,825,688 | 3,825,689 |
send JSON android object to .net server
|
<p>I have .net web service that expect JSON object. This web service has method for return token: </p>
<pre><code>public string GetToken(string username, string password)...
</code></pre>
<p>This is my site url for direct access (when I field manually id, method and params and paste in browser url I receive response )</p>
<pre><code>http://mysite.com/JsonRPC.aspx?id={0}&method={1}&params={2}
</code></pre>
<p>On stackoverflow I found way to create and send JSON object in android , here is example:</p>
<pre><code>HttpPost request = new HttpPost(URL);
JSONStringer json = new JSONStringer()
.object()
.key("username").value("username")
.key("password").value("password")
.endObject();
Log.i("json",json.toString());
StringEntity entity = new StringEntity(json.toString());
entity.setContentType("application/json;charset=UTF-8");//text/plain;charset=UTF-8
entity.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE,"application/json;charset=UTF-8"));
request.setEntity(entity);
// Send request to WCF service
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpResponse response = httpClient.execute(request);
</code></pre>
<p>My problem is that I don't know how to call my .net web service. What format should be URL variable , where to specific method name , and how to specific method parameters ?</p>
<p>Please give me code </p>
<p>Thanks</p>
|
java android
|
[1, 4]
|
504,966 | 504,967 |
How can I get package name in android?
|
<p>I need to write some util class by myself and I need the packagename of android app.
While I found the packageManager which only can be used in Activity and so on that has context. I only want to get packagename in my class which will be used in android app. So how can I do this? Thank you!</p>
|
java android
|
[1, 4]
|
5,216,747 | 5,216,748 |
Anonymous function on page load
|
<p>I'm trying to get better with JavaScript and learn how to utilize my code in functions and keep everything clean. I'm trying to run a function on page-load...</p>
<pre><code>var setColors = function(){
this.init = function(){
$.getJSON('js/colors.json', function(colors) {
$.each(colors, function(i, colors) {
$('<li>', {
text: colors['color'],
'name' : colors['color'],
'data-hex' : colors['hex'],
'data-var' : colors['var']
}).appendTo('#picker');
})
});
}
}
</code></pre>
<p><em>(This is not a color-picker, just a list of colors)</em>
I want <code>setColors()</code> to be executed as soon as the page starts. I read that an anonymous function runs automatically, but this one isn't, I also tried...</p>
<pre><code>$(function(){
setColors();
});
</code></pre>
<p>Below the <code>setColors()</code> function and that isn't working ether (The page is just blank). What am I doing wrong and how do I get my function to run on page load? I'm trying to learn so an explanation would be great.</p>
|
javascript jquery
|
[3, 5]
|
3,483,688 | 3,483,689 |
getting nodes without texts
|
<pre><code>$("br").parent().contents().each(function(i) {
if(this.nodeType == "#Text")
{
alert(this.textContent);
}
});
</code></pre>
<p>i am trying to select all texts not surrounded by html tags, but separated via <code><br></code></p>
<p>doing this, sometimes returns a lot of alert messages, even when there should only be a couple. </p>
<p>i have tried to filter it out using </p>
<pre><code>if(this.nodeValue != "") or if(this.textContent != "")
</code></pre>
<p>but still, empty alert messages pop up.</p>
<p>I suspect its the whitespaces in the html document (i dont control it). I only want to display <code>this.textContent</code>, which actually has visible text.</p>
|
javascript jquery
|
[3, 5]
|
4,553,589 | 4,553,590 |
Jquery Get all the array elements
|
<p>I am programming beginner..</p>
<p><strong>Code</strong></p>
<pre><code> <script type="text/javascript">
$(function() {
var course_category = "<?php echo $_REQUEST['cities'] ?>";
alert(course_category); // alerts as Array
});
</code></pre>
<p>when i do print_r in php (<code>print_r($cities);</code>) i get </p>
<pre><code> Array ( [0] => BLR [1] => DEL [2] => HYD [3] => MUM
</code></pre>
<p>now i want to print the array in above jquery </p>
<p><strong>try</strong></p>
<pre><code> $.each(course_category, function(key,value){
alert(value);
}};
</code></pre>
<p>printns <strong>A,r,r,a,y</strong></p>
|
php javascript jquery
|
[2, 3, 5]
|
2,031,855 | 2,031,856 |
asp:menu in safari and chrome
|
<p>I have seen some posts of the asp:menu and the browsers Chrome and Safari here, but nevertheless, I think the problem that I have is different than other problems.</p>
<p>I am using the following code in order to display the menu:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
if (Request.UserAgent.IndexOf("AppleWebKit") > 0)
{
Request.Browser.Adapters.Clear();
}
...
}
</code></pre>
<p>However, the problem is still there if I start the browsers for the very first time, the menu is displayed vertically instead of horizontally. After a page refresh, the menu works fine... How is that possible? Or is the problem that simple,and I need to place the code in somewhere earlier (eg Page_PreInt).</p>
<p>Thanks in advance,
Patto</p>
|
c# asp.net
|
[0, 9]
|
2,251,637 | 2,251,638 |
popup window according to CheckBox checked
|
<p>If user don't checked, I want to show asp:ModalPopupExtender and get numeric value from this form.</p>
<p>I'm using asp.net wizard control. I don't know "finish" button id. Can somebody help me?</p>
<p><img src="http://i.stack.imgur.com/V7ZnU.png" alt="enter image description here"></p>
|
c# asp.net
|
[0, 9]
|
3,551,731 | 3,551,732 |
jQuery disable/re-enable validators on a page
|
<p>When I need to disable/re-enable validator I usually use jQuery code like so:</p>
<pre><code> ValidatorEnable($('[id*=DueDateRequiredValidator]')[0], false);
</code></pre>
<p>and to re-enable it back:</p>
<pre><code> ValidatorEnable($('[id*=DueDateRequiredValidator]')[0], true);
var validator = $('[id*=DueDateRequiredValidator]')[0];
validator.isvalid = true;
ValidatorUpdateDisplay(validator);
</code></pre>
<p>And it works. But now I need to disable/re-enable a large number of validators, but only a subset of validators, not entire set on a page. There's too many of them to refer each validator by "id".</p>
<p>I tried something like this but it didn't work, don't know why:</p>
<pre><code> $.each(Page_Validators, function(index, validator) {
if ( validator.CssClass == "noinjuries" )
{ ValidatorEnable(validator, false); }
});
</code></pre>
<p>What's the best way to do this, if any? </p>
|
asp.net jquery
|
[9, 5]
|
3,144,848 | 3,144,849 |
Game Engine Remake - Trouble Choosing a Language /API(Java or Python)
|
<p>The engine I've been wanting to remake is from a PlayStation 1 game called Final Fantasy Tactics, and the game is basically a 2.5D game I guess you could say. Low-resolution sprites and textures, and 3D maps for battlefields. The plan is to mainly load the graphics from a disc, or .iso (I already know the sectors the graphics need to be read from) and fill in the rest with game logic and graphics routines, and probably load other things from the disc like the map data.</p>
<p>I want this to be a multiplatform project, because I use Linux and would like for more people to join in on the project once I have enough done (and it's easy to get more people through platforms like Windows). I'll be making a website to host the project. Also, none of the graphics will be distributed, they'll have to be loaded from your own disc. I'd rather not have to deal with any legal issues.. At least not soon after the project is hosted on my site. </p>
<p>But anyway, here's my dilemma- I know quite a bit of Java, and some Python, but I'm worried about performance/feature issues if I make this engine using one of these two languages. I chose them due to familiarity and platform independence, but I haven't gotten too into graphics programming yet. I'm very much willing to learn, however, and I've done quite a bit of ASM work on the game- looking at graphics routines and whatnot. What would be the best route to take for a project like this? Oh, and keep in mind I'll eventually want to add higher-resolution textures in an .iso restructuring patch or something.</p>
<p>I'm assuming based on my results on Google that I could go with something like Pygame + OpenGL, JOGL, Pyglet, etc. Any suggestions on an API? Which has plenty of documentation/support for game or graphics programming? Do they have any serious performance hits?</p>
<p>Thank you for your time.</p>
|
java python
|
[1, 7]
|
3,118,072 | 3,118,073 |
Disabling a checkbox in asp.net
|
<p>I am dynamically creating a CheckBox and setting the disabled property like this:</p>
<pre><code>chk.Disabled = false.
</code></pre>
<p>This renders the following HTML:</p>
<pre><code><input type="checkbox" disabled="disabled" .../>
</code></pre>
<p>On the click of the checkbox, I have a JS function that tries to enable it by doing a:</p>
<pre><code>//get reference to the checkbox
chk.disabled = false;
</code></pre>
<p>This does not work. Any help?</p>
|
asp.net javascript
|
[9, 3]
|
1,900,649 | 1,900,650 |
How to find control on Jquery tab control
|
<p>I am using Jquery tabcontrol i.e using tabs() plugin. I have created 5 asp.net pages & assigned each page to each tab. Everything is working fine but when i try to find a control using $find("cntName") it always returns null. When i run the same page directly i.w without using tab control. It finds the control.when i click on viewsource it shows only ` </p>
<pre><code><div id="tabs">
<ul>
<li><a href="Tab1General.aspx" id="tab1">General</a></li>
<li><a href="Tab2DetailLines.aspx">Detail Lines</a></li>
<li><a href="Tab3InqQuotes.aspx" id="tab3">Inq/Quotes</a></li>
<li><a href="Tab4GrnDetails.aspx">Grn Details</a></li>
<li><a href="Tab5InvoiceDetails.aspx">Invoice Details</a></li>
</ul>
</div>
</code></pre>
<p>with jquery javascript & html tags. How do i find control on jquery tab control?</p>
|
jquery asp.net
|
[5, 9]
|
1,300,448 | 1,300,449 |
Converting String to class
|
<p>I have a class <code>AuthUser</code></p>
<pre><code>public class AuthUser
{
public int UserID { get; set; }
public string UserNo { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
}
</code></pre>
<p>I have converted the class to a <code>string</code>.</p>
<pre><code>AuthUser au = new AuthUser();
//dtUserDetails is a data table
if (dtUserDetails.Rows.Count > 0)
{
DataRow DR = dtUserDetails.Rows[0];
au.UserID = Convert.ToInt32(DR["UserID"].ToString());
au.UserNo = DR["UserNo"].ToString();
au.UserName = DR["UserName"].ToString();
au.Password = DR["Password"].ToString();
}
string userData = au.ToString();
</code></pre>
<p>Now I need to convert above <code>UserData</code> String back to object type to retrieve data. How can I do this?</p>
|
c# asp.net
|
[0, 9]
|
3,014,889 | 3,014,890 |
importance of super keyword in android
|
<p>I am new to Android.I want to know whats the use of super keyword in android.</p>
<p>Thanks in advance
Tushar</p>
|
java android
|
[1, 4]
|
4,758,903 | 4,758,904 |
How to reset the form fields after moving to other tab or on closing the current tab,java and jquery
|
<p>I am using jquery-ui tabs ...Actually i want to reset the form fields after closing the current tab or if we move to another tab means form fields should be reseted.. I don't know how to reset the form fields at the close of tab.</p>
<p>Anything help me in this.</p>
|
java javascript jquery
|
[1, 3, 5]
|
5,660,933 | 5,660,934 |
Using JavaScript which of these code chunks is best for real world use?
|
<p>This is just an example but there are a bunch of similar scenarios sprinkled throughout the code so it would be nice to choose the best solution and stick with it. The first is probably quickier but the second takes up less space*</p>
<p>*less space when reading/fixing code and less space when downloading.</p>
<pre><code>if (imageCountCurrent <= 0){
$('#next_arrow').addClass('disabled');
}
else{
$('#next_arrow').removeClass('disabled');
}
if (imageCountCurrent >= imageCount - 5){
$('#prev_arrow').addClass('disabled');
}
else{
$('#prev_arrow').removeClass('disabled');
}
$('#.arrow').removeClass('disabled');
if (imageCountCurrent <= 0){
$('#next_arrow').addClass('disabled');
}
if (imageCountCurrent >= imageCount - 5){
$('#prev_arrow').addClass('disabled');
}
</code></pre>
|
javascript jquery
|
[3, 5]
|
3,945,955 | 3,945,956 |
How to get rid of "Menu_HoverRoot(this) Object Expected" error in ASP.NET application (SharePoint 2007)
|
<p>I have just deployed my ASP.NET/C# code to a sharepoint server and am getting this error when hoving over the menu:</p>
<p>Menu_HoverRoot(this) Object Expected</p>
<p>I have absolutely no idea what is causing it, but have seen other people with this problem, and it seems to be something with WebResource.axd.</p>
<p>Could someone help me with this? Thanks.</p>
|
asp.net javascript
|
[9, 3]
|
4,924,670 | 4,924,671 |
Data structure for Statistics and Achievements system
|
<p>I'm implementing an Statistics + Achievements system. Basically the structure is:</p>
<ul>
<li>An Achievement have many related Statistics, this relations must associate each Achievement with the required Statistics (and it value). For example the Achievement1 needs the Statistic1 with value 50 (or greater) and the Statistic2 with value 100 (or greater).</li>
<li>Given an Statistic I need also know what are the related Achievements (in order to check them when the Statistic changes.</li>
</ul>
<p>Both Stats and Achievements have an unique id.</p>
<p>My problem is I donยดt know whats the best data(s) structure(s) for representing that. By the way I'm using:</p>
<pre><code>SparseArray<HashMap<Statistic, Integer>> statisticsForAnAchievement;
</code></pre>
<p>For the first point where the index of the array is the Achievement ID and the HashMap contains the Statistic/TargetValue pairs. And a:</p>
<pre><code>SparseArray<Collection<Achievement>> achievementsRelatedToAStatistic;
</code></pre>
<p>For the second point where the index is the StatisticID and the item is the collection of Achievements related.</p>
<p>Then I need to handle both objects keeping it coherence. </p>
<p>Is there an easier way of representing that? Thanks</p>
|
java android
|
[1, 4]
|
158,521 | 158,522 |
Why does the click function not work after I change the class of a button?
|
<p>I have a set of buttons(previous & next) that the user clicks.</p>
<pre><code><a id="prev_btn" class="prev_1" href="#">Previous</a>
<a id="next_btn" class="next_1" href="#">Next</a>
</code></pre>
<p>When the user clicks on the next button(.next_1), it changes the class name of the button to next_2 and changes the the previous button(.prev_1) to prev_2. Once the class name is changed, the click function that is set for prev_2 doesn't work.</p>
<pre><code>$('.next_1').click(function() {
$('#next_btn').removeClass('next_1').addClass('next_2');
$('#prev_btn').removeClass('prev_1 inactive').addClass('prev_2');
});
$('.prev_2').click(function() {
alert('this works');
});
</code></pre>
<p>Why does the click function not work after I change the class using jquery?</p>
|
javascript jquery
|
[3, 5]
|
2,068,272 | 2,068,273 |
php - Calling a jquery dialog box in a div loop
|
<p>How do i call a jquery dialog box from a div in a loop?</p>
<p>See for instance, clicking the <code><p></code> will show up the profile of selected database user. </p>
<p>Ex:</p>
<pre><code><div id="db-users">
<div id="user-info1"> //db userinfo 1
<p>ID#001 John Smith</p>
<div id="dialog-box">Profile of John Smith</div>
</div>
<div id="user-info2"> //db userinfo 2
<p>ID#002 John Doe</p>
<div id="dialog-box">Profile of John Doe</div>
</div>
</div>
</code></pre>
<p>EDIT: By the way , here is what i have done so far</p>
<pre><code>$('p').click(function() {
$('#dialog-box').dialog({
modal: true,
width:560,
height: 500,
draggable: false,
buttons: {
Close: function() {
$( this ).dialog( "close" );
}
}
});
});
</code></pre>
<p>Only one dialog box is showing up, only for John Smith. I don't have the idea to come up the desired output. Any help would much appreciated. Thanks.</p>
<p>EDIT 2: I added IDs to all div, to identify each div. Now, using jquery, how to implement q dialog box to show up the info when Name is clicked?</p>
|
php javascript jquery
|
[2, 3, 5]
|
3,423,707 | 3,423,708 |
cannot get results from an asp.net page to be used in the jquery token input drop-down
|
<p>please help me I'm stuck here for a long time with no solution, I'm trying to use the jQuery token input to display selection result from an asp.net page, the page is called correctly and it generates the right JSON form, but the result didn't appear in the drop-down list, here is the code of the input field in the HTML,</p>
<pre><code><div>
<input type="text" id="textBox2" name="blah2" runat="server"/>
<input type="button" value="Submit" />
<script type="text/javascript">
$(document).ready(function () {
$("#textBox2").tokenInput("Default.aspx", {
theme: "facebook"
});
});
</script>
</div>
</code></pre>
<p>and the code of the aspx page is something like this:</p>
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/json";
string searchParam = Request.QueryString["q"];
Country country = new Country();
country.name = searchParam;
country.id = searchParam;
List<Country> countryList = new List<Country>();
countryList.Add(country);
JavaScriptSerializer serializer = new JavaScriptSerializer();
string serialized = serializer.Serialize(countryList);
Response.Write(serialized);
}
</code></pre>
<p>is there any thing more i should do,
please help,
thanks in advance,</p>
|
jquery asp.net
|
[5, 9]
|
3,326,693 | 3,326,694 |
Total number with jquery
|
<p>How can total the number of characters between the <code>p</code> tags with jQuery?</p>
<p>I try as:</p>
<p><strong><a href="http://jsfiddle.net/TPFkF/" rel="nofollow">DEMO</a></strong></p>
<p>html:</p>
<pre><code><b>1</b>
<b>1</b>
<b>1</b>
</code></pre>
<p>js:</p>
<pre><code>var tBytes = 0,
tFiles = $('b').length;
for (var tFileId = 0; tFileId < tFiles; tFileId++) {
tBytes += $('b').text();
}
alert(tBytes);โ // Output is : 0111111111 I want output as: 3
</code></pre>
<p>What do i do?</p>
<p>โ</p>
|
javascript jquery
|
[3, 5]
|
3,822,975 | 3,822,976 |
ASP.Net: Dynamic JavaScript path / src
|
<p>I try to make Folder for things in my ASP.Net Application (e.g. all with Finance in /Finance).</p>
<p>No I bind an JavaScript in the MainPage:</p>
<pre><code><script type="text/javascript" src="Helper/jquery-1.3.2.min.js"></script>
</code></pre>
<p>But when I now open ~/Finance/Payment.aspx I get an JavaScript Error with "Path ~/Finance/Helper/jquery..." not found.</p>
<p>What to do?</p>
|
asp.net javascript
|
[9, 3]
|
3,793,405 | 3,793,406 |
Add dynamically controls to asp placeholder in addition to controls which already exist in it
|
<p>Add dynamically controls to asp placeholder in addition to controls which already exist in it ?
how to add them?</p>
<p>for example - on page load I added to textboxs and labels to placeholder on button click I need to add additionally one more textbox.</p>
|
c# asp.net
|
[0, 9]
|
2,237,456 | 2,237,457 |
Why I can't get position of all items in my ListView?
|
<p>My problem is, I have listView with contacts, then I'm using </p>
<pre><code>onItemClickListener and Object obj = lImenik.getItemAtPosition(position);
String tmp = obj.toString();
</code></pre>
<p>to get position of clicked item. That works fine for visible items.</p>
<p>But the problem is when I scroll little down and click on item which wasn't visible in the first place and try to get that position, I don't get it. Do I have to load differently? </p>
<p>for example:</p>
<pre><code> lImenik.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> adapter, View view,
int position, long id) {
Object obj = lImenik.getItemAtPosition(position);
String tmp = obj.toString();
Toast.makeText(context, tmp, Toast.LENGTH_LONG).show();
}
});
}
</code></pre>
|
java android
|
[1, 4]
|
441,319 | 441,320 |
Is there an equivalent of ? : operator of C# in Javascript/Jquery?
|
<p>I want to write the following C# code equivalent in JavaScript/jQuery</p>
<pre><code>(x == 0 && y < 0 ? x : x+y)
</code></pre>
<p>Is there an equivalent shorthand way such as above in JavaScript/jQuery or will I have to write the whole if else. </p>
<p>I need to put such a condition in the for loop definition, </p>
<pre><code>for (i=0; i< (x == 0 && y < 0 ? x-y : x+y); i++)
</code></pre>
<p>and thus was wondering if there is a way I could do something similar in JavaScript. As far as I know, I will have to write an if else, compute the value and then use that value. But perhaps somebody knows a better way?</p>
|
c# javascript jquery
|
[0, 3, 5]
|
2,081,192 | 2,081,193 |
How to access PHP methods inside a Javascript?
|
<p>I have made a method which will delete a file.
first i echo the url to this file.
like this </p>
<pre><code>echo "<a href='$fulr'>$filename</a>";
</code></pre>
<p>now basicaly i want to call the function <code>deletefile($file);</code>
how can i do it like this </p>
<pre><code>echo "<a onclick='$this->deletefile($filename)' href='$fulr'>$filename</a>";
</code></pre>
<p>is that even posible? </p>
<p>Or how can i implement something similiar inside the php code?</p>
|
php javascript jquery
|
[2, 3, 5]
|
780,300 | 780,301 |
JQuery delete button not working
|
<p>Hi I have a JQuery function which creates a popup dialog box, which you have to click to continue, however whilst the box pops up and everything works fine the link doesn't trigger the php link.</p>
<p>Below is the JQuery code:.</p>
<pre><code>jQuery('.delete-row').click(function () {
var conf = confirm('Continue delete?');
if (conf) jQuery(this).parents('tr').fadeOut(function () {
jQuery(this).remove();
});
return false;
});
</code></pre>
<p>And here is my code which calls the dialog box and should pass the php info to the block.php page:</p>
<pre><code> echo "<a href=\"block.php?ip_address={$ip_address}&id={$id}&userna={$username1}\" class='delete-row' data-original-title='Delete'>Block</a>";
</code></pre>
|
php jquery
|
[2, 5]
|
1,016,248 | 1,016,249 |
Calling a server side method in client side in asp.net
|
<p>This is the JavaScript that I have to use in my ASP.NET page, how to change it so that it works in ASP.NET?</p>
<pre><code><script type="text/javascript">
window.onload = function ()
{
/**
* These are not angles - these are values. The appropriate angles are calculated
*/
<% Message message = (Message)request.getSession().getAttribute("message");
out.print("var pie1 = new RGraph.Pie('pie1',"+Statistics.messagePercentStats(message.getMessageID()) + ")"); %>
// Create the pie object
pie1.Set('chart.key', ['Read', 'Received', 'Not Received']);
pie1.Set('chart.colors',['#86cf21', '#eaa600', '#e01600']);
pie1.Set('chart.title', "Message Status");
pie1.Set('chart.align', 'left');
pie1.Set('chart.shadow', true);
pie1.Set('chart.radius', 80);
pie1.Set('chart.labels.sticks', false);
pie1.Set('chart.highlight.style', '2d'); // Defaults to 3d anyway; can be 2d or 3d
if (!RGraph.isIE8())
{
pie1.Set('chart.zoom.hdir', 'center');
pie1.Set('chart.zoom.vdir', 'up');
pie1.Set('chart.labels.sticks', false);
pie1.Set('chart.labels.sticks.color', '#aaa');
}
pie1.Draw();
}
</script>
</code></pre>
<p>How should I change this line to get value from my class which is named <code>messagePercentStats</code>?</p>
<pre><code>RGraph.Pie('pie1',"+Statistics.messagePercentStats(message.getMessageID()) + ")"); %>
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,374,216 | 2,374,217 |
jquery equivalent to javascript piece of the code
|
<p>I have this part of the code which works very well on javascript:</p>
<pre><code>document.getElementById("firma").onkeypress = function(e) {
return restrictCharacters(this,e,alphaOnly);
};
</code></pre>
<p>i'ts part of some script and this part joins it on id="firma"</p>
<p>I'm courious to know what is equivalent if this code in jquery?</p>
<p>it's something like $( "#firma" ).....</p>
|
javascript jquery
|
[3, 5]
|
3,345,755 | 3,345,756 |
How to post status updates on myspace using asp.net C#?
|
<p>Can someone please tell how can I post status updates on myspace using asp.net C# ?</p>
<p>Thanks :D</p>
|
c# asp.net
|
[0, 9]
|
2,146,739 | 2,146,740 |
Using custom adapter?
|
<p>I want to use custom adapter to fill my list view with phone contact data.
I have xml with 2 text views for contact name and contact number.
Also I have xml with list view and 2 buttons which I need to use latter.
I want to extend Activity if is possible not ListActivity!?
I tried lots of things(BaseAdaper, SimpleCursorAdapter ...), but every time I get an error.
I would really appreciate some help, because I don't know what to do with it.</p>
<p>this is my code:</p>
<p>public class Imenik extends ListActivity{</p>
<pre><code>TextView ime, broj;
ListView myListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//setContentView(R.layout.imeniklista);
ime = (TextView) findViewById(R.id.tvImeImenik);
broj = (TextView) findViewById(R.id.tvSamoProba);
Cursor contactCursor = this.managedQuery(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
myListView = (ListView) findViewById(R.id.lvImenik);
this.setListAdapter(new MyContactAdaper(this, contactCursor));
}
private class MyContactAdaper extends CursorAdapter{
private Context myContext;
private Cursor myCursor;
private LayoutInflater myLayoutInflater;
public MyContactAdaper(Context context, Cursor cursor) {
super(context, cursor, true);
// TODO Auto-generated constructor stub
myLayoutInflater = LayoutInflater.from(context);
myContext = context;
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
// TODO Auto-generated method stub
ime.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME)));
broj.setText(cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)));
}
@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
// TODO Auto-generated method stub
final View view = myLayoutInflater.inflate(R.layout.imenik, parent, false);
return view;
}
}
</code></pre>
|
java android
|
[1, 4]
|
235,984 | 235,985 |
How to disable Windows default shortcut & use user defined functions in javascript/ASP.net (web application)
|
<p>I am developing web application, in that I want to use hot eys functionality, like combination of Ctrl + F1 ..... F12. But there are some keys having default functionality like F1 is used for Help, ctrl + f4 used to close windo or do. f11 for full screen.So how to disable their default functionality to use my function on key press. how can i able to disable the default functionality of these keys?</p>
|
javascript asp.net
|
[3, 9]
|
3,998,685 | 3,998,686 |
Refresh Treenode parent to show most current child nodes
|
<p>I am able to select and expand to a particular tree node programmatically, but unable to refresh it to reflect most current data in the table. Is there Treeview1.Refresh() method ? or something like that to effect? any help will be appreciated. I have a treeview and I am adding child nodes to a parent node by having the user enter data and click on a button. After that insert into the table is done, I want the parent node to refresh and show all child entries.</p>
<pre><code> protected void PopulateNode(Object sender, TreeNodeEventArgs e)
{
switch (e.Node.Depth)
{
case 0:
PopulateChild(e.Node);
break;
default:
//PopulateChild(e.Node);
break;
}
}
protected void PopulateChild(TreeNode node)
{
DataSet ResultSet = RunQuery("Select Id From tbl");
if (ResultSet.Tables.Count > 0)
{
foreach (DataRow row in ResultSet.Tables[0].Rows)
{
TreeNode newNode = new TreeNode();
newNode.Text = row["Id"].ToString();
newNode.Value = row["Id"].ToString();
newNode.PopulateOnDemand = true;
newNode.SelectAction = TreeNodeSelectAction.Expand;
node.ChildNodes.Add(newNode);
}
}
}
DataSet RunQuery(String QueryString)
{
String ConnectionString = "asdasdasdasd";
OleDbConnection DBConnection = new OleDbConnection(ConnectionString);
OleDbDataAdapter DBAdapter;
DataSet ResultsDataSet = new DataSet();
try
{
DBAdapter = new OleDbDataAdapter(QueryString, DBConnection);
DBAdapter.Fill(ResultsDataSet);
DBConnection.Close();
}
catch (Exception ex)
{
if (DBConnection.State == ConnectionState.Open)
{
DBConnection.Close();
}
}
return ResultsDataSet;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,457,010 | 2,457,011 |
Best way to store a key=>value array in Javascript?
|
<p>What's the best way to store a key=>value array in javascript, and how can that be looped through?</p>
<p>The key of each element should be a tag, such as <code>{id}</code> or just <code>id</code> and the value should be the numerical value of the id.</p>
<p>It should either be the element of an existing javascript class, or be a global variable which could easily be referenced through the class.</p>
<p>Jquery can be used</p>
|
javascript jquery
|
[3, 5]
|
1,964,946 | 1,964,947 |
javascript toggle to jQuery slow toggle slide
|
<p>Hello I have a bullet tree that toggles fine, but I wanted to do a one of those sliding toggles that look pretty in jquery...can you help?</p>
<p>javascript:</p>
<pre><code>function toggle(id) {
var e = document.getElementById(id);
if (e.style.display == '')
e.style.display = 'none';
else
e.style.display = '';
}
</code></pre>
<p>html:</p>
<pre><code><ul style="text-align: left;">
<li>
<a href="#" onclick="toggle('node1')">All</a> <input type="checkbox" name="sors" value="A" checked="checked"/>
<ul id="node1" style="display:none">
<li>
<a href="#" onclick="toggle('node2')">Organic</a>
<ul id="node2" style="display:none">
<li>MCA <input type="checkbox" name="sors" value="A" checked="checked"/></li>
<li>MCB <input type="checkbox" name="sors" value="A" checked="checked"/></li>
</ul>
</li>
<li>COMM &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="sors" value="A" checked="checked"/></li>
<li>DMISA &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="sors" value="A" checked="checked"/></li>
</ul>
</li>
</ul>
</code></pre>
|
javascript jquery
|
[3, 5]
|
4,895,998 | 4,895,999 |
puting 1D arrays into the end of the 2D arrays
|
<p>Lets say i've got this code:</p>
<pre><code>float[] bigA = {1,2,3,4};
for (int i = 0; i < bigA.length; ++i) {
float abc = bigA[i] - 1;
float[] bigerAbc = {abc};
float[][] wcs = {bigerAbc};
}
</code></pre>
<p>The <code>float[][] wcs = {abc};</code> part is defining the wcs array everytime, and the end result of wcs is {{3}}, but i want wcs to be defined as an empty array, and instead of <code>float[][] wcs = {abc};</code> i want to write some code to add bigerAbc in the end of the wcs, and in the end wcs should be more like this {{0},{1},{2},{3}}...</p>
<p>To the question is: how can i add a 1D array to the end of a 2D array?</p>
|
java android
|
[1, 4]
|
347,389 | 347,390 |
Jquery selectbox script not auto-initializing
|
<p>I am trying to implement the jquery selectbox script. I have made all the changes needed to css and html markup and the selectbox is working and appearing fine. the problem is. It is not initializing automatically at page load. </p>
<p>I have to manually run <code>$("SELECT").selectBox();</code> from the firebug script panel to make it work. I have tried everything from putting hte initializing command at the bottom of the page, and putting it in <code>$(document).ready()</code> as well. Nothing works. What am i missing?</p>
<p><strong>EDIT</strong>: The code I am running involves dynamic select box generation from the server. </p>
|
javascript jquery
|
[3, 5]
|
4,219,825 | 4,219,826 |
jQuery extension (scope?) question
|
<p>I have some confusion over a jQuery extension not working as I'd expect. I have the following function defined:</p>
<pre><code>$.fn.poster = function() {
this.each(function() {
self = $(this);
self.click(function() {
/* does stuff */
$.post(url, data, function(d, t) { handle_storage(d, t, self); }, "json");
});
});
}
handle_storage = function(storages, status, caller) {
container = $("<div>");
$("<span>").poster().html(storage.name).appendTo($("<li>").addClass("folder").appendTo(container));
}
$(function() {
$("li.storage span").poster();
});
</code></pre>
<p>The initial call to poster() in the ready function works, but inside the handle_storage() callback, I get a "poster() is undefined" error. What gives?</p>
|
javascript jquery
|
[3, 5]
|
1,372,602 | 1,372,603 |
Bind touch event to elements created by array
|
<p>How to make touch event work on single element of each created by this function. This code doesn't work since it makes all of the '#demo-1 p' background-color change together even I touch one of them.</p>
<pre><code>function token1(r) {
for (var j = 0; j < r.length; j++) {
if (r[j].match(srr[0], "g")) {
$('<p>').html(r[j]).appendTo("#demo-1");
scnt++;
$('#demo-1 p').bind("touchstart", function (event) {
$('#demo-1 p').css('background-color', 'red')
});
$('#demo-1 p').bind("touchmove", function (event) {
$('#demo-1 p').css('background-color', 'white')
});
$('#demo-1 p').bind("touchend", function (event) {
$('#demo-1 p').css('background-color', 'white')
});
}
}
}
</code></pre>
|
android jquery
|
[4, 5]
|
1,816,214 | 1,816,215 |
how to send a variable from jquery to a template?
|
<p>how to send a variable from jquery to a template?</p>
|
javascript jquery
|
[3, 5]
|
2,108,484 | 2,108,485 |
Populate a TextBox from a DropDownList selection ASP.NET/Javascript
|
<p>I have a DDL and ASP.NET Textbox. I would like to populate the text box with the option I choose from the DDL. I need this to be instant and not use postbacks so it would seem JavaScript would be the obvious choice here. I have done quite a bit of searching but everything I have found seems to be for standard HTML (Selects and Inputs) and these do not appear to work with ASP objects:</p>
<pre><code><asp:DropDownList runat="server" ID="DDLSalesPerson" DataValueField="keyid" DataTextField="FullName" />
<asp:TextBox runat="server" id="txtSalesPerson" />
</code></pre>
<p>My DDL is populated from SQL in the code-behind page.</p>
<p>Can somebody assist with the appropriate code I should use? Thanks.</p>
|
javascript asp.net
|
[3, 9]
|
2,259,701 | 2,259,702 |
ASP.NET proxy to access protected resources (other webapps)
|
<p>I am running an ASP.NET based CMS/portal site using mojoPortal (www.mojoportal.com, open source). Users log in and access content based on their group/role. Now I would like to add a different web application (a wiki, MediaWiki based for ease of maintenance, but essentially any other web application or site) that should only be accessible to certain roles within mojo.</p>
<p>A possible solution I figured out would be to hide the wiki completely from direct external access and proxy the requests through mojo, such that they are only accessible for the desired groups.</p>
<p>Having found this question: <a href="http://stackoverflow.com/questions/11460/asp-net-proxy-application">aspnet-proxy-application</a>, I am unsure whether a general proxy will do in this case. Is this the way to go or are there any easier solutions? I'd appreciate any thoughts or reading resources on how to implement this scenario. Thanks!</p>
|
c# asp.net
|
[0, 9]
|
2,316,548 | 2,316,549 |
Variable Undefined in Anonymous Function
|
<pre><code>function updateServerList() {
var i;
for (i=0; i < servers.length; i++) {
var server = servers[i];
var ip = server['serverIp']
var html = constructServer(i);
var divId = '#server' + ip.replace(new RegExp("\\.", "mg"), "-");
var visible = $(divId).find(".server_body").is(":visible");
var div = $(divId);
div.html(html);
// Set div class.
var prevState = div.attr('class').substring(7)
if (prevState != server['state']) {
if (server['state'] == 'ok') {
console.debug(server);
div.slideUp('fast', function(server) {
$(this).removeClass();
$(this).addClass('server_ok');
var id = ipToId[server['serverIp']];
console.debug(id);
if (id == 0) {
adjacentIp = servers[1]['serverIp'];
adjacentDivId = '#server' + adjacentIp.replace(new RegExp('\\.', 'g'), '-');
$(adjacentDivId).before(this);
}
}).delay(1000);
div.slideDown();
}
}
}
</code></pre>
<p><code>console.debug</code> shows <code>server</code> as being defined, but inside the anonymous function, <code>server</code> is not defined. What am I going wrong?</p>
|
javascript jquery
|
[3, 5]
|
4,519,379 | 4,519,380 |
jQuery How to kill a Created Div?
|
<p>What I have at the moment is a list of products (divs) that, when hovered over, a duplicate div is created and positioned over the original div (offset a bit and restyled using css). This new div is larger and offers more information that was being shown in the list view.</p>
<p>When I hover off the new div it is .remove()'d, however I have found that it does not do this immediately, and if I move my mouse fast enough the hover event is fired, but the mouseleave event is not (as such the new div is just left on screen).</p>
<p>What I have at the moment to detect when to remove the new div:</p>
<pre><code>jQuery('.newDiv').mouseleave(function(){
jQuery(this).remove();
});
</code></pre>
<p>How do I get my new div to check that the mouse is on/off it so that I can kill it correctly?</p>
|
javascript jquery
|
[3, 5]
|
810,985 | 810,986 |
Start reading from a specific byte
|
<p>How I can start reading from a specific byte? I have following code:</p>
<pre><code> try {
while ( (len = f.read(buffer)) > 0 ) {}
}
</code></pre>
<p>For example, I want to start to read at byte 50.</p>
|
java android
|
[1, 4]
|
5,570,360 | 5,570,361 |
Is increased programming efficiency in Java or C# a myth?
|
<p>A big advantage of Java or C# in increasing <strong>productivity of development</strong> is that you're supposed to lose less time with complicated language features, especially those related to memory management. But is it just an impression?</p>
<p>I think that the learning curve for C++ is definitely more steep, but for a proficient C++ programmer, and given a set of coding standards for C++, isn't the difference between Java and C++ fading away?</p>
|
c# java c++
|
[0, 1, 6]
|
4,715,532 | 4,715,533 |
Looking for a way to impliment a pop out read more link
|
<p>I am kind of handcuffed here with a limited spacing of 350px x 160px, my goal is to highlight three main topics from a CMS and have a READ MORE link for each. Achieving this by either a horizontal fly out to the right or to have it pop up like a tooltip that stays up until the user clicks to close. </p>
<p>I am having some issues getting my head around this issue, any help would be greatly appreciated</p>
<p>WDH</p>
|
javascript jquery
|
[3, 5]
|
2,401,513 | 2,401,514 |
How do you select a specific child div with jQuery?
|
<p>How do you select a div which is a child of the current $(this)? </p>
<p>I have many divs with the class row, in each of which I have a hidden div called form_explanation. I want to show() the div form_explanation when the row is onClick-ed. </p>
<p>Thanks!</p>
|
javascript jquery
|
[3, 5]
|
828,645 | 828,646 |
What is the java Vector.element() C# equivalent
|
<p>Here is the java code i incompletely tried to translate</p>
<pre><code> static Enumeration enumerate()
{
Vector list = new Vector();
Enumeration e = cache.keys();
while (e.hasMoreElements())
{
Vector v = (Vector) cache.get(e.nextElement());
for (int i = 0; i < v.size(); i++)
{
list.addElement(v.elementAt(i));
}
}
return list.elements();
}
</code></pre>
<p>This is the C# translation but not complete</p>
<pre><code> public static IEnumerable<Http> enumurate()
{
List<Http> list = new List<Http>();
IEnumerator e = cache.Keys.GetEnumerator();
while (e.MoveNext())/*While e has more element*/
{
var vector = (List<Http>)cache[e.Current];
for (int i = 0; i < vector.Count; i++)
{
list.Add(vector.ElementAt<Http>(i));
}
}
return //Something missing!!
}
</code></pre>
<p>Any help please !</p>
|
c# java
|
[0, 1]
|
1,445,162 | 1,445,163 |
Why isn't my CustomValidator in ASP.NET 4.0 working?
|
<p>The controls in the ASP.NET</p>
<pre><code><asp:TextBox ID="txtEnd" runat="server" placeholder="12:59"></asp:TextBox>
<asp:RadioButtonList ID="rblTime2" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
<asp:ListItem>AM</asp:ListItem>
<asp:ListItem>PM</asp:ListItem>
</asp:RadioButtonList>
</code></pre>
<p>CustomValidator</p>
<pre><code><asp:CustomValidator ID="ValidateStartTime" ControlToValidate="txtEnd" OnServerValidate="ValidateStartTimeFun" runat="server" ErrorMessage="*required"></asp:CustomValidator>
</code></pre>
<p>CodeBehind</p>
<pre><code>protected void ValidateStartTimeFun(object source, ServerValidateEventArgs args)
{
try
{ if (txtStart.Text != "" && rblTime.SelectedValue != null )
{ args.IsValid = true; }}
catch (Exception ex)
{ args.IsValid = false; }
}
</code></pre>
<p>It doesn't even give me a *required if I change the entire CodeBehind to this;</p>
<pre><code>protected void ValidateStartTimeFun(object source, ServerValidateEventArgs args)
{
args.isValid = false;
}
</code></pre>
|
c# asp.net
|
[0, 9]
|
2,254,022 | 2,254,023 |
In which jquery version does outerHTML method exist
|
<p>I tried this in my javascript and it worked without additional plugin</p>
<pre><code>var2 = $('.my_div')[0].outerHTML;
</code></pre>
<p>But i could not find it in official documentation . Where can i find more information about that</p>
|
javascript jquery
|
[3, 5]
|
3,126,806 | 3,126,807 |
Parallel lists vs list of class with multiple variables
|
<p>I am creating a list of x,y values for tracking positions. Working on android optimization is very important, so I am wondering which method would be better from a resource usage standpoint.</p>
<p>Method 1:
Create a class(Position) containing an int for x and y, then create a list: positions.</p>
<p>Method 2:
Create parallel lists: positionsX and positionsY.</p>
<p>I am asking because method 1 seems to be the most user friendly for OO coding, but I don't know enough about the inner workings of Java or android and I'm afraid the overhead of the extra class would cancel out any benefits.</p>
<p>Or are they close enough that it doesn't really matter?</p>
|
java android
|
[1, 4]
|
1,907,368 | 1,907,369 |
check if a string contain specific words in the start should remove-JavaScrip/jQuery
|
<p>I want to remove any label that begins with M#- or L#-
this rule should be in jquery/javascript that any label that begins with M#- or L#- should return false
labels example:</p>
<pre><code>Live
M1- My Choice,
Stage
M2- Site,
KFC
L1- 1KFC,
L2- New Choice
</code></pre>
<p>Result:</p>
<pre><code>Live
Stage
KFC
</code></pre>
|
javascript jquery asp.net
|
[3, 5, 9]
|
620,061 | 620,062 |
Can I pass javascript variable to a PHP form?
|
<p>I'm using jcrop to crop my photos and need to send the current values along with my form submission. Is there an easy way to do this?</p>
<p>The JavaScript variable is this:</p>
<pre><code>c = coords;
$.param(c)
</code></pre>
<p>Can I include this as a hidden field in my PHP form somehow?</p>
<pre><code><input type="hidden" name="coords" value=" ??? " />
</code></pre>
|
php javascript
|
[2, 3]
|
5,754,568 | 5,754,569 |
Trying to get numbers from keypress document, javascript
|
<p>it seems simple, but I couldn't figure how to intercept numbers on javascript from Document DOM</p>
<pre><code> $(document).keypress(function (e) {
if (e.keyCode == xx) {
alert();
}
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
2,559,952 | 2,559,953 |
jquery gallerific preload conflict
|
<p>I'm unflashing a gallery using jquery-1.3.2, galleriffic and opacityrollover.</p>
<p>The goal is to display a large image in the gallery container only when one mouses over a thumb. <a href="http://dcostaging.net/clients/AHF/washington_mills.php" rel="nofollow">Example page here</a>.</p>
<p>Everything's working fine, but when the mouse hovers over the larger image for a period of time, there's a lot of pre-loading going on/flashing and cycling of all 8 images.</p>
<p>Any ideas on how I can stop this only in this ?</p>
<p>Thanks so much!</p>
|
php jquery
|
[2, 5]
|
2,226,602 | 2,226,603 |
JavaScript innerchild?
|
<p>I have the following example HTML:</p>
<pre><code><div id="target">
<div id="targetText"></div>
</div>
</code></pre>
<p>and I'm using the following code to get the inner div:</p>
<pre><code>$('#targetText');
</code></pre>
<p>instead, I was wondering if I could drop the id of the inner element, and somehow match the #target's child?</p>
<p>I have like hundreds of inner children, so, it does not make sense to put an id to each of them. I could just do something like $("#target").innerChild(5); or something. Does anyone know a good way of doing this?</p>
|
javascript jquery
|
[3, 5]
|
3,982,911 | 3,982,912 |
How can I get the JQuery to return a valid img src?
|
<p>So, I have images in a div that share the same class and one of them is selected at a time for a single view of that image. In this single view, I have arrows that I want to use to cycle between the images. The images sharing the same class have sequential alt values.</p>
<p>Right now, I can get the preceding alt value and set the src of the image in the single view to the source of that image. But, I can't seem to get the same effect with the following image.</p>
<pre><code> $("#leftButton").click(function(){
var current= $('img[id="selected"]');
var altVal=current.attr("alt").valueOf()-1;
if(altVal>=0)
{
var next= $('img[alt='+altVal+']');
current.attr("id", "");
next.attr("id", "selected");
$("#embiggenImage").attr("src", next.attr("src"));
}
}
);
$("#rightButton").click(function(){
var gal=$('img[class="galleryImage"]');
alert(gal.length);
var current= $('img[id="selected"]');
var altVal=current.attr("alt").valueOf()+1;
if(altVal<gal.length)
{
alert("inside");
var next= $('img[alt='+altVal+']');
current.attr("id", "");
next.attr("id", "selected");
$("#embiggenImage").attr("src", next.attr("src"));
}
}
);
</code></pre>
<p>As you can see, the code for changing the sources is exactly the same, and it reaches those two alerts fine, but returns a null source.</p>
<p>Edit: It seems that in the leftButton click function, alt is being properly decremented, but in the rightButton click function, when I am trying to increment alt, it instead, is appending the '1', such that the final value of altVal is '01'. This does not make any sense to me..</p>
|
javascript jquery
|
[3, 5]
|
5,180,540 | 5,180,541 |
Android camera out of memory exception
|
<p>I have a strange problem on my htc hero. When launching camera, i get out of memory exception. After that, if i launch any other application that uses camera, they also crash(when trying to use camera function).
I call camera.release and camera.stoppreview in surfacedestroyed function, but that doesnt help. </p>
<p>What is the right way to release all resources? Could somebody please show his working surfacechanged, surfacecreated and surfacedestroyed functions?
I have empty onPreviewFrame function, should i put something there?</p>
|
java android
|
[1, 4]
|
736,697 | 736,698 |
jQuery autocomplete to get unused value
|
<p>In my ASP.Net MVC application I have a jQuery autocomplete on a text box. I have everything working to display currently used item names and what I want to do is force the user to enter a completely NEW item name. I.e. the autocomplete acts as a guide to what exists but the user must ultimately enter a completely used string value.</p>
<p>I want the UI to signal if a currently used item is selected (there will be anther check on the server side when submit is posted) so for the moment there is just a simple alert().</p>
<p>My script is as follows:</p>
<pre><code> $(document).ready(function() {
$('#combobox').autocomplete('<%= Url.Action("ProjectIdList", "LookUp") %>', {
delay:10,
minChars:1,
matchCase: 0,
matchSubset: 1,
autoFill: true,
maxItemsToShow:10,
cacheLength: 10,
onItemSelect:selectItem,
onFindValue:selectItem
});
</code></pre>
<p>});</p>
<p>Please note the markup:
<strong>onItemSelect:selectItem, onFindValue:selectItem</strong> </p>
<p>I have further script as follows:</p>
<pre><code> function findValue(li) {
if (li != null) return alert("This Project Id cannot be used");
}
function selectItem(li) {
findValue(li);
}
</code></pre>
<p>However, <strong><em>I cannot get these events to fire</em></strong>. What am I missing?</p>
<p>Alternatively, is there a better way to do this?</p>
|
javascript jquery
|
[3, 5]
|
5,719,197 | 5,719,198 |
jQuery remove() on element doesn't hide used space
|
<p>I'm removing an element using <code>remove()</code> (it's a <code><li></code> with <code>display: inline;</code> set, although the same problem seems to exist with <code>display: block;</code>), and while the element is removed from the page the space it was occupying isn't.</p>
<p>Is this standard behaviour and so should I be using another method instead? The <code><li></code> contains a form field, so I'm wanting to ideally not have this form field sent through to the server - hence using <code>remove()</code> instead of <code>hide()</code>.</p>
|
javascript jquery
|
[3, 5]
|
3,763,218 | 3,763,219 |
Richtextbox in web application and highlighting the text
|
<p>I am a beginner to web application development. I am loading some text to the text box and checking for certain errors like if occurring of space before <code>.</code>(dot/full-stop). <br>I want to display the line no, column no and cursor position of the errors. Which control is suited for this. How to find the line no,column no and cursor position and how to highlight the error text in the text box.? <br>I have heard that through <code>RichTextBox</code> it is possible, but richtextbox control is not there in web application toolbox controls list.</p>
|
c# javascript asp.net
|
[0, 3, 9]
|
1,973,724 | 1,973,725 |
Best data combination to ensure web user uniqueness?
|
<p>How to ensure that the anonymous web users that voting using your poll-system are unique (<em>each anonymous user votes for once only</em>)?</p>
<p><strong>I can think of:</strong><br>
1. Client's IP Address<br>
2. Client's Machine Name<br>
3. MAC Address<br>
4. Storing cookie</p>
<p>As far as I know, you cant get (2) & (3) in web development, and (4) is not guaranteed since user can delete/not allow cookies</p>
<p>what do you think is better to achieve uniqueness?</p>
|
c# asp.net
|
[0, 9]
|
1,130,957 | 1,130,958 |
not validating special character "_" in javascript
|
<p>hello i am using javascript to validate field</p>
<p>i am checking special characters.. the code i am implementing validates all the special characters except _ underscore..</p>
<pre><code> <script type="text/javascript" language="javascript">
function validateForm()
{
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?_";
for (var i = 0; i < document.reg_form.txtusername.value.length; i++)
{
if (iChars.indexOf(document.reg_form.txtusername.value.charAt(i)) != -1)
{
alert ("Special Characters are not allowed.");
return false;
}
}
return true;
}
</script>
</code></pre>
<p>for this filed </p>
<pre><code><input name="txtusername" type="text" id="txtusername" maxlength="10" style="background-color:#CCC" />
</code></pre>
<p>but its not validating the underscore</p>
|
php javascript
|
[2, 3]
|
3,614,822 | 3,614,823 |
Creating Javascript function called from PHP
|
<p>I have a piece of Javascript that invokes a social publishing widget overlay. When you load the page the overlay will popup and this is the script that calls it:</p>
<pre><code><script type="text/javascript">
RPXNOW.loadAndRun(['Social'], function () {
var activity = new RPXNOW.Social.Activity(
"Share your comment",
"commented on 'Like My New Perfume?' on cuteoverload.com",
"http://cuteoverload.com/2009/10/26/like-my-new-perfume/");
RPXNOW.Social.publishActivity(activity);
});
</script>
</code></pre>
<p>I need put somehow create a javascript or php function that will fire when this PHP function is called:</p>
<pre><code>function response($oAlert) {
// something to happen here;
}
</code></pre>
|
php javascript
|
[2, 3]
|
5,346,892 | 5,346,893 |
Jquery and trigger a click on a hidden button
|
<p>I have a hidden button on a form that I need to click in order to fire an asyncpostback trigger that's attached to an update panel.</p>
<p>How is this done?</p>
|
asp.net jquery
|
[9, 5]
|
2,694,938 | 2,694,939 |
find out if a certain id itself has certain text part of it
|
<p>I got the id of a clicked element from the site, and i need to check if the id has a certain word. (all the id start with same word but have also a number which is efferent for all).<br>
How can i do that with jquery?</p>
|
javascript jquery
|
[3, 5]
|
3,720,304 | 3,720,305 |
jquery on submit
|
<p>i have little problem</p>
<p>on form submit</p>
<pre><code>e.preventDefault();
</code></pre>
<p>not working</p>
<p>code:</p>
<pre><code>$(function(){
$("#contact-form").submit(function(e){
Validation.init({
name : $("#contact-form").find("input[name='name']").val(),
phone : $("#contact-form").find("input[name='mobile']").val(),
mail : $("#contact-form").find("input[name='email']").val(),
text : $("#contact-form").find("textarea").val()
});
e.preventDefault();
});
});
</code></pre>
<p>after submit page reloading :(</p>
<p>HTML</p>
<pre><code> <form id = "contact-form" action = "" method = "post">
<input type = "text" name = "name" placeholder="แกแแฎแแแ">
<input type = "text" name = "mobile" placeholder="แแแแแแฃแ แแก แแแแแ แ">
<input type = "text" name = "email" placeholder="แแแแแแ">
<textarea name = "text" placeholder = "แขแแฅแกแขแ" ></textarea>
<input type = "submit" name = "submit" value = "แแแแแแแแ">
</form>
</code></pre>
<p>i think problem is</p>
<pre><code> Validation.init({
name : $("#contact-form").find("input[name='name']").val(),
phone : $("#contact-form").find("input[name='mobile']").val(),
mail : $("#contact-form").find("input[name='email']").val(),
text : $("#contact-form").find("textarea").val()
});
</code></pre>
|
javascript jquery
|
[3, 5]
|
1,332,567 | 1,332,568 |
JQuery sum all data in specific table row
|
<p>I have a table with inputs in each cell, except one (.total) which specifies the total of each table row. When one of the inputs are changed I would like the sum to change for that row. Below is far as I have been able to get.
<strong>The HTML:</strong></p>
<pre><code><table>
<tr>
<td><input value = "100"/></td>
<td><input value = "100"/></td>
<td><input value = "100"/></td>
<td class="total">300</td>
</tr>
<tr>
<td><input value = "200"/></td>
<td><input value = "200"/></td>
<td><input value = "200"/></td>
<td class="total">600</td>
</tr>
</table>
</code></pre>
<p><strong>Now for the jQuery:</strong></p>
<pre><code> //add keyup handler
$(document).ready(function(){
$("input").each(function() {
$(this).keyup(function(){
newSum();
});
});
});
function newSum() {
var sum = 0;
var thisRow = $(this).closest('tr');
//iterate through each input and add to sum
$(thisRow).("td:not(.total) input:text").each(function() {
sum += this.value;
});
//change value of total
$(thisRow).(".total").html(sum);
}
</code></pre>
<p>Any help in finding out what I've done wrong will be greatly appreciated. Thanks!</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.