Unnamed: 0
int64
302
6.03M
Id
int64
303
6.03M
Title
stringlengths
12
149
input
stringlengths
25
3.08k
output
stringclasses
181 values
Tag_Number
stringclasses
181 values
2,707,390
2,707,391
jQuery - redirect after ajax call
<p>I have the following code, however im having a problem getting window.location to work</p> <pre><code>$('.test_container a').click(function() { $.ajax({ url: $(link).attr('href'), type: 'GET', dataType: 'json', beforeSend: function() { $('#lightbox').show(); }, success: function(data) { $('#lightbox').hide(); window.location(data); } }); return false; }); </code></pre> <p>If window.location.replace is used instead it does work, however this then doesnt allow the brwser back buttons to work.</p> <p>Does anyone know of any solution?</p> <p>Thanks</p>
javascript jquery
[3, 5]
2,216,333
2,216,334
check if element exists within parent element
<p>I'm embedding and appending a youtube video to a div by using the href value and adding it to youtube.com/embed/ +hrefvariable. I just need some guidance in how to check if the youtube video is already in the div, to not run the click function that appends it there. I'm thinking using .length() with the parent div?</p> <p>Here's the appending function:</p> <pre><code>$(function () { $(".youtube").click(function (a) { a.preventDefault(); a = '&lt;iframe src="http://www.youtube.com/embed/' + $(this).attr("href") + '?&amp;iv_load_policy=3&amp;autoplay=1#t=0m12s&amp;rel=0" frameborder="0" allowfullscreen &gt;&lt;/iframe&gt;'; $("#currentvid").html(a); $("#currentvid").animate({ opacity: 1 }, 1E3); return !1 }) }); </code></pre>
javascript jquery
[3, 5]
4,802,084
4,802,085
Can someone explain this seeming inconsistency in jQuery/Javascript?? (trailing brackets inconsistency on reads)
<p>So, in my example below, "InputDate'" is an input type=text, "DateColumn" is a TD within a table with a class of "DateColumn".</p> <p>Read the value of a discreet texbox: </p> <pre><code>var inputVal = $('#InputDate').val(); </code></pre> <p>Read the value of a div within a table.... </p> <p>This works:</p> <pre><code>$('#theTable .DateColumn').each(function() { var rowDate = Date.parse($(this)[0].innerHTML); }); </code></pre> <p>This doesn't:</p> <pre><code>$('#theTable .DateColumn').each(function() { var rowDate = Date.parse($(this)[0].innerHTML()); }); </code></pre> <p>The difference is the "()" after innerHTML. This behavior seems syntactically inconsistent between how you read a value from a textbox and how you read it from a div. I'm ok with sometimes, depending on the type of control, having to read .val vs .innerHTML vs.whateverElseDependingOnTheTypeOfControl...but this example leads me to believe I now must also memorize whether I need trailing brackets or not on each property/method.</p> <p>So for a person like me who is relatively new to jQuery/Javascript....I seem to have figured out this particular anomaly, in this instance, but is there a convention I am missing out on, or does a person have to literally have to memorize whether each method does or does not need brackets?</p>
asp.net javascript jquery
[9, 3, 5]
5,688,268
5,688,269
Javascript: How to intercept window.location change
<p>I need a way to attach some pre-processing to each assignment of the window.location. Is there a way to do this. I basically need to serialize some info, that will be used in the new location.</p>
javascript jquery
[3, 5]
179,690
179,691
Unable to import cls file to sql server 2005
<p>when i am trying to import cls file to sql server 2005. cell containing value with comma is not imported to sql server<img src="http://i.stack.imgur.com/VbiJ4.png" alt="enter image description here"></p> <p>Rows 7 to 14 not import to sql server 2005</p>
c# asp.net
[0, 9]
2,116,445
2,116,446
How to use a variable's contents to declare another variable in javascript?
<p>I have a problem that I hope to use one variable's contents as another variables name in javascript. In this case, I do not know what is the contents in that variable, I only know it is a text type and I hope the variable I need to declare will use that text as its name.</p> <p>Anyone could kindly give me some suggestion of how to do that?</p> <p>Thank you!</p>
javascript jquery
[3, 5]
268,038
268,039
Inserting data in specified gridview row
<p>I am working with my timesheet program. On the first column of the gridview there are list of each day in a month. How can I simply place the datetime data once I clicked the time in/time Out button? For example the first row is today's date, after I clicked the time in button the time must be place in the row of today's date.</p> <p>Here's the code</p> <pre><code>DataTable dtDates = new DataTable(); dtDates.Columns.Add("Date"); dtDates.Columns.Add("Time In"); dtDates.Columns.Add("Time Out"); if (DateTime.Now.Day &lt; 15) { DateTime dtStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); for (int i = 0; i &lt; 15; i++) { dtDates.Rows.Add(new Object[] { dtStart.ToString("dd-MMM-yyyy") }); // with format dtStart = dtStart.AddDays(1); //dtDates.Rows.Add(new Object[] { dtStart }); // without format } } else { DateTime dtStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 16); for (int i = 0; i &lt; 15; i++) { dtDates.Rows.Add(new Object[] { dtStart.ToString("dd-MMM-yyyy") }); // with format dtStart = dtStart.AddDays(1); //dtDates.Rows.Add(new Object[] { dtStart }); // without format } } this.GridView1.DataSource = dtDates; this.GridView1.DataBind(); </code></pre>
c# asp.net
[0, 9]
1,318,974
1,318,975
How do I synchronize the scroll position of two divs?
<p>I want to have 2 divs sized to a particular width (i.e. 500px). One above the other aligned horizontally.</p> <p>The top box should hide its scroll bar, the bottom should show a scroll bar and when the user scrolls I'd like the offset of the top box to change to the value of the bottom box. So that when the bottom DIV scrolls horizontally it appears that the top DIV is also scrolling in unison.</p> <p>I'm happy to do this in Jquery if it makes the process easier.</p>
javascript jquery
[3, 5]
1,687,336
1,687,337
Open Element on Click
<p>I apologise in advance for the poor quality of this question but here goes:</p> <p>I simply want an element to slide open on mouse click! That's it!</p> <p>Specifically, i want a single menu item which, when clicked, will slide open to reveal a form. </p> <p>What i'm after is almost exactly like an accordion menu in jQuery BUT they all rely on two or more elements to click on and open, whereas i only have one button whose default will be in 'closed' state.</p> <p>I am a complete Javascript novice (even less than novice), so editing existing JS code can prove quite tricky and error prone to me, but it seems what i'm after is 'fairly' simple and everything i have found online is for multiple elements in a menu, so i thought i'd see if anyone could help.</p> <p>I would have ideally asked this in the Javascript chat room but its empty at the mo.</p> <p>I hope someone can help</p>
javascript jquery
[3, 5]
5,807,276
5,807,277
Run a function in timeout looping
<p>I have the following code:</p> <pre><code>// After 8 seconds change the slide... var timeout = setTimeout("changeSlide()", 8000); $('div.slideshow').mouseover(function() { // If the user hovers the slideshow then reset the setTimeout clearTimeout(timeout); }); $('div.slideshow').mouseleave(function() { clearTimeout(timeout); var timeout = setTimeout("changeSlide()", 8000); }); </code></pre> <p>What I want to happen is make the function changeSlide run EVERY 8 seconds in a loop unless someone hovers the slideshow div. When they remove the cursor then do the timeout again!</p> <p>However the loop only happens once and the hover doesn't stop the timeout or start it again :/</p> <p>EDIT:</p> <p>This loops great but the hover on and off causes the function to run multiple times:</p> <pre><code>// After 8 seconds change the slide... var timeout = setInterval(changeSlide, 2000); $('div.slide').mouseover(function() { // If the user hovers the slideshow then reset the setTimeout clearInterval(timeout); }); $('div.slide').mouseleave(function() { clearInterval(timeout); var timeout = setInterval(changeSlide, 2000); }); </code></pre>
javascript jquery
[3, 5]
354,216
354,217
how to get a formatted date as milliseconds?
<p>I have a formatted date from sqllite database, to use this in a graph view I need to format it in a long number.</p> <p>The format is:</p> <p>2012-07-11 10:55:21</p> <p>how can I convert it to milliseconds?</p>
java android
[1, 4]
4,681,823
4,681,824
How can I convert a JavaScript variable to a Java variable?
<p>I need to convert a variable from JavaScript into a Java variable. I'm asking users for their e-mail ids with a Block-UI popup through Test Box. If the field is neither null nor empty, the e-mail id should be sent to a session variable so that it can be accessed anywhere in the project.</p> <p>Here's my code:</p> <pre><code>function sbtEmail(){ var email = document.getElementById("EmailId").value; if (email == null || email == ""){ alert("Enter your contact Email address to continue...!"); document.getElementById("EmailId").focus(); } else { &lt;%session.setAttribute("quoteEmail",email);%&gt; window.location.href = "demo2.jsp"; } } </code></pre> <p>It doesn't work. What am I doing wrong?</p>
java javascript
[1, 3]
750,677
750,678
Retrieve Facebook Wall Posts
<p>I want to retrieve only my wall post of facebook and the comment given by my friends and also user can give comments also by successfully Authorised through my application..</p> <p>I have tried this <a href="http://csharpsdk.org/" rel="nofollow">http://csharpsdk.org/</a> . But i am totally confused..I am getting my friend list</p> <pre><code> List&lt;long&gt; myFrndId = (List&lt;long&gt;)api.Friends.Get(); // Call REST to fetch user's of give id's IList&lt;user&gt; usrFrnds = api.Users.GetInfo(myFrndId); //Store frind's list for paging Friends = usrFrnds; // Bind to GridView to display grvMyFriends.DataSource = Friends; grvMyFriends.DataBind(); UpdatePanel1.Update(); // Call REST to fetch facebook friends lists's(friend group) IList&lt;friendlist&gt; friends = api.Friends.GetLists(); // Bind to GridView to display grvFriends.DataSource = friends; grvFriends.DataBind(); </code></pre> <p>But I wants to retrieve My Wall posts like i saw this man's link He has shown his wall posts information in his own site <a href="http://www.timbalandmusic.com/Default.aspx#!facebook" rel="nofollow">http://www.timbalandmusic.com/Default.aspx#!facebook</a></p> <p>In the same way i wants to show..</p>
c# asp.net
[0, 9]
3,285,420
3,285,421
Cannot use php tag in javascript tag
<p>I'm trying to use php tag in a javascript function. But unfortunately its not working. I even used <code>&lt;?php</code> but still not working. I checked php.ini file and there the short tag is already enabled.</p> <p>Any sort of suggestion will be appreciated. </p>
php javascript
[2, 3]
696,849
696,850
var attribute echoed with php and not submitted from form
<p>Using this </p> <pre><code>`$(function(){$(".signaler").click(function(){var element=$(this);var I = element.attr("id");var page = $('#page').attr('value');var info = "id="+I+"&amp; page="+ page;$("#signaler"+I).hide();$("#load"+I).html('&lt;img class="think" src="load.gif" &gt;');$.ajax({type:"POST",url:"signaler.php",data:info,success:function(){$("#load"+I).empty();$("#ok"+I).fadeIn(200).show();}});return false;});});` </code></pre> <p>but have a form with hidden inputs only so i can echo current user info into it, was wondering if I could put it straight into jquery? Working fine though. </p> <p>With a form you would use the following </p> <p><code>var page=$('#page').attr('value');</code> </p> <p>I would like to set the id with php echoing user name/id..</p> <p>Something like <code>var id=$('&lt;?php echo $user/$id... ?&gt;');</code></p> <p>If someone could point out the right jquery syntax, would be very greatful!</p>
php jquery
[2, 5]
952,990
952,991
Fancy box add button onComplete open current image in new window
<p>I am trying to extend fancybox to allow for a new button to open the current image in a new window. I was planning on adding this via the onComplete although I can find any information in the API that explains how to get teh current image from:</p> <pre><code>'onComplete' : function(currentArray, currentIndex, currentOpts){ alert(currentArray.title); } </code></pre> <p>Or if you can point me in the direction of some documentation on how I can use the <strong>"currentArray, currentIndex, currentOpts"</strong></p>
javascript jquery
[3, 5]
5,195,077
5,195,078
How to check if document is ready?
<p>How to check if document is ready (all js files loaded, DOM is ready) through jQuery? Is there any flag?</p> <p>Facing issues if some of the files are not downloaded completely, and the event is raised by user. I want to check inside event handler.</p> <p>I am using jQuery, asp.net</p>
asp.net jquery
[9, 5]
16,956
16,957
jQuery extend with prototypes
<p>Hi I am relatively new to jQuery and JavaScript and have a question regarding the functionality of <code>$.extend</code>. I am using <code>extend</code> to overwrite the prototype of a class that extends a "base class". Lets call the base <code>Parent</code> and the the children/extend classes <code>A</code> and <code>B</code>. Now when I use <code>$.extend(true, A.prototype, {someObject: {extraKey: 'value'}});</code> it seems also the Prototype of <code>Parent</code> is changed regarding the contents of <code>someObject</code>, resulting in really odd behavior if several objects/classes inherit from parents. Also this only happens if the "deep" extending is used.</p> <p>I managed to avoid this problem by extending an empty object with the respective prototype and then using the return value of extend as the new prototype. E.g. <code>A.prototype = $.extend(true, {}, A.prototype, {someObject: {extraKey: 'value'}});</code></p> <p>To show the problem I created this small jsfiddle: <a href="http://jsfiddle.net/x8UtF/12/" rel="nofollow">http://jsfiddle.net/x8UtF/12/</a></p> <p>The actual question: Is there a way to get around the empty objects and stuff to just go <code>extend(true, X.prototype, {});</code></p>
javascript jquery
[3, 5]
1,809,995
1,809,996
Broadcast event when IP changes?
<p>I'm developing an application that is sending data through tcp/ip</p> <p>I've made my own Name server that the clients register their IP and listening port. All of this is working very well.</p> <p>Right now the clients send a ping to the server to get the latest IP and updates it if necessary. Since the app is already using quite allot of network I would prefer to minimize it as much as possible.</p> <p>My question is if the ConnectivityManager (or any other service) sends a broadcast when the IP changes? Or is this not possible for the phone to detect this locally?</p>
java android
[1, 4]
1,363,009
1,363,010
How can I get information about events that are bound to an element via live()?
<p>I have one <code>&lt;a&gt;</code> tag and bind to it two events. How I can get information about other events attached to it?</p> <p>The follow code explains what I mean:</p> <pre><code>&lt;a href="#" id="sample" class="sample-cls"&gt;Click me&lt;/a&gt; $(function(){ $('#sample').live("click", function(){ sampleFunction(); }) $('.sample-cls').live("click", function(){ // How to get information that to this link // is attached another event, that run sampleFunction() ? }) }) </code></pre> <p>Unfortunately, <code>$('#sample').data('events')</code> doesn't include the events bound via <code>live()</code>.</p>
javascript jquery
[3, 5]
4,005,826
4,005,827
How to create draggable widgets?
<h2>Background</h2> <p>I am tasked with developing the front-end to an analytics product that presents the information to the user in a customizable dashboard like the one used by Google Analytics: - Dashboard is comprised of draggable widgets arranged in a grid layout - Widgets have a drag handle which can be clicked by the user to start dragging - Widgets can be re-ordered by dragging and dropping the widget</p> <h2>Question</h2> <p>Part 1. Using jQuery (or any other open source Javascript API) can anyone explain to me how such a feature is implemented, from a high level overview.</p> <p>Part 2. Can you recommend any resources for me to read that may be relevant to implementing this feature, or any foreseeable related features? (books, links, api docs, tutorials)</p>
javascript jquery
[3, 5]
95,911
95,912
Why does the html disappear?
<p>I would like to insert <code>&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;</code> in another DIV at the top. So I try</p> <pre><code>$(document).ready(function(){ $('form').live('submit', function(){ var aform = $(this); $('#w').append('&lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt;'); }); }); </code></pre> <p>HTML looks like</p> <pre><code>&lt;div id="w"&gt; &lt;div&gt;&lt;p&gt;Test&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>When I do that, it gets inserted, but goes away right after.</p> <p>Try click on the Save button in this example.</p> <p><a href="http://jsfiddle.net/Rv2w7/" rel="nofollow">http://jsfiddle.net/Rv2w7/</a></p>
javascript jquery
[3, 5]
3,454,465
3,454,466
I have an error as raw cant be resolved or is not a field in ADT
<pre><code> InputStream is = getResources().openRawResource(R.raw.map1); map = convertStreamToString(is); </code></pre> <p>How i could resolve this problem, i have used com.mypackage.R even i am getting problem also map1 is a txt file can anyone help me out to fix this error?</p> <p>Thanks</p>
java android
[1, 4]
2,358,088
2,358,089
Asp:Image with Link
<p>I would like to place an image in my application. when I click on it I want to move to another page. In general my asp:image to work as link Is that possible ??</p>
c# asp.net
[0, 9]
3,093,578
3,093,579
android null pointer exception in Application
<p>i have an activity which initialize a variable of my Application class (AppVariables):</p> <pre><code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); app = (AppVariables) getApplicationContext(); } </code></pre> <p>when using this if condition which check if a drawable is null or not i get a null pointer exception from some reason:</p> <pre><code> if (app.getFacebookCurrentUser().getProfilePicture() != null) </code></pre> <p>can't really under stand why.. i am checking if it null.. </p>
java android
[1, 4]
2,816,321
2,816,322
how do i get rid of a "Unchecked cast" warning?
<pre><code>Map&lt;String,?&gt; one = (Map&lt;String,?&gt;) parent.getAdapter().getItem(position); </code></pre> <p><code>Type safety: Unchecked cast from Object to Map&lt;String,?&gt;</code></p> <p>with the above line of code i get that unchecked cast warning. what is the best way for me to have the same results but alleviate that warning?</p>
java android
[1, 4]
5,813,074
5,813,075
What requires SessionState in ASP.NET
<p>In order to help speed up my page load times I am removing SessionState from as many pages as possible. I have a lot of pages viewed that don't require any session tracking.</p> <p>I know that storing something in the session e.g. </p> <pre><code>Session.Add("name", value); </code></pre> <p>uses the session state, but does anything else or is that it?</p> <p>I'm using plain old ASP.NET not MVC.</p>
c# asp.net
[0, 9]
2,488,837
2,488,838
Convert PHP script to ASP.NET
<p>Does anyone know how to write the following PHP in ASP.NET(VB.NET)?</p> <pre><code>foreach ($_GET['listItem'] as $position =&gt; $item) : $sql[] = "UPDATE `table` SET `position` = $position WHERE `id` = $item"; endforeach; </code></pre> <p>The data in $_GET['listItem'] looks like this:</p> <p>item[]=1&amp;item[]=2&amp;item[]=3</p>
php asp.net
[2, 9]
873,495
873,496
Disable HTML Markup In "Preview Article"
<p>I have a problem displaying a "preview" of a text on my website. Let's assume it's an article and I only want to display the first 50 letters of the article (people will have to click 'read more' to read the rest), that I have accomplished but my issue now is that it displays the text as HTML.</p> <p>So, what I do is the following:</p> <pre><code>&lt;td&gt;&lt;%# Eval("Description").ToString().Crop(50, true) %&gt;&lt;/td&gt; </code></pre> <p>This line above displays the Description and then calls my TextService.cs to crop the text to 50 letters, as below:</p> <pre><code>public static string Crop(this string text, int length) { return Crop(text, length, false); } public static string Crop(this string text, int length, bool removeBreak) { if (removeBreak) text = text.Replace("&lt;br /&gt;", " "); return (text.Length &gt; length) ? string.Format("{0}...", text.Substring(0, length)) : text; } </code></pre> <p>But if I edit my article to a big fat text, then it will be visible in the preview box. How can I display the "preview text" as plain text without any HTML?</p> <p>I hope it all makes sense - otherwise feel free to ask questions.</p>
c# asp.net
[0, 9]
5,113,988
5,113,989
Jquery show preloader for every image?
<p>Hey guys, I've a website with a lot of images:</p> <pre><code>&lt;img class='thumb' src=thumbs/image1.jpg/&gt; &lt;img class='thumb' src=thumbs/image2.jpg/&gt; &lt;img class='thumb' src=thumbs/image3.jpg/&gt; &lt;img class='thumb' src=thumbs/image4.jpg/&gt; </code></pre> <p>I wonder if I can display a loading-div for every single image and when it's loaded the div hides? I'm using jquery for most of my animations. Can i solve that with jquery.</p> <p>It would be cool if every image shows this loading-div centered in the middle of the image. When the image is loaded the div should hide!</p> <p>Is that possible? Thank you for your help!</p>
javascript jquery
[3, 5]
5,934,625
5,934,626
how to get instance name using jquery
<p>in my.js</p> <pre><code>$(document).ready(function(){ a = new person(); b = new person(); ... }) person.prototype.init = function(){..} function person(){ var someVariable; function doSomeThing(){ ... // I need my instance name ... } return {doSomeThing:doSomeThing} } </code></pre> <p>how can I get my instance name?</p>
javascript jquery
[3, 5]
1,753,202
1,753,203
Open specific jquery ui tab based on which the previous page is
<p>I have created a jquery ui tab and what I would like to do is when the page containing the jquery ui tab loads, specific tab will open depends on the previous page. So far, I have down the following:</p> <p>PHP:</p> <ol> <li>obtain the previous page by using $_SERVER['HTTP_REFERER'];</li> <li>determine which tab to open by using a "if" statement (assigning a tab_index variable);</li> <li>assign "tab_index" to a hidden input value.</li> </ol> <p>Javascript:</p> <ol> <li>pick up the hidden input value and assign it to a js variable;</li> <li>??</li> </ol> <p>Then I am not too sure how to do this make it work in $('#tabs').tabs({.... statement. Any idea of how to resolve this will be much appreciated. Many thanks.</p> <pre><code>PHP: $string = $_SERVER['HTTP_REFERER']; $string = substr($string, -(strlen($string)-strrpos($string, '/')-1), strlen($string)-strrpos($string, '/')); if ($string == "specific_page.php") { $tab_index = 2; } else { $tab_index = 0; } HTML: ... &lt;input id="hidden_input" type="hidden" value="&lt;?php echo $tab_index; ?&gt;" /&gt; JS: $(document).ready(function() { var tab_index = $('#hidden_input').attr('value') $('#tabs').tabs({ cache:false, ajaxOptions: { error: function(xhr, status, index, anchor) { $(anchor.hash).html("Couldn't load this tab. We'll try to fix this as soon as possible."); } }, ...something here for tab selection?... }); }); </code></pre>
php javascript
[2, 3]
1,137,882
1,137,883
set values in web.config dynamically?
<p>in my web.config I have things like:</p> <pre><code> &lt;connectionStrings&gt; &lt;add name="Entities1" connectionString="metadata=res://*/CData.csdl|res://*/CData.ssdl|res://*/CData.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=ser;initial catalog=dda;persist security info=True;user id=s;password=a;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; &lt;add name="Entities2" connectionString="metadata=res://*/M.AuthModel.csdl|res://*/M.AuthModel.ssdl|res://*/M.AuthModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=ser;initial catalog=dda;persist security info=True;user id=s;password=a;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt; &lt;/connectionStrings&gt; </code></pre> <p>where I have things like the DB password and so on.</p> <p>Every time I create a setting in my Project, I get s.th. like:</p> <pre><code>&lt;setting name="db_username" serializeAs="String"&gt; &lt;value&gt;s&lt;/value&gt; &lt;/setting&gt; </code></pre> <p>is it possible to user this <code>setting</code> in the <code>connectionString</code> above so that I can change e.g. the Username for both with just changing the <code>setting</code>?</p>
c# asp.net
[0, 9]
3,420,983
3,420,984
Jquery : Automatic type conversion during parse JSON
<p><br> Is there a way to specify type while parsing Json, so that the conversion happens automatically.</p> <p>So I have the jsonData, and the x and y values needs to be number. So, the only way I can think about is looping and converting each. Any better logic, or efficient way?</p> <pre><code>var jsonData = '[{"x:"1", "y":"2"}, {"x:"3", "y":"4"}]' var needed = [{x:1, y:2}, {x:3, y:4}] var vals = $.parseJSON(jsonData); // var Coord = function(x, y){ this.x = x; this.y = y; } var result = []; function convert(vals) { for (var i=0,l=vals.length; i&lt;l; i++) { var d = vals[i]; result.push(new Coord(Number(d.x), Number(d.y))); }; } </code></pre>
javascript jquery
[3, 5]
914,772
914,773
jQuery: Checking if next element exists
<p>is there a way to check if an next element exists? Check my code:</p> <pre><code>if($("#people .making-of .mask ul li.current").next("li") != null) { alert("Exists"); } else { alert("Dont exists"); } </code></pre> <p>What im doing wrong? Thanks a lot!</p>
javascript jquery
[3, 5]
3,749,728
3,749,729
need a script to split and assign values Jquery
<p>I am trying to separate and reassign values in a variable. What I have is </p> <pre><code>#&amp;first=1&amp;second=2 </code></pre> <p>can anyone help with a script that will separate and assign this values to another variable so it would be like</p> <pre><code>var first= val.(first); var second= val.(second); </code></pre> <p>I am new to jquery so I am not even sure if I am using the correct syntax.</p> <p>Thanks</p>
php jquery
[2, 5]
5,182,005
5,182,006
Pass value to function from <a> tag, not from button
<p>Consider the following link and associated Javascript function:</p> <pre><code>&lt;a class="someClass" href="#" onClick="someFunc('someVal'); return false;"&gt;Run someFunc&lt;/a&gt; function someFunc(val) { doSomething(val); } </code></pre> <p>I would prefer to refactor the link and Javascript function to support some additional functionality (the link is actually in a <code>div</code> returned by AJAX):</p> <pre><code>&lt;a class="someClass" href="#" someAttribute="someVal"&gt;Run someFunc&lt;/a&gt; $(".someClass").click(function(e) { e.preventDefault(); // How to get value of someAttribute? doSomething(val); }); </code></pre> <p>How can I get the value of <code>someAttribute</code>? Thanks.</p>
javascript jquery
[3, 5]
2,729,409
2,729,410
How to get the text of the selected option of a select using jquery?
<p>If I have this select:</p> <pre><code> &lt;select id="days"&gt; &lt;option value="0"&gt;Today&lt;/option&gt; &lt;option value="1"&gt;Yesterday&lt;/option&gt; &lt;option value="7"&gt;Last week&lt;/option&gt; &lt;/select&gt; </code></pre> <p>and someone selects the 3rd option 'last week', I can get the value of last week (which is 7), using <code>$("#days").val()</code>, but how can I get the value of the text i.e 'Last week'?</p>
javascript jquery
[3, 5]
3,698,256
3,698,257
Hide mobile safari keyboard when form submitted in Ajax application
<p>I have a textfield which fires an event in a web app, but I'd like the keyboard to close when the user presses enter. Using jquery to disable usual submission.</p>
jquery iphone
[5, 8]
162,057
162,058
javascript Today() function
<p>I'd like to determine if a given date object is the same day as the current day. Below is the psuedo code.</p> <pre><code>// date is a Date object function (date) { if (date == Today()) alert('How are you today?'); else alert('How were you last ' + date.toDateString() + '?'); } </code></pre> <p>How do I implement the Today() function? It doesn't have to be a function really, an equivalent solution will be just as good. Thanks.</p> <p>[edit] I forgot to mention. The current time (today) is local time and the date object that it will be compared with is server time, which can be anywhere in the world.</p>
javascript jquery
[3, 5]
4,863,476
4,863,477
How to get day of the month?
<p>I am trying to retrieve which day of the month it is.</p> <p>Such as today is August 29,2011.</p> <p>What i would like to do is just get the days number such as 29, or 30. Which ever day of the month it is. </p> <p>How would i go about doing this?</p>
java android
[1, 4]
1,768,713
1,768,714
jQuery Can't Append an Object to an Element?
<p>For some reason my object isn't being appended to my element. Do you know why?</p> <pre><code>row_value_object[row_value] = '&lt;div class="timeline_row row_'+row_value+'"&gt;&lt;/div&gt;'; $(".trek_timeline_day").append(row_value_object[row_value]); </code></pre> <p>Can jQuery do this?</p>
javascript jquery
[3, 5]
3,468,962
3,468,963
jQuery index of dom element?
<p>I have...</p> <pre><code>element = document.elementFromPoint(x, y) </code></pre> <p>then I want to do something like...</p> <pre><code>index = $(element).index() </code></pre> <p>The DOM element is a <code>li</code> and I need its position in the list. </p> <p>Thanks!</p> <p>EDIT: If what i'm doing is correct then something here is wrong, <a href="http://stackoverflow.com/questions/7814550/touch-events-over-two-divs/7814791">Touch events over two dom elements?</a></p> <p>Any help is much appreciated.</p>
javascript jquery
[3, 5]
882,644
882,645
Hide android soft keyboard in browser
<p>I'm building a webapp for ios/android and currently got a problem</p> <p>My app has a input element and when people focus on it, the soft keyboard show as usual. But some times I want to hide it by javascript, I tried this:</p> <pre><code>document.getElementById('oneinput').blur() </code></pre> <p>It works fine in ios safari , but in android browser, the input element just lost focus but the soft keyboard still appeared.</p> <p>I also tried to create a click event by javascript on some element but not working either. Any Ideas? </p>
javascript android
[3, 4]
5,532,871
5,532,872
Passing multiple parameter to PHP from Javascript
<p>i am trying to Use this</p> <pre><code>function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } function CallSomePHP() { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="myPhp.php"; ***(Need to Pass multiple parameter to php from here)*** xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { alert(xmlhttp.responseText); </code></pre>
php javascript
[2, 3]
4,272,507
4,272,508
determining the type of element selected in jquery
<p>I have a jQuery selection, is there a way to determine what type of element it is (e.g. &lt;a>,&lt;span>,etc...)?</p>
javascript jquery
[3, 5]
4,175,882
4,175,883
Parsing date string in Java of format [2012-07-15T20:55:33+00:00]
<p>Im trying to parse a String thats a date "2012-07-15T20:55:33+00:00", however I keep getting illegal argument exception. I don't know what I'm doing wrong.</p> <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddzHH:mm:SS+00:00"); String date = "2012-07-15T20:55:33+00:00"; Log.e("res",sdf.format(date)); </code></pre> <p>Throws</p> <pre><code> 07-15 12:37:28.436: E/AndroidRuntime(20985): FATAL EXCEPTION: main 07-15 12:37:28.436: E/AndroidRuntime(20985): java.lang.IllegalArgumentException 07-15 12:37:28.436: E/AndroidRuntime(20985): at java.text.DateFormat.format(DateFormat.java:365) 07-15 12:37:28.436: E/AndroidRuntime(20985): at java.text.Format.format(Format.java:93) </code></pre>
java android
[1, 4]
2,924,499
2,924,500
c# code to check is string contains only numbers
<p>I'm a C# noob and I have this task. I have TextBox, and user need to put 13 digits. I need to check is user correctly populate that TextBox. Only numbers can be acceptable.</p> <p>After that, I need to check is that last entered (13th) number equal with my int64 variable I got from other function. </p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,987,721
2,987,722
How to raise list controls SelectedIndexChanged event in codebehind?
<p>How to raise the SelectedIndexChanged event of an asp.net List control in a codebehind using C#?</p>
c# asp.net
[0, 9]
1,013,077
1,013,078
The remote server returned an error: 227 Entering Passive Mode ()
<p>I am doing code which uploads file from one server to another, Following is my code:</p> <pre><code> string CompleteDPath = "ftp://ExampleURL/photos/"; string UName = "USerName"; string PWD = "Password"; WebRequest reqObj = WebRequest.Create(CompleteDPath + fileName); reqObj.Method = WebRequestMethods.Ftp.UploadFile; reqObj.Credentials = new NetworkCredential(UName, PWD); FileStream streamObj = System.IO.File.OpenRead(Server.MapPath(path)); byte[] buffer = new byte[streamObj.Length + 1]; streamObj.Read(buffer, 0, buffer.Length); streamObj.Close(); streamObj = null; reqObj.GetRequestStream().Write(buffer, 0, buffer.Length); reqObj = null; </code></pre> <p>But first time it works fine, but next time it throws error as bellow: The remote server returned an error: 227 Entering Passive Mode ()</p> <p>Can you please tell me whats wrong with this.</p>
c# asp.net
[0, 9]
700,412
700,413
trouble accessing working HTTPService from Android
<p>I have a working .Net WCF HTTP service. If I put the URL into I.E, FireFox, or google Chrome browsers, I get back the correct stream. But when I try to access that same service in an android app (running in Eclipse) I get a socketException with the detail message "Permission Denied". The service is running on my machine in the Visual Studio web hoster and the client is running in the android emulator also on my machine.</p> <p>The line that gets the exception is: InputStream in = new BufferedInputStream(urlConnection.getInputStream()); </p> <p>(I have an earlier post on this same program where the url is www.android.com and I'm getting "invalid url")</p> <p>Might anyone have a clue why the browsers have no problem with it and the android client is getting permission denied? thanks, Gary</p> <pre><code> HttpURLConnection urlConnection = null; try { URL url = new URL("http://localhost:8080/TeamTask/Tasks"); urlConnection = (HttpURLConnection) url.openConnection(); InputStream in = new BufferedInputStream(urlConnection.getInputStream()); readStream(in); } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } </code></pre>
java android
[1, 4]
3,226,837
3,226,838
ASP.NET master page and optional Jquery script
<p>I am using a master page, and JQuery is referenced in some, but not all pages. I am adding some user controls which use client side JQuery, and so need to include the reference to the jQuery library in the pages using them.</p> <p>There are obviously many ways to achieve this but I was wondering thoughts on relative merits disadvantages of the following techniques (or if indeed a better technique exists):</p> <ol> <li><p>Add a script element (by creating an HTMLgenericControl with the relevant attributes) to the header controlCollection - cons -> several script elements pointing to the same file may be served to the client, if the page and a few user controls all use jquery. Is this really a disadvantage? will the browser try and download several copies?</p></li> <li><p>Add a masterPage boolean property jQueryLib &amp; add the script element as above only if it has not already been added. Disadvantage - in the case of masterpages, I am not able to set the properties in the ASP, as I can with user controls. Thus all pages will need more code-behind rather than a simple &lt;%@ Page jQueryLib="true"></p></li> <li><p>Use some fairly simple client side javascript to load jQuery and run associated script after the library is loaded if jQuery==='undefined'. Cons - the script tags pointing to the javascript utility function for doing this will still be in the header multiple times if a number of user controls are used on the one page. As an advantage however, this file is much, much smaller than the jQuery library.</p></li> <li><p>Just put the script reference in the master page, even though only those logged in as administrators require any jquery functionality.</p></li> </ol> <p>As always - thank you very much for your thoughts an apologies for my amateurish knowledge of all things html and asp.</p>
jquery asp.net
[5, 9]
4,845,470
4,845,471
Download file & get percent complete
<p>Can I Detect how many bytes are downloaded from a large image say 2-4 MB? i.e. to inform the user by the percent of downloaded image? </p>
javascript jquery
[3, 5]
4,521,289
4,521,290
how to make a part of the textbox as readonly
<p>i have a tagtextbox on my page when a user selects a category that category name goes to tagtextbox</p> <p>now i want that this category name user cant change but he can append some more tags means first tag becomes readonly and further he can add too in same text box</p>
c# javascript
[0, 3]
4,435,806
4,435,807
Declare variable in C#
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/41479/use-of-var-keyword-in-c">Use of var keyword in C#</a> </p> </blockquote> <p>Hi, I am pretty new in C#,</p> <p>I would like to know the best practices in declaring variables.</p> <p>I know it is possible to use VAR (explicit declaration) or the DataType when declaring a variable (implicit).</p> <p>I would appreciate your opinions thanks</p>
c# asp.net
[0, 9]
567,133
567,134
How can I get dropdown selected value using javascript?
<p>I have an asp.net DropdownList Control. when i use this code</p> <pre><code>var id = $("[id*='drpCategory'] option:selected").val(); </code></pre> <p>the id is always come first index of dropdown. How can i get other selected values. ?</p>
javascript jquery asp.net
[3, 5, 9]
4,345,262
4,345,263
JQuery UI Dialog and OnClick event
<p>I have a JQuery UI Dialog which I have put an ASP.NET button on. I need to be able to call a server side OnClick event from this, but it is never called. Here is my Dialog, can somebody help?</p> <pre><code>&lt;div id="dialogWrapper" runat="server"&gt; &lt;div style="height: auto; width: auto;" id="dialog"&gt; &lt;table&gt; &lt;tr&gt; &lt;td width="300px" valign="top"&gt; Current Documents : &lt;/td&gt; &lt;td width="300px" valign="top"&gt; &lt;table&gt; &lt;tr&gt; &lt;td&gt; Upload Document : &lt;/td&gt; &lt;/tr&gt; &lt;tr /&gt;&lt;tr /&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:FileUpload id="fileUploadControl" runat="server" Width="200px" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr /&gt;&lt;tr /&gt; &lt;tr&gt; &lt;td&gt; &lt;asp:Button ID="btnUploadFile" runat="server" OnClick="btnUploadFile_Click" Text="Upload File" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;br /&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>EDIT : Here is how the dialog is being created :</p> <pre><code>$(document).ready(function() { $('#&lt;%=dialogWrapper.ClientID %&gt;').dialog({ autoOpen: false, height: 250, width: 600, modal: true, title: "Upload/Open Files", show: "drop" }); }); </code></pre>
jquery asp.net
[5, 9]
2,920,232
2,920,233
When you write your own jquery function, what does this mean?
<p>Hi I came across this piece of code and I was wondering specifically what is going on with <code>this.each(function(i,e)</code> and <code>var $e = $(e);</code>. I'd like to know what the programmer is trying to do.</p> <p>Thanks!</p> <pre><code>$.fn.rssfeed = function (url, options, fn) { return this.each(function (i, e) { var $e = $(e); var s = ''; } </code></pre>
javascript jquery
[3, 5]
5,660,487
5,660,488
Usage of ITemplate in custom control
<p>I'm trying to figure out if I can use the <code>ITemplate</code> interface in a custom control. Here is what I've done so far.</p> <pre><code>public class Tooltip : Control { public ITemplate ContentTemplate { get; set; } protected override void CreateChildControls() { base.CreateChildControls(); var ctrl = new HtmlGenericControl("a"); if (ContentTemplate != null) { ContentTemplate.InstantiateIn(ctrl); } this.Controls.Add(ctrl); } } </code></pre> <p>The asp.net control usage</p> <pre class="lang-html prettyprint-override"><code>&lt;gc:Tooltip runat="server"&gt; &lt;ContentTemplate&gt; hello &lt;/ContentTemplate&gt; &lt;/gc:Tooltip&gt; </code></pre> <p>The idea is that it should return something like this</p> <pre class="lang-html prettyprint-override"><code>&lt;a&gt;hello&lt;/a&gt; </code></pre> <p>But the result looks like this</p> <pre class="lang-html prettyprint-override"><code>&lt;ContentTemplate&gt; hello &lt;/ContentTemplate&gt; &lt;a&gt;&lt;/a&gt; </code></pre> <p>It does include the template tags and seem to ignore whatever I do.</p> <p>Any advice is appreciated </p>
c# asp.net
[0, 9]
5,135,076
5,135,077
Package private in C#?
<p>In Java a method that hasn't any visibility keyword is called package private and can be seen in from objects in the same package.</p> <p>If a method or a field hasn't any visibility keyword in C# is it also package private and if not whats the visibility then?</p> <p>And how can I make a field package private in C#?</p>
c# java
[0, 1]
1,951,479
1,951,480
adding php string to some javascript
<p>I'm trying to add a php string to some javascript:</p> <pre><code>document.getElementById("button").value = mygetrequest.responseText; </code></pre> <p>basically there are a load of buttons on one page. </p> <p>So i need to add a value at the end of button. <br>Basically the ID of each row so button<code>&lt;? echo $row['ID']; ?&gt;</code> but i'm not too sure how i would do this in javascript.</p> <p>Any help</p> <p>Thanks in advance</p>
php javascript
[2, 3]
3,606,770
3,606,771
JavaScript, jQuery - How would I reuse this function properly
<p>Maybe Im just confusing myself due to being pressed for time, but how would I reuse this function without reloading the page itself? </p> <pre><code>$(function() { var uploadqueue = $("#uploader").pluploadQueue({ // General settings runtimes : 'html4,silverlight', url : 'upload_file.json?hdfs_url=&lt;%=@file_name%&gt;&amp;authenticity_token=&lt;%= form_authenticity_token %&gt;', max_file_size : '100000000000mb', //chunk_size : '1mb', unique_names : true, multipart: false, multiple_queues: true, //multipart_params: { //"authenticity_token" : '&lt;%= form_authenticity_token %&gt;' //}, // Flash settings flash_swf_url : 'javascripts/plupload/plupload.flash.swf', // Silverlight settings silverlight_xap_url : 'javascripts/plupload/plupload.silverlight.xap', init : { Refresh: function(up) { // Called when upload shim is moved $(".plupload_header_title").text("Upload files to HDFS"); $(".plupload_header_text").text("Files will go in: &lt;%=@file_name%&gt;"); }, StateChanged: function(up) { // Called when upload shim is moved $.get("file_tree?dir=&lt;%=@file_name%&gt;", function(data){ //alert("&lt;%=@rel_link%&gt;") //alert("Command = ul[name*='&lt;%=@rel_link%&gt;']") //alert("Data Loaded: " + $("ul[name*='&lt;%=@rel_link%&gt;']").html()); $("ul[name*='&lt;%=@rel_link%&gt;']").html($(data).children()); }); } } }); </code></pre>
javascript jquery
[3, 5]
1,194,194
1,194,195
carriage return internationalize without ASCII
<p>Is there any other way to identify the carriage return rather than using the ASCII to internationalize it.</p> <p>I don't want this as i have already used this</p> <pre><code>$("var").keypress(function(event){ if(event.which==13){ event.preventDefault(); }); </code></pre>
javascript jquery
[3, 5]
2,728,033
2,728,034
Application Runs when Debugging but not when Published
<p>When publishing my web application and then running it will return the error </p> <p><strong>"Could not load file or assembly 'BaseApplicationName' or one of its dependencies. An attempt was made to load a program with an incorrect format."</strong></p> <p>However if I run the application through <strong>debugging (f5) it runs correctly</strong>. </p> <p>I guess what it comes down to is </p> <p><strong>what differences are there when running an application through debugging vs publishing it that would cause a problem like this?</strong></p> <p><em>When publising I have it set to delete all existing.</em></p> <p><strong>History of how it started...</strong> I added the 32 bit Oracle.DataAccess dll to my 64 bit system. It would not work and crash giving the same error as above but with the Oracle.DataAccess name instead of the baseApplicationName. I have since removed all references to it and removed the dll to try and get it to run without it once again. </p> <p>Any advice?</p>
c# asp.net
[0, 9]
438,658
438,659
Setting Label Text to Number of Rows with jQuery
<p>This is my code but nothing happens.</p> <pre><code>$(document).ready(function() { var totalRows = $("#&lt;%=GridView3.ClientID %&gt; tr").length; document.getElementById('Label6').InnerHTML = totalRows; }); </code></pre> <p>this is what i ended up using</p> <pre><code>var rqnum = $("#&lt;%=GridView3.ClientID %&gt; tr").length - 1; document.getElementById('rqnum').innerHTML = rqnum; var oknum = $("#&lt;%=GridView4.ClientID %&gt; tr").length - 1; document.getElementById('oknum').innerHTML = oknum; var xlnum = $("#&lt;%=GridView5.ClientID %&gt; tr").length - 1; document.getElementById('xlnum').innerHTML = xlnum; var dynum = $("#&lt;%=datalist1.ClientID %&gt; tr").length / 3; document.getElementById('dynum').innerHTML = dynum; </code></pre> <p><strong>this way it subtracts the header, however, how can i make it so if it is 0 dont subtract the -1 because i dont want negatives</strong></p>
jquery asp.net
[5, 9]
2,334,033
2,334,034
trying to append content to DOM element
<p>I'm trying to add a div to a row of content with the click of a button. My code works for the first row but not for any other row. Please help. This is the function for the button:</p> <pre><code>$(".addMMbtn").each(function() { $(this).bind("click", function() { var thisRow = $(this).closest(".txtContentRow"); var thisTxt = thisRow.find(".txtContent"); var cellStr = '&lt;div class = "mmCell prep"&gt;&lt;/div&gt;'; $(cellStr).appendTo(thisTxt); } ); }); </code></pre> <p>You can see a fiddle of the problem here: <a href="http://jsfiddle.net/z7uuJ/" rel="nofollow">http://jsfiddle.net/z7uuJ/</a></p>
javascript jquery
[3, 5]
5,776,405
5,776,406
Sending and receiving an SMS by an application in Java
<p>I want an application in Java that can receive SMSes from the users and send the response back to the users.</p> <p>For example, I want the users to send the SMS to a particular number, say 5000 or 6000 and the application should recieve it and send back the response to the user itself. </p> <p>How do I implement this in Java and how could I use a number that could be used by the users to send the SMS to the application?</p>
java android
[1, 4]
1,231,830
1,231,831
How to call jar files from PHP?
<p>I know this question is not new but I am posting this after going through enough googling around.</p> <p>I have a jar file which I don't control. I mean I have not written the Java class in there and all I know is that there is a class named "hist" in it which takes two arrays and gives out the output. Now I have to use PHP to call this class "hist" in the jar file named "histvol.jar". I have installed the PHP/Java Bridge and it is installed correctly.<br> But I don't understand how to call this jar file in PHP and where to place this jar file.</p> <p>This is what I did:</p> <ol> <li>Installed tomcat and php-javabridge</li> <li>Placed the jarfile "histvol.jar" under Tomcat/webapps/JavaBridgeTemplate621/webinf/lib/</li> <li>Went to xampp/htdocs and created a file named testjava.php</li> </ol> <p></p> <pre><code>&lt;?php require_once("http://localhost:8080/JavaBridgeTemplate621/java/Java.inc"); $System = java("java.lang.System"); $myclass=java("histvol"); echo $System-&gt;getProperties(); ?&gt; </code></pre> <p><code>Class not found</code> exception is expected because I am not calling it anywhere in PHP, but how do I call it?<br> I am lost, please help (I don't know a word of Java).</p>
java php
[1, 2]
4,639,703
4,639,704
how to import multiple excel sheets into 2 sql server tables?
<p>Am having one excel file with 2 different worksheets as fundmodelrate and project.Now I want to import these 2 different sheet values into 2 different sql tables(k2_fundmodelrate,k2_project).I can able to do import only if am working with 1 sheet and and 1 table,but I want two sheets values to be imported on two tables at the same time on button click event. My code below:</p> <pre><code>private String strConnection = "Data Source=kuws4;Initial Catalog=jes;User ID=sa;Password=******"; protected void btnSend_Click(object sender, EventArgs e) { string path = fileuploadExcel.PostedFile.FileName; string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\fmr.xls;Extended Properties=Excel 12.0;Persist Security Info=False"; OleDbConnection excelConnection = new OleDbConnection(excelConnectionString); OleDbCommand cmd = new OleDbCommand("Select * from [FundModelRate$]", excelConnection); //OleDbCommand cmd1 = new OleDbCommand("Select * from [FundModelRate$], [Project$]", excelConnection); excelConnection.Open(); OleDbDataReader dReader; dReader = cmd.ExecuteReader(); SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection); sqlBulk.DestinationTableName = "K2_FundModelRate"; // sqlBulk.DestinationTableName = "K2_Project"; sqlBulk.WriteToServer(dReader); excelConnection.Close(); } </code></pre>
c# asp.net
[0, 9]
5,263,192
5,263,193
ASP.NET w/ C# SortedList
<p>How do I create a SortedList that holds multiple variables? I want to keep multiple instances of (date, height, weight).</p>
c# asp.net
[0, 9]
707,148
707,149
Update Custom ListView Item
<p>I have a listview that uses a customadapter based on the baseadapter. The listview populates ok using external data and I can pick up the click events and know which item has been selected. </p> <p>I'm having a problem updating the clicked item's views, like TextView and ViewFlipper.</p> <p>Do I have to update something via the listview or is it via the adapter. I've tried things like the following;</p> <pre><code>View test = (View)adapter.getView(pos, null, myListView); ViewFlipper temp = (ViewFlipper)test.findViewById(R.id.flipholder); temp.showNext(); TextView temp2 = (TextView)test.findViewById(R.id.filmtitle); temp2.setText("Hello World"); </code></pre> <p>Which results in the viewfliper flipping the first and third item or second and fourth and the text not updating at all.</p> <p>Any ideas?</p> <p>Cheers</p>
java android
[1, 4]
3,803,053
3,803,054
Correct way to deal with potential session expiration
<p>I am wondering what is the best (e.g. most efficient, commonly accepted, industry standard) way to deal with the potential expiration of a session when you are regularly using the values stored in it in your code.</p> <p>For example, I am often using (in C#) lines similar to the following:</p> <pre><code>Guid personGuid = (Guid)Session[SSPersonGuid]; </code></pre> <p>I am checking in Page_Load whether the values are null and dealing accordingly, but the session might expire while the person is on the page, in which case when they click a button on the page, and we need to use something like the above, there will be a NullReferenceException.</p> <p>Is the best way to handle this just to check for null before each usage like this:</p> <pre><code>if (Session[SSPersonGuid] == null) {...} </code></pre> <p>Or is there some kind of special thing I don't know about?</p>
c# asp.net
[0, 9]
3,076,263
3,076,264
jQuery .contains(+number+)
<p>it's been a long day and I think I just have code blindness but..</p> <p>Trying to figure out if an element contains a number, do something to another element.</p> <pre><code>result_val = 9; $(".result").contains("+result_val+") (function() { $(".parag").css("color", "#eee"); }); </code></pre> <p>Maybe I'm taking the wrong approach? But there is no effect on the <code>.parag</code> div.</p> <p><a href="http://jsfiddle.net/xzeCq/" rel="nofollow">http://jsfiddle.net/xzeCq/</a></p>
javascript jquery
[3, 5]
5,304,063
5,304,064
onClose event is not called on cancel click in simple modal...when i am loading another jquery dialog on simple modal?
<p>I am using Eric martin simple modal (1.3)to show some dynamic data (table) this table is clickable (when i click cells of table which i am showing on simple modal) , I am showing another popup jquery dialog which is also showing some content.....here i got the problem . After my 2nd popup (jquery dialog) when i am closing my simple modal window onClose event is not called and not closing modal window.</p> <pre><code>// My main jsp page lil code snippet &lt;script&gt; $("#eric").modal({ onShow: function(){alert("show");}, onClose: function(){alert("close "); $.modal.close(); } }); &lt;/script&gt; &lt;body&gt; &lt;div id="eric"&gt;&lt;/div&gt; &lt;div id="rfi"&gt;&lt;/div&gt; &lt;/body&gt; // showing this dialog over simple modal dialog $("#rfi").dialog({ //some dynamic data ajax call writing on dialog $("rfi").html(data); }); </code></pre> <p>please help me i had already spent 3 days on this......:(</p>
javascript jquery
[3, 5]
4,435,762
4,435,763
What are the hardest parts of the C++/C#/Java programming languages?
<p>Just wondered what are the features of the three main programming languages which show you are an 'expert'? Please exclude 'practical' skills such as indenting.</p> <p>Am I right in saying for C++ the most difficult aspect to master is STL/generics? Java seems much easier as memory is handled for you. I'm not entirely sure on C# either?</p> <p>I'm trying to use this to guage my current level of ability and what i wish to aim for.</p> <p>ps this was posted on stackoverflow but got binned due to arguing, please do try to keep it civil as I am really interested in the answers from everyone :)</p>
java c# c++
[1, 0, 6]
3,400,056
3,400,057
How to remove object from inside .each()
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4178123/how-to-remove-a-property-from-an-object">How to remove a property from an object?</a> </p> </blockquote> <p>I am comparing two JSON objects and then deleting the old items from a list with this code:</p> <pre><code>dangerousPeople = ({1:{title:"Jackie Chan", user:"Jackie"}, 2:{title:"Chuck Norris", user:"Chuck"}, 3:{title:"Britney spears", user:"Britney"}}); newDangerousPeople = ({1:{title:"Jackie Chan", user:"Jackie"}, 3:{title:"Britney spears", user:"Britney"}}); $.each(dangerousPeople, function(index) { if(!newDangerousPeople[index]){ $('#dangerousPeople #id'+index).slideUp("normal", function() { $(this).remove(); } ); delete dangerousPeople.index; } }); </code></pre> <p>The part of the script that slidesup the element works, but deleting the element from the object I can't make it work.</p> <p>I tried with <code>delete dangerousPeople.index</code> but doesn't work, also tried delete <code>$(this)</code> but no luck either. </p> <p>So how should I remove the element from itself?</p>
javascript jquery
[3, 5]
767,376
767,377
The notification can't skip to another activity?
<p>my code is</p> <pre><code>public class AlarmReceiver extends BroadcastReceiver { public Notification mNotification = null; public NotificationManager mNotificationManager = null; @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "time up!", Toast.LENGTH_SHORT).show(); mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mNotification = new Notification(R.drawable.icon, "tip!", System.currentTimeMillis()); mNotification.contentView = new RemoteViews(context.getPackageName(), R.layout.notification); mNotification.contentView.setTextViewText(R.id.tv_tip, "click to see the description"); Intent notificationIntent = new Intent(context,NotificationTip.class); notificationIntent.putExtra("description", intent.getStringExtra("description")) ; //notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0); mNotification.contentIntent = contentIntent; mNotificationManager.notify(0, mNotification); } </code></pre> <p>}</p> <p>While when I click the item in notification ,I can't get to NotificationTip activity,so what's wrong with this code?</p>
java android
[1, 4]
2,965,470
2,965,471
Pre-fill a form (no control over form code)
<p>I'm using a form plugin / addon where I don't have control over how the form is generated.</p> <p>The form generates HTML which looks like this:</p> <pre><code>&lt;form&gt; &lt;label&gt;First Name&lt;/label&gt;&lt;input name="Question25" type="text" value="" /&gt; &lt;input class="formBlockSubmitButton" name="add" type="submit" value="Submit" /&gt; &lt;/form&gt; </code></pre> <p>I would like to prefill some of the form values but I <strong>can't</strong> write, say</p> <pre><code>&lt;input name="Question25" type="text" value="&lt;?php echo $my_value; ?&gt;" /&gt; </code></pre> <p>Because the form addon generates that HTML. I can write PHP or Javascript before this block, is there a way to search for an input with a name of "Question25" and then prefill it when the block comes up?</p>
php javascript jquery
[2, 3, 5]
1,106,731
1,106,732
Best method for a PHP script to communicate with an application?
<p>I'm currently writing a c++ application for a linux server which basically handles requests (I haven't coded the part handling the requests yet, as I'm not sure of the best method).</p> <p>Basically I have a PHP page that when fired (client hits the page) needs to communicate with the above mentioned application.</p> <p>Now I can't fire off this application each time it's needed, as it's a rather complex application that needs to load data before it can do any processing (so it should just stay loaded forever as a daemon).</p> <p>How would you suggest I have the PHP page make requests to the application? Should I just use socket programming with TCP/IP?</p> <p>Thanks in advance!</p>
php c++
[2, 6]
730,734
730,735
Sort Arraylists according to Dates with particular format
<p>I have a problem that I want to sort multiple Arraylists with respect to Date Arraylist with a format as: 2011-07-18T10:39:32.144Z. How to that in java? Can anyone Help me out?</p> <p>Thanks in advance.</p>
java android
[1, 4]
1,565,418
1,565,419
How to make fixed floating element stop at #footer?
<p>Below is the code I am using to fix a sidebar as the user scrolls. As of now, it overlaps with my footer. How can I make it stop at a certain point or when it hits the footer?</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { if ($('.pageheaderwrap').length) { $(window).scroll(function() { if ($(this).scrollTop() &gt; 362) { $(".sidebar-left").css({ "position": "fixed", "top": 0 }); } else { $(".sidebar-left").css({ "position": "absolute", "top": "255px" }); } }); } else { $(window).scroll(function() { if ($(this).scrollTop() &gt; 230) { $(".sidebar-left").css({ "position": "fixed", "top": 0 }); } else { $(".sidebar-left").css({ "position": "absolute", "top": "125px" }); } }); } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
485,706
485,707
How to convert a java swing application to work on android
<p>So I built a program in Java using swing for the interface and i didn't realize how difficult it would be to convert it to be used as an android application. Is there any way for me to easily convert or rebuilt the program to be sold in the android market place? If not can anyone point me toward any resources to help build a android.</p>
java android
[1, 4]
5,664,227
5,664,228
Serialize inputs and select option
<p>I need to serialize inputs and selected option in table row(tr)<br/></p> <pre><code>&lt;form action='' METHOD='post' id='formConfirmOrder'&gt; &lt;table id='viewTableOrders'&gt; &lt;tr id='vagon1'&gt; &lt;td&gt; &lt;select name="order[1][rail_path]" title="1"&gt; &lt;option value="" selected="selected"&gt;&lt;/option&gt; &lt;option value="1"&gt;Patch1&lt;/option&gt;&lt;option value="2"&gt;Patch2&lt;/option&gt; &lt;option value="3" selected="selected"&gt;Patch3&lt;/option&gt;&lt;option value="5"&gt;Patch4&lt;/option&gt;&lt;/select&gt; &lt;/td&gt; &lt;td&gt; &lt;input name="order[1][vagon_id]" value="210" type="hidden"/&gt; &lt;/td&gt; </code></pre> <p> </p> <pre><code> $('#formConfirmOrder &gt; #viewTableOrders tr#vagon1 select option:selected, #formConfirmOrder &gt; #viewTableOrders tr#vagon1 input').serializeArray(); </code></pre> <p>.. *<em>FireBug</em>*Only inputs <br/></p> <pre><code>[Object { name="order[1][vagon_id]", more...}] </code></pre> <p><br/> I can`t get selected value from option!<br/> Inputs were serialized. ,but not options.</p>
javascript jquery
[3, 5]
3,642,602
3,642,603
How can I embed a static HTML page in a aspx page?
<p>I have a static HTML page complete with client-side scripts and css (both are included in the html). I was wondering if it would be possible to embed this HTML page into an ASPX page and have the ASPX page be able to respond to javascript events that are raised from within the static html document? Does asp.net provide a specific control for this or can I use a frame?</p> <p>Any help would be great. Thanks a lot!</p>
javascript asp.net
[3, 9]
10,824
10,825
remove everything after a certain character
<p>Is there a way to remove everything after a certain character or just choose everything to that character, either way. my scenario is like this that its always gone be different amount of characters and im getting the value from a href and up to the ? </p> <pre><code>like /Controller/Action?id=11112&amp;value=4444 </code></pre> <p><strong>EDIT</strong><br /> I want the href to be <code>/Controller/Action</code> only, so i remove everything after the ?</p> <p>im using this now</p> <pre><code> $('.Delete').click(function (e) { e.preventDefault(); var id = $(this).parents('tr:first').attr('id'); var url = $(this).attr('href'); alert(url); </code></pre>
javascript jquery
[3, 5]
969,731
969,732
java Script User Define $ function like jquery
<p>I'm trying to Create user define $ function as i cannot use Jquery in existing project.</p> <p>I want to get this function as work as Jquery $('ID')</p> <p>Please give me some hint Any hint OR Example for Example</p> <pre><code>function $(element) { } var value = $('elementID').value </code></pre> <p><strong>UPDATE:</strong> As i have prototype.js</p> <pre><code>function $(element) { if (arguments.length &gt; 1) { for (var i = 0, elements = [], length = arguments.length; i &lt; length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } </code></pre>
javascript jquery
[3, 5]
2,218,621
2,218,622
Recording button ID's in Javascript
<p>I am trying to create an item selection menu, where the user is presented with multiple buttons to pick their choices. I am creating several divs with PHP.</p> <pre><code> &lt;div id="h1-1"&gt;&lt;input type="button" value="h1-1" onclick="recordValue()"&gt;&lt;/div&gt; &lt;div id="h1-2"&gt;&lt;input type="button" value="h1-2" onclick="recordValue()"&gt;&lt;/div&gt; </code></pre> <p>I would like to record all the values of buttons pressed and show these values via Ajax. Then when user is done selecting and presses submit I will insert these into MSSQL database.</p> <ul> <li>How do I record button values to an array with Javascript?</li> <li>How do I then show what was pressed?</li> <li>Where could I execute some filtering of the selections (e.g. if h1-1 was pressed i do not want them to be able to select h2-1) ?</li> </ul>
php javascript
[2, 3]
437,584
437,585
Adding jQuery function to select box to make it change the CSS dynamically
<p>I want my select box to dynamically change the CSS of another part of the page so that the right options are visible according to each selection.</p> <p>E.g. the right DIV elements are shown when the correlating select option is selected. </p> <p>My select input and DIVs:</p> <pre><code>&lt;select id="chooser" class="input_select" name="chooser"&gt; &lt;option value=""&gt;Select...&lt;/option&gt; &lt;option value="Car"&gt;Car&lt;/option&gt; &lt;option value="House"&gt;House&lt;/option&gt; &lt;option value="Commercial"&gt;Commercial&lt;/option&gt; &lt;option value="Other"&gt;Other&lt;/option&gt; &lt;/select&gt; &lt;div id="car" style="display:none;"&gt;Cars&lt;/div&gt; &lt;div id="house" style="display:none;"&gt;House related&lt;/div&gt; &lt;div id="commercial" style="display:none;"&gt;Commercial stuff&lt;/div&gt; &lt;div id="other" style="display:none;"&gt;Other stuff&lt;/div&gt; </code></pre> <p>my jquery so far:</p> <pre><code>$(document).ready(function() { $('#chooser').change{ $('#house').hide() $('#commercial').hide() $('#other').hide() $('#car').show() } }); </code></pre> <p>I'm a noob at jQuery and I just don't know HOW to tell it to filter it by which option is selected. I mean, I think I added the .change{} part right but no idea how to filter it.</p> <p>Any help is appreciated. Thanks</p>
javascript jquery
[3, 5]
1,212,112
1,212,113
jQuery Image fadeIn Upon Scroll Inside DIV
<p>I can't get the actually LazyLoad plugin to work for me so I am trying to write my own with. Currently I have a list of images loading inside of a DIV. They are pulled by a PHP query to the mysql database. The DIV scroll is set to auto. The code I am using is:</p> <pre><code>&lt;div id="b1" style="overflow:auto;"&gt; &lt;?PHP $result = mysql_query("SELECT * FROM images"); while($row = mysql_fetch_assoc($result)) { echo "&lt;img src='$row[photo]' style='display:none'&gt; &lt;br&gt;"; } &lt;/div&gt; &lt;script type="text/javascript"&gt; function imgCheck() { var position = $("img").offset().top; var scrollCheck = $("#b1").scrollTop() + $("#b1").height(); if ( scrollCheck &gt; position) { $("img").fadeIn("fast"); } $("#b1").scroll( function() { imgCheck() } ); &lt;/script&gt; </code></pre> <p>Although this is not quite working for me. Could anyone help me out or shoot out some suggestions?</p>
javascript jquery
[3, 5]
5,672,899
5,672,900
Android package name must start with "com."?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/189209/do-you-really-use-your-reverse-domain-for-package-naming-in-java">Do you really use your reverse domain for package naming in java?</a> </p> </blockquote> <p>I am a beginner in android programming. I made a few android projects using eclipse.. while I was catching up with some android tutorials I could see everyone using "com" as a starting word of package name. I want to know why, as far as I have known it's just package name but why does everyone start with "com"? Do I have to follow? or is there any specific reason programmatically?</p>
java android
[1, 4]
3,366,791
3,366,792
Android Notepad exercise. Menu isn't working
<p>I'm using <a href="http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html" rel="nofollow">http://developer.android.com/resources/tutorials/notepad/notepad-ex1.html</a> as a guide.</p> <p>I've got to step 13 and ran the application, but when I pressed the menu button, the application stopped working:</p> <p><img src="http://i.stack.imgur.com/cHudR.png" alt="The problem"></p> <p>When debugging:</p> <p><a href="http://i.stack.imgur.com/0QiBt.png" rel="nofollow"><img src="http://i.stack.imgur.com/0QiBt.png" alt="Debugging"></a></p> <p>What can I do?</p> <p><strong>Edit</strong> Stacktrace: <img src="http://i.stack.imgur.com/70uEV.png" alt="enter image description here"> Errors: <img src="http://i.stack.imgur.com/iCOvu.png" alt="enter image description here"></p> <p><strong>MoreEdits:</strong> <img src="http://i.stack.imgur.com/em0Cl.png" alt="enter image description here"></p>
java android
[1, 4]
85,184
85,185
Joint image and data display in a gridview bound to a database
<p>Good evening</p> <p>I am inserting book items into a table of an access database on a web service from my web site and this table I add to a dataset(using a method in the web service) which I return to the website and bind to a gridview control to display the items. So far so good.</p> <p>My problem is that I would ideally want to display images that should also be inserted along with the other detail such as book title and author. It is however very tricky to add images to a access database and I am therefore asking for advice(pointer) as to how display the images in my gridview along with the book items.</p> <p>Should I add the images to the App_dat folder which is what I am thinking but how to add the pictures so that they are displayed together with the correct book items?.</p>
c# asp.net
[0, 9]
5,599,122
5,599,123
What is the most idomatic way to index a list of objects by coordinates
<p>I have a strong python background and a total newbie with Java, so I try to do things in <em>Pythonic</em> way in java and end up struggling. Currently I have a problem to figure out how to do store objects, indexed by coordinates, so that they are iterable. I <em>could</em> create an 2-dimensional array of the objects, but I'm afraid that would take a lot of memory <strong>AND</strong> I would have to iterate over all the indexes every time (when I only want to do it occassionally) to get all the objects.</p> <p>In python, I would use a dictionary with tuples as keys, but looks like such thing is not possible in Java.</p> <p>E.g.</p> <pre><code>class bar() pass bar1 = bar() bar2 = bar() # etc foo = { (0,1): bar1, (100,30): bar2 } for x in foo.values(): do_something() </code></pre>
java python
[1, 7]
2,086,041
2,086,042
asp.net textbox with java script problem
<p>I'm trying to check if asp.net textbox is empty or not using java script. my code working ok but if I enter only numbers will conder it empty so I have either enter letters and numbers or only letters.</p> <p>Please advice.</p> <p>here is my code</p> <pre><code> &lt;script type="text/javascript"&gt; function check(){ var txt = document.getElementById('&lt;%=txt.ClientID%&gt;').value; //(isNaN(cmbStateHome) == false if (isNaN(txt) == false) { alert("Please enter some thing."); } else {alert("ok");} } } &lt;/script&gt; &lt;asp:TextBox ID="txt" runat="server"&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID="txtZipCodeHome" runat="server" Style="top: 361px; left: 88px; position: absolute; &lt;asp:LinkButton ID="LinkButton1" runat="server" OnClientClick="check()"&gt;LinkButton&lt;/asp:LinkButton&gt; </code></pre>
asp.net javascript
[9, 3]
3,049,568
3,049,569
Passing a variable in as a JQuery ID
<p>I am passing an id into a function as a string. I want to use that ID to then change the background color. I have used:</p> <pre><code>$("#"+address).css("background-color", "#3399FF"); </code></pre> <p>but it is not changing the background color and when I do a:</p> <pre><code>console.log($("#"+address).css("background-color")); </code></pre> <p>It is coming up as undefined.</p> <p>How can I pass the variable address into jquery?</p> <p>Thanks for your help.</p> <p>Kevin</p>
javascript jquery
[3, 5]
3,660,457
3,660,458
Move row to top in data table c#
<p>I have a data table in which if the Addresses match move one of the rows to the top of the data table. I am using the following code but it doesnt work. Any idea how to achieve this. The data in the data table is imported from an excel file. I have tried the same if statement in GridView to highlight the duplicates and that works but I also want to move them to the top because the data has more than 1000 rows and its hard to move up and down again and again to check for the highlighted row.</p> <pre><code>for (int row = 1; row &lt; dtf1.Rows.Count; row++) { for (int rowinner = 1; rowinner &lt; dtf1.Rows.Count; rowinner++) { if (rowinner != row) { if (dtf1.Rows[row][addresscolno] == dtf1.Rows[rowinner][addresscolno].ToString()) { DataRow newrow = dtf1.Rows[row]; dtf1.Rows.RemoveAt(row); dtf1.AcceptChanges(); dtf1.Rows.InsertAt(newrow, 1); dtf1.AcceptChanges(); GridView1.DataSource = dtf1; GridView1.DataBind(); } } } } </code></pre>
c# asp.net
[0, 9]
1,544,186
1,544,187
Creating a textfield which takes values based on the first character
<p>I have a textfield. If we enter a number for the first character, the textfield should only accept numbers. Otherwise if the first character is a letter, then the textfield should accept only letters. I am trying to achieve this in jQuery/Javascript.</p>
javascript jquery
[3, 5]
5,870,495
5,870,496
jQuery UI Not being loaded properly? Dialog method not found
<p>I'm having an issue with my jQuery UI dialog on this page (and this page only):</p> <p><a href="http://www.satelliteinternet.com/" rel="nofollow">http://www.satelliteinternet.com/</a></p> <p>I'm not sure what the issue is as it's working on all the other pages on the site. The error I'm getting is the $("#DealerSearch") object has no dialog method. Very odd indeed.</p> <p>Has anyone else experienced this issue?</p>
javascript jquery
[3, 5]
4,837,172
4,837,173
Get image from portfolio page and post in homepage
<p>Hi I have created myself a portfolio website.On the homepage in the footer on the right I would like to add four images from the portfolio page that change every time the page is loaded.Can anyone tell me how this can be achived? </p> <p>On the portfolio page this is the structure for the html:</p> <pre><code>&lt;ul class="ourHolder"&gt; &lt;li class="item" data-id="id-1" data-type="websites" &gt; &lt;img src="img/portfolio/websites/small/1.jpg" alt=""&gt; &lt;div class="full"&gt;&lt;/div&gt; &lt;/li&gt; &lt;/li&gt; &lt;li class="item" data-id="id-2" data-type="pdesigns"&gt; &lt;img src="img/portfolio/Print/small/1.jpg" alt="" /&gt; &lt;div class="full"&gt;&lt;/div&gt; &lt;/li&gt; &lt;li class="item" data-id="id-3" data-type="ldesign"&gt; &lt;img src="img/portfolio/Logo/small/001.jpg" alt="" /&gt; &lt;div class="full"&gt;&lt;/div&gt; &lt;/li&gt; .... &lt;/ul&gt; </code></pre> <p>I am using the jquery quicksand plugin to create a nice effect.I am trying to randomnly get 4 images from this page and post them on the homepage in the footer.Here is my website:</p> <p><a href="http://foxteam.net" rel="nofollow">foxteam.net</a></p>
php javascript jquery
[2, 3, 5]
1,127,360
1,127,361
Java Script Undefined Error in mozilla?
<p>I use the following Javascript function.It will not work.It will give the <strong>Undefined Error</strong> in the following line, <code>c= row.cells[0].innerText.strip();</code></p> <pre><code>function a() { var table = getServerObject("b"); var row,c; for (var i = 2; i &lt; table.rows.length - 1; i++) { row = table.rows[i]; if(row.cells.length==1)continue; c= row.cells[0].innerText.strip(); if(c==0) { //Something } } } </code></pre>
javascript asp.net
[3, 9]