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,057,764
2,057,765
Databound Value in href javascript link
<p>I've trawled the net looking for the syntax to get this working and i'm hoping this is a quick fix else i'll go mad. Basically I have a nested repeater and the button below hides another nested repeater.</p> <p><code>((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id</code> evaluates perfectly well (3824 in the case i'm testing), but when I try to pass it so that its a string parameter for the javascript function it fails everytime.</p> <pre><code>&lt;asp:Linkbutton ID="lb_showhide_oloc_gnotes" runat="server" Text="Expand/Close" href='javascript:sltoggle('" + &lt;%# ((location_details)((RepeaterItem)Container.Parent.Parent).DataItem).tbl_location.location_id %&gt; +" '); return false;' /&gt; </code></pre> <p>Any ideas what i'm missing (I know the above syntax is wrong I must have changed it 100 times already but you get the idea).</p> <p>thanks!</p>
c# javascript asp.net
[0, 3, 9]
5,763,845
5,763,846
Is there anyway i could dynamically fetch the value of an <option> and pass it to PHP without using AJAX?
<p>I have two <code>&lt;select&gt;</code> one is category and the second is subcategory. </p> <p>here is the first <code>&lt;select&gt;</code> for category.</p> <pre><code>&lt;select name="category" size="10"&gt; &lt;?php foreach($categories-&gt;fetch(array('table' =&gt; 'categories')) as $category) { ?&gt; &lt;option value="&lt;?php echo $category['id']; ?&gt;"&gt;&lt;?php echo $category['name']; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; </code></pre> <p>now the second <code>&lt;select&gt;</code> i.e subcategory should be hidden initially and when a user click on category <code>&lt;select&gt;</code> based on the value it should populate the value in subcategory. </p> <p>One way of doing this is via AJAX by passing categoryId as POST Request and getting HTML as response.</p> <p>however i would like to know if there is any other alternative so that it automatically pass the categoryId value to PHP and unhide the second <code>&lt;select&gt;</code> here is the code of second <code>&lt;select&gt;</code></p> <pre><code>&lt;select name="subcategory" size="10"&gt; &lt;?php foreach($categories-&gt;fetch(array('table' =&gt; 'subCategories', 'categoryId' =&gt; $categoryId)) as $subCategory) { ?&gt; &lt;option value="1"&gt;&lt;?php echo $subCategory['name']; ?&gt;&lt;/option&gt; &lt;?php } ?&gt; &lt;/select&gt; </code></pre> <p>the only thing i need here is $categoryId to be populated dynamically. is there any way of doing this?</p> <p>thank you..</p>
php jquery
[2, 5]
2,822,925
2,822,926
Dynamic Day of Week Selection
<p>I am searching for a dynamic day of week select.</p> <p>So the code would recognise today is August 1st so... would work like so.</p> <p>So code ( how I would like it to perform )</p> <pre><code>&lt;select id="selectday" name="selectday" tabindex="13"&gt; &lt;option value=""&gt;Please select Preferred Day&lt;/option&gt; &lt;option value=""&gt;Today Wed 1st Aug&lt;/option&gt; &lt;option value=""&gt;Thursday 2nd Aug&lt;/option&gt; &lt;option value=""&gt;Friday 3rd Aug&lt;/option&gt; &lt;option value=""&gt;Saturday 4th Aug&lt;/option&gt; &lt;option value=""&gt;Sunday 5th Aug&lt;/option&gt; &lt;/select&gt; </code></pre> <p>Also would like if possible to factor, if current time is => 12.00pm then Today ( becomes unavailable as an option )</p> <p>Does this make sense ?</p> <p>Just wondered if anyone has seen anything like this and how to do it ? Prefer jquery but I suppose php would be fine.</p> <p>I see plenty of date and time pickers specifically Trents <a href="https://github.com/trentrichardson/jQuery-Timepicker-Addon" rel="nofollow">https://github.com/trentrichardson/jQuery-Timepicker-Addon</a></p> <p>But I need something very very simple and lightweight.</p> <p>Only needs to show either 7 day block or 14 day block. Would prefer if Sunday was not an option , but that isnt a major issue.</p>
php jquery
[2, 5]
5,398,744
5,398,745
adding clickable image links to jquery code
<p>i show some images with the simple script shown below. how can i make the images clickable?</p> <p>thank you!</p> <pre><code>$(function() { $('.fadein img:gt(0)').hide(); setInterval(function() { $('.fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('.fadein'); }, 4000); }); </code></pre>
javascript jquery
[3, 5]
2,934,897
2,934,898
How to handle a blank row from the database?
<p>I have the following script which works as long as it is returned data:</p> <pre><code>$(document).ready(function() { $.ajax({ type: 'POST', url: 'notifications.asmx/GetNotifications', data: '{strUser: "pqr"}', contentType: 'application/json; charset=utf-8', dataType: 'json', success: function( notifications ) { if( notifications !== null ) { //&lt;-- this makes no difference alert( notifications.d[0].text ) ; } else { alert ( "null" ); } }, error: function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(err.Message) ; } }); }); </code></pre> <p>If data is not returned, I get the error:</p> <pre><code>Uncaught TypeError: Cannot read property 'text' of undefined </code></pre> <p>I have tried wrapping it in various if statements checking for <code>null</code> values, but that does not make any difference.</p>
javascript jquery
[3, 5]
1,092,288
1,092,289
Managing JavaScript dependencies with CDN in ASP.NET
<p>Generally speaking, individual JavaScript files that a page uses should be combined into a single filed and minified. To this end, we have an <code>AssetController.ScriptTag()</code> that's used like this:</p> <pre><code>&lt;%= ScriptTag ( "/js/global.js", "/js/accounts.js", "/js/googmaps.js" )%&gt; </code></pre> <p>The output of this method is a single URL that returns a single, minified file from a GET. This worked great until we decided that we needed put our resources like .js and .css files on a CDN. Now, we need to generate these combined, minified JS files at build time, and push the results to the CDN.</p> <p>How do most people accomplish this--how do they incorporate the generation of these files into their build and deploy?</p>
c# javascript asp.net
[0, 3, 9]
5,537,718
5,537,719
How do I pass a R.drawable as a parameter so I can get images parsed
<p>I try to save a unique image to each object but I get this error, how should the constructor look for it to work that way? The constructor Beer(String, int, int) is undefined</p> <pre><code>m_beer = new ArrayList&lt;Beer&gt;(); final Beer b1 = new Beer("Tuborg", 7, R.drawable.tuborg); final Beer b2 = new Beer("Carlsberg", 7, R.drawable.carlsberg); final Beer b3 = new Beer("Urquel", 9, R.drawable.urquel); public class Beer { //Members private String name; private int color; //1 = Very dark 10 = Very light private R.drawable icon; //Methods public Beer(String name, int color, R.drawable icon) { this.name = name; this.color = color; this.icon = icon; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getColor() { return this.color; } public void setColor(int color) { this.color = color; } public R.drawable getIcon() { return icon; } } </code></pre>
java android
[1, 4]
1,967,316
1,967,317
Take two arrays and make them into key - value pair
<p>I have two arrays as follows.</p> <pre><code>idOne = ["6", "6", "11"] counts = ["2", "1", "1"] </code></pre> <p>How would I make this into a associative array with idOne being the key and counts being the value?</p>
javascript jquery
[3, 5]
3,195,436
3,195,437
How to properly release Android MediaPlayer
<p>I'm trying to add a button to my android app where it plays an MP3 when the button is tapped. I've gotten it working, but without a way to release the mediaPlayer object - therefore it keeps playing even after I leave the activity. If I initialize the MediaPlayer object outside of my react() method(what gets called when the button is pressed) it causes the app to force close when the activity is opened. But if I initialize the MediaPlayer within the react() method I then can't use mplayer.release in the onQuit() method. What am I not seeing here?</p> <pre><code> public void react(View view) { MediaPlayer mediaPlayer = MediaPlayer.create(ToBeOrNot.this, R.raw.achord); mediaPlayer.start(); } protected void onStop(){ mediaPlayer.release(); mediaPlayer = null; } </code></pre> <p>Doesn't work for obvious reasons and </p> <pre><code>MediaPlayer mediaPlayer = MediaPlayer.create(ToBeOrNot.this, R.raw.achord); public void react(View view) { mediaPlayer.start(); } protected void onStop(){ mediaPlayer.release(); mediaPlayer = null; } </code></pre> <p>Causes it to force close. </p> <p><strong>Update:</strong> Here is the whole java class. </p> <pre><code>public class ToBeOrNot extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_to_be_or_not); } MediaPlayer mediaPlayer; public void react(View view) { mediaPlayer = MediaPlayer.create(ToBeOrNot.this, R.raw.achord); mediaPlayer.start(); } protected void onStop(){ mediaPlayer.release(); mediaPlayer = null; } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. //getMenuInflater().inflate(R.menu.activity_to_be_or_not, menu); // Locate MenuItem with ShareActionProvider return true; } } </code></pre> <p>I think what it does is relatively self explanatory. When called, it shows some text plus a button that when tapped starts a recording playing. When someone hits the back button, it should go back to the previous activity and stop the recording. Thanks for helping me!</p>
java android
[1, 4]
2,840,858
2,840,859
JQUERY: Dynamic AJAX and html element removal
<p>Consider this code:</p> <pre><code>&lt;tr&gt; &lt;td&gt; &lt;input type="checkbox" name="20081846" value="20081846" class="chk-input"&gt; &lt;/td&gt; &lt;td&gt;20081846&lt;/td&gt; &lt;td&gt;AGONOY, JAY TAN&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>Let's say I have N of these in a table (with different sets of data). What I am planning is, if the user checks the input box, it will delete the users are checked. I got it using this JQUERY </p> <pre><code>var del_users = function(btn,chk,url) { $(btn).click(function(){ $(chk).each(function(){ if($(this).attr('checked') == 'checked') { //pass code data } }); }); } </code></pre> <p>Which works, I just have to do the function that deletes the data. </p> <p>My next problem is, once the data is deleted, I want the row displayed in the table to be removed in the display. Other than refreshing the entire entries, is there a way to selectively remove the checked "tr" elements?</p>
javascript jquery
[3, 5]
5,506,020
5,506,021
asp.net override
<p>what are the pros and cons of using a standard event handler or overriding the base class of an asp.net page? Are there any? I've seen both used to do the same thing.</p> <pre><code>protected void Page_PreInit(object sender, EventArgs e) { //Put your code here } protected override void OnPreInit(EventArgs e) { base.OnPreInit(e); //Put your code here } </code></pre>
c# asp.net
[0, 9]
1,284,691
1,284,692
Does jQuery do any initial processing?
<p>Simple question. If you include jQuery in a page of HTML, is there any initialization overhead before one uses any jQuery functions.</p>
javascript jquery
[3, 5]
1,376,525
1,376,526
im getting "function not defined" in firebug. help please
<p>I am using an external javascript file to call a function and it will not. i get function not defined in firebug too. the name of the external js file is getpic.js in the html, i put this in the header:</p> <pre><code>&lt;script src="getpic.js" type="text/javascript"&gt; &lt;/script&gt; </code></pre> <p>php:</p> <pre><code>echo "&lt;button id='sldkfj' onclick='hg();'&gt;sdlkfj&lt;/button&gt;"; </code></pre> <p>js:</p> <pre><code>function hg() { alert("hello") } </code></pre> <p>the file system is basically in one folder for wamp this is all of getpic.js</p> <pre><code>function hg() { alert("hello") } </code></pre> <p>for the php part</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="getpic.js" type="text/javascript"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;?php echo "&lt;button id='sldkfj' onclick='hg();'&gt;sdlkfj&lt;/button&gt;"; ?&gt; </code></pre> <p>EDIT----- i also keep getting this in firebug: </p> <pre><code>Reload the page to get source for: http://localhost/iframe/getpic.js </code></pre> <p>Thanks</p>
php javascript
[2, 3]
2,954,305
2,954,306
How to append query parameter at runtime using jQuery
<p>Through JavaScript I am appending one query parameter to the page url and I am facing one strange behaiviour.</p> <pre><code>&lt;div&gt; &lt;a href="Default3.aspx?id=2"&gt;Click me&lt;/a&gt; &lt;/div&gt; $(function () { window.location.href = window.location.href + "&amp;q=" + "aa"; }); </code></pre> <p>Now I am appending <code>&amp;q=aa</code> in default3.aspx and in this page the <code>&amp;q=aa</code> is getting added continuously, causing the URL to become:</p> <pre><code> http://localhost:1112/WebSite2/Default3.aspx?id=2&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa&amp;q=aa </code></pre> <p>One would say just pass it like <code>&lt;a href="Default3.aspx?id=2&amp;q=aa"&gt;Click me&lt;/a&gt;</code>, but I cant do that. The value of this query parameter is actually the value of an HTML element which is in default3.aspx. I have to add it in runtime.</p> <p>What are the ways to achieve this?</p>
javascript jquery
[3, 5]
3,444,597
3,444,598
Text field default value overrides user input
<p>I'm setting some default value for my text fields and those fields are in read only mode. When I pass new values to the those fields and submits the form it saved default value not the new one. I have used PostBack function but it's not working. Here is my code,</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (! this.IsPostBack) { MakeReadControl(); } } private void MakeReadControl() { ((TextBox)this.FindControl("txtMedicalCheckup")).Text = System.DateTime.Now.ToShortDateString(); ((TextBox)this.FindControl("txtBosiet")).Text = System.DateTime.Now.ToShortDateString(); ((TextBox)this.FindControl("txtLandSurvival")).Text = System.DateTime.Now.ToShortDateString(); ((TextBox)this.FindControl("txtDefensiveDriving")).Text = System.DateTime.Now.ToShortDateString(); ((DropDownList)this.FindControl("comboDrivingLicense")).SelectedIndex = 1; ((TextBox)this.FindControl("txtOtherLicense")).Text = "Not available"; } </code></pre> <p>However, the drop down list updates the value correctly.</p> <p><strong>Update:-</strong></p> <p>Instead of Read Only attribute if I use enable attribute then it works fine. </p>
c# asp.net
[0, 9]
1,210,908
1,210,909
Bind a onKeyDown to a particular webview android
<p>Hey I am working on implementing the back key functionality for my WebViews. I have got it working with the given code but the problem is I need it to work for 3 different WebViews so none conflict with each other and cause a crash, so far it works for each one singly at a time. My guess is I need to bind the keylistener to that particular webview but I am unsure how. Here is the code I am using for my youtube view for example..</p> <pre><code>@Override public boolean onKeyDown(int keyCode, KeyEvent event) { wv_yt = (WebView) findViewById(R.id.web_youtube); if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: if (wv_yt.canGoBack() == true) { wv_yt.goBack(); } else { finish(); } return true; } } return super.onKeyDown(keyCode, event); } </code></pre>
java android
[1, 4]
1,585,718
1,585,719
How to pass the dynamic text box value to another php page
<p>i make a dynamic textbox through javascript now i want to post the data of all dynamically generated textboxes to php script and then insert into a table. how can i do this... </p> <pre><code>&gt; var intTextBox=0; &gt; &gt; //FUNCTION TO ADD TEXT BOX ELEMENT &gt; function addElement() { &gt; intTextBox = intTextBox+1; &gt; &gt; var contentID = document.getElementById('content'); &gt; var newTBDiv =document.createElement('div'); &gt; newTBDiv.setAttribute('id','strText'+intTextBox); &gt; newTBDiv.innerHTML="Author : &lt;input type='text' id='citingfield' name='"intTextBox"'/&gt;"; &gt; contentID.appendChild(newTBDiv); &gt; } &gt; &gt; //FUNCTION TO REMOVE TEXT BOX ELEMENT &gt; function removeElement() { &gt; if(intTextBox != 0) &gt; { &gt; var contentID = document.getElementById('content'); &gt; contentID.removeChild(document.getElementById('strText'+intTextBox)); &gt; intTextBox = intTextBox-1; } } &gt; &gt; &lt;body&gt; &gt; &gt; &lt;form action="add_save.php" method="post" &gt; &gt; &gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;p&gt;&lt;a href="javascript:addElement();" &gt; &gt;Add&lt;/a&gt; &lt;a href="javascript:removeElement();" &gt;Remove&lt;/a&gt;&lt;/p&gt; &gt; &gt; &lt;input name="submit" type="submit" id=" " value="Submit"&gt; &gt; &lt;/from&gt; </code></pre>
php javascript
[2, 3]
982,533
982,534
Capture filled PDF form data
<p>I would like to capture filled PDF form data from public facing website and save it in the database on the server. Is it possible?Please let me know.</p>
c# asp.net
[0, 9]
3,158,971
3,158,972
Issue with JavaScript binding?
<p>I have a drag oriented UI I'm putting the finishing touches on. I was having trouble with losing the mousemove event outside of the parent container, and found some code to bind the mousemove and mouseup functions to the document instead of the element. I tried to apply this to my code but have been unsuccessful so far.</p> <p>Original working code:</p> <p>...</p> <p>Reference Code: <a href="http://www.foreachbit.com/2010/08/draggable-html-element.html" rel="nofollow">http://www.foreachbit.com/2010/08/draggable-html-element.html</a></p> <p>EDIT: I got the code working, but now I have two mousemove functions. I feel like one of them muse be redundant. How would you clean up the following code?</p> <pre><code>$(document).ready(function () { metroUI.init(); $('#panorama').mousedown(function (event) { $(document).mousemove(function (event) { $('#panorama').bind("mousemove", metroUI.moveInfo); }); }); $(document).mouseup(function (event) { $(document).unbind('mousemove'); $('#panorama').unbind('mousemove'); metroUI.panelAnimate('#panorama'); metroUI.resetVars(); $('body').removeClass('unselectable'); }); }); </code></pre>
javascript jquery
[3, 5]
3,389,424
3,389,425
how to know if UI is idle for X time?
<p>I have a servery app. That ask questions from users. What I want to do. If user did not do any thing with UI for the 1 mint... Then I must terminate the server.</p> <p>What should I do for this?</p> <p>I know ACTION_SCREEN_OFF. This event actually called when screen time out. That may be 30 mint? depend on user setting. But let suppose user set time out for 30mint. and this event will call after 30 mint. But I want to know if UI is idle for 1 mint only.</p>
java android
[1, 4]
5,911,243
5,911,244
Eliminating server side view | Pros / Cons
<p>My server, implemented in PHP, is now just a data pump. I compose HTML on the client using JavaScript.</p> <p><strong>Pros</strong></p> <ul> <li>Reduces network load (no HTML, just raw data)</li> <li>Reduces server load (server does not have to compose)</li> </ul> <p><strong>Cons</strong></p> <ul> <li>Increases client load</li> </ul> <p>Given these pros/cons it seems a good idea to move HTML composing to the client as long as there are no load issues at the client.</p> <p>Are there any angles I have not looked at?</p> <p><strong>From Comments / Answers</strong></p> <p><strong>Possible Cons</strong></p> <ul> <li>Bots might fail</li> <li>Screen Readers might fail</li> </ul> <p><strong>Additional Pros</strong></p> <ul> <li>Pure data is readily available for new apps on new devices</li> </ul>
php javascript
[2, 3]
4,017,307
4,017,308
Jquery/JavaScript Time Calculation
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7641791/javascript-library-for-human-friendly-relative-date-formatting">Javascript library for human-friendly relative date formatting</a> </p> </blockquote> <p>How to show 2days ago, 3 months ago instead of time and date in Jquery?</p>
javascript jquery
[3, 5]
2,152,625
2,152,626
Client side vs server side basics
<p>For the last 6 months I have been trying to wrap my head around Web development and understanding the diferences beetween client-side programming and server side programming.For the moment I only know the client side at an medium level(javascript/jQuery) but I am also interested in learning PHP and MySQl for server-side programming.</p> <p>What are the diferences of client side programming and server side programming?</p> <p>When do I use client side and when do I use server side?</p> <p>Those a web developer need to know both to be effective in writing website?</p>
php javascript
[2, 3]
4,947,274
4,947,275
Serialising POST requests jQuery/Javascript
<p>I am working on an application which sends an AJAX POST request (I'm using jQuery currently) every 1500ms. I have noticed that most of the times, these requests succeed within 350-450ms and are sent to the server nicely in the same order as they are generated. </p> <p>However sometimes, one or two requests take nearly 3-4 seconds and they are delivered later. In my application I need to ensure that these requests are received by the server in the same order as they are sent from the client. How do I do that? I am using currently setInterval of 1500ms to call a function (which generates the data to be posted) and which POSTs it using $.ajax(). However, how do I serialise the requests?</p>
javascript jquery
[3, 5]
4,821,116
4,821,117
Obtain the ID of all selected checkbox in jquery?
<p>I have some checkboxes with class=check. How can I obtain the ID of all selected checkboxes with jQuery?</p>
javascript jquery
[3, 5]
4,189,185
4,189,186
Image storage and retrieval using sqlite db
<p>I have a few questions about database storage and retrieval of images. I have an activity that prompts the user to either take a picture using the camera or selecting an existing from the gallery. When a picture has been taken/selected, it is shown in the activity and should be saved in a sqlite database (I use my own content provider).</p> <ol> <li><p>Should I store the images as a blob or store them seperately and then only store the URI pointing to the requested image?</p></li> <li><p>How do I show the image and save it?</p></li> </ol>
java android
[1, 4]
6,008,970
6,008,971
Referencing new Activity in Manifest
<p>From what I understood watching the Android tutorial, to reference a new class you need to reference it in the manifest.</p> <p>Say, I had a class AndroidX and I need to reference it. What I have to do is;</p> <pre><code>startActivity(new Intent("thepackage.RANDOMNAME")) ; </code></pre> <p>and reference it <code>android:name="thepackage.RANDOMNAME"</code> </p> <p>I'd think "RANDOMNAME" would be a new folder, but it isn't and I have no idea how it is referenced.</p> <p>I haven't even seen a file or folder.</p> <p>What's happening?</p>
java android
[1, 4]
152,278
152,279
Having problems with simple jQuery snippet
<p>I am having problems with simple jQuery snippet. Here is the markup:</p> <pre><code> &lt;div class="banner"&gt; &lt;div class="bannerInnerRight"&gt; &lt;span class="box5"&gt;&lt;h4&gt;Reviews&lt;/h4&gt;&lt;/span&gt; &lt;span class="box6"&gt;&lt;h4&gt;Mission Statement&lt;/h4&gt;&lt;/span&gt; &lt;span class="box7"&gt;&lt;h4&gt;Serving Areas&lt;/h4&gt;&lt;/span&gt; &lt;span class="box8"&gt;&lt;/span&gt; &lt;/div&gt;&lt;!-- bannerInnerRight --&gt; &lt;/div&gt;&lt;!-- banner --&gt; </code></pre> <p>The <code>h4</code>s are being hidden using css (<code>display:'none'</code>). When each span is hovered over I want its respective <code>h4</code> to show.</p> <p>My attempt:</p> <pre><code>$(document).ready(function() { $('div.banner &gt; div &gt; span').mouseover(function() { $(this &gt; h4).show(); }); }); </code></pre> <p>I must be using the <code>this</code> keyword wrong, how do I get this to work?</p>
javascript jquery
[3, 5]
865,964
865,965
Using jQuery to Highlight Selected ASP.NET DataGrid Row
<p>It is easy to highlight a selected datagrid row, by for example using toggleClass in the tr's click event. But how best to later remove the highlight after a different row has been selected? Iterating over all the rows to unhighlight them could become expensive for larger datagrids. I'd be interested in the simplest solution, as well as the most performant.</p> <p>Thanks,<br /> Mike </p>
asp.net jquery
[9, 5]
4,880,453
4,880,454
Set Time Limit to Expire ASP.NET Website C#
<p>I have a website developed in ASP.Net &amp; C# and this source code is given to my client...</p> <p>Is any way so that <strong>after one Year it will expire and His is not able to use it</strong>...&amp; <em>its hidden from him some where secure..</em> </p> <p>Please Help me out....</p>
c# asp.net
[0, 9]
711,556
711,557
Loading aspx page in JQuery UI dialog
<p>I have a aspx page where I have a linkbutton and upon clicking that link button I am calling another aspx page passing a parameter in a pops up window, like below:</p> <pre><code>&lt;asp:linkbutton id='lbtn1' onClick=&lt;%#"window.open('/testsite/mypage.aspx?param=abcd');return false"%&gt; </code></pre> <p>Till now it was working fine but now I have to include my page to another site where they have used JQuery for popup dialog and asked me to load my page using the same.</p> <p>I am really new to JQuery and have no idea about. I tried searching through this forum and google but no luck.</p> <p>Can someone please help me and show me how can I achieve this (please don't mind but a code example would be really appreciated).</p> <p>A lot thanks. </p>
asp.net jquery
[9, 5]
5,418,506
5,418,507
How to get a jQuery item in a collection of selectors
<p>I would like to access a selector in my array:</p> <pre><code>&lt;ul&gt; &lt;li class="elem"&gt;A&lt;/li&gt; &lt;li class="elem"&gt;B&lt;/li&gt; &lt;li class="elem"&gt;C&lt;/li&gt; &lt;/ul&gt; var $elems = $('li.elem'); console.log($elems[1].text()); /* jQuey Method call */ </code></pre> <p>I know there is the <code>get()</code> method, but it seems to be an implementation to se <code>[]</code> operator. So what is the best way to access an item on a jQuery array?</p> <p>Should we do something like <code>$($elems[1]).text()</code> ?</p>
javascript jquery
[3, 5]
4,427,947
4,427,948
How to see if a user has clicked on two elements?
<p>I am working on a selection menu. I want the user to be able to select two different options and have something displayed depending on what they have selected. Right now, I am just using images to represent the selections. I am wondering if there is a way to see if a user has selected/clicked two of the images consecutively. After the user has clicked two pictures, I want them to be redirected to another page and have something displayed.</p> <pre><code>/*clicked on certain two images*/(function(){ document.location.href="#page"; $('option').css('display', 'inline'); }); </code></pre>
javascript jquery
[3, 5]
5,078,229
5,078,230
Clear gridview using javascript/jquery
<p>Afternoon all.</p> <p>Another hour, another question!</p> <p>I have the following bit of jquery up and running that essentially 'resets' control contents.</p> <p><code> tbxProdAC.Attributes.Add ("onclick", "$('#txtbxHowMany').val(''); SetRadioFocus('" + radProd.ClientID + "');"); </code></p> <p>I have a gridview that pops up occasionally (don't worry, I have got that bit under control!) so what I would like to do is amend the above code so that when I click on txtProdAC, GridView1 is removed.</p> <p>Further to this, how would one implement a checked/unchecked function with jquery i.e. if tbxProdAC was click, radiobutton1 is unchecked?</p> <p>Again, as always, apologies for my ignorance.</p>
javascript jquery
[3, 5]
4,294,034
4,294,035
WebBrowser InvokeScript
<p>I have a Webrowser with some settings that are changed using javascript. I'm trying to use the example <a href="http://msdn.microsoft.com/en-us/library/cc452443%28v=vs.100%29.aspx" rel="nofollow">here</a> but can't get the correct syntax</p> <p>the script looks like this</p> <pre><code> &lt;div class="DisplayInput"&gt;&lt;input type="radio" name="displaytype" value="decimal" onclick="setdisplayType('decimal');" checked="checked"&gt;&lt;a href="javaScript:setdisplayType('decimal');" onclick="s_objectID=&amp;quot;javascript:setdisplayType('decimal');_1&amp;quot;;return this.s_oc? this.s_oc(e):true"&gt;Decimal&lt;/a&gt;&lt;/div&gt; </code></pre> <p>So far I've tried these with no success</p> <pre><code>this.webBrowser1.InvokeScript("setdisplayType"); this.webBrowser1.InvokeScript("setdisplayType('decimal')"); this.webBrowser1.InvokeScript("setdisplayType","decimal"); </code></pre>
c# javascript
[0, 3]
881,750
881,751
News Bar with jQuery
<p>I need to make a horizontal "breaking-news" style bar with jQuery. I pick new from the server (the easy part) and I need some way to make them continually scroll from left to right. Any jQuery plugin to help me? thanks</p>
javascript jquery
[3, 5]
3,301,273
3,301,274
Display new page showing user input upon button click
<p>Greetings, all. I'm working on a training project; I have a page for user input which I save to the database; now I need the submit button to bring up a static(?) form which only displays their input, with a link to go back and edit this input. I'm using C# and ASP.NET. Any ideas out there? The examples I found googling were semi-relevant, but I had a difficult time understanding, as I am ignorant to a near-criminal degree. </p>
c# asp.net
[0, 9]
102,392
102,393
JQuery class selectors
<p>I have an html text box with some having class names as <strong>numbers</strong></p> <pre><code>&lt;input type="text" name="msg_timeout" class="numbers" /&gt; </code></pre> <p>similarly there are different text box with class as <strong>numbers</strong>.I want to assign keydown event to those text box that has class as number so i tried with following ,but not working</p> <pre><code>$('input.numbers').each $('.numbers').each $('input.numbers:text').each $('input:text.numbers').each $('input[type=text]').each // only this is working but it selects all textboxes. </code></pre> <p>kindly let me know idea. <strong>CODE BELOW</strong></p> <pre><code>$(document).ready(function() { $('input.numbers').each(function() { $(this).get(0).oncontextmenu = function() { return false; }; $(this).bind("keydown",function(event) { // alert(window.event); // Allow only backspace and delete if ( event.keyCode == 46 || event.keyCode == 8 &amp;&amp; (event.keyCode &gt;=96 &amp;&amp; event.keyCode &lt;=105) ) { // let it happen, don't do anything } else { // Ensure that it is a number and stop the keypress if (event.keyCode &lt; 48 || event.keyCode &gt; 57 || event.shiftKey || event.ctrlKey || event.altKey ) { event.preventDefault(); } } var forbiddenKeys = new Array('c', 'x', 'v'); var keyCode = (event.keyCode) ? event.keyCode : event.which; var isCtrl; isCtrl = event.ctrlKey; if (isCtrl) { for (i = 0; i &lt; forbiddenKeys.length; i++) { if (forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) { //alert('You are prompted to type this twice for a reason!'); return false; } } } return true; }); }); }); </code></pre>
javascript jquery
[3, 5]
799,084
799,085
How to add name value pair to existing query string
<p>i need to add new name ,value pair to existing query string when the user click on some button.</p> <p>i'm using jquery for client side operations.</p> <p>any idea..?</p> <p>thank in advance!</p>
javascript jquery
[3, 5]
4,642,674
4,642,675
Is it possible to Post Data from a Java application to a .php page?
<p>im trying to make a quick java app that posts data to a website just basic $_POST variables. Is it possible?</p> <p>Thanks.</p>
java php
[1, 2]
3,441,515
3,441,516
Trouble with Timeout function and jquery
<p>Hello I get the following Javascript error when calling goon() within a jquery function. I thought it is defined...but obviously not...?! Why not?: </p> <blockquote> <p><strong>goon is not defined var timeout= setTimeout('goon()', 3000)</strong>;</p> </blockquote> <pre><code> $('.rs-slideshow').stop().fadeOut('fast',function(){ $('html,body').stop().animate({ scrollLeft:$offset }, 1000, function(){ function goon(){ $('.rs-slideshow').fadeIn('fast'); $('#slideshow').clearQueue().rsfSlideshow('startShow'); } var timeout= setTimeout('goon()', 3000); }); }); </code></pre>
javascript jquery
[3, 5]
5,346,512
5,346,513
how to cache data repository in asp.net?
<p>I just wonder how to cache my data repository I mean there are some data repositories in my project they are so useful and I have to call their method several times so I need some tools or maybe patterns to cache them on the client to avoid get extra and duplicate queries.</p> <pre><code>&lt;asp:DropDownList ID="Dropdownlist1" runat="server" DataTextField="DataTextField" DataValueField="Key"&gt; &lt;/asp:DropDownList&gt; Dropdownlist1.DataSource = dbContext.EntityTest1; Dropdownlist1.DataBind(); </code></pre> <p>For each running the page or web application whenever I use this control it makes an executable linq query and caching data from sql server then transfer them to client but in fact it is unnecessary.</p> <p>I think there are two different caching server side between sql server and application to avoid extra fetching data. and second caching client side between my application and client.</p> <p>What is the best solution for caching ? and is there any sample project to explain both of them ?</p>
c# asp.net
[0, 9]
3,245,051
3,245,052
Localization of Confirm dialog box in jQuery
<p>I'm using jquery dialog box to display Confirm &amp; Cancel button as shown below:</p> <pre><code> $("#delete_user").click(function(e) { $("#delete_user_dialog").dialog({ buttons : { "Confirm" : function() { $(this).dialog("close"); DeleteUser(); }, "Cancel" : function() { $(this).dialog("close"); } } }); $("#delete_user_dialog").dialog("open"); </code></pre> <p>});</p> <p>Is it possible to localize this text "Confirm" &amp; "Cancel"??</p> <p>thanks!</p>
javascript jquery
[3, 5]
4,261,929
4,261,930
How to show MessageBox on asp.net?
<p>if I need to show a MessageBox on my ASP.NET WebForm, how to do it?</p> <p>I try: <code>Messagebox.show("dd");</code></p> <p>But it's not working.</p>
c# asp.net
[0, 9]
3,187,798
3,187,799
Running PHP under ASP.NET
<p>ASP.NET web server can allows to deploy PHP code, even full applications like phpBB. is it possible? please guide me</p> <p>by googling i found this</p> <p>check this link</p> <p><a href="http://www.communitymx.com/content/article.cfm?cid=F8079" rel="nofollow">http://www.communitymx.com/content/article.cfm?cid=F8079</a></p> <p>and in the time of running the PersonalWebSite projet getting error </p> <p>Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index and other projet is not oppening </p>
php asp.net
[2, 9]
2,215,408
2,215,409
How to make nested call with jquery
<p>I've below code in JS file:</p> <pre><code>$(document).ready(function() { $("#key_verify").click(function () { $("#errrmsg").html("&lt;img src=\"/images/shim.gif\"/&gt;"); if($.trim($("#key").val()).length != 0){ $.ajax({ type : "POST", cache : false, async : true, url : "/issuekey?key="+$("#key").val(), success : function(data) { var json_obj = $.parseJSON(data); if(json_obj === undefined || json_obj == null){ }else{ if(json_obj.result == "true"){ top.location.href="/register" }else{ $("#errrmsg").html(invalid_key); } } }, error : function(data) { $("#errrmsg").html(invalid_product_key); } }); } }); </code></pre> <p>}</p> <p>How can I invoke above code in below lines so that when user hits enter key, it should make a call on enter key as well??</p> <pre><code>$("#key_verify").keypress(function(e) { if(e.which == 13){ ?????? } }); </code></pre> <p>Thanks!</p>
javascript jquery
[3, 5]
5,943,192
5,943,193
Appending to <td> instead of below <tr>. What's wrong?
<p>In this jsFiddle</p> <p><a href="http://jsfiddle.net/littlesandra88/tZqYX/" rel="nofollow">http://jsfiddle.net/littlesandra88/tZqYX/</a></p> <p>would I like that a new <code>&lt;tr&gt;</code> is inserted below the one where "Details" is clicked.</p> <p>I do</p> <pre><code>$('.row').append("&lt;tr&gt;&lt;td&gt;It worked&lt;/td&gt;&lt;/tr&gt;"); </code></pre> <p>but this results in</p> <pre><code>&lt;tr class="row"&gt; &lt;td class="edit-column"&gt;&lt;a href="javascript:addRemove('7249');"&gt;Details&lt;/a&gt; &lt;input value="Save" type="submit"&gt;&lt;/td&gt; &lt;tr&gt;&lt;td&gt;It worked&lt;/td&gt;&lt;/tr&gt;&lt;/tr&gt; </code></pre> <p>where I was hoping for</p> <pre><code>&lt;tr class="row"&gt; &lt;td class="edit-column"&gt;&lt;a href="javascript:addRemove('7249');"&gt;Details&lt;/a&gt; &lt;input value="Save" type="submit"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt;&lt;td&gt;It worked&lt;/td&gt;&lt;/tr&gt; </code></pre> <p>Any idea how to fix this?</p>
javascript jquery
[3, 5]
516,740
516,741
Detect before user closes/changes mobile browser tab
<p>Is it possible to detect before the user changes tab or closes the tab on a mobile browser. </p> <p>I tried</p> <pre><code>$(window).bind('beforeunload', function () { // AddToCart(123, 123, 123, 123); return "Message"; }); </code></pre> <p>but that did not work.</p> <p>Any help would be great.</p> <p>Thanks</p>
javascript android jquery iphone
[3, 4, 5, 8]
2,619,484
2,619,485
Javascript alert message Alternative
<p>On my online page I have a simple alert message. I basically need to change the title but I've read that I cannot do that.</p> <p>Here's the code:</p> <pre><code>&lt;script&gt;alert("My Message Here");&lt;/script&gt; </code></pre> <p>In the alert message I get the url of my website and then the message under it. </p> <p>What is the quickest alternative to having a javascript alert? </p> <p>Thanks</p>
javascript jquery
[3, 5]
5,786,774
5,786,775
How to set JavaScript variable by php with out AJAX?
<p>I need to set JavaScript variable by php variable with out ajax. I try following code:</p> <pre><code>&lt;script type="text/javascript"&gt; var url = &lt;?php echo($url); ?&gt;; &lt;/script&gt; </code></pre> <p>but it will make problem,How can I do it?</p>
php javascript
[2, 3]
5,967,109
5,967,110
Model not showing when creating a controller class
<p>For some reason the add controller class dialog isn't picking up on the Movies, and MovieDBContext classing. I'm new to ASP.NET and Visual Studio 2010, is there something which I should do for the classes to show here?</p> <p><img src="http://imgur.com/Ylnmn.png" alt="Screenshot"></p>
c# asp.net
[0, 9]
5,915,816
5,915,817
jQuery star rating question
<p>I have a around 8 jQuery star rating in my page:</p> <pre><code>&lt;input class= "auto-submit-star" name="star2" type="radio" class="star"/&gt; &lt;input class= "auto-submit-star" name="star2" type="radio" class="star"/&gt; &lt;input class= "auto-submit-star" name="star2" type="radio" class="star" checked="checked"/&gt; &lt;input class= "auto-submit-star" name="star2" type="radio" class="star"/&gt; &lt;input class= "auto-submit-star" name="star2" type="radio" class="star"/&gt; </code></pre> <p>What I want to do is that when a user clicks on the rating, it does a post back to the database (MySQL) and update some data. I know there is a callback function for this star rating that looks something like this:</p> <pre><code>$('.auto-submit-star').rating({ callback: function(value, link){ $.post("ajax.php", {name: unknown, val: value}); } }) </code></pre> <p>The question is that in this callback function, how do I get the name. Which is star2 in the example above? Can someone also give me an example of a doing a post </p> <p>;</p>
javascript jquery
[3, 5]
2,815,132
2,815,133
Android File Association
<p>How do I have a new file type launch my app?</p> <p>For example if I have a new file type 'file.mjl' and I receive this file as an email, I want Android to associate this file type with my app and allow me to open / save it.</p>
java android
[1, 4]
2,567,295
2,567,296
Binding Events rather than using onclick
<p>I have been told its better to bind events to elements rather than having <code>onclick</code>s with functions everywhere. I agree with this as it devolves more from the HTML which means cleaner and easier to debug code. </p> <p>But I am having trouble doing this! I loop through some data with PHP (see below) and I currently use onclick to call a function. How can I bind this onclick event to many elements using JQuery.</p> <pre><code>&lt;?php foreach($main_tags as $key=&gt;$value){ ?&gt; &lt;li&gt; &lt;a id="&lt;?php echo $key; ?&gt;" href="#" onclick="tag_search('&lt;?php echo $key; ?&gt;'); return false;"&gt; &lt;?php echo $key; ?&gt; &lt;span class="num-active"&gt; &lt;?php echo $value; ?&gt; &lt;/span&gt; &lt;/a&gt; &lt;/li&gt; &lt;?php } ?&gt; </code></pre> <p>Thanks all for any help</p>
javascript jquery
[3, 5]
3,520,462
3,520,463
php and javascript cookie
<p>why php get cookie new value only when i refresh page twice. When run page first time, php do not get cookie value.</p> <p>Thanks</p> <pre><code>&lt;script type="text/javascript"&gt; var name = 'test1'; var value = '1234'; var expirydays = '1'; expiry = new Date(); expiry.setDate(expiry.getDate() + expirydays); document.cookie = name+"="+escape(value)+";expires="+expiry.toGMTString(); &lt;/script&gt; &lt;?php print_r($_COOKIE); ?&gt; </code></pre>
php javascript
[2, 3]
3,272,052
3,272,053
Javascript error: Error: ta is not defined
<p>I am new to JavaScript and I am trying to add a character counter to a text field using this code: </p> <pre><code>$(function(){ $('.txtclass').keypress(function(){ ta = $(this); if(ta.val().length &gt;= 350){ ta.val( ta.val().substr(0, 350) ); } else { $("#counter span").text(350-ta.val().length); } }); }); setInterval('$("#counter span").text(350-ta.val().length);', 350); </code></pre> <p>I get that JavaScript error: <code>"Error: ta is not defined"</code> and points me to that specific line in my code.</p> <p>Any insight into whats happening and how to fix it would be really appreciated as I'd like to add more counters for other text-fields into the website elsewhere. </p> <p>Edit: here's the html for the counter</p> <pre><code> &lt;div id="counter"&gt;&lt;span&gt;350&lt;/span&gt; characters remaining.&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
569,575
569,576
i'm getting CultureInfo.InvariantCulture format for MM/dd/yyyy. but i want to get dd/MM/yyyy format what i do that
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12986114/get-the-system-date-and-split-day-month-and-year">get the system date and split day,month and year</a> </p> </blockquote> <p>getting CultureInfo.InvariantCulture format for MM/dd/yyyy. but i want to get dd/MM/yyyy format and i want to split the day and month and year.</p> <p>Here is my code :</p> <pre><code>string sDate = string.Empty; DateTime _date = DateTime.Now; DateTime dateFormat = Convert.ToDateTime(_date.ToString(CultureInfo.InvariantCulture)); int count = 0; string format = "dd/MM/yyyy"; sDate = dateFormat.ToString(format); string[] Words = sDate.Split(new char[] { '/' }); foreach (string Word in Words) { count += 1; if (count == 1) { Day = Word; } if (count == 2) { Month = Word; } if (count == 3) { Year = Word; } } </code></pre>
c# asp.net
[0, 9]
247,260
247,261
Audio tag attribute issue
<p>I need to create audio tag with bunch of attributes.</p> <p>I have </p> <pre><code>var audioPlayer=document.createElement('audio'); var audioSource=document.createElement('source'); audioSource.type="audio/mp3"; audioPlayer.controls="controls"; audioPlayer.autoplay="autoplay"; $('div').append(audioPlayer); </code></pre> <p>My html become:</p> <p>in Chrome</p> <pre><code>&lt;audio controls autoplay id='test', class='classname'&gt; &lt;/audio&gt; </code></pre> <p>in FF</p> <pre><code>&lt;audio controls='' autoplay='' id='test', class='classname'&gt; &lt;/audio&gt; </code></pre> <p>What should i do to create these in javascript? Thanks a lot!</p>
javascript jquery
[3, 5]
1,174,994
1,174,995
Creating Threads results in force close in android app
<p>I am trying to create a thread to handle a login function that is executed when the login button is pushed, so that I can show a progressDialog.</p> <pre><code> btnLogin.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Check Login ProgressDialog.show(Activity.this, "", "Loading..."); new Thread(new Runnable(){ public void run(){ try{ int duration; Toast toast; Context context; String username = etUsername.getText().toString(); String password = etPassword.getText().toString(); JSONArray jsonArray=null; password=ServerConnection.encryptPassword(password); //Log.i("login hash",password); jsonArray=ServerConnection.login(username, password); if(jsonArray!=null) //login successful { context=getApplicationContext(); duration=Toast.LENGTH_SHORT; toast=Toast.makeText(context, "Login Successful!", duration); toast.show();//Shows the little pop up right at the bottom of the screen Intent i = new Intent(getApplicationContext(), MapWithFriends.class); startActivity(i); } else { context=getApplicationContext(); duration=Toast.LENGTH_SHORT; toast=Toast.makeText(context, "Login Fail", duration); toast.show();//Shows the little pop up right at the bottom of the screen //lblResult.setText("Login failed. Username and/or password doesn't match."); } }catch(Exception e) { Log.e("tag", e.getMessage()); } progressDialog.dismiss(); } }).start(); } }); </code></pre> <p>However when the thread is created, it force closes. If I change back to no threads, it works fine.</p> <p>Thanks</p> <p>Edit: <br> LogCat of crash:<br> Can't create handler inside thread that has not called Looper.prepare()<br> FATAL EXCEPTION: Thread-10<br> java.lang.NullPointerException <br> ..... would you guys need more than this?</p>
java android
[1, 4]
772,197
772,198
How to make the numbers automatically using jquery append ..?
<p>Hello all I want to ask, how to make the numbers automatically using jquery append ..? I have made ​​it but still failed My source code is : </p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Help Help&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" id="button" value="Create a number from 1 to N"/&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('#button').click(function() { $('#result').append('&lt;div class="number"&gt;Numbers To ......&lt;/div&gt;'); }); }); &lt;/script&gt; &lt;/body&gt; &lt;hr&gt; results from click button &lt;hr&gt; &lt;div id=result&gt;&lt;/div&gt; </code></pre> <p></p>
javascript jquery
[3, 5]
1,640,781
1,640,782
need to pass the php value to javascript
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1917576/how-to-pass-javascript-variables-to-php">How to pass JavaScript variables to PHP?</a> </p> </blockquote> <p>Here below my code:</p> <pre><code>function disablefields(){ var suresh=[&lt;?php echo $cryo_1kl_18_orig_jan; ?&gt;]; if (document.getElementById('checkboxA').checked == 1){ document.getElementById('cryo_1kl_18_rev_jan').disabled=''; document.getElementById('cryo_1kl_18_rev_jan').value='**i want pass the php value here**'; } </code></pre> <p>I want to pass the php value to javascript...</p>
php javascript
[2, 3]
1,796,337
1,796,338
How to determine if my app is running on Android
<p>I have an app that runs on several mobile devices running either Fedora or Android. To consolidate my codebase and distribution I would like to determine which OS I am on. I tried System.getProperty("os.name"), but that just returns "Linux". Is there something unique to Android in the System properties? Thanks</p>
java android
[1, 4]
2,561,602
2,561,603
Java/Android: Increment Algorithm
<p>I have a value of Android accelerometer x axis, and on every <strong>0.18</strong> change of that value, the value of <strong>az</strong> should also be incrementally/decrementally changed by <strong>5</strong> </p> <p>for example:</p> <p>at <code>x=0, az=0</code></p> <p>at <code>x=0.18, az=5</code></p> <p>at <code>x=0.36, az=10</code></p> <p>if the value of x back to 0.18, so az value must also be back to 5 (that means x and az are synchronized)</p> <p>How should I implement this logic into codes?</p> <p>PS: I expect "for", "if", or maybe "while" statements here</p> <p>Sorry for my bad English. Thank you in advance </p>
java android
[1, 4]
1,268,630
1,268,631
Using find() excluding some elements?
<p>I need to use find() to find all inputs in a form and change its value to ''. But I also need to exclude 2 inputs, the name of these inputs are: 'data', and 'date'</p> <p>I tried this (with no success)</p> <p><strong>$('#contactForm').find("input[ @name != 'data' ][ @name != 'date' ]").val('');</strong></p>
javascript jquery
[3, 5]
315,858
315,859
JQuery form auto submit clicking out side the div
<p>I want to auto-sumbit my form once user clicks out side the div of the form.</p> <p>I tried the following but it submits within clicking within the div.</p> <pre><code>&lt;div id="formDiv"&gt; &lt;form id="search"&gt; &lt;input id="target" type="text" value="Field 1" /&gt; &lt;input type="text" value="Field 2" /&gt; &lt;/form&gt; &lt;/div&gt; // auto submit jQuery('#formDiv').live('blur',function() { $(this).children('form').submit(); }); </code></pre>
javascript jquery
[3, 5]
4,392,350
4,392,351
Simplifying shorthand if bool
<p>I just declared a variable like this:</p> <pre><code>bool b = (x is Foo) ? (x as Foo).Bar == 1 ? false; </code></pre> <p>But resharper told me that I could simplify the expression, so I rewrote it like this:</p> <pre><code>bool b = (x as Foo).Bar == 1; </code></pre> <p>Amd now resharper is satisfied, but is "exception safe"? For example, will it return false if <code>x</code> isnt of the type <code>Foo</code>?</p>
c# asp.net
[0, 9]
4,849,501
4,849,502
Prev/next functionality failing
<p>Prev/next functionality not working on new section selection. The idea is that when the the page loads, several slide shows will load and the user will navigate through them with prev/next buttons. When they get to the end of one section, they will select the next section that they want to view. My problem is that the prev/next function doesn't work after the user navigates to a new section.</p> <p>Here is a <a href="http://jsfiddle.net/edubs/NmBSS/2/" rel="nofollow">JSFiddle</a>. So you don't miss them, the prev/next buttons are the edges of the prev/next slides hanging on the left and right side of the page, respectively. Below is the section of my javascript that I believe is causing the problem. </p> <p>Thanks</p> <pre><code>var secName, slideCount, centSlide; liveSec(0); // Initiate live section function liveSec(x) { centSlide = 0; secName = $('#slider &gt; div:eq('+x+')').attr('id'); slideCount = $('#'+secName+'').children().length; $('#'+secName+'').children().first().addClass('liveslide').next().addClass('next'); } // call prev/next functions $('#'+secName+' &gt; div').click(function() { var index = $('#'+secName+' &gt; div').index(this); if (index &gt; centSlide) nextcycle(centSlide, slideCount); if (index &lt; centSlide) prevcycle(centSlide, slideCount); return false; }); // cycle sections $('#'+secName+' .select').click(function () { if (!e) var e = window.event; e.cancelBubble = true; if (e.stopPropagation) e.stopPropagation(); $('.liveslide').removeClass('liveslide'); $('.prev').removeClass('prev'); i = $('#'+secName+' .select').index(this); liveSec(i); }); </code></pre>
javascript jquery
[3, 5]
325,871
325,872
class relations and site architecture
<p>I'm building a asp.net web site<br> i build a class localiziedpage that inherit from System.Web.UI.Page this class in dealing with all localization of the page. ii have a class basepage that inherit from localiziedpage that get all simple data from db for a page (h1,title,main content,description...)</p> <p>now i need to create a page that bring another type of data (news list,albums ...) do i need to build a separate class for every type of page?</p> <p>for rss page a rssPage class that inherit from basePage ?<br> for newslist page a newsListPage that inherit from basePage ?</p>
c# asp.net
[0, 9]
4,320,023
4,320,024
Persisting information across repeat form submission attempts
<p>Below is a simplified version of a sign-up page I'm working on. </p> <p>When the user clicks the button I need to collect money from a credit card. Then, if the transaction is successful, create the new user account. </p> <p>My problem is handling the scenario where the credit card transaction succeeds but then the create-user transaction fails. If the user needs to correct some information in the form I don't want to charge their card again.<br> My <code>PaymentStatus</code> variable contains a <code>1</code> or a <code>0</code> depending on whether or not the transaction succeeds. </p> <p>Will this persist across multiple button clicks? And if it does, is this a reliable way of avoiding duplicate transactions in scenarios where the user needs to correct some data in the form?<br> I could persist the information to the database, but my preference would be to do that later in the transaction when there exists a <code>UserID</code> to associate the payment with.</p> <pre><code>protected void btn_Click(object sender, ImageClickEventArgs e) { int PaymentStatus = ChargeCardForSignUpFee(userInfo); if (PaymentStatus == 0) { Label1.Text = "Your credit card is invalid. Please try again."; } else { try { MembershipUser newUser = Membership.CreateUser(userInfo); if (newUser == null) { lblStatus.Text = GetErrorMessage(status); } else { CreateCustomer(userInfo); SendWelcomeEmail(userInfo.email); FormsAuthentication.SetAuthCookie(userName, true); Response.Redirect("welcomepage.aspx"); } } catch { lblStatus.Text = "An error occurred while creating your account. "+ "Please check your information and try again. "+ ex.Message; } } } </code></pre>
c# asp.net
[0, 9]
5,875,567
5,875,568
fadeIn() an invisible list item with jQuery
<p>I have an unordered list whose <code>li</code>s are invisible (<code>display:none</code>) to begin with.</p> <p>I want to make a specific <code>li</code> visible with a JS function. How can I do that?</p> <p>I've tried <code>$("#my-list li:nth-child(1)").fadeIn()</code> but that only works if the <code>ul</code> is visible to begin with.</p> <p>Here's my code:</p> <pre class="lang-css prettyprint-override"><code>ul.hide &gt; li { display: none; } </code></pre> <pre class="lang-html prettyprint-override"><code>&lt;ul class="hide" id="my-list"&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;li&gt;3&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I'm trying to answer <a href="https://bountify.co/i" rel="nofollow">this question</a>. Feel free to take a stab at it!</p>
javascript jquery
[3, 5]
302
303
javascript callback after loop
<p>Iv'e just started a new Wordpress blog and i have started to build the JavaScript base!</p> <p>the issue im having is that i have a fucntion that loops several variables and includes the required JS libraries, what i need to do is execute the callback when the loop is finished!</p> <p>Heres my code!</p> <pre><code>var Utilities = { Log : function(item) { if(console &amp;&amp; typeof console.log == 'function') { //Chrome console.log(item); } }, LoadLibraries : function(callback) { $.each(Wordpress.required,function(i,val){ //Load the JS $.getScript(Wordpress.theme_root + '/js/plugins/' + val + '/' + val + '.js',function(){ // %/js/plugins/%/%.js Utilities.Log('library Loaded: ' + val); }); }); callback(); } } </code></pre> <p>And the usage is like so!</p> <pre><code>Utilities.LoadLibraries(function(){ Utilities.Log('All loaded'); }); </code></pre> <p>Above you see the execution of <code>callback()</code> witch is being executed before the files are in the dom! i need this called at the end of every library inclusion!</p>
javascript jquery
[3, 5]
1,979,708
1,979,709
jquery .find and append img tag
<p>I am trying to load pictures name from a xml object and append to div. I am getting confuse with append typing layout, not able to find where im doing typing mistake. </p> <p>This is working</p> <pre><code>$("#nn").append("&lt;img id='theImg' src='/pic/jas/pic1.jpg'/&gt;"); </code></pre> <p>This not working</p> <pre><code>$("#nn").append("&lt;img id='theImg' src='/pic/jas/'" + customer.find("pic_name") + "/&gt;"); </code></pre> <p>My jquery script part is</p> <pre><code>function OnSuccess(response) { var xmlDoc = $.parseXML(response.d); var xml = $(xmlDoc); pageCount = parseInt(xml.find("PageCount").eq(0).find("PageCount").text()); var pic_infoVar = xml.find("pic_info"); pic_infoVar.each(function () { var customer = $(this); $("#picDiv").append("&lt;img id='theImg' src='/pic/jas/'" + customer.find("pic_name") + "/&gt;"); }); $("#loader").hide(); } </code></pre> <p>Html Div tag</p> <pre><code>&lt;div id="picDiv"&gt; LoadPic &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
3,599,722
3,599,723
show a string of my div and append
<p>How do I show a string representation of my div emptied then append to it?</p> <pre><code> var x = $('#myDiv').outerHTML(); x = x.empty().append('&lt;h1&gt;test&lt;/h1&gt;'); //result must look like &lt;div id="myDiv"&gt;&lt;h1&gt;test&lt;/h1&gt;&lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
1,408,313
1,408,314
Android set ringtone failure
<p>I try the following code and it doesn't set the ringtone. The logcat entry for "ff" says null so I guess the URI isnt being concatenated properly?, I cant seem to figure out where in my code I am going wrong.</p> <pre><code>String filepath =Environment.getExternalStorageDirectory().toString()+"//media//audio//ringtones//bluemoon.mp3"; File ringtoneFile = new File(filepath); ContentValues content = new ContentValues(); content.put(MediaStore.MediaColumns.DATA,ringtoneFile.getAbsolutePath()); content.put(MediaStore.MediaColumns.TITLE, "test"); content.put(MediaStore.MediaColumns.SIZE, 215454); content.put(MediaStore.MediaColumns.MIME_TYPE, "audio/mpeg"); content.put(MediaStore.Audio.Media.ARTIST, "artist"); content.put(MediaStore.Audio.Media.DURATION, 230); content.put(MediaStore.Audio.Media.IS_RINGTONE, true); content.put(MediaStore.Audio.Media.IS_NOTIFICATION, false); content.put(MediaStore.Audio.Media.IS_ALARM, false); content.put(MediaStore.Audio.Media.IS_MUSIC, false); Log.i("BOOM", "the absolute path of the file is :"+ringtoneFile.getAbsolutePath()); Uri uri = MediaStore.Audio.Media.getContentUriForPath( ringtoneFile.getAbsolutePath()); Uri newUri = getApplicationContext().getContentResolver().insert(uri, content); Uri ringtoneUri = newUri; Log.i("ff","the ringtone uri is :"+ringtoneUri); RingtoneManager.setActualDefaultRingtoneUri(getApplicationContext(), RingtoneManager.TYPE_RINGTONE,newUri); </code></pre>
java android
[1, 4]
4,223,878
4,223,879
How to check if textbox is empty in jquery dialog
<p>I have one jquery dialog in my app.</p> <p>Here Is how It is made</p> <pre><code> var routePopup = "Route Name : &lt;input type='text' id='routeName' name='routeName'/&gt;"; document.getElementById('popUp').innerHTML = ""; document.getElementById('popUp').innerHTML = routePopup; $("#popUp").dialog({ title: "Route Name", resizable: false, width: auto, height: auto, buttons: { "Create Route": function () { $(this).dialog("close"); } } }); </code></pre> <p>now I want to check if textbox is empty or not. If it is empty then it should not allow to close the popup.</p> <p>Also It should give message on top that the value can not be empty.</p>
javascript jquery
[3, 5]
3,439,245
3,439,246
How to identify IE browsers Build and Sub Build Numbers?
<p><a href="http://msdn.microsoft.com/en-us/library/3yekbd5b.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/3yekbd5b.aspx</a></p> <p>Using this link we are no where able to find the build and sub build version!</p> <p>For more information regarding the build and sub build and how those version being generated are in this following link: <a href="http://support.microsoft.com/kb/969393" rel="nofollow">http://support.microsoft.com/kb/969393</a></p> <p>Can anyone please help me with this?</p> <p>I want to know, browsers major version.minor version.build number.subbuild number</p> <p>i.e., 6.00.2800.1106 </p> <p>The above can also be achieved using WMI and VBScripting! and also through C# registry and managementobjects but i term those are not the exact way to identify! Is there any way to identify these build and sub build versions???</p>
javascript asp.net
[3, 9]
938,382
938,383
Is there any way to know if a button is not clicked a determined time?
<p>Is there any way to know if a button is not clicked a determined time? I've two increment and decrement buttons (plus and minus )to control the temperature with Ajax request. The value is incremented one to one with the next function:</p> <pre><code>Plugin_increment.prototype.startPluginTempe = function (selector, dataAux, dataAux2, varAux, varAux2) { var valueElement = $(selector); function incrementValue(e){ if((valueElement.text() &lt; 40) &amp;&amp; (valueElement.text() &gt; 10)){ //max and min valueElement.text(Math.max(parseInt(valueElement.text()) + e.data.increment)); } if(valueElement.text() == 40){//max if(e.data.increment == -1){ valueElement.text(Math.max(parseInt(valueElement.text()) + e.data.increment)); } } if(valueElement.text() == 10){//min if(e.data.increment == 1){ valueElement.text(Math.max(parseInt(valueElement.text()) + e.data.increment)); } } //Ajax request?????? return false; } $(varAux).button({ icons: { primary: "ui-icon-plusthick" }, text: false }).bind('click', {increment: 1}, incrementValue); $(varAux2).button({ icons: { primary: "ui-icon-minusthick" }, text: false }).bind('click', {increment: -1}, incrementValue); }; </code></pre> <p>"selector" is the selector of a span to show the value. "varAux" and "varAux2" are the selectors to plus and minus buttons.</p> <p>If I send an Ajax request for each increment, the client is overloaded. I think that an option could be to know if a button is not clicked a determinated time. Another way?</p> <p>I use jquery-ui to plus and minus buttons.</p>
javascript jquery
[3, 5]
515,261
515,262
output HTML content using Jquery
<p>I want to display a message on the webpage as result of search . below is my JS code. I kept the DIV empty in the HTML. after calling the function nothing is displaying in the browser.I am novice Please correct where I am doing wrong. </p> <pre><code> function test() { var v = "&lt;p class=""noresults""&gt; &lt;img src=""icons/oops-icon_small.jpg"" alt=""OOPS!"" &gt; id=""img_align"" /&gt; we did not find" + "any results relating to your search. &lt;/p&gt;" + "&lt;span &gt; class=""noreult_home""&gt; &lt;a href=""#""&gt;&lt;img src=""icons/home_icon.jpg"" alt=""Home""/&gt; &lt;/a&gt; &gt;&lt;/span&gt;"; $("div#con").html(v); } </code></pre>
javascript jquery
[3, 5]
2,783,736
2,783,737
disable textbox Required field validator control
<p>I want to disable the requiredfield validator control for the textbox based on some condition of a variable</p> <pre><code>if(var==null) { //Activate it } else { //disable it } </code></pre> <p>Can some one help me with the code</p>
c# asp.net
[0, 9]
5,881,483
5,881,484
When including your header, in PHP, how do you add things?
<p>I am building one of my first PHP websites, and just playing around with it. I am going to be using PHP includes, so I only have to change my meta stuff once. Currently, I have everything from the doctype to the end of the <code>&lt;/head&gt;</code>.</p> <p>A friend is saying I should not include the <code>&lt;/head&gt;</code> on the header.php, but instead, include it on each page, so I can add page specific stuff. Is that a good way of doing it?</p> <p>Currently, for stuff like title, I was doing </p> <pre><code>&lt;title&gt;&lt;?php echo $page_title; ?&gt; </code></pre> <p>and then on the top of each page, I was doing </p> <pre><code>&lt;?php $page_title = 'Blah'; ?&gt; </code></pre> <p>How would I add a page specific Javascript file if this is the way I'm doing this?</p>
php javascript
[2, 3]
5,599,927
5,599,928
How to know text is breaking using javascript or jquery
<p>I have table in some colums text is breaking in two lines. I want to reduce font size for which td text is breaking. I am not getting any clue to where to start coding for this issue <a href="http://jsfiddle.net/WZNPx/" rel="nofollow">http://jsfiddle.net/WZNPx/</a></p> <pre><code>&lt;table width="500" border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td&gt;sdfasdfas asdfasf asdfsaf &lt;/td&gt; &lt;td&gt;adfafdafd adfasdf afasdf sdfsadfasasdfa sdf asdfsafd adfaf&lt;/td&gt; &lt;td&gt;adfasf&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre>
javascript jquery
[3, 5]
4,753,469
4,753,470
reading content of .aspx using javascript
<p>i am using javascript to read the content of .aspx page. but i am not able to read it. i am using javascript as:</p> <pre><code>function edit(headtext,totext, bodytext, footertext){ alert('lll'); //var xmlDoc=new ActiveXObject("MSXML.DOMDocument"); xmlDoc.async="false"; xmlDoc.load("theme3ex.aspx"); var students = xmlDoc.documentElement; alert('0000'); var student = students.childNodes(0); document.getElementById('txtareahead').innerHTML = headtext; document.getElementById('txtareato').innerHTML = totext; document.getElementById('txtareabody').innerHTML = bodytext; document.getElementById('txtareafooter').innerHTML = footertext; location.href = "MailSender.aspx"; } </code></pre> <p>is there any problem eith my javascript..</p>
javascript asp.net
[3, 9]
3,944,046
3,944,047
clearTimeout is not working for some reason
<p>I am not sure what is wrong with my code here, I've set the variable global but the clear timeout is still not working here.</p> <p>Thank you, Kelvin</p> <pre><code>var myslide = null; $(document).ready(function () { var current = null; $('ul#panel li a').click(function () { stopAuto(); $('ul#panel li a').removeClass('active'); $(this).addClass('active'); current = $(this).attr('href'); $('#wrapperSlide').clearQueue(); $('#wrapperSlide').scrollTo($(current), 800); return false; }); if (current==null) { $("ul#panel li").each(function(i){ var counter1 = i+1; var timer1 = counter1 * 5000; myslide = setTimeout(function(){ setLoop1(counter1); },timer1); }); } else { $('#wrapperSlide').clearQueue(); return false; } }); </code></pre> <p>these are the functions for looping the slide images and stop auto </p> <pre><code> function setLoop1(counter) { var counter4 = counter; var myID = $('a#'+counter4).attr('href'); $('ul#panel li a').removeClass('active'); $('a#'+counter4).addClass('active'); $('#wrapperSlide').scrollTo($(myID), 800); } //function to stop the auto slide function stopAuto() { clearTimeout(myslide); } </code></pre>
javascript jquery
[3, 5]
737,378
737,379
Alert based on if condition error
<p>I am trying to fire an alert based on wether a flag is set or not. The first time the page is loaded, the alert works fine. If I then alert data after success, then when I close the dialog the old data is still there. So instead of seeing no data, I still see the old data. The idea, is that if user closes the dialog without doing anything, then the else statement is triggered. I would be grateful if someone could help with this. many thanks</p> <pre><code>var box; var status; var size; var flag; beforeclose: function (event, ui) { if(flag==1){ jAlert("You have successfully editted\n\rBox: "+box+"\n\r"+ "Status: "+status+"\n\r"+ "Size: "+size+"\n\r", 'Box addittion successfull'); } else{ alert("no data"); }$("#f2").html(""); } success: function (data) { flag = 1; $("#EB_edit").get(0).reset(); $('#f2').html(data); //$("#form").dialog('close'); $("#flex1").flexReload(); } </code></pre>
javascript jquery
[3, 5]
4,849,665
4,849,666
How to print a nested array inside the value of a cloned input object?
<p>I have a <a href="http://jsfiddle.net/rayd360/7NHXf/2/" rel="nofollow">fiddle</a></p> <p>code:</p> <pre><code>//create array with values thisArray= ['',[]]; thisArray[0] = ['numbers',['one','two','three','four','five']]; // have a clean clone of input var newElem = $('#input').clone(); //search through aray and print the nested array inside the // value of the cloned input for(i = 0; i&lt;thisArray[0][1].length; i++){ $(newElem).val(thisArray[0][1][i]); $('input.input').last().after(newElem); } </code></pre> <p>Conditions: I cannot change the HTML or layout of the array.</p> <p>Question: how can i edit the for loop to display the numbers in the array one after another inside the cloned input field? so the final output will be six input fields with a number in each except the first one.</p>
javascript jquery
[3, 5]
1,541,768
1,541,769
remove entry from javascript array object
<p>I have two object array in Js</p> <pre><code>a = [{"photoId":"1","albumId":"121"},{"photoId":"2","albumId":"131"},{"photoId":"3","albumId":"131"}] ; b = [{"photoId":"2","albumId":"131"}]; </code></pre> <p>I want to remove b object array entry from the a object array..so the output should be</p> <pre><code>c = [{"photoId":"1","albumId":"121"},{"photoId":"3","albumId":"131"}]; </code></pre> <p>its easy to achieve in case of array but how to do the same for array object..</p>
javascript jquery
[3, 5]
5,366,487
5,366,488
execCommand for font-size causes problem in Google Chrome
<p>I am using a jquery based rich text editor "lwRTE"</p> <p>It works well in all ways except in changing fontsize</p> <p>I traced the problem as follows:</p> <p>when i change the font size the command and the argument is chosen correctly as "font size" and "[the font size in number Eg.6]"</p> <p>now the <strong>execCommand</strong> is executed and <strong>chrome executes it differently</strong>.</p> <p>firefox changes the selected text as </p> <pre><code> &lt;font size="6px"&gt;sample text&lt;/font&gt; </code></pre> <p>chrome changes the selected text as </p> <pre><code>&lt;span class="Apple-style-span" style="font-size: xx-large;"&gt;sample text&lt;/span&gt; </code></pre> <p>this is what causes the problem. when i edit and save using Chrome, firefox seems to not understand the above way of formatting.</p> <p>how do i make chrome also do the same? (i.e) insert font tag and insert crazy font sizes.</p> <p>Thanks in advance</p>
javascript jquery
[3, 5]
5,997,122
5,997,123
How to use jquery API over html string
<p>context: I have an ajax request which return data structure with an html key.</p> <p>I would like to wrap this data with a jQuery object to be able to use API like width / height and modify the data before adding it to the DOM.</p> <pre><code>&gt; $('&lt;div width="220" height="200"&gt;&lt;/div&gt;').width() 0 </code></pre> <p>So how could I do to get 220 and then modify it ?</p> <p>I'm using jquery 1.7.2</p> <p>Edit:</p> <p>I'm not from the 90's because I use the wrong tag in my example. My need is to change width and height of an iframe for responsive:</p> <pre><code>&gt; $('&lt;iframe width="220" height="200"&gt;&lt;/iframe&gt;').width() 0 </code></pre>
javascript jquery
[3, 5]
2,833,053
2,833,054
What PDF library should I use for Android?
<p>I have been developing Android application, and I need to read PDF-files in my app. There are some requirements for lib:</p> <ul> <li><p>will the solution be able to read fairly large files? Like if the file is much larger than available memory, would it be able to read piece by piece as the user browses?</p></li> <li><p>will in the future this module be able to read from a stream not just from a file?</p></li> <li><p>will the solution, with this or future project/effort be able to re-flow text - to accommodate different screen sizes?</p></li> <li><p>what version of the PDF format (up to) will it be able to read.</p></li> </ul> <p>Please, recommend me some library. </p>
java android
[1, 4]
5,509,634
5,509,635
accordion in jquey ul
<p>I am trying to Convert one header and one content panel into an accordion. </p> <pre><code> &lt;div id="accordion-two"&gt; &lt;h3&gt;Header&lt;/h3&gt; &lt;div&gt;Content panel&lt;/div&gt; &lt;/div&gt; </code></pre> <p>this is jquery</p> <pre><code> $('#accordion-two').accordion({header: 'h3', event: 'click', animated: 'swing', duration: 800, active: false }); </code></pre> <p>my question is I need to apply click event to header to open the content panel and to collapse the content panel.. </p> <p>thank you..</p>
javascript jquery
[3, 5]
750,592
750,593
How to have a smooth transition when showing / hiding text
<p>I need to switch between the short and the full description of an article. Actually i have this markup</p> <pre><code>&lt;div class="post-content"&gt; &lt;p class="corta"&gt;Antonio Colombo Contemporary Art and Atelier Biagetti, have the honour to present&amp;nbsp;a&lt;/p&gt; &lt;span class="points" &gt;...&lt;/span&gt; &lt;br /&gt; &lt;span style="display:none" class="completa"&gt;Here i have the full description &lt;/span&gt; &lt;a style="width:auto;" class="link readLess" href="#"&gt;read more&lt;/a&gt; &lt;/div&gt; </code></pre> <p>and this js </p> <pre><code>$('div.post-content').delegate("a", "click", function(e) { e.preventDefault(); var div = $(this).closest('div'); var points = div.find('.points'); var complete = div.find('.completa').html(); var corta = div.find('.corta').html(); div.find('.corta').html(complete); div.find('.completa').html(corta); var $this = $(this); if ($this.hasClass('readMore')) { $this.text("read less"); $this.addClass('readLess').removeClass('readMore'); points.show(); } else { $this.text("read more"); $this.addClass('readMore').removeClass('readLess'); points.hide(); } }); </code></pre> <p>This works ok, but id rather have a smooth transition between the short and long description. What would you suggest? I could change the markup or use a jQuery plugin if neded</p> <p>Fiddle here <a href="http://jsfiddle.net/ycdBH/" rel="nofollow">http://jsfiddle.net/ycdBH/</a></p>
javascript jquery
[3, 5]
5,351,714
5,351,715
Jquery object compare problem
<p>How to compare two Jquery object?</p> <pre><code>$('&lt;p&gt;&lt;/p&gt;')[0] === $('&lt;p&gt;&lt;/p&gt;')[0] false $('&lt;p&gt;&lt;/p&gt;') == $('&lt;p&gt;&lt;/p&gt;') false $('&lt;p&gt;&lt;/p&gt;').get() == $('&lt;p&gt;&lt;/p&gt;').get() false </code></pre>
javascript jquery
[3, 5]
5,416,596
5,416,597
Are there any real risks to continuous polling?
<p>It's sort of been 'against my religion' to poll a condition using a <code>timeOut</code> or similar technique. I'd so much rather handle an event than continuously search for evidence that an event occurred.</p> <p>But, due to spotty support for the <code>onHashChange</code> event, it was suggested I use a plugin that polls the <code>window.location</code> property every 50ms.</p> <p>Are there any real risks to doing this (eg processing expense)? Or am I just superstitious?</p>
javascript jquery
[3, 5]
4,448,670
4,448,671
JavaScript minifier that strips out unused code
<p>Does anyone know of a JavaScript minifer that can detect unused code and strip it out.</p> <p>Google Closure seems alright but it appears to only compact.</p> <p>I'm looking for something much more advanced, where it can look through my JavaScript and not only compact but also remove unused code.</p> <p>Anyone know of such a tool?</p> <p>The use base being, I use very little functionality of JQuery - what I would like to do is remove from the base/core all the bloat that is unneeded from my use.</p>
javascript jquery
[3, 5]
5,034,691
5,034,692
remove/hide table's empty column(s), including <th>
<p>How can I hide the column with all empty cells including the title <code>&lt;th&gt;</code> in that column, while leaving the other columns and their titles as it is. Following jquery hides the entire <code>&lt;th&gt;</code>, which is not I want. <a href="http://jsfiddle.net/F3Hnm/" rel="nofollow">Here</a> is a sample, where I want to hide only the entire 'Column3' including <code>&lt;th&gt;</code>. Many thanks in advance.</p> <pre><code>$('table#mytable tr').each(function() { if ($(this).children('td:empty').length === $(this).children('td').length) { $(this).hide(); } }); </code></pre>
javascript jquery
[3, 5]
2,078,703
2,078,704
preview of another website not thumbnails in php and javascript
<p>I am in the process of creating a site where visitors can preview(not THUMBNAILS!) another url on mypage in an input text box and click on"preview" button-</p> <p>I am using CURL from php to extract the contents of the site and have divided my page into two halves one for accepting url and the other half which will display the previewed content, basically i do not want image of the url site like GOOGLE.</p> <p>though the CURL fetches me the contents and I am able to see the content on the preview half what is annoying is the CSS of the previewed html is getting applied across even my page :( since my knowledge of css is very limited can anyone help me with the following</p> <ol> <li>css of the previewed section must not get applied to my part of the page</li> <li>How to scale down the previewed site just to fit into the preview section of my page.</li> </ol> <p>thanks, Jay</p>
php javascript
[2, 3]
3,317,612
3,317,613
Update label C#
<p>When the page first load i have a label who has 0 or 1. Look at the code and you will se what i trying to do. But it don't work because the page allready loaded.</p> <pre><code>protected void rptBugStatus_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label lblName = e.Item.FindControl("lblBugStatus") as Label; if (lblName.Text == "1") { lblName.Text = lblName.Text + "Under arbete"; } else if (lblName.Text == "0") { lblName.Text = "Fixad"; } else { } } } </code></pre>
c# asp.net
[0, 9]
1,230,552
1,230,553
how to upload ppt and display ppt in website using c#
<p>How can I display an uploaded power point presentation inside a c# asp.net web application?</p>
c# asp.net
[0, 9]
463,384
463,385
Storing an inline style into jquery variables
<p>I have the following img tag,</p> <pre><code> &lt;img id="image1" src="URL" alt="image1" name="image1" width="137" height="119" border="0" style="position: relative; left: -355px; top: 62px;" &gt; </code></pre> <p>I would like to somehow, onclick, store the following items into seperate variables..</p> <pre><code> style="position: relative; left: -355px; top: 62px;" var left = -355px var top = 62px </code></pre> <p>Is that possible? Thank you!</p>
javascript jquery
[3, 5]
4,845,313
4,845,314
JQuery add hidden element to form programmatically
<p>This is really getting to me now.I have a form that loads when the page loads.In my jquery 'ready' function I append a hidden to that form like so : </p> <pre><code>$("&lt;input id='thehidden' type='hidden' name='thehidden' value='hiddenval'&gt;").appendTo("#MenuForm") </code></pre> <p>When I check the form content with firebug i can see the element is added.</p> <pre><code>["$(\"#MenuForm\").children()"] is [div, input#thehidden hiddenval] </code></pre> <p>All good so far.When I submit this form and try and read the elemet again,i can't get the value of the new hidden val I added.</p> <pre><code>alert($('#thehidden').val()) </code></pre> <p>is undefined</p> <p>Any help would be appreciated</p>
javascript jquery
[3, 5]