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,726,190
2,726,191
hide paging numbers in gridview?
<p>I am trying to hide paging numbers on gridview that shows on bottom of the gridview. I am using dropdown list instead of this number clicks. How can I hide them?</p> <p>Please advice</p>
c# asp.net
[0, 9]
2,435,949
2,435,950
Changing the inner tags class of a tag using jquery or javascript
<p>I have the following code:</p> <pre><code>&lt;li id="toto" class="jstree-leaf"&gt; &lt;ins class="jstree-icon2"&gt;&amp;nbsp;&lt;/ins&gt; &lt;a class=""&gt;&lt;ins class="jstree-icon2"&gt;&amp;nbsp;&lt;/ins&gt;Story B&lt;/a&gt; &lt;/li&gt; </code></pre> <p>I need to change the class of the <code>&lt;ins&gt;</code> tags for a specific <code>&lt;li&gt;</code>. I need to access the <code>&lt;li&gt;</code> id and then change the class of all <code>&lt;ins&gt;</code> tags found inside it</p> <p>I would appreciate it if someone could show me the right way to do that.</p> <p>Thanks a lot..</p>
javascript jquery
[3, 5]
966,604
966,605
From the web to games
<p>I'm a basic web developer. I know PHP, a little bit of Python and Ruby. JavaScript as well [some stuff]. I'm not a hardcore developer. I know what it takes do develop most of web cases.</p> <p>Now, I have this desire to go deeper and start developing games. I know it sounds a huge leap, but that is why I'm asking here. I already have some games ideas. It would be simple 2d plataform games, and I would like to know what is the best way to start.</p> <p>I don't want to start with Flash. I'm looking for working with other stuff. I already started to look around for the Unity 3D framework and UDK, but I just don't know how to get started.</p> <p>So, any hints, tips or sugestions to make? Thanks in advanced!</p>
php javascript python
[2, 3, 7]
2,719,680
2,719,681
Problem in show value jQuery toolti
<p>I created a tooltip and i have problem with it, i want:</p> <p>When that <code>mouseenter</code> on <code>hi</code> show value into next div it <code>value hi</code> <br> When that <code>mouseenter</code> on <code>hello</code> show value into next div it <code>value hello</code> <br></p> <p>But in following code, when that <code>mouseenter</code> on each tow <code>hi</code> &amp; <code>hello</code> showing <code>value hello</code>,</p> <p>How can fix it?</p> <pre><code>var tip = $('.tool_tip').closest('li').find('div').clone(); $('.tool_tip').mouseenter(function () { var $this = $(this), $div = '.'+$this.closest('li').find('div').attr('class'); $(this).attr('title', ''); $($div).hide().fadeIn('slow').children('.tipBody').html(tip); }).mousemove(function (e) { $('.tooltip').css('top', e.pageY + 10); $('.tooltip').css('left', e.pageX + 20); }).mouseleave(function () { $('.tooltip').hide(); }) </code></pre> <p><strong>Example:</strong> <a href="http://jsfiddle.net/dege4/2/" rel="nofollow">http://jsfiddle.net/dege4/2/</a></p>
javascript jquery
[3, 5]
4,451,308
4,451,309
Filter Input in Real-Time?
<p>I have an EditText (accepts 0-9) with a listener. I want to grab input as it's entered, apply a calculation, and display it in the same EditText box.</p> <p>The box initially displays $0.00. When the user inputs a 2, I want to grab that from the box, parse it to remove the $ and decimal, convert it to an int... divide it by 100 and put a $ in front of it. After setText, it should display $0.02. If they then press 5, I'll grab it, parse it, end up with 25, do the math and it should display $0.25, etc.</p> <p>I don't know if this is the best way, I'm open to new ideas. Here is my current code:</p> <pre><code>mEditPrice.addTextChangedListener(new TextWatcher(){ DecimalFormat dec = new DecimalFormat("0.00"); @Override public void afterTextChanged(Editable arg0) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { String userInput = mEditPrice.getText().toString().replaceAll("[^\\d]", ""); int userInputInt = Integer.parseInt(userInput); mEditPrice.setText("$"+dec.format(userInputInt / 100)); } </code></pre>
java android
[1, 4]
4,609,981
4,609,982
lightbox is not working in updatepanel + c#
<p>I have 6 thumbnail images as <code>asp:imagebutton</code> instances. These are treated as triggers for <code>asp:updatepanel</code> control on the page which contains an <code>asp:image</code> control. <br><br> When the user clicks on the thumbnail, the image in the <code>asp:updatepanel</code>'s image control changes to the clicked thumbnail image. <br> The users are also allowed to again enlarge the image by clicking on the enlarge button (this runs the <code>lightbox</code> function). This works fine. <br><br> <b>Question</b><br> The problem is that the enlargement works when the page loads, however when the user select a thumbnail and then tries. The method (<code>lightbox</code>) does not work.<br> <br> I have had similar problems with <code>javascript</code> functions and the <code>asp:updatepanel</code>. Has anyone else faced similar issues? If so, how do I solve this issue?</p>
c# asp.net
[0, 9]
5,788,632
5,788,633
asp.net regularexpressionvalidator ValidationExpression
<p>I want to make a asp.net regularexpressionvalidator ValidationExpression that will prevent to give input ; and –- .</p> <p>I can do for – and it is ValidationExpression="[^-]*"</p> <pre><code>&lt;asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="TextBox1" Display="Dynamic" ErrorMessage="**" ValidationExpression="[^-]*"&gt;&lt;/asp:RegularExpressionValidator&gt; </code></pre> <p>Above expression can prevent single – character. I will give permission for single – chareter. I will block for double – character (--). I need to prevent ; and – at a time.</p> <p>Can anyone help me?</p>
c# asp.net
[0, 9]
970,027
970,028
With JS add default date on TextBox
<pre><code>&lt;asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" OnTextChanged="txtDate_TextChanged"&gt;&lt;/asp:TextBox&gt; </code></pre> <p>how can with Jquery add default date. I do not know where and when to call this code:</p> <pre><code>function addDefaultDate() { if ($('#txtDate').val().length == 0) { var now = new Date(); $('#txtDate').text(now.getDate() + '.' + now.getMonth() + '.' + now.getYear()); } } </code></pre>
jquery asp.net
[5, 9]
120,413
120,414
How to change the value of a dropdown box from within it's own change function so that the change function is called again
<p>I run some code when a value is selected from a drop-down box:</p> <pre><code>$('#temp_id').change( function() { if ($('#temp_id').val() == "temp_val") { $('#temp_id').val("temp_val2"); } }): </code></pre> <p>This code runs ok, but the <code>$('#temp_id').val("temp_val");</code> line changes the value of the dropdown box without causing the change function to run again, which I need it to. Is there a way to do this?</p>
javascript jquery
[3, 5]
4,581,638
4,581,639
I would like to call setinterval, and when set interval completes, change the page
<p>I would like to use set interval, and when interval completes, change page - however, with this below, it changes the page after 1 interval run when I want to to change page when myNumber >= 300.</p> <p>I'd be grateful of any help, thanks</p> <pre><code> var myNumber = 0; function openportal() { var myInterval = window.setInterval(myzoom,2); document.location.href ="http://next page"; } function myzoom () { if(myNumber&gt;=300){ clearInterval(myInterval); } myNumber++; } </code></pre>
javascript jquery
[3, 5]
5,539,879
5,539,880
how to hide/remove all text in-between two elements?
<p>lets say i have this lump of HTML:</p> <pre><code>&lt;div class="container"&gt; &lt;span class="title"&gt;Heading 1&lt;/span&gt; This is a description..&lt;br /&gt; This is the second line.. &lt;div class="image"&gt;&lt;img src="image.jpg" /&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>What i want to do using jQuery/JavaScript is hide/remove all text and elements between <code>&lt;span class="title"&gt;</code> and <code>&lt;div class="image"&gt;</code>.</p> <p>I've looked all over and found pretty much nothing. Any ideas on how i could do this? </p>
javascript jquery
[3, 5]
2,206,586
2,206,587
On writing jQuery Plugins
<p>I've written my fourth plugin now and I'm starting to notice a trend in my development pattern and not sure if theres a better way to handle it.</p> <p>I'm using the Plugin method (lightweight start pattern outlined by Addy Osmani, see here: <a href="http://addyosmani.com/resources/essentialjsdesignpatterns/book/#jquerypluginpatterns">http://addyosmani.com/resources/essentialjsdesignpatterns/book/#jquerypluginpatterns</a>)</p> <p>In my Plugin.prototype, I have a bunch of methods including the init() function which I use to call all the methods in the plugin. Pardon the confusion, but this is what it would look like:</p> <pre><code>Plugin.prototype = { init: function() { this.doMethodOne(); this.doMethodTwo(this.element, this.options) this.doMethodThree(); }, doMethodOne: function() { .. } doMethodTwo: function(el, options) { .. } doMethodThree: function() { .. } } $.fn[pluginName] = function ( options ) { return this.each(function () { if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new Plugin( this, options )); } }); } </code></pre> <p>I left out some of the envelope code but I hope you get the idea.</p> <p>I find my code a little lacking because I'm pretty much just calling my code linearly and storing it in a plugin namespace.</p> <p>I've read the plugin development patterns and authoring text many times, and still write this way. How can I improve this?</p> <p>Thanks !</p>
javascript jquery
[3, 5]
5,703,881
5,703,882
Run function based on hash tag using jQuery or Javascript
<p>On my site I have user profiles. Each user profile can have a number of tabs which have a javascript function to show the selected tab and hide all other tabs.</p> <p>What I'm trying to do is allow a group of users called authors to be able to send a link to their profile and when that profile is loaded, show a specific tab.</p> <p>Take this user's profile:</p> <pre><code>http://www.findyourgeek.com/jasonward </code></pre> <p>I'd like to let this user link to their reviews as follows:</p> <pre><code>http://www.findyourgeek.com/jasonward#reviews </code></pre> <p>I put code in the document.ready function that I thought would work but it doesn't:</p> <pre><code>if(window.location.hash.toLowerCase() == "reviews") { $('#profileAbout').hide(); $('#profileInterests').hide(); $('#profileOnline').hide(); $('#profileArticles').hide(); $('#profileReviews').slideDown(); $('#profileStatistics').hide(); $('#tabsAbout').removeClass('selected'); $('#tabsInterests').removeClass('selected'); $('#tabsOnline').removeClass('selected'); $('#tabsArticles').removeClass('selected'); $('#tabsReviews').addClass('selected'); $('#tabsStatistics').removeClass('selected'); } </code></pre> <p>However, when the code runs it does not show the tab. The code that reads the hashtag is correct but it doesn't run the code below it.</p> <p>Also, that code is defined as <code>$('#tabsReviews a').click()</code> as well.</p> <p>Any ideas as to why this doesn't work or any better ideas on how to do it better would be appreciated.</p>
javascript jquery
[3, 5]
4,082,602
4,082,603
jQuery click event triggering more than once
<p>I am having trouble figuring out what is causing the click event to fire more than once in the webapp below. Please visit the url, click on any level [from Ground - 4], and then click on a unit.</p> <p><a href="http://plaza.foxqa.com.au/touch/index.html" rel="nofollow">http://plaza.foxqa.com.au/touch/index.html</a></p> <p>That will bring up the Unit Details [price, images etc.]. The images in this page has a click event attached to them which basically enlarges the image. This event keeps stacking up. It will work fine when a unit is clicked for the first time. </p> <p>Then it will fire twice for the second unit and three times for the third unit and so on. I tried to unbind the click event once the enlarged view is closed but still not working.</p> <p>Any help would be appreciated.</p> <p>Edit: Please test this in Google Chrome.</p> <p>Edit 2: Steps that might help you figure out the problem sooner.</p> <ol> <li>Open the components_draft.js in your console.</li> <li>Add a breakpoint at line 687.</li> <li>Click on a level on the building</li> <li>Click on any green coloured unit [or lot].</li> <li>Once the unit details are displayed, click on the unit plan image.</li> <li>It gets enlarged.</li> <li>Click anywhere on the image and it will be minimized. </li> <li>Go back to step 4 by clicking the close icon.</li> <li>Repeat 5,6,7.</li> <li>Now, when the enalrged image is clicked, step through the functions in the console and you will see the click event looping twice for a single click.</li> </ol> <p>I know following all of this is a pain but please take some time to analyze it.</p>
javascript jquery
[3, 5]
2,341,585
2,341,586
Detect HTML5 Context Menu Support with JavaScript?
<p>I didn't notice it in Modernizr's documentation but I imagine you create a <code>menu</code> element then check if it exists? My only concern is that the browser may support that but not <strong>type</strong> <code>context</code>. Any ideas? Thanks.</p>
javascript jquery
[3, 5]
2,252,613
2,252,614
Is it possible to add transparency to jpg in Java and Android
<p>I want to load some images to the cloud, but I want to add some protections when someone views the photos and saves the images; they will not see anything because of the transparency. </p> <p>would the code be common for Java and Android? I would like to prototype it in Java first.</p> <p>I have found some code that combines two files. One file is my main file the other is a transparent file. The combined file does not have a transparent overlay. </p> <p>Do I need to use an image drawing order? <a href="http://www.developer.nokia.com/document/Java_Developers_Library_v2/GUID-D3E35E6F-0C45-48ED-B09D-F716E14C1C02/javax/microedition/amms/control/imageeffect/OverlayControl.html" rel="nofollow">http://www.developer.nokia.com/document/Java_Developers_Library_v2/GUID-D3E35E6F-0C45-48ED-B09D-F716E14C1C02/javax/microedition/amms/control/imageeffect/OverlayControl.html</a></p> <pre><code> BufferedImage image = ImageIO.read(new File("rose.jpg")); BufferedImage overlay = ImageIO.read(new File("myimg1.gif")); // create the new image, canvas size is the max. of both image sizes int w = Math.max(image.getWidth(), overlay.getWidth()); int h = Math.max(image.getHeight(), overlay.getHeight()); BufferedImage combined = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); // paint both images, preserving the alpha channels Graphics g = combined.getGraphics(); g.drawImage(image, 0, 0, null); g.drawImage(overlay, 0, 0, null); // Save as new image ImageIO.write(combined, "PNG", new File("combined.png")); </code></pre>
java android
[1, 4]
3,730,033
3,730,034
How do you find Min & Max of a property in an array of objects in Javascript
<p>I have the following javascript object:</p> <pre><code>Person1.Name = "John"; Person1.Age = 12; Person2.Name = "Joe"; Person2.Age = 5; </code></pre> <p>I then have an array of persons, how do I find the Min/Max based on a persons age?</p> <p>Any solution in Javascript or Jquery is acceptable.</p> <p>your help is much appreciated.</p>
javascript jquery
[3, 5]
2,554,884
2,554,885
How to get a javascript function to execute only once on dom ready
<p>I'm getting alerted "hi" over and over again, how do I get it to do it once and stop:</p> <pre><code>function doSomething() { alert('hi'); } $(function() { doSomething(); }); </code></pre>
javascript jquery
[3, 5]
2,770,064
2,770,065
I can't remember programming 5 mins after learning?
<p>I'm learning Java, and I found a great teacher. He explains everything perfectly. I understand it <em>all</em>. My problem, is that after learning a short section, for example "Nested If Statements" or "Many Methods and Instances", I can type it all great, but in 5 mins, after going on to a new section (when I'm comfortable with the last section) I forget the code to type for the last section. Any tips or techniques you guys use to remember code????</p>
java javascript
[1, 3]
4,294,457
4,294,458
Javascript 'this' Problem
<p>Why are 'me' and 'this' undefined when setTimeout calls it's anonymous callback? </p> <pre><code> var gMyObj = new MyObj(); gMyObj.myFunc(); function MyObj() { this.myFunc = function () { var me = this; alert(me.constructor); // defined setTimeout(function(me) { alert(me.constructor); // undefined }, 100); }; } </code></pre> <p>Resolution: The selected answer is correct, thank you. My question was a simplification of the real problem I was having, which turned out to be the way jQuery modifies 'this' inside the click() method so that it points to the relevant DOM element. I had created a new var, 'me', to hold onto 'this', and was trying to pass it in to the click method. All I needed to do was just use 'me' inside the click event, and let the closure keep a reference to it. Passing 'me' into click() failed, for the same reason that it failed in this example, namely, click() was not expecting it. </p>
javascript jquery
[3, 5]
3,393,900
3,393,901
export SQLite database from android phone to my system as mdb or accdb database format
<p>I want to export SQLite database file created by simple android code. I want to use that database in microsoft access (.mdb or .accdb). Is it possible? If it is possible means, Tell me the steps</p> <p><b>Note</b>:Here, I didn't put any code.. I just want know what are steps to exporting the sqlite database file to mdb or accdb format file..</p> <p>Thanks in Advance...</p>
java android
[1, 4]
2,871,451
2,871,452
javax.script on Android
<p>I would like to port my Java project to Android devices, the problem I am facing is, that I need javax.script library. So the question is: Is it possible to import <em>javax.script</em> to an Android project? And if so, how can I do that?</p>
java android
[1, 4]
1,249,025
1,249,026
What does following a function with (jQuery, window, document); mean?
<p>I have the following plugin:</p> <pre><code>;(function($, window, document) { ... ... })(jQuery, window, document); </code></pre> <p>I can understand what the ; is for and also realize that $ is the jQuery but can someone explain why is the function followed by (jQuery, window, document);</p>
javascript jquery
[3, 5]
33,738
33,739
C#/C++ multiple apps pes solution
<p>How can I link multiple applications found within the same solution? Each app has a different objective, yet the output of each is determined by the input of the previous</p>
c# c++
[0, 6]
3,634,010
3,634,011
Translate KeyDown keycode to string (jQuery)
<p>I am looking for a way to translate a keypress into the string corresponding to the chracter. Something like this:</p> <pre><code>$(document).keydown(function(event) { console.log(String.fromCharCode(event.which)); }); </code></pre> <p>except that this code does not take into account capitalization and does not work for special character, e.g. ",". This:</p> <pre><code>$(document).keypress(function(event) { console.log(String.fromCharCode(event.which)); }); </code></pre> <p>seems to the trick, but it can not prevent default browser actions (such as go back on backspace) and there seem to be browser compatibly issues.</p> <p>Is there any better way, that works across browsers and keyboard layouts ?</p>
javascript jquery
[3, 5]
913,766
913,767
How do I detect, via javascript in Safari Mobile, if my iPhone application is installed?
<p>As you probably know, iPhone applications can register a custom URL scheme handler, ala "myapp:" and these can be used for links in a page viewed in Safari. </p> <p>I'd like to automatically launch my application from a specific page if the visitor has the app installed. If the app's not installed, I'll just show them the current mobile-optimized view of the page.</p> <p>How can I do this detection? Google searches have been fruitless. Also, to be tricky, I've tried doing something like this to no avail:</p> <pre><code>var image = new Image(); image.onerror = function(e){ alert("bummer"); } image.onload = function(e){ alert('success!'); } image.src = 'myapp://something=meaningful'; </code></pre> <p>Has anyone come across a way to do application detection?</p>
javascript iphone
[3, 8]
60,452
60,453
Jquery - How to grab specific data-type of option after that option is selected?
<p>I'll jump straight with the markup, then explain what I'm trying to do.</p> <p>Html select options</p> <pre><code> &lt;select id="1d" name="camp"&gt; &lt;option data-url="week_1" value="Week 1"&gt;30th July&lt;/option&gt; &lt;option data-url="week_2" value="Week 2"&gt;6th August&lt;/option&gt; &lt;/select&gt; &lt;input type="hidden" name="camp_url" id="1e"&gt; </code></pre> <p>Jquery script I'm struggling with. The script below shows the value of the selected option, of course, but I can't find a way to grab to the <code>data-url</code> info.</p> <pre><code> $('#1d').change(function () { $('#1e').val($(this).val()); }); </code></pre> <p>Bottom line, I'm needing the <code>value</code> of <code>input#1e</code> to be the <code>data-url</code> of <code>#1d</code> upon selection.</p> <p>Thanks for your help.</p>
javascript jquery
[3, 5]
897,728
897,729
Jquery $.post method doesn't work
<p>Background: I'm using Apache with XAMPP to set up localhost. I'm relatively new to programming, and very new to PHP. I'm trying to call a PHP file in the same directory as my Javascript file, but the code I'm using doesn't seem to work. Here's a sample:</p> <p>Javascript:</p> <pre><code>function SendPhps(){ var point = 2;' $.post('json.php',point);} $(document).ready(function(){ SendPhps(); }); </code></pre> <p>PHP:</p> <pre><code>&lt;?php if(!empty($_POST)){ file_put_contents('example.txt','Itworks'); } ?&gt; </code></pre> <p>EDIT: Ok, I've revised my scripts to be more simple, but opening my page still doesn't trigger any alert box:</p> <p>PHP:</p> <pre><code>&lt;?php if (empty($_POST)) echo "empty"; else echo "not empty"; ?&gt; </code></pre> <p>Javascript:</p> <pre><code>$(document).ready(function() { var point = {'param':2}; $.post( 'json.php', point, function(data){ alert(data); } ); }); </code></pre>
php javascript jquery
[2, 3, 5]
3,360,310
3,360,311
How to disable/enable button when the edit text is empty/nonempty
<p>I have 2 edit text and 1 button. How can I make this button to be disabled until the user fill all the edit text? I used this code but when I run this code it always disable the button even when I fill the 2 Edit text, also I do not know what the onTextChanged and beforeTextChanged doing!!</p> <p>Please help me, I will appreciate it.</p> <pre><code>public class TestActivity extends Activity { /** Called when the activity is first created. */ EditText edit1; EditText edit2; EditText edit3; Button button; String test1; @Override protected void onCreate(Bundle savedInstanceState) { // Your initialization code... // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.main); edit1= (EditText) findViewById(R.id.edit1); edit2= (EditText) findViewById(R.id.edit2); button=(Button) findViewById(R.id.button); TextWatcher watcher = new LocalTextWatcher(); edit1.addTextChangedListener(watcher); edit2.addTextChangedListener(watcher); updateButtonState(); } void updateButtonState() { boolean enabled; if(enabled = checkEditText(edit1) &amp;&amp; checkEditText(edit2)){ button.setEnabled(enabled);} } } private boolean checkEditText(EditText edit) { return Integer.getInteger(edit1.getText().toString()) != null; } private class LocalTextWatcher implements TextWatcher { public void afterTextChanged(Editable s) { updateButtonState(); } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { } } }}} </code></pre>
java android
[1, 4]
4,024,399
4,024,400
Showing Who is online in ASP.NET
<p>what is the best simple way to show who is online in c# without using membership control? Is the only way is using session ?</p>
c# asp.net
[0, 9]
4,658,396
4,658,397
how to make a counter like badoo.com
<p>I'm really amazed with Badoo.com counter. How can we implement such a graphical counter, wich is by the way very eye-catching. When It adds one number it shows all the number from 0 to that number. With firebug I just noticed that all of it a picture. They use css to show a specific number.<br> thanks </p>
php jquery
[2, 5]
3,450,572
3,450,573
Page reload with a variable function
<p>I am trying to write a code to make a page reload when a new Post is set. So I figured that I could use the variable as an image, since everytime a new post is set,the image of new post appears. </p> <p>I started using the meta http refresh code. </p> <p>I could use jQuery or javascript (i know they are same, just written differently)</p> <p>I just know I'd like to have the page auto refresh with the condition of if image is appeared. or (new post)</p> <p>Please dont negative vote this, I know Im jabbering on, but i guess i can't find the words I wanna say. </p> <pre><code>&lt;script type=”text/javascript”&gt; function pageRefresh(timeoutPeriod) { setTimeout("location.reload(true);",timeoutPeriod); } &lt;/script&gt; </code></pre> <p>and maybe i could use onSubmit, onLoad, onReady, or something that would work in this question. UGh lost for words</p>
javascript jquery
[3, 5]
5,162,833
5,162,834
jQuery: Detect element's height when window is resized
<p>I need help with the following issue.</p> <p>I'm creating a responsive site. Its structure is quite basic: header, nav bar, body and footer.</p> <p>In the header I have several elements and all these elements use percentages for their dimensions, so the <em>height</em> of the header is determined by the height of the elements inside of it.</p> <p>For the nav bar I plan to use a "sticky" script, so when you scroll the page, the nav bar 'sticks' to the top of the page, and once you go back all the way up, it 'unsticks' and appears under the header.</p> <p>So far, so good.</p> <p>Thing is that the sticky script depends on the <em>height</em> of the header in order to correctly stick the nav bar under the header. So when I resize my window to test the responsiveness of the layout, the sticky nav bar goes crazy.</p> <p>What I need is a way to detect the <strong><em>height</em></strong> of the header and modify the DOM by creating a style on the <code>&lt;header&gt;</code> ie. (<code>&lt;header style="height:198.3px"&gt;</code>), and assign a dynamic height to it as I resize the browser window.</p> <p>I think this is something that would be accomplished using the <code>height();</code> property, but I'm not a jQuery guru so I'm not sure if that would work.</p> <p>Any help is greatly appreciated.</p> <p>PS. BTW, Stackoverflow.com uses this 'sticky' feature on the boxes on the right column when you're creating/editing a post.</p>
javascript jquery
[3, 5]
3,213,147
3,213,148
I want Convert a Html page with all its content i.e. images like .png,.gif to ms word document with the same look and feel
<p>Can any one help me to convert a html page and its content to Microsoft Word file . Basically what i want is a ms word page which looks like my html page in Browser.</p> <p>i am using this code can any one suggest me something else.</p> <pre><code>object filename1 = @"html file path"; object oMissing = System.Reflection.Missing.Value; object readOnly = false; object oFalse = false; Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application(); Microsoft.Office.Interop.Word.Document oDoc = new Microsoft.Office.Interop.Word.Document(); oDoc = oWord.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing); oWord.Visible = false; oDoc = oWord.Documents.Open(ref filename1, ref oMissing, ref readOnly, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing); if (!Directory.Exists(@"D:\FileConverter\Temp\new.doc"))//path of destination file. { Directory.CreateDirectory(@"D:\FileConverter\Temp"); } if (!File.Exists(@"D:\FileConverter\Temp\new.doc")) { File.Create(@"D:\FileConverter\Temp\new.doc"); } filename1 = @"D:\FileConverter\Temp\new.doc"; object fileFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument; oDoc.SaveAs(ref filename1, ref fileFormat, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing); oDoc.Close(ref oFalse, ref oMissing, ref oMissing); oWord.Quit(ref oMissing, ref oMissing, ref oMissing); </code></pre>
c# asp.net
[0, 9]
801,911
801,912
object Key in javascript class/dictionary?
<p>I have a Javascipt object which I use as dictionary</p> <pre><code>var obj={ xxx:'1' yyy:'2' } </code></pre> <p>However - xxx and yyy should be a jQuery <strong>object</strong>.</p> <p>something like :</p> <pre><code>var obj = { $('#div1'):'1' , $('#div2'):'2' } </code></pre> <p>is it possible ? </p> <p>also, How can I <strong>get</strong> the "<code>value</code>" for key <code>$('#div2')</code> ?</p> <p>p.s. I the $.data cant help me here since its also a key value and i need in the key - object Type also.</p>
javascript jquery
[3, 5]
5,172,265
5,172,266
javascript dropdownchecklist selected/checked options are not updated on deselecting
<p>I am new to javascript and jquery. I have a asp.net page where a dropdown checklist is used. When i select some options from the drop down i am able to get all the selected options first time. When i try to deselect some of the selected items, am not getting the updated selected options in my code. Still it contains the previously selected options plus newly selected options. The options which i unchecked are still available in the code. Can somebody help where i am going wrong?</p> <p>the code below is what i am using to access the selected/checked options:</p> <pre><code> var dropdown = this.sourceSelect; var c = dropdown.find("option:selected"); </code></pre> <p>I also tried using checked on the options:</p> <pre><code> var c = dropdown.find("option:checked"); </code></pre> <p>The value in c is not updated properly. The deselected options are also available. Looking forward for your help. Thanks</p>
javascript jquery
[3, 5]
281,750
281,751
How to store previous selected item from `DropDownList`
<p>I have a <code>DropDownList</code>, using which I have to store some values from the <code>CheckBoxList</code> in the database.</p> <p>Before I select another index from the <code>DropDownList</code>, the values in the <code>CheckBoxList</code> has to be stored, prompting the user with an alert "Save before proceeding".</p> <p>I am able to display the above mention alert message. But the problem is once i change the index it <code>DropDownList</code>, the previous selected index is lost.</p> <p>Can someone kindly help me getting the previous selected value and select the same dynamically in <code>DropDownList</code>. Because the value is need to store in database.</p> <p>The code for displaying alert message is:</p> <pre><code>protected void LOC_LIST2_SelectedIndexChanged(object sender, EventArgs e) { if (CheckBoxList2.Items.Count &gt; 0) { Label7.Visible = true; Label7.Text = "*Save List Before Proceeding"; } </code></pre>
c# asp.net
[0, 9]
744,520
744,521
asp.net user control element is null
<p>I have a simple asp.net user control:</p> <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QueryDefinitionItem.ascx.cs" Inherits="xxx.UserControls.QueryDefinitionItem" %&gt; &lt;link href="../Styles/Site.css" rel="stylesheet" type="text/css" /&gt; &lt;div class="title"&gt; &lt;h1 id="TextField" runat="server"&gt;&lt;/h1&gt; &lt;/div&gt; </code></pre> <p>Code behind:</p> <pre><code> public partial class QueryDefinitionItem : System.Web.UI.UserControl { private string m_text; protected void Page_Load(object sender, EventArgs e) { TextField.InnerText = m_text; } public void SetText(string text) { m_text = text; } } </code></pre> <p>I use LoadControl to load one instance programatically:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { var control = (QueryDefinitionItem)LoadControl(typeof (QueryDefinitionItem),null); control.SetText("test2"); itemsPanel.Controls.Add(control);} </code></pre> <p>I then use the SetText function to set the text and once the Page Load is fired I get a NullReferenceException that says TextField is null... </p> <p>I cant figure out why.</p>
c# asp.net
[0, 9]
2,270,619
2,270,620
How to set blur for brush?
<p>I have been developing the application which draws on a view using user's finger. So, I have a piece of code which demonstrate settings for Paint, Bitmap, Canvas:</p> <pre><code> mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor(mForegroundColor); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(mBrushWidth); mBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); mCanvas = new Canvas(mBitmap); mPath = new Path(); mBitmapPaint = new Paint(Paint.DITHER_FLAG); mBitmap.eraseColor(mBackgroundColor); </code></pre> <p>But now I need to set a blur for brush, but I don't know how I can do it. I hope you can help me. </p>
java android
[1, 4]
3,852,230
3,852,231
How to use slideToggle on a set of elements?
<p>I'm attempting to use the jQuery slideToggle() function to minimize a set of table rows. The problem I'm encountering is that while the set of rows are minimized, the animation does not seem to be taking effect. I think it has something to do with the manner in which I'm using slideToggle, calling it on a set of results instead of on a parent element, but am not sure.</p> <p>I'm using this bit of javascript and jquery to minimize a set of rows.</p> <pre><code>$('td').on("click", "a.collection-minimize, a.list-minimize", function(event) { event.stopPropagation(); // Get the class of the following row var minimize_class = $(this).parent().parent().next().attr('class'); // trim whitespace minimize_class = minimize_class.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); // Minimize all following rows of the same class. $(this).parent().parent().siblings('.' + minimize_class).slideToggle(); }); </code></pre> <p>An example set of rows:</p> <pre><code>&lt;tr class="collection-original"&gt; &lt;td&gt; &lt;a class="collection-minimize" onclick="return false" href="#"&gt;Minimize collection&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class=" collection-original" style="display: table-row;"&gt;&lt;/tr&gt; &lt;tr class=" collection-original" style="display: table-row;"&gt;&lt;/tr&gt; &lt;tr class=" collection-original" style="display: table-row;"&gt;&lt;/tr&gt; &lt;tr class=" collection-original" style="display: table-row;"&gt;&lt;/tr&gt; </code></pre> <p>A live page where this is being used can be viewed here: <a href="http://iodocs.vky.me/whitehat#Application-API-PUT-Modify-an-application" rel="nofollow">http://iodocs.vky.me/whitehat#Application-API-PUT-Modify-an-application</a>. </p>
javascript jquery
[3, 5]
1,972,942
1,972,943
Can PHP and C++ pass data between each other?
<p>I have a lot of mathematical calculations in my PHP script, which can be quite slow at times. I'm wondering if it's possible to pass data from PHP to C++, do the calculations in C++, then pass the results back to PHP?</p> <p>P.S. I'm not very good at C++.</p>
php c++
[2, 6]
5,655,808
5,655,809
click to add border to div
<p>I have a web page with multiple div. When the user clicks on the body, all div elements will have their border changed to red. However, when the user clicks on a div, only that div will have their border changed to blue.Every other div element will remain with a red border. this is my code so far:</p> <pre><code>$('body').click(function() { var $target = $(event.target); if (!target.closest($('div')).length) { //I want the border of all div on the page to change to red $('div'). css('border', '2px solid red'); } else if (target.closest($('div')).length) { //Here just the div that was clicked on will have its border changed to blue $(this).css('border', '2px solid blue'); } }); </code></pre>
javascript jquery
[3, 5]
4,614,618
4,614,619
Pushing to an Array within a jQuery each loop
<p>I'm using jQuery to parse an XML file, and I'm trying to push each element in the XML file to an array using a jQuery .each loop. Strangely, if I alert the value of the array within the loop it comes out as it should, but if I try to alert a value in the array after the loop has finished it results in "undefined". </p> <p>Is there something strange that happens when you push values to an array within this kind of a loop?<br /> <br /> <br /> Here is the Javascript:</p> <pre><code>var splashArray = new Array(); // Load the Splash XML file and assign each image within to an array $.get('splash.xml', function(xml) { $('image', xml).each(function (i) { splashArray.push($(this).attr("src")); }); }); alert(splashArray[1]); // Results in undefined </code></pre> <p><br /> <br /> Here is the XML:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;site&gt; &lt;image src="splash1.jpg" /&gt; &lt;image src="splash2.jpg" /&gt; &lt;image src="splash3.jpg" /&gt; &lt;image src="splash4.jpg" /&gt; &lt;image src="splash5.jpg" /&gt; &lt;image src="splash6.png" /&gt; &lt;/site&gt; </code></pre>
javascript jquery
[3, 5]
3,833,614
3,833,615
ClassCastException with XMLRPC call to get ArrayList
<p>I've got a problem with ClassCastException - maybe you could please suggest something ? I'm trying to get response from server via XMLRPC and get a CCE.</p> <p>Here`s how I call it:</p> <pre><code>Object[] filesList = new Object[] { new Object[] {"somefile.txt", lengthOfThatFile}, new Object[] {"somefile2.txt", lengthOfThatFile2} }; ArrayList&lt;Object[]&gt; filesResent = (ArrayList&lt;Object[]&gt;) client.call("someserv.checkwhattoresend", userClientID, filesList); </code></pre> <p>That last line throws an exception: </p> <pre><code>09-11 16:14:33.953: ERROR/AndroidRuntime(389): java.lang.ClassCastException: [Ljava.lang.Object; </code></pre> <p>Procedure checkwhattoresend looks like this:</p> <pre><code>public List&lt;Object[]&gt; checkwhattoresend(String userClientID, Object[] fileInfo) { ArrayList&lt;Object[]&gt; results = new ArrayList&lt;Object[]&gt;(); // doing some stuff return results; } </code></pre> <p>There should be no flaws on the server side.</p> <p><strong>UPDATE. SOLVED AS SIMPLY AS THIS:</strong></p> <pre><code>Object[] filesResent = (Object[]) client.call("someserv.checkwhattoresend", userClientID, filesList); </code></pre>
java android
[1, 4]
2,412,988
2,412,989
Encrypt the querystring in C#.net
<pre><code>string emailfield=txtEmail.Text.ToString(); string url = "http://localhost:3076/user/Authenticate-Users.aspx?email="+emailfield; </code></pre> <p>I want to encrypt the querystring and then decrpyt. Is there any way to do this in C#?</p> <p>Thanks</p>
c# asp.net
[0, 9]
1,253,341
1,253,342
window.open and sending form data not working
<p>I'm trying to open new window and send form data with <strong>javascript</strong> and <strong>jquery-1.8.3</strong>. But, It's not woriking.</p> <p>This is source code.</p> <pre><code>&lt;a href="#" onclick="printPage()"&gt;Print this&lt;/a&gt; &lt;script type="text/javascript" src="/common/js/jquery-1.8.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function printPage(){ var form = $("&lt;form method='post' action='/common/print.jsp' target='printWindow'&gt;&lt;/form&gt;"); var input = $("&lt;input type='hidden' name='view'/&gt;"); input.val($("#ctn").html()); form.append(input); var printWindow = window.open(form.attr("action"), "printWindow", "width=700px,height=800px"); form.submit(); } &lt;/script&gt; </code></pre> <p>window was opened. But <code>request.getParameter("name")</code> is null.</p> <p>Here is <code>/common/print.jsp</code> page</p> <pre><code>&lt;%@ page contentType="text/html; charset=utf-8"%&gt; &lt;% request.setCharacterEncoding("UTF-8"); %&gt; &lt;div id="ctn"&gt; &lt;% out.print(request.getParameter("view")); %&gt; &lt;/div&gt; </code></pre> <p>What's the problem in this code? </p>
javascript jquery
[3, 5]
5,856,782
5,856,783
What's th mean by "public abstract class SampleAdapter <T extends Adapter> extends ViewGroup"?
<p>I am not getting meaning by</p> <pre><code>public abstract class SampleAdapter &lt;T extends Adapter&gt; extends ViewGroup </code></pre> <p>What does it do? In general we perform normal inheritance, but here something extended form. can any body suggest me?</p> <p>thanks</p>
java android
[1, 4]
4,340,793
4,340,794
How to cast a STRING to a GUID
<p>I need cast a String to a Guid.</p> <p>I am using this code but</p> <pre><code>string myUserIdContent = ((Label)row.FindControl("uxUserIdDisplayer")).Text; Guid myGuidUserId = new Guid(myUserIdContent); // PROBLEM HERE MembershipUser mySelectedUser = Membership.GetUser(myGuidUserId); </code></pre> <p>I receive this error</p> <blockquote> <p>Exception Details: System.FormatException: Unrecognized Guid format.</p> </blockquote> <p>Any other ways to do it?</p> <p>Thanks</p>
c# asp.net
[0, 9]
4,229,113
4,229,114
Creating an ad widget
<p>I am trying to create an ad widget. This piece of code should be re-usable by anybody. I was wondering if it is ok to use jquery in such a widget or should i be writing the entire thing in pure javascript?</p>
javascript jquery
[3, 5]
1,747,670
1,747,671
How to trigger a toggle function by click another click-event-handler?
<p>I have already searched the google oracle etc and found this <a href="http://stackoverflow.com/questions/3370934/trigger-second-function-in-toggle">Trigger second function in toggle()</a> similar article, but it doesnt helps me.</p> <p>My pricip is the same, i have a toggle function which includes two other functions.</p> <pre class="lang-sql prettyprint-override"><code>$('#master').toggle($.proxy(this.fnctA,this), $.proxy(this.fnctB,this)); </code></pre> <p>within the #click element i have some necessary attributes which i need in the functions <code>fnctA</code> or <code>fnctB</code>.</p> <p>my new task is that i create two buttons (one for <code>fnctA</code> and one for <code>fnctB</code>) out of these area. and they should do the same as i clicked the #master.</p> <p>i.e. what I want is:</p> <pre class="lang-sql prettyprint-override"><code> $('.fnctA').bind('click', $.proxy(this.testA, this)); $('.fnctB').bind('click', $.proxy(this.testB, this)); testA:function(){ $("#master").toggle('firstToggle'); }, testB:function(){ $("#master").toggle('lastToggle'); } </code></pre> <p>can any give me any tips etc?</p>
javascript jquery
[3, 5]
4,940,466
4,940,467
What pitfalls should be noted when moving from C# to PHP?
<p>So, I just stumbled across this one in another <a href="http://stackoverflow.com/questions/2321009/are-abstract-class-constructors-not-implicitly-called-when-a-derived-class-is-ins">question</a>: </p> <blockquote> <p>Parent constructors are not called implicitly if the child class defines a constructor.</p> </blockquote> <p>What else should one be aware of when writing code in PHP from a C# background?</p>
c# php
[0, 2]
5,537,573
5,537,574
smtpException was unhandled by user code
<p>here is the code.</p> <pre><code>void sendMail() { MailMessage mail = new MailMessage(); mail.To.Add("abc@gmail.com"); mail.From = new MailAddress("abc@gmail.com", txt_name.Text); mail.Subject = txt_subject.Text; mail.Body = txt_body.Text; SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.EnableSsl = true; NetworkCredential yetki = new NetworkCredential("abc@gmail.com", "11111111"); smtp.Credentials = yetki; smtp.Send(mail); Response.Write("mailiniz başarılı bir şekilde gönderilmiştir"); } protected void btn_gonder_Click(object sender, EventArgs e) { sendMail(); } </code></pre>
c# asp.net
[0, 9]
1,358,608
1,358,609
How to show user entered EditText value in a android dialogue box
<p>my modified sample of my work basically below i have 2 editboxes i want the values of the both to be shown in an alertbox, rest of the code works fine, the alertbox does show up but without the entered values.</p> <pre><code>public class Main extends Activity { EditText username = null; EditText password = null; Button login; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); EditText usern = (EditText) findViewById(R.id.username); EditText pass = (EditText) findViewById(R.id.password); Button login = (Button) findViewById(R.id.login); String usernm = usern.getText().toString(); String passnm = pass.getText().toString(); final Builder alert = new AlertDialog.Builder(this) .setTitle("SHOW FIELDS") .setMessage("USERNAME:" + usernm + " PASSWORD:" + passnm) .setNegativeButton("CLOSE", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // do nothing closeContextMenu(); } }); login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { alert.show(); } }); </code></pre>
java android
[1, 4]
5,738,812
5,738,813
jQuery make .change and .click event for different element to call same function
<p>I googled but most of them is to bind different event for SAME element. </p> <p>For</p> <pre><code>$('#a').change(function() { /bla /bla }); $('#b').click(function(){ /bla /bla }); </code></pre> <p>I want something like this</p> <pre><code>$('#a').change OR ('#b').click(function(){ /bla /bla }); </code></pre>
javascript jquery
[3, 5]
2,022,001
2,022,002
how to check whether a variable contain double or empty value using java in android
<p>how to check wheather the variable containing double value or empty </p> <p>?? i am getting response from web services which i have stored in 3 different different variable say for example </p> <p>var1=some double value var2= some double value and var 3=some double value </p> <p>now how to check var1,var2 and var3 wheather they really contain double value or integer value ??? this is my question</p> <p>Thanks in advance</p>
java android
[1, 4]
4,365,274
4,365,275
ASP.NET: Problem with CheckBoxList and OnSelectedIndexChanged
<p>I'm having a problem with CheckBoxList and OnSelectedIndexChanged:</p> <pre><code> &lt;asp:UpdatePanel runat="server"&gt; &lt;ContentTemplate&gt; &lt;asp:CheckBoxList id="lstWatchEType" runat="server" DataTextField="DescriptionText" DataValueField="Id" AutoPostBack="true" OnSelectedIndexChanged="lstWatchEType_SelectedIndexChanged"/&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre> <p>This is populated in Page_Load (!IsPostBack)</p> <pre><code>public static void PopulateWatchEType(CheckBoxList list, Guid clientId) { OffertaDataContext db = new OffertaDataContext(); var ds = (from e in db.EnquiryTypes select new { Id = e.Id, DescriptionText = e.DescriptionText, IsWatching = !db.WatchXrefEnquiryTypes.Any(f =&gt; f.ClientId.Equals(clientId) &amp;&amp; f.EnquiryTypeId==e.Id &amp;&amp; f.Inbox==false) }); list.DataSource = ds; list.DataBind(); foreach(var item in ds) { list.Items.FindByValue(item.Id.ToString()).Selected = item.IsWatching; } } </code></pre> <p>My problem is in:</p> <pre><code> protected void lstWatchEType_SelectedIndexChanged(Object sender, EventArgs e) { ListItem item = lstWatchEType.SelectedItem; ... } </code></pre> <p>Where item is always the first element in the list??? </p>
c# asp.net
[0, 9]
1,075,201
1,075,202
Make a bar being full every 15 seconds
<p>I was trying to make a sort of loading bar, I've made this but it won't work... Who can help me??</p> <pre><code>&lt;div id="loader" style="height: 2px; width: 0px; background: green;"&gt; Test &lt;/div&gt; &lt;script&gt; $('#loader').animate({width:'100px'}, 15000); &lt;/script&gt; </code></pre> <p>Thank you!</p> <p>Edit: This one's working</p> <pre><code>&lt;div id="loader" style="height: 2px; width: 0px; background: green;"&gt; &lt;/div&gt; &lt;script&gt; $(document).ready(function(){ function loader(){$('#loader').animate({width:'0px'}, 1).animate({width:'468px'}, 15000, function() {loader()});} loader(); }); &lt;/script&gt; </code></pre> <p>Thanks to Pahnin</p>
javascript jquery
[3, 5]
4,476,853
4,476,854
progress bar(animated GIF image) when page loads or some background process is going on::
<p>I want to have an animated GIF image to appear or load whenever my .aspx page (for my appln) is loaded or postaback or some background process is going on::</p> <pre><code>&lt;div id="WaitDialog" style="left: 480px; top: 255px; position: absolute"&gt; &lt;img src="http://developers.sun.com/docs/web-app-guidelines/uispec4_0/progress_graphics/asynch-1F.gif" /&gt; &lt;FONT size=3 class="text3" &gt;&lt;font color="black"&gt;Loading, Please Wait.&lt;/font&gt;&lt;/FONT&gt; &lt;/div&gt; function ProgressBar() { var dialog = document.getElementById("WaitDialog"); dialog.style.visibility = 'hidden'; scrollTo(0,0); } </code></pre> <p>........ this animated image should load just like as browser progress bar progresses and if I perform any validations in database (DB operations say), then also the image should load...</p> <p>1) I'm not using AJAX for my application so I dont want AJAX to come into picture too... </p> <p>2) the image should appear as when the page started loading... </p> <p><strong>i.e.</strong> Something is goin in progress in tha background and the .gif image should load</p> <p>How can i write the code accordin to tht as now i have a Javascript function ProgressBar() which i invoke by having onSubmit="ProgressBar()" in <em>body</em> tag.....</p> <p>Can any1 help me in this ?</p>
c# asp.net
[0, 9]
1,942,309
1,942,310
jQuery/JS simulation
<p>I'm not an expert in jQuery or Javascript (I have only started with it recently), so this might sound like a silly question: I have 4 tabs, all of which are clickable. So, I made 2 functions, 1 to actually execute on click, and one to only "simulate" the click, so I could change the tabs every 5 seconds. What I've done is, set a bool variable "click" to false, which is set to "true" if the actualy click function is executed, so the automatic tab switching stops. And below both of these functions I added a while loop like this:</p> <pre><code>var nr = 0; while(!klik){ tabss.eq(st % 4).click().delay(5000); //this is the "simulation" st++; } </code></pre> <p>now, it opens up the first tab as it's suppose to, but after 5 seconds nothing happens. Any suggestions? I sorta want is like a slideshow that stops, when users clicks something.</p>
javascript jquery
[3, 5]
4,544,005
4,544,006
jQuery not ready though still instantiating
<p>I am using a jQuery Class plugin as so :</p> <pre><code>jQuery(document).ready(function($) { window.SSK.calendar = new(Class.extend({ filter_by_filtered_names: function() { console.log('foobar!'); }, init: function() { if ( window.location.href.match(/name_filters/) ) { SSK.calendar.filter_by_filtered_names(); }; } })) }); </code></pre> <p>For some reason this returns on load :</p> <pre><code>SSK.calendar is undefined </code></pre> <p>Which tells me that the plugin class is not loading before its own call. Very strange indeed. Curious if anyone knew a remedy?</p>
javascript jquery
[3, 5]
1,719,281
1,719,282
Javascript/JQuery - How to get number of specific child elements
<p>I wish to get the number of all TR elements that have a input element in them somewhere. How should I proceed ?</p> <p>Html :</p> <p><code>&lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Ignore this item 1&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Ignore this item 2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input blablabla&gt;... Include this TR...&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;</code></p> <p>Thanks!</p>
javascript jquery
[3, 5]
2,284,315
2,284,316
Why I can't access variables from inside some functions (JavaScript)?
<pre><code>var myvar = "my value"; (function() { alert(myvar); // undefined })(); </code></pre> <p>or</p> <pre><code> var myvar = "my value"; $.post( url, function( data ) { alert(myvar); // undefined }); </code></pre> <p>and how can I solve this issue without storing this value in a hidden input or div or other html containers ??</p>
javascript jquery
[3, 5]
9,969
9,970
How to make a super in javascript function
<p>Like in this example:</p> <pre><code>var teste = {name:'marcos'}; $(teste).each(function(){ var name = this.name; // i don't want to do that. // i want to have access to 'this' inside this function (sayName) var sayName = function(){ alert(name); // there is something like "super" in java? or similar way to do? } sayName(); }); </code></pre> <p>How can i do that?</p>
javascript jquery
[3, 5]
4,645,226
4,645,227
jQuery Accordion Menu Items Remain Open Until Clicked
<p>I have made a jQuery accordion menu but it doesn't seem to be acting in the default manner. Basically, when I click on a menu item the item opens as expected. However, when I click on a different menu item it also opens as expected but the first menu item remains open. The jQuery documentation states:</p> <p>"An accordion doesn't allow more than one content panel to be open at the same time, and it takes a lot of effort to do that."</p> <p>I promise it took very little effort to break this default functionality ;). Anyway, I have posted my JS, HTML and CSS on JSFiddle and am hoping someone can point me in the right direction. Other than opening and closing it works fine, even though it doesn't appear to on JSFiddle. Here's the link: <a href="http://jsfiddle.net/stringman/9Jrqq/" rel="nofollow">JSFiddle Post</a></p> <p>Thanks in advance.</p> <p>Ken</p>
javascript jquery
[3, 5]
1,506,398
1,506,399
Get output of PHP script from C#
<p>I was wondering if it is possible to get the HTML output of a PHP file using a C# Windows application. I have already googled for this, but all I could find was a compiler where you could use PHP together with C#.</p> <p>Is there any possibility to do this?</p>
c# php
[0, 2]
652,744
652,745
Creating a temporary element X made up of other elements?
<p>I am using a jquery print plugin that has the capability to print out particular elements from the page. </p> <p>If I call <code>$('.main-container').print();</code> it will print out all elements within the main container.</p> <p>However, there are many elements within the 'main-container' that I would not like to include in the element that is passed on to the print() function.</p> <p>My question is, is there an a way to combine 3-4 elements into one and store that element in a variable so then I can pass this new element to the print() function leaving out all the elements I wish to not print?</p> <p>Something like:</p> <pre><code>var $printThis = $('header').html(); $printThis += $('.middle-column').html(); $printThis += $('.footer').html(); $printThis.print(); </code></pre>
javascript jquery
[3, 5]
5,769,648
5,769,649
invoking keypress event without actually pressing key in javascript
<p>hi i want spacebar to be fired in javascript without pressing spacebar in textbox,i tried this code please help me to solve this</p> <pre><code> &lt;script language="javascript" type="text/javascript"&gt; jQuery(document).ready(function () { var getOldValue = jQuery("#&lt;%=txtCompany.ClientID%&gt;"); var e = jQuery.Event("keydown"); e.which = 32; //key code jQuery("#&lt;%=txtCompany.ClientID%&gt;").trigger(e); }); &lt;/script&gt; </code></pre> <p>and aspx page is</p> <pre><code> &lt;asp:TextBox ID="txtCompany"&gt;&lt;/asp:TextBox&gt; </code></pre>
javascript asp.net
[3, 9]
780,498
780,499
mvc mini profiler alternative for vs 2008
<p>I am working on VS2008 project and it seems that mvc mini profiler does not support it. Do you know any decent alternative with simillar functionalities that will work in my environment?</p>
c# asp.net
[0, 9]
860,134
860,135
JQuery within PHP: How can I keep the browser from inserting a closing tag too early?
<p>The output of this code:</p> <pre><code>&lt;?php echo "&lt;script type='text/javascript'&gt; $('#query-info').append('&lt;div class=\"well\"&gt;')&lt;/script&gt;"; foreach ($_POST as $key =&gt; $entry) { echo "&lt;script type='text/javascript'&gt; $('#query-info').append('". $key . ": " . $entry . "&lt;br /&gt;')&lt;/script&gt;"; } echo "&lt;script type='text/javascript'&gt; $('#query-info').append('&lt;/div&gt;')&lt;/script&gt;"; ?&gt; </code></pre> <p>is:</p> <pre><code>&lt;div class="well"&gt;&lt;/div&gt; itemID: 1 &lt;br&gt; &lt;/div&gt; </code></pre> <p>Note the extra unwanted (first) closing div.</p>
php jquery
[2, 5]
4,111,318
4,111,319
how to return false if string has null or white space in c#
<p>I cannot return null because my <code>Hlist</code> is a non nullable type. What else can I return in the place of null?</p> <pre><code>HList findHListentry(string letter) { if (string.IsNullOrWhiteSpace(letter)) { HList result = listentry.Find(delegate(HList bk) { return bk.letter == letter; }); return result; } else { return ?; } } </code></pre>
c# asp.net
[0, 9]
3,282,536
3,282,537
Target a class whether or not it has a number in the name
<p>I'm struggling a bit with this : let's say I have a class in the body <code>&lt;body class="video page"&gt;</code> and in my page I have a pagination which add a number like this <code>&lt;body class="video-2 page"&gt;</code> at each page. I would like to target the class <code>video</code> whether or not it has a number in order to apply some jquery if the condition is filled.</p> <p>How do I do that?</p>
javascript jquery
[3, 5]
2,640,719
2,640,720
Mask input for number - percent
<p>How can create a mask input for number that have percent by jQuery? Do I make input just accept until three numbers and put percent sign after numbers while user finished typing(<code>keyup</code>)?</p> <p><strong>I don't use plugins.</strong></p> <p>Example: <strong>1%</strong> Or <strong>30%</strong> Or <strong>99%</strong> Or <strong>100%</strong> Or <strong>200%</strong> </p> <pre><code>&lt;input name="number" class="num_percent"&gt; </code></pre>
javascript jquery
[3, 5]
5,234,134
5,234,135
How has my stack trace got file system references to the build machine?
<p>I use svn and asp.net. We have a website and there is an error in it. Im not really concerned about the error I know how to fix it what im wondering is how .net is showing the original file path that the .cs files were in when the prioject was built:</p> <pre><code>[SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp; stackMark, Boolean isPermSet) +0 System.Security.PermissionSet.Demand() +76 System.Data.Common.DbConnectionOptions.DemandPermission() +79 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +6265031 System.Data.SqlClient.SqlConnection.Open() +258 VLSCore2.VlsDb.GetDataReader(SqlCommand Command) in C:\Repositories\VideoLibraryServer\tags\205_main_hml\VLSCore2\VlsDb.cs:55 VLSCore2.VlsSettings.GetGeneralSettings() in C:\Repositories\VideoLibraryServer\tags\205_main_hml\VLSCore2\VlsSettings.cs:338 ASP.global_asax.Application_Start(Object sender, EventArgs e) +136 </code></pre> <p>I mean this is a pre-compiled asp.net application so why are the references in it?</p>
c# asp.net
[0, 9]
1,858,022
1,858,023
How do I unbind another jQuery function on .click()?
<p>I have this script that run to fix my menu bar to the browser on scroll. Nothing really needs to change here (works as it should). However, you may need it...</p> <pre><code>var div = $('#wizMenuWrap'); var editor = $('#main_wrapper'); var start = $(div).offset().top; $(function fixedPackage(){ $.event.add(window, "scroll", function() { var p = $(window).scrollTop(); $(div).css('position',((p)&gt;start) ? 'fixed' : 'static'); $(div).css('top',((p)&gt;start) ? '0px' : ''); //Adds TOP margin to #main_wrapper (required) $(editor).css('position',((p)&gt;start) ? 'relative' : 'static'); $(editor).css('top',((p)&gt;start) ? '88px' : ''); }); }); </code></pre> <p>Now for the issue at hand. I have another script function that calls a modal pop-up (which again works as it should). However, it's not slick from a UI perspective when I scroll the page when the modals open. So I want to disable the script above when the modal script below is called. In other words, when I click to open the modal pop-up, the script above shouldn't work.</p> <pre><code>$(function () { var setUp = $('.setupButton'); // SHOWS SPECIFIED VIEW $(setUp).click(function () { $('#setupPanel').modal('show'); //PREVENTS PACKAGE SELECT FIXED POSITION ON SCROLL $(setUp).unbind('click',fixedPackage); }); }) </code></pre> <p>As you can see above, I tried to unbind the scroll function (the first code snippet), but this is not correct.</p> <p>These two scripts are in two separate js libraries.</p>
javascript jquery
[3, 5]
1,685,163
1,685,164
jTweetsAnywhere not working on live server, only on local server
<p>jTweetsAnywhere works on my local server, but isn't displaying tweets on the live server. Just an empty box and I even included the anywhere.js and consumer key.</p> <p>In my head:</p> <pre><code> &lt;script src="http://platform.twitter.com/anywhere.js?id=YQDAme3v6zI0CR1FiWCg&amp;v=1" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/js/jTweetsAnywhere/jquery.jtweetsanywhere-1.3.1.min.j"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/js/jTweetsAnywhere/jquery.jtweetsanywhere-de-1.3.1.min.j"&gt;&lt;/script&gt; </code></pre> <p>Then the element to target:</p> <pre><code> &lt;div id="twitterbox" class="sidebar-header"&gt; &lt;h2&gt;&lt;a href="http://twitter.com/overbitespics"&gt;Follow OverbitesPics on Twitter&lt;/a&gt;&lt;/h2&gt; &lt;div id="tweetFeed" class="clear"&gt; &lt;/div&gt; </code></pre> <p>Must be missing a step or something goes wrong when making a call from the host server?</p>
javascript jquery
[3, 5]
2,375,813
2,375,814
Android Java Text not being centered
<p>I'm trying to make the text all centered but it's not working out. Here's my xml code</p> <pre><code>&lt;TextView android:id="@+id/creditText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dp" android:textColor="#ffffff" android:layout_marginLeft="0dp" android:layout_marginTop="350dp" android:gravity="center" android:maxLines="6" android:text=" Dalton Metlzer: Lead Programer/Designer Cole Selensky: Lead Designer/Programer Carson Rego: Lead Artist Carly R: Logo Artist Evan Swonke: Music Composer/Performer Blake Jackson: Narator" /&gt; </code></pre> <p>instead it just gets all jumbled up.</p> <p>this is how it looks <a href="http://i.imgur.com/DVNua.png" rel="nofollow">http://i.imgur.com/DVNua.png</a></p>
java android
[1, 4]
2,328,216
2,328,217
Group Validation of Two DateTime Picker Using Javascript in asp.net
<p>Group Validation of Two DateTime Picker Using Javascript in asp.net</p>
c# javascript asp.net
[0, 3, 9]
1,800,461
1,800,462
Javascript Library Quickstart
<p>I'm trying to build a Javascript library that will provide some functionality for a JQuery Plugin I'm putting together. </p> <p>I got the following skeleton code from searching online although I'm not quite sure how it all works (I do know it's a closure). I've added my functions via declarations.</p> <pre><code>(function(window, document, $) { function func_1(){ return 1; } function func_2(){ return 2; } })(window, document, jQuery); </code></pre> <p>So I put the above code in a separate JS file and then source it in my HTML page, then I run try to run the function like so (Note: I have JQuery set up as well):</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { console.log(func_1()); }); &lt;/script&gt; </code></pre> <p>However, I seem to be getting some errors in Firebug (<code>ReferenceError: func_1 is not defined</code>).</p> <p>I have two questions:</p> <ol> <li>How do I call my functions?!</li> <li>I'd like to be able to call the functions in the following format: <code>className.functionName()</code>. How do I restructure the skeleton code to enable me do this and, say, call my function like this: <code>Device.func_1()</code>?</li> </ol> <p>Thanks for your anticipated assistance.</p>
javascript jquery
[3, 5]
2,158,500
2,158,501
jQuery hash attribute
<p>At 4 minutes into the "Scroll Linked Navigation" podcast Posted: Wed, 18 Aug 2010 at <a href="http://feeds.feedburner.com/jqueryfordesigners-podcast" rel="nofollow">jQuery for Designers</a>, Remy uses the hash attribute.</p> <p>Q: Where is the hash attribute documented?</p>
javascript jquery
[3, 5]
1,140,736
1,140,737
Java/Android: Passing Intent Extras, then use it on another method
<p>Hello again everyone,<br> This time I have a problem with Intent &amp; Extras.</p> <p>here's my first activity</p> <pre><code>Intent i1 = new Intent(RoomSetting.this, App.class); i1.putExtra("subposition1", "right"); final int result=1; startActivityForResult(i1, result); </code></pre> <p>and in the 2nd activity I try to get "subposition1" value</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mAccVals = new Number3d(); Bundle extras = getIntent().getExtras(); String SubPos = extras.getString("subposition1"); } </code></pre> <p>My question is, how can I use SubPos on another method?</p> <p>Sorry for noobish question. Thanks in advance</p>
java android
[1, 4]
1,195,421
1,195,422
Adding a value from input to a div
<p>I have the below code that im trying to add the search results to a div by clicking on the result. Let me know if anyone can assist, I looked at the code about a hundred times and can't seem to figure out why it wont work. I have tried placing the javascript below the div, below the body, and in the head, no dice. Below is the PHP, javascript, and HTML. Thanks.</p> <p><strong>Javascript:</strong></p> <pre><code>&lt;script type="text/javascript"&gt; var oButton = document.getElementById('addData'); var data = document.getElementById('dataInput'); var display = document.getElementById('display'); oButton.onclick = function() { display.innerHTML += data.value + "&lt;br /&gt;"; } &lt;/script&gt; </code></pre> <p><strong>PHP:</strong></p> <pre><code>echo '&lt;button id="addData"&gt;','&lt;input id="dataInput" type="hidden" value="'.$results_row['username'].'" /&gt;','&lt;div id="testt"&gt;', '&lt;h3&gt;', $results_row['username'],'&lt;/h3&gt;','&lt;/div&gt;','&lt;/button&gt;'; </code></pre> <p><strong>HTML:</strong></p> <pre><code>&lt;div id ="search_results"&gt;&lt;/div&gt; &lt;p&gt; &lt;div id="display"&gt;&lt;/div&gt; &lt;/p&gt; &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="search.js"&gt;&lt;/script&gt; </code></pre>
php javascript
[2, 3]
450,731
450,732
myIntent.getStringExtra returns null?
<p>Hey, I'm having a weird problem when I try to send strings with intents when switching activities.</p> <p>Here is what I do in class 1:</p> <pre><code>Intent myIntent = new Intent(SearchText.this, Search.class); myIntent.putExtra("searchx", spinnerselected); myIntent.putExtra("SearchText", input); startActivity(myIntent); </code></pre> <p>Class 2: </p> <pre><code>Intent myIntent = getIntent(); searchText=myIntent.getStringExtra("SearchText"); spinnerselectednumber=Integer.parseInt(myIntent.getStringExtra("searchx")); </code></pre> <p>And using the debugger in the second class, its clear that there is a value in "searchx": <a href="http://i51.tinypic.com/jj1ctx.png" rel="nofollow">http://i51.tinypic.com/jj1ctx.png</a></p> <p>Though the line "myIntent.getStringExtra("searchx")" gives null<br> Why is this?<br> Thanks</p>
java android
[1, 4]
1,403,461
1,403,462
jquery ajax error
<p>what data do i need to send from my server(php) so that jquery recognizes it as error and executes the error callback </p>
php jquery
[2, 5]
1,408,517
1,408,518
closests jquery
<pre><code>&lt;div class="panels"&gt; &lt;div&gt; &lt;h2&gt; Test &lt;/h2&gt; &lt;/div&gt; &lt;div class="inner_panel statict"&gt; Test2 &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I want so that when people click on Test, Test2 appears. If not, they don't see Test2, How can I make that happen using jquery?</p> <p>I tried the following but it does not work.</p> <pre><code> $('.inner_panel').hide(); $('.panels').click(function () { $(this).closest('div .inner_panel').toggle(); }); </code></pre> <p>I have multiple divs with class panels in the file, so I don't want click on Test affecting the other "panels."</p>
javascript jquery
[3, 5]
4,396,800
4,396,801
Image sliding right to cover text then revealing new text as it slides back
<p>I have an effect I want to achieve, but I'm having trouble thinking of exactly how I could achieve it. Here are some images that show the progression of the effect I want to achieve: <a href="http://imgur.com/a/In6IK" rel="nofollow">http://imgur.com/a/In6IK</a></p> <p>So essentially, I have multiple slides containing text which I want to automatically display one by one. In order to hide the current slide and show the next one, I want an image (which sits to the left of the text) to slide to the right, covering/hiding the text as it goes, and then when it slides back to its original position, the text for the next slide is shown.</p> <p>So how would I go about achieving this effect?</p>
javascript jquery
[3, 5]
4,239,773
4,239,774
append a div to another div only once on droppable drop
<p>I have a draggable element , that when its dropped onto the target, it adds a delete button:</p> <pre><code> $( "#committed" ).droppable({ hoverClass: 'drophover', drop: function( event, ui ) { $(function() { var done; if( done ) return; done = true; $(ui.draggable).append('&lt;button class="delBtn" type="reset"&gt;X&lt;/button&gt;'); $(ui.draggable).draggable( "option", "disabled", true ); $( "#sortable" ).sortable(); $( "#sortable" ).disableSelection(); }); } </code></pre> <p>Once its been dropped, it then becomes sortable. The issue is , everytime the element is sorted, the Delete button gets added again. As there are multiple elements being dragged and dropped and then sorted, so <code>.length&gt;?</code> doesn't work. </p> <p>I essentially need </p> <pre><code>If (this.delBtn exists) </code></pre>
javascript jquery
[3, 5]
5,202,005
5,202,006
How to pass structure as pointer in C dll from C#
<p>I am working on simple telephony application where I am changing the class of service of panasonic pbx extension. For that I am using "Tapi32.dll" which has methods in c++. Now as per my need I have to pass two argument both integer pointer type. One Argument is getting passed correctly but I am not able to pass second argumnet which is structure type. </p> <p>Here is my code...</p> <pre><code>[DllImport("Tapi32.dll", CharSet=CharSet.Auto, SetLastError=true)] unsafe private static extern int lineDevSpecific(int* hLine, int* lpParams); [StructLayout(LayoutKind.Sequential)] public struct UserRec { [MarshalAs(UnmanagedType.I4)] public int dwMode=4; public int dwParam1=8; } unsafe static void Main(string[] args) { int vline=int.Parse("Ext101"); int* hline = &amp;vline; lineDevSpecific(hline, ref UserRec userrec); } </code></pre>
c# c++
[0, 6]
1,342,702
1,342,703
how to display the grid in div tag
<pre><code>&lt;script type="text/javascript"&gt; var showGrid = function() { $("#Grid1").load('/friends/names/fried'); }; &lt;/script&gt; &lt;div&gt; &lt;%= Html.Trirand().JQGrid(Model.OrdersGrid, "JqGrid1")%&gt; &lt;/div&gt; &lt;div&gt; &lt;/div&gt; </code></pre> <p>/////// i need to dispaly the Grid1 here? can anyone tell me?</p> <p>thanks</p>
asp.net jquery
[9, 5]
5,592,306
5,592,307
Understanding this javascript jquery function in function snippet
<p>This is partly a jquery question, but most javascript. I just don't know javascript well enough to understand this code:</p> <pre><code>1 (function () { 2 $(function () { 3 //Global ajax progress dialog box 4 //Simply run $("#ajax-progress-dialog").dialog("open"); script before the ajax post and 5 //$("#ajax-progress-dialog").dialog("close"); on the ajax post complate 6 $("#ajax-progress-dialog").dialog({ 7 autoOpen: false, 8 draggable: false, 9 modal: true, 10 height: 80, 11 resizable: false, 12 title: "Processing, please wait...", 13 closeOnEscape: false, 14 open: function () { $(".ui-dialog-titlebar-close").hide(); } // Hide close button 15 }); 16 }); 17 })(); </code></pre> <p>I understand lines 3-15. In fact, I think I understand lines 2 through 16: this is creating an anonymous function and wrapping it as a jquery object, right? Not sure why it needs to be wrapped, but more importantly, I especially don't understand lines 1: opens with "(function" and 17: closes with ")()". What's that about?</p> <p>BTW, for completeness, note that this is invoked as follows:</p> <p>$("#ajax-progress-dialog").dialog("open");</p> <p>Credit: this example comes from <a href="http://www.tugberkugurlu.com/archive/working-with-jquery-ajax-api-on-asp-net-mvc-3-0-power-of-json-jquery-and-asp-net-mvc-partial-views" rel="nofollow">tugberkugurlu</a></p>
javascript jquery
[3, 5]
222,872
222,873
jquery: Change the background-colour of a column if its header has a class
<p>I have the following jQuery that I'm trying to use to change the background colour of a column where its header has a class.</p> <p>So for example:</p> <pre><code>$('th').each(function (i) { if ($(this).hasClass('headerSortUp') || $(this).hasClass('headerSortDown')) { sortIndex = $(this).index(); } $('tr').each(function () { $('td:eq(' + sortIndex + ')').css('background-color', 'orange'); }); }); </code></pre> <p>So if I had a table like:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;th class="headerSortDown"&gt;Header&lt;/th&gt; &lt;th&gt;Header&lt;/th&gt; &lt;th&gt;Header&lt;/th&gt; &lt;th&gt;Header&lt;/th&gt; &lt;th&gt;Header&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;td&gt;Text&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>So in this example the whole first column should have a bg of orange. However it's not working... Any ideas what I have done wrong? Thanks</p>
javascript jquery
[3, 5]
4,402,721
4,402,722
forceful download not working for browser on Android phone on wap site
<p>I have a wapsite where i am implementing forceful download.</p> <p>The script is in PHP</p> <p>It works great for all the other mobile browsers, but when I access the site using ANDROID phone, it downloads the actual php file.</p> <p>following is my code snippet of file downloadFiles.php.</p> <hr> <p>$fileExt = "jpg"; $strOrgFileName = "abc.jpg";</p> <p>switch($fileExt) {</p> <p>case "jpeg":</p> <p>case "jpg": $ctype="image/jpg"; break;</p> <p>case "gif": $ctype="image/gif"; break;</p> <p>case "png": $ctype="image/png"; break;</p> <p>case "zip": $ctype="application/zip"; break;</p> <p>default: $ctype="application/force-download";</p> <p>}</p> <p>header("Pragma: public");</p> <p>header("Expires: 0");</p> <p>header("Cache-Control: must-revalidate, post-check=0, pre-check=0");</p> <p>header("Content-Type: $ctype");</p> <p>header("Content-Description: File Transfer");</p> <p>header("Content-Disposition: attachment; filename=\"".$strOrgFileName."\";" );</p> <p>readfile($strOrgFileName);</p> <hr> <p>In Android system it downloads the php file.</p> <p>ie. downloadFiles.php</p> <p>Please help through this.</p>
php android
[2, 4]
5,720,705
5,720,706
Hide/show DIVs - change current effect to fade
<p>I'm currently using the code below found on web tutorial to show/hide DIVs. It works great but don't like the effect. Would like the DIVs to fade in / fade out instead (or something smoother, for the moment the DIVs are growing from the top-right corner). How could I adapt the code to do this? Youc ans ee it here <a href="http://jsfiddle.net/Grek/w4HWn/1/" rel="nofollow">http://jsfiddle.net/Grek/w4HWn/1/</a> Many thanks</p> <pre><code>function showonlyone(thechosenone) { $('.textzone').each(function(index) { if ($(this).attr("id") == thechosenone) { $(this).show(2000); } else { $(this).hide(2000); } }); } </code></pre>
javascript jquery
[3, 5]
5,538,025
5,538,026
how to add different time present in a column of a gridview and show the sum in footer textbox
<p>i have some values (08:12,09:22,01:09) in a column(datetime) in a gridview<br> what i want is to get the sum of all values present in that column in a textbox which is present in the footer of that column.</p> <p>i tried the below code - </p> <pre><code> int hours, minutes; TextBox footxt = (TextBox)GridView2.FooterRow.FindControl("footxt1"); foreach (GridViewRow row in GridView2.Rows) { TextBox txts = (TextBox)row.FindControl("text11"); TimeSpan ts = TimeSpan.Parse(txts.Text); hours = ts.Hours; minutes = ts.Minutes; hours += hours; minutes += minutes; footxt.Text = Convert.ToString(hours); } </code></pre> <p>but it doesnt work!</p>
c# asp.net
[0, 9]
3,937,918
3,937,919
replace a table cell with the text box, read the value typed and replace back the table cell with the new value using jquery
<p>I am new to Jquery and working on a small project with PHP, and Jquery. Below is on of the table cell. I would like to replace this cell with a text box and read the vale entered by user and bring back the original cell(replaced cell) with this new value. I am not sure how can I do this with Jquery. Any help is highly appreciated.</p> <pre><code>&lt;td&gt;&lt;a href="#"&gt;&lt;?php echo money_format('%.2n', $Cashup['actual_cash']); ?&gt;&lt;/a&gt;&lt;/td&gt; </code></pre> <p>Thanks, Bhaskar</p>
php jquery
[2, 5]
981,839
981,840
Measuring time of execution on method
<p>Let's say we have this:</p> <pre><code>function myMethod1() { ... } </code></pre> <p>and later in the code:</p> <pre><code>myMethod1(); alert('myMethod1() was executed!'); </code></pre> <p>I need to set timeout for the alert so that it will be called after myMethod1() executes. But how do I know the value of the second parameter for the setTimeout function? How do I measure the time needed for myMethod1() to execute?</p> <p>MyMethod1() has an async ajax call.</p>
javascript jquery
[3, 5]
1,379,957
1,379,958
Data addition and updation in SQL tables
<p>Iam fairly new to SQLClient and all, and iam having a problem with my SQL tables..when ever i run my code, the data, rather than getting updated, attaches itself to the already existing records in the tables..here's my code</p> <pre><code>SqlConnection conneciones = new SqlConnection(connectionString); SqlCommand cmd; conneciones.Open(); //put values into SQL DATABASE Table 1 for (int ok = 0; ok &lt; CleanedURLlist.Length; ok++) { cmd = new SqlCommand("insert into URL_Entries values('" + CleanedURLlist[ok] + "' , '" + DateTime.Now + "' , '" + leak + "' )", conneciones); cmd.ExecuteNonQuery(); } conneciones.Dispose(); </code></pre>
c# asp.net
[0, 9]
4,326,977
4,326,978
How to change a color for standard button?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1521640/standard-android-button-with-a-different-color">Standard Android Button with a different color</a> </p> </blockquote> <p>I have 1 problem - I need to change a color for standard button. I do it using "background" property of button. But when I do it button will change it's shape - rounded corners will disappear, button won't change a color by click (hightlight), color of button won't be gradient. How can I fix this problems? I want to change button's color it to look like a standard button.</p>
java android
[1, 4]
2,381,138
2,381,139
C# variable with jquery path referenced for jquery src file not working
<p>I'm trying to do something like this: </p> <pre><code>&lt;script src="&lt;%= ResolveUrl( Urls.jquery) %&gt;" type="text/javascript" &gt;&lt;/script&gt; </code></pre> <p>For importing jquery. The path is of the form <code>http://domain.com/js/jquery-1.3.2.min.js</code></p> <p>In my developer tools console, the path is loaded perfectly, but when I try and run jquery it won't work. I'm kind of puzzled.</p> <p>Thanks! </p> <p>EDIT:</p> <p>code i'm using to test it:</p> <pre><code>&lt;script type="text/javascript" &gt; window.onload = function () { if (window.jQuery) { // jQuery is loaded alert("Yeah!"); } else { // jQuery is not loaded alert("Doesn't Work"); } } &lt;/script&gt; </code></pre> <p>I also have another external .js file that says '$' is undefined in the developers console for chrome. </p> <p>EDIT2:</p> <p>It appears that this code actually works on Mozilla Firefox, but it does not work on Chrome or IE. </p>
c# javascript jquery asp.net
[0, 3, 5, 9]
4,811,688
4,811,689
need some help in android game developing?
<p>I'm developing a game for android and it's like a match game it looks like that:</p> <p><img src="http://i.stack.imgur.com/N8RET.jpg" alt="http://imageshack.us/photo/my-images/59/96718770.png/"></p> <p>the game work perfectly but the problem is the size of the cards " the clowns in the picture "didn't change I've tried everything from changing the size of the image to change the size of the image view, the xml file is a Tablelayout and each row table contain something in the first row there is the image view that will display the card and this is the xml code</p> <pre><code>&lt;TableRow android:id="@+id/Row01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" &gt; &lt;LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center"&gt; &lt;ImageView android:id="@+id/ImageView1" android:layout_width="100dp" android:layout_height="100dp" android:layout_gravity="bottom|center" &gt;&lt;/ImageView&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; </code></pre>
java android
[1, 4]
1,377,307
1,377,308
Front end Java, back end C++ , how to join?
<p>Lets give an over-basic example, I have a program which goes through a directory and grabs the list of files in the directory. Assume for argument's sake that this HAS to be done in C++. I then wish to present the list of files using Java Swing? </p> <p>How is this done?</p>
java c++
[1, 6]