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
5,850,162
5,850,163
Jframe inside C# form
<p>I'm trying to add a Java JFrame into a container inside a C# form. The JFrame I have is implementing a AppletStub aswell, and I've used IKVM to do the interopting, but the problem I get is that the Applet loaded in the AppletStub freezes. But it works perfect fine when its not interopting with C#. This is the only thing I'm doing btw, trying to load that JFrame into my C# form, and pass 2 integer values to the JFrame. Please let me know if there is a simple solution to do this...?</p> <p>Also, let me know if this will be alot more easier in C++ rather then C#, so I can just do Java -> C++ -> C# ~ Thanks</p>
c# java
[0, 1]
481,168
481,169
Javascript included but alert() function not working
<p>I've included the javascript by </p> <pre><code>wp_enqueue_script('slider', plugins_url( 'slider.js', __FILE__ ) ); </code></pre> <p>with just a simple</p> <pre><code>$(document).ready(function () { alert("alert"); }); </code></pre> <p>It shows up in the browser but doesn't prompt me with "alert".</p> <p>PS: Forgot to mention I've also included the jquery, but still not working.</p> <pre><code>wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); </code></pre> <hr> <p>In addition to the answers, I also had to tell wordpress that my script depends on jQuery</p> <pre><code>wp_enqueue_script( 'slider', plugins_url( 'slider.js', __FILE__ ),array('jquery') ); </code></pre>
jquery javascript
[5, 3]
4,402,356
4,402,357
Does setting of width and height only work in jquery if the element is visible?
<p>Does setting of width and height only work in jquery if the element is visible? Unless I do show - nothing gets resized, however this is causing flickering. Is there a way to make it work even when the element I want to resize or its container is not visible?</p>
javascript jquery
[3, 5]
5,327,754
5,327,755
Dynamic value in popup
<p>PHP Code:</p> <pre><code>$cour = mysql_sql('SELECT c.id, c.category, cc.name, c.fullname,c.summary FROM mdl_course c, mdl_course_categories cc WHERE c.id = cc.course'); echo '&lt;table&gt;'; foreach($cour as $cou) { $coursename = $cou-&gt;fullname; $courseid = $cou-&gt;id; $summary = $cou-&gt;summary; echo ' &lt;tr style="border:1px solid #BACC82;"&gt; &lt;td&gt;&lt;a onclick="ShowHide(); return false;"&gt;'.$coursename.'&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;!--SHOW AND HIDE DIV--&gt; &lt;div id="enclosure" style="display:none;"&gt;'.$summary.'&lt;/div&gt;'; } echo '&lt;/table&gt;'; </code></pre> <p>Javascript code:</p> <pre><code>function ShowHide(id) { $('#enclosure_'+ id).animate({"height": "toggle"}, {duration: 1000}); } </code></pre> <p>This was working as you guys suggested on Stackoverflow, but I need in the same manner as a small popup (with smooth) in jQuery. Now the summary informaion should display in a popup Could anyone help me?</p>
php jquery
[2, 5]
2,233,694
2,233,695
how can i check how many '.classname' items are?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/5706106/count-elements-with-jquery">Count elements with jQuery</a> </p> </blockquote> <p>hi there,</p> <p>i was considering, using jquery,</p> <pre><code>var n = 0; $('.className').each(function(){ n = n+1; }); </code></pre> <p>Any better solution in mind?</p> <p>thanks!</p>
javascript jquery
[3, 5]
2,852,318
2,852,319
File.Exists using the wrong root path?
<p>In my c# class I wrote I have a photo property that returns the photo source if the image exists (nothing or default image otherwise). In my code I use:</p> <pre><code> public string Photo { get { string source = "~/images/recipes/" + id + ".jpg"; if (File.Exists(source)) return "~/images/recipes/" + id + ".jpg"; else return ""; } } </code></pre> <p>If I get the FileInfo() information for this image I see that I tries to find this image in the following directory: <em>C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\~\images\recipes</em></p> <p>Of course the image is not located in that directory and File.Exists is returning me the wrong value. But how can I fix this?</p>
c# asp.net
[0, 9]
1,079,461
1,079,462
accessing browser history via javascript to implement custom back and forward buttons
<p>I have custom back and forward buttons on my page.</p> <p>The back button should be enabled only if the history.back page is from my website.</p> <p>Similary the forward button should be enabled only if the history.forward page belongs to my website.</p> <p>document.referrer returns the name of the previous page.</p> <p>How do I get the name of the forward page?</p>
javascript jquery
[3, 5]
1,928,835
1,928,836
Publishing website project, database date format will be the same or converted to the default host date format?
<p>I'm developing a web application and I'm using a gridview and sqldatasource.</p> <pre><code>I have some columns with type : Date. </code></pre> <p>In my control panel I set the format of the date for my country wich is : <code>dd.mm.yyyy</code> </p> <ul> <li>In this case , the Table Data of the database in c# will have the format for date : <code>dd.mm.yyyy</code></li> </ul> <p>I'm planing to publish my website on a host when I'll finish the project.</p> <ul> <li>But my question is :</li> </ul> <p>If in my database the columns with Date are in format dd.mm.yyyy , if I publish the database and use it with the website on the host , the dates will be dd.mm.yyyy or converted to the default format of the host?</p>
c# asp.net
[0, 9]
4,047,410
4,047,411
How to select the correct id for the specific button pressed in dynamic table 2 PHP JQUERY
<p>I have a very similar problem, but i cant seem to figure it out, it could be that i have been trying to do this for the past 14 hours... my problem is: I cant get this to return the corresponding customer id, it just always returns the first one. here is the code</p> <pre><code>&lt;div id="saveAdButtons"&gt; &lt;?php if ($limit == 5){ for ($i=0;$i&lt;$count;++$i){ $results33 = mysql_query("SELECT * FROM saved_ads WHERE customer_id='{$contact_id}'") or die(mysql_error()); $data2222 = mysql_fetch_array($results33); $idCheck = $data2222['customer_id']; if($ids[$i]!=$idCheck){?&gt; &lt;button name="contact_ids[]" class="contact_ids" id="contact_ids0" title="Save Ad: &lt;?php echo $ids[$i]?&gt;" value="Save Ad" &gt;&lt;/button&gt; &lt;input name="parse" id="SaveBtnID" type="hidden" value="&lt;?php echo $ids[$i] ?&gt;" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;?php } } }?&gt; </code></pre> <p>Here is JQUERY code</p> <pre><code>$(document).ready(function(){ $( "#contact_ids0" ).live('click',function(event){ </code></pre> <p>what should I put here??.. i have tried </p> <pre><code> var tr = $(this).closest('I DONT KNOW WHAT TO PUT HERE'); // tr.find('#I DONT KNOW WHAT TO PUT HERE').empty(); // var vidid = tr.find('#SaveBtnID').val(); </code></pre> <p>but it returns the first id only, no matter which button i click :(</p> <pre><code>var datastr2="ids="+CusID; alert(CusID); return true; }); }); </code></pre> <p>thank you in advance! :)</p>
php jquery
[2, 5]
2,370,432
2,370,433
How to define distance in time in words in pure javascript?
<p>I would like to include very common feature in my web application. I would like the times/dates be written as the distance of time from now in words, for example (2 hours ago). </p> <p>Rails have excellent implementation of this functionality, but I need something like that written in pure javascript. The problem is, that lots of pages in my application are cached, and the only thing that would change is the actual time. </p> <p>Are there any extended libraries in JS which could translate a date to a distance of time in words? </p>
javascript jquery
[3, 5]
1,323,595
1,323,596
issue with custom gridview android
<p>I have developed an app in which I display data in <code>Gridview</code>. All data comes from local storage. I am able to display each data correctly and there are no issues with it. But when I have scroll the <code>Gridview</code> and goto the bottom and getback to <code>Top</code>,it changes position. And sometimes when I scroll down and getback to Top, a blank screen appears on screen;no data found at all! So I thought that there is issue with <code>getView()</code>. I am unable to figure out the problem</p> <p><strong>Code of getView() ::</strong> </p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ViewHolder viewholder; // LayoutInflater inflator = activit.getLayoutInflater(); if(convertView == null) { // recycled view is null so create it. viewholder = new ViewHolder(); convertView = inflator.inflate(R.layout.griedviewrow, null); viewholder.imgvGridicon = (ImageView) convertView.findViewById(R.id.imgvGridicon); viewholder.txtGridItemlabel = (TextView) convertView.findViewById(R.id.txtGridItemlabel); convertView.setTag(viewholder); } else { viewholder = (ViewHolder) convertView.getTag(); } if ((lstpinfo.get(position).appname.toString()) != null) { viewholder.imgvGridicon.setImageDrawable((lstpinfo.get(position).icon)); viewholder.txtGridItemlabel.setText(lstpinfo.get(position).appname.toString()); } return convertView; } </code></pre> <p><strong>Update:: Intitalize of inflater::</strong></p> <pre><code>private LayoutInflater inflator; private ArrayList&lt;PInfo&gt; lstpinfo = new ArrayList&lt;PInfo&gt;(); public GriedViewAdapter(Context cntx, ArrayList&lt;PInfo&gt; lstpinfo) { activit = cntx; inflator = LayoutInflater.from(cntx); this.lstpinfo = lstpinfo; } </code></pre>
java android
[1, 4]
3,653,729
3,653,730
Android PHP server
<p>i working in Android app that send information to a php server. the Android app should login first then if the login successful start to send the data this is the php page (login):</p> <pre><code>&lt;?php $data = file_get_contents('php://input'); $json = json_decode($data); $id=$json-&gt;{'im'}; $con = mysql_connect('localhost','root','1111'); mysql_select_db('root') or die(' '); $sql = "SELECT name FROM chiled WHERE `im` LIKE $id "; $query = mysql_query( $sql ); $a=mysql_fetch_row($query); print(json_encode($a[0])); $n=$json-&gt;{'name'}; mysql_close(); ?&gt; </code></pre> <p>the php page receive the id from the android app then check if it in the DB then send response to the android app, according to the received response the app will decided if the login successful or not ,if the login successful then start send the data. what do you think the best way to start to receive the data in the php server(if the login successful )?can i put a new page to receive(create a new connection in android app that connect to another page then start to send the data) the data or i can do that in the same login page .</p>
php android
[2, 4]
4,113,916
4,113,917
jQuery appentTo and reset/reorder position function?
<p>I am appending into a "div" several "img" tags, using appendTo() which seems to be working great. now what if I want to remove an image and reorder them? To make my self more clear, I am keeping the image divs in an array. When I delete an element from that array, I also want the "visual" images to be reordered. So I have this:</p> <pre><code>[img_1] [img_2] [img_3] -&gt; in a div </code></pre> <p>now if I delete "image div" 2 I want to get this:</p> <pre><code>[img_1] [img_3] -&gt; in a div </code></pre> <p>and NOT this:</p> <pre><code>[img_1] [img_3] -&gt; in a div </code></pre>
javascript jquery
[3, 5]
1,839,271
1,839,272
Get HREF property
<pre><code>&lt;a class="some" id="1" href="/s/1/2"&gt;link 1&lt;/a&gt; &lt;a class="some" id="2" href="/s/2/3"&gt;link 1&lt;/a&gt; &lt;script&gt; $(document).ready(function() { $('.some').click(function() { var id = this.id; var link = $(this).css('href'); alert(id); alert(link); return false; }); }); &lt;/script&gt; </code></pre> <p>When I click on the link I get correct id, but "undefined" link. What is the problem and how can I fix it?</p>
javascript jquery
[3, 5]
979,375
979,376
Are there any FOSS libraries that are the result of ripping bits out of Android for plain Java?
<p>Before you jump, yes i have heard of the recent project to make Android proper run on a plain JRE. This question is not about Android the platform but rather about leveraging the great stuff thats in there, and may be useful in parts, eg the bitmap/graphics stuff.</p> <p><em>PS</em> Yes lets ignore the obvious bits that dont make sense such as telephony etc.</p>
java android
[1, 4]
2,656,412
2,656,413
How to handle Confirm() of Javascript as per my following requirements?
<p>My Requirement is this. Steps:-</p> <ol> <li>On Client Click (button)</li> <li>Disabled the Button. </li> <li>Then it should prompt for OK or CANCEL.</li> <li>If OK then fire the OnClick event (Code Behind). </li> <li>If CANCEL then don't make a server-side trip and enable the button.</li> </ol> <p>Following is the code I am using for the button.</p> <pre><code>&lt;asp:Button ID="btn1" OnClientClick="this.disabled=true;return Confirm();" Text="Testing" runat="server" /&gt; </code></pre> <p>But instead of what I am expecting, it is disabling button and prompting Confirmation but if User hits Cancel then button stays as disabled.</p>
javascript asp.net jquery
[3, 9, 5]
3,738,687
3,738,688
Printing last 200 lines from Logcat
<p>I am trying to print the last 200 or so lines from Android Logcat in my app. So far I have been able to get Logcat into a BufferedReader using InputStreamReader. The problem is I don't know how to to jump to the end of the buffered Reader and then read backwards, Or jump to a just above the last 200 lines and print from there. I don't want to do the brute force method where I read the whole log. I am hoping there is a more elegant solution.</p> <p>Thanks.</p>
java android
[1, 4]
4,356,885
4,356,886
Refresh a webpage automatically from within a loop
<p>I have a loop that runs through a variety of websites and I'd like to put some kind of a postback in the loop so that each time through a textbox would refresh with the url that is currently being considered. I don't know AJAX yet so I'd like to redo the webpage. I am currently using a session variable to hold data for display between page loads. I have tried</p> <p>1) Response.Redirect("Default.aspx");</p> <p>2) Server.Transfer("Default.aspx");</p> <p>3) Page_Load(sender, e);</p> <p>4) this.RaisePostBackEvent(URLTextBox.Text);</p> <p>but they don't work, possibly because I am not implementing them properly. I'd like to watch the current situation as it is updated within the loop. Any ideas? Thanks, bsperlin</p>
c# asp.net
[0, 9]
5,867,692
5,867,693
How to check 'undefined' value in jquery
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/27509/detecting-an-undefined-object-property-in-javascript">Detecting an undefined object property in JavaScript</a><br> <a href="http://stackoverflow.com/questions/2778901/javascript-undefined-compare">javascript undefined compare</a> </p> </blockquote> <p>How we can put a check for undefined like:</p> <pre><code>function A(val){ if(val == undefined) //do this else //do this } </code></pre>
javascript jquery
[3, 5]
1,918,305
1,918,306
Javascript loader
<p>I have an image carousel on my page with some fairly small images. the issue is not with the images but with the script itself. I want to display a javascript loader image while the entire plugin is loaded and is ready for action. </p> <p>when i launch the page, the carousel <code>&lt;li&gt;</code> first display like a normal list, then get formed into the carousel. i want to avoid that and display a loader image while the entire thing is loaded. </p>
javascript jquery
[3, 5]
3,950,076
3,950,077
insertAfter clicked element
<p>I have the following markup;</p> <pre><code>&lt;div class="model-timeline"&gt; &lt;p&gt;Text&lt;/p&gt; &lt;div class="timeline"&gt; &lt;div class="span-blank-5"&gt;&lt;/div&gt; &lt;div class="time-span-1"&gt;&lt;/div&gt; &lt;div class="time-span-2"&gt;&lt;/div&gt; &lt;div class="time-span-2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="model-timeline"&gt; &lt;p&gt;Text&lt;/p&gt; &lt;div class="timeline"&gt; &lt;div class="span-blank-5"&gt;&lt;/div&gt; &lt;div class="time-span-1"&gt;&lt;/div&gt; &lt;div class="time-span-2"&gt;&lt;/div&gt; &lt;div class="time-span-2"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>and script;</p> <pre><code> $('[class*="time-span"]').on('click', function () { $('.model-detail-panel').insertAfter('.timeline').slideDown('fast', function () { $('html,body').animate({ scrollTop: $(this).offset().top }, 500); }); }); </code></pre> <p>I need to insert a new div 'model-detail-panel' after clicking one of the time-span classes.</p> <p>This new div should appear after the timeline class and only inside the parent div of the timeline class that was clicked.</p> <p>The code I have is inserting the div, but its adding it after every timeline class which is not the behaviour I need.</p> <p>How can I modify my code to target only the clicked parent of the element, hence inserting the div once?</p> <p>Thanks in advance.</p>
javascript jquery
[3, 5]
2,877,448
2,877,449
window.showModalDialog dialogWidth property not working in IE
<p>I have a 2.0 framework ASP.Net page that runs in our controled environment (IE 7). The <code>dialogWidth</code> property seems not to be working. The scrip is as follows:</p> <pre><code>var win = window.showModalDialog ('Page.aspx', 'PopupPage', 'dialogHeight:600px,dialogWidth:800px,resizable:0'); </code></pre> <p>The <code>dialogHeight</code> works fine but no matter what I change the <code>dialogWidth</code> to - it seems to be limited to a width of about 250px. In the configuration above the modal popup is higher that it is wide - even though width is 800 and height is 600.</p>
asp.net javascript
[9, 3]
5,979,998
5,979,999
IE7 Jquery v1.7.1 show syntax error
<p>In my website i am using jquery v1.7.1 <br/> In other browers(IE9,IE8) it works fine But in IE7 it's not working. It showing the following Syntax error.</p> <pre><code>SCRIPT5022: Syntax error, unrecognized expression: hover jquery.min.js, line 3 character 14659 </code></pre> <p>If you guys have any idea about this please tel me to fix this.</p>
javascript jquery
[3, 5]
3,649,436
3,649,437
Setting value onClientClick() and Getting that on onClick()
<p>i have a asp:button and a asp:hiddenfield like this..</p> <pre><code>&lt;asp:Button ID="btn_CreateContent" runat="server" Text="Upload" Height="25px" OnClientClick="UploadNewContent(event)" OnClick="btn_CreateContent_Click" /&gt; &lt;asp:HiddenField runat="server" ID="hdn_ContentID"&gt;&lt;/asp:HiddenField&gt; </code></pre> <p>I am setting value of "hdn_ContentID" onClientClick() with jQuery..</p> <pre><code>$('#ctl00_GspaceOnlinePlaceHolder_hdn_ContentID').val(SomeID); </code></pre> <p>and then i am trying to get that value onClick() on server side</p> <pre><code>protected void btn_CreateContent_Click(object sender, EventArgs e) { string FileName = hdn_ContentID.Value; } </code></pre> <p>but i am not getting that value.. i.e. getting FileName = "";</p> <p>please help..</p>
jquery asp.net
[5, 9]
5,545,420
5,545,421
replace a string in a youtube embed code using jquery
<p>I have here an embed code from youtube and Im using a plugin to show that video</p> <pre><code>&lt;object width="350" height="200"&gt; &lt;param name="allowfullscreen" value="true" /&gt; &lt;param name="allowscriptaccess" value="always" /&gt; &lt;param name="movie" value="http://www.youtube.com/v/KVu3gS7iJu4&amp;autoplay=0&amp;loop=0&amp;rel=0" /&gt; &lt;param name="wmode" value="transparent"&gt; &lt;embed src="http://www.youtube.com/v/KVu3gS7iJu4&amp;autoplay=0&amp;loop=0&amp;rel=0" type="application/x-shockwave-flash" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" width="350" height="200"&gt; &lt;/embed&gt; &lt;/object&gt; </code></pre> <p>My problem is I cannot edit those codes, I need to change the "&amp;" sign to "<code>&amp;amp;</code>" for w3c validation, is this possible using jquery</p> <p>here is My sample fiddle which is not working and dont know how <a href="http://jsfiddle.net/kfX9M/" rel="nofollow">http://jsfiddle.net/kfX9M/</a></p>
php javascript jquery
[2, 3, 5]
457,048
457,049
Call page load event after every 10 seconds
<p>I'm having a scenario to call load event after every 5 seconds or 10 seconds someone help me, with some related links.</p>
c# javascript asp.net
[0, 3, 9]
3,830,088
3,830,089
What is the best way to cut the file name from 'href' attribute of an 'a' element using jQuery?
<p>For example I've got the simple code:</p> <pre><code>&lt;ul class="list"&gt; &lt;li&gt;&lt;a href="http://www.aaa.com/bbb/ccc/file01.pdf"&gt;Download file 01&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.bbb.com/ccc/ddd/file02.pdf"&gt;Download file 02&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>and I wish to store in variables only the file names: file01.pdf and file02.pdf, how can I cut them?</p> <p>Many thanks for the help.</p> <p>Cheers.</p>
javascript jquery
[3, 5]
924,088
924,089
Pull in random form for testing
<p>I would like some help in starting this project, some advice on where to look. On one of my sites we have a jQuery Tools powered overlay that holds a contact form. The form is located in the /forms directory. I would like to create several (5-6) forms that have different layouts and test which works best with our users. </p> <p>I think that creating a "control" file in php, and linking to it instead of directly to a form to pull in a random form would work.</p> <p>I am not sure about the code, but know that I need to: - read the directory with opendir and readdir? - add FILES to an array (use is_dir ) - generate a random number between 0 and the count() of the array - include the specified random file. - call this function on the click event of the link either inline or jQuery </p> <p>Would I do this in a separate file? Any advice is much appreciated. Let me know if I need to clarify or add more details.</p> <p>Thank you.</p>
php jquery
[2, 5]
5,006,876
5,006,877
Beginners question: Variable in Javascript
<p>I'm new to javascript and cant get this little thing to work. (all external scripts a of course loaded)</p> <p>I have this jQuery script:</p> <pre><code>$('a.Link').click(function(){ autoComp('City'); }); function autoComp(strFormName) { var Company = 'Adobe Apple Microsoft'.split(" "); var City = 'London Paris Berlin'.split(" "); $('#'+strFormName).autocomplete(strFormName) } </code></pre> <p>I cant get it to work. I've discovered that the problem is the last "strFormName" after .autocomplete</p> <p>Appreciate all the help I can get.</p>
javascript jquery
[3, 5]
4,949,032
4,949,033
Select element by attribute only
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4333720/jquery-is-there-a-way-to-select-all-elements-on-the-page-with-a-specific-attrib">JQuery, is there a way to select all elements on the page with a specific attribute?</a> </p> </blockquote> <p>My code</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script&gt; $(function(){ $("No idea what to write here").remove(); }); &lt;/script&gt; &lt;button data-fun="a"&gt;Remove&lt;/button&gt; &lt;div data-fun="b"&gt;Remoave&lt;/div&gt; &lt;span data-fun="c"&gt;Remdove&lt;/span&gt; &lt;strong data-fun="d"&gt;Rdemove&lt;/strong&gt; &lt;b data-fun="e"&gt;Remosve&lt;/b&gt; &lt;p data-fun="f"&gt;Remoe&lt;/p&gt; &lt;div&gt;Not Remove&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I want to remove all the elements that have the <code>data-fun</code> attribute no matter what the element is and value of <code>data-fun</code> is.</p>
javascript jquery
[3, 5]
1,602,599
1,602,600
how does this jquery count get updated?
<p>I am trying to figure out how this javascript works. <a href="http://www.pickhealthinsurance.com/u/search?age=25&amp;people=1&amp;smoker=false&amp;zip=20001" rel="nofollow">On this website</a> that someone else created, if you check the HMO Plan type checkbox in the top left corner, the count changes for Maternity, Prescriptions, and HSA Eligible.</p> <p>In the source I see code such as </p> <pre><code>data-key="hsa", id="f_hsa", name="f_hsa" &lt;span class "count"&gt;10&lt;/span&gt; data-hsa='0' / data-hsa='1' </code></pre> <p>If I change a row to have data-hsa='1' and not '0', I see the count changes. I am trying to figure out where the code that is retrieving the new count is. The function has to be somewhere, but I don't see it.</p>
javascript jquery
[3, 5]
3,741,048
3,741,049
Is there any way I could auto-fill the fields on this registration page?
<p>I have a link to a registration page: <a href="https://www.website.ws/orderflow/index.dhtml?sponsor=gditraffic&amp;src=DSP_66&amp;last_page=DSP_66" rel="nofollow">Registration Page</a></p> <p>When I take users to the page, I'd like to save them a load of time, frustration and calories to burn, by filling in the fields automatically.</p> <p>The whole form is ran in JavaScript and JQuery by the looks of things, but I have no idea where I would start to actually do something like this. I have the users details (to input into the fields) in a SQL db, so some PHP parsing to start off with.</p> <p>Any ideas where I'd go from there?</p> <p>SORRY,forgot to mention: I don't have any moderation access to the Reg page.</p>
javascript jquery
[3, 5]
5,859,458
5,859,459
Saving/ Reading an arrayList of Points to/from a file
<p>Q1 - I have a string like this - </p> <p>strPoints = "[Point(10,20), Point(20,30), Point(30,40)]"</p> <p>What is the best way to convert it into arrayList like this - </p> <p>arrPoints = [Point(10,20), Point(20,30), Point(30,40)]</p> <p>Q2 - If I have an arrayList of points like this - arrPoints = [Point(10,20), Point(20,30), Point(30,40)]</p> <p>What is the best way to store it into a file so that it can be easily readable later? - </p> <p>a) Store whole arrayList as a string in some .txt file</p> <p>b) Store whole arrayList as an object in some .ser/ .dat file. Could you please provide an example for serialization/de-serialization in this case?</p> <p>c) Store points as a node in some .xml file</p> <p>d) Other way</p> <p>Regards,</p> <p>Prasoon</p>
java android
[1, 4]
4,263,344
4,263,345
How to run Android (command line) application in PHP script?
<p>On my Android phone are a Web Server with PHP-plugin, and are a simple HelloWorld application. In Android Terminal Emulator run this application:</p> <p>am start -n com.hello/.Android_HelloWorldActivity</p> <p>So this very good. I wrote a PHP script, but my problem is, that with PHP script no start application:</p> <pre><code>&lt;?php echo("Hello World!"); $output = shell_exec('am start -n com.hello/.Android_HelloWorldActivity'); echo "&lt;pre&gt;$output&lt;/pre&gt;"; ?&gt; </code></pre> <p>Thanks for answer.</p>
php android
[2, 4]
2,722,879
2,722,880
"document.getElementById" return null after a "document.write"
<p>I am using a javascript code to write on my document : </p> <pre><code>nr = Math.floor(Math.random()*99999999999); document.write('&lt;div class="wads-content-' + nr + '" id="flashcontent' + nr + '"&gt;'+ flashrequired +'&lt;/div&gt;'); var flashcontent = document.getElementById('flashcontent' + nr); </code></pre> <p>In my page, i execute this script twice. The first time everything works, but the second time, flashcontent is null, but i know it's wrong because I just write the element before the : </p> <pre><code> document.getElementById </code></pre> <p>Any idea what is happening?</p>
javascript jquery
[3, 5]
3,119,222
3,119,223
ToolTip Question
<p>OK, so I have a checkboxlist (which is databounded) and I'm displaying a tooltip icon next to each checkbox. This code displays a css tooltip on hove rfor the icon. I want to pass a different message for each icon: project duration, customer involvement, etc. Atm, the same message is displayed when I hover over each of the icons. How can I fix this? Thanks!</p> <pre><code>protected void agilefactors_DataBound(object sender, EventArgs e) { var checkBox = sender as CheckBoxList; if (checkBox != null) { foreach (ListItem listItem in checkBox.Items) { listItem.Text = string.Format("{0} &lt;span class='link'&gt;&lt;a href='javascript: void(0)'&gt;&lt;font face='verdana,arial,helvetica' size='2'&gt;&lt;img src='{1}' Height='20' Width='20' /&gt;&lt;/font&gt;&lt;span&gt;&lt;b&gt;Project Duration:&lt;/b&gt;&lt;br/&gt;Ideally, the project should be close to 6 months: much shorter means less iterations, and much longer tends towards long term planning.&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;", listItem.Text, GetImageFor(listItem.Text)); } } } private string GetImageFor(string text) { // return image url for check box based on text. switch (text) { case "Project Duration": return "images/info.png"; case "Customer Involvement": return "images/info.png"; case "Acceptance of Change": return "images/info.png"; case "Team Size": return "images/info.png"; case "Skill of Team": return "images/info.png"; case "Organisational and Reporting Structure": return "images/info.png"; case "Process": return "images/info.png"; case "Documentation Requirements": return "images/info.png"; case "Layout of Workspace": return "images/info.png"; case "Empowered Team": return "images/info.png"; default: return null; } } </code></pre>
c# asp.net
[0, 9]
1,496,109
1,496,110
javascript on click events
<p>Is there any way to get pass the variables from one php page to another using javascript and get the the output of it without loading the page?? Note that variables should pass only using javascript. I</p>
php javascript
[2, 3]
3,752,904
3,752,905
Is it possible to launch an android application activity when the phone starts?
<p>Im attempting to build an android application and one of the key features to this application is for it to be able to launch an activity automatically when the phone starts, I see some apps on my phone that already do this, any help would be great so that I can atleast research this a little better through the sdk, thanks! </p>
java android
[1, 4]
552,717
552,718
saving the state of a SeekBar
<p>I'm struggling to find the best way to implement my update to the database</p> <p>The code below is in the adapter for a list view, so each list item has its own seekbar.</p> <p>The list is of homework assignments so each item has its own degree of completion which I need to persist to a database.</p> <p>I have a <em>business method</em> which can do the database write, it just needs the id of the assignment and the new progress value.</p> <pre><code>private void attachProgressUpdatedListener(SeekBar seekBar) { seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { public void onStopTrackingTouch(SeekBar seekBar) { // need to update database with new progress here! } public void onStartTrackingTouch(SeekBar seekBar) { // empty as onStartTrackingTouch listener not being used in // current implementation } public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { // empty as onProgressChanged listener not being used in current // implementation } }); } </code></pre> <p>the problem I'm having is getting a handle to my AssignmentHandler which deals with the database reads / writes. I can pass the assignment_id to my attachProgressUpdatedListener without any issues but I'm not sure this is the best way to go about it as I haven't got / not sure I want an instance of AssignmentHandler instantiated inside the ArrayAdapter.</p>
java android
[1, 4]
2,309,539
2,309,540
How to get value from hidden column in gridview?
<p>I have a gridview and sqldatasource.</p> <p>When I bounded gridview to sqldatasource ,I've selected all columns from the sql database. And after this , I've removed my self some columns from the gridview.</p> <p>Now , I want to get the value from the removed column without adding the column to the gridview.</p> <p>THanks</p>
c# asp.net
[0, 9]
4,547,303
4,547,304
jQuery - wrap all unwrapped text in p tags
<p>I have a situation where the following code is getting written to my page. </p> <pre><code>&lt;div&gt; Some text here which is not wrapped in tags &lt;p&gt;Some more text which is fine&lt;/p&gt; &lt;p&gt;Blah blah another good line&lt;/p&gt; &lt;/div&gt; </code></pre> <p>In this case it always seems to be the first line which is not being wrapped in p tags which might make the solution to this easier, although it's not every time. Some times it is fine.</p> <p>What I need to do is identify whether the first line is wrapped or not and if not then wrap it. </p> <p>Unfortunately I'm not sure where to start with this problem so any help would be appreciated.</p>
javascript jquery
[3, 5]
548,215
548,216
digital clock using javascript/jquery
<p>Anybody has a suggestion on how to build a textbox that is exactly like the one showing the windows time using javascript and/or jquery?</p>
javascript jquery
[3, 5]
5,428,222
5,428,223
Clear text inside DIV
<p>I'm using the following HTML structure:</p> <pre><code>&lt;div id="clock"&gt;5:30 AM &lt;div id="day"&gt;Wednesday &lt;/div&gt; &lt;div id="date"&gt;14 December &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I update the contents of these elements using Javascript. For "day" and "date" I use <code>$("#day").text(day)</code> and <code>$("#date").text(date)</code>. Because "clock" is a parent element I had to use <code>$("#clock").prepend(clock)</code> to succesfully add the text.</p> <p>The problem with the latter function, is that new text is prepended every time the clock is refreshed, i.e. it builds up a list of clock times. For the first two functions the text is just replaced, like it should. Is there a way to make this happen for the "clock" function as well?</p> <p>EDIT: Sorry, should have been a bit more clear about the clock. Have edited the code, so you understand. BTW, the reason the clock is parent element is that could make the other two elements depend on the clock's position and styling.</p> <p>I also created a jsFiddle: <a href="http://jsfiddle.net/KeyMs92/NZtFA/" rel="nofollow">http://jsfiddle.net/KeyMs92/NZtFA/</a> I left the list building thing (annoyingly) in!</p> <p>BTW, I'm not too sure if <code>function(); setInterval('function()', 1000)</code> is the best way to refresh, so if you something better I'd be happy to know :)</p>
javascript jquery
[3, 5]
3,403,405
3,403,406
Javascript/JQuery event arguments. I don't understand what this 'e' argument is or does
<p>JQuery:</p> <pre><code>this.saveButton.click(function (e) { scope.saveForm(); }); </code></pre> <p>This is a very simple line of JQuery that binds the .click() event to the saveButton object and calls a saveForm function when the event is fired.</p> <p>When this event is called, what is 'e'? I don't think it is ever used.</p>
javascript jquery
[3, 5]
1,239,032
1,239,033
show and hide several random divs using jquery
<p>i am developing a jquery application. I have 10 divs with quotes. I am trying to create a function that takes a number and randomly displays that number of quotes from the 10 divs for 10 seconds and hide the divs. Then repeat the process again. I have not been able to do it please help me out. here is my code:</p> <pre><code>$(document).ready(function(){ var div_number = 4; var used_numbers = new Array(); var todo = setInterval(showQuotes(),3000); function showQuotes(){ used_numbers.splice(0,used_numbers.length); $('.quotes').hide(); for(var inc = 0; inc&lt;div_number; inc++) { var random = get_random_number(); $('.quotes:eq('+random+')').show(); } $('.quotes').fadeOut(3000); } function get_random_number(){ var number = randomFromTo(0,9); if($.inArray(number, used_numbers) != -1) { get_random_number(); } else { used_numbers.push(number); return number; } } function randomFromTo(from, to){ return Math.floor(Math.random() * (to - from + 1) + from); } }); </code></pre>
javascript jquery
[3, 5]
5,830,937
5,830,938
jquery change div
<p>hello my friends I have two div's and I doing this div's change</p> <pre><code>div class="switchLeft div class="switchRight" &lt;tab&gt; (function ($) { $(".switchLeft").click(function () { $(this).toggleClass("switchLeft switchRight"); }); })(jQuery); &lt;/tab&gt; </code></pre> <p>and I have other two div's I changed the div above, I would like to see that change this div</p> <p>I have done this but not working thank you</p> <pre><code>$(".switchLeft").click(function (){ { $(this).toggleClass("switchLeft switchRight"); }); var myClass = $(this).attr("class"); if (myClass == "switchLeft") { $('.advertTabMenu').hide(); $('.searchTabMenu').show(); } else { $('.searchTabMenu').hide(); $('.advertTabMenu').show(); } }; </code></pre> <p>I can not add code to the site</p>
jquery asp.net
[5, 9]
3,193,917
3,193,918
How to integrate Programmatically layout into static layout(.xml)?
<p>can any one help me how to add dynamic tablelayout into static main.xml layout, in the static layout i added the buttons and textview. i want add the dynamic tablelayout into specific linearlayout in the .xml form.</p>
java android
[1, 4]
2,487,937
2,487,938
How can I easily manipulate the state of page elements using PHP?
<p>In ASP.NET </p> <ul> <li><p>I can show a hidden panel that contains many controls by using simple command such as:</p> <pre><code>Panel.Visible = CheckBox1.Checked; </code></pre></li> <li><p>I can disable a Button easily:</p> <pre><code>&lt;asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Submit" Enabled="false" /&gt; </code></pre></li> </ul> <p>But now I'm looking at using PHP. Does it offer a similarly simple technique for hiding / disabling page elements?</p>
php asp.net
[2, 9]
3,308,480
3,308,481
Need to store Ip address of client in a variable
<p>I want to store clients Ip address to a varialbe and want to send it to server.</p> <p>for fetching ip address i am using</p> <pre><code>$.getJSON("http://jsonip.appspot.com?callback=?", function(data){ alert( "Your ip: " + data.ip); }); </code></pre> <p>That is working properly. But storing this value to a variable is not possible for me.</p> <p>Can any one suggest any other code to get ip address of client which can store to a javascript variable and can send to server.</p>
javascript jquery
[3, 5]
2,585,814
2,585,815
How to get the eq() of $(this)?
<p>Here's my code:</p> <pre><code>$('div.menu &gt; ul &gt; li &gt; a').click(function(e) { alert($(this).eq()); e.preventDefault(); }); &lt;div class="menu"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=""&gt;Animals&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Cars&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=""&gt;Sports&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- menu --&gt; </code></pre> <p>My attempt alerts an object object error. If should instead return the numeric place of the link being clicked. For example if you click animals it should alert 1 (not sure if the eq count starts at 0 like arrays in which case it should alert that) and if you click sports it should alert 3 and so on...</p>
javascript jquery
[3, 5]
3,792,526
3,792,527
JQuery Post And Get
<p>I have a method I'm trying to write that can post data to a php file and get the results and return the output in a variable. For some reason, my block of code is not working. </p> <pre><code>function post_get(){ var result = null; $.post("modules/data.php", { "func": "getNameAndTime" }, function(data){ result = JSON.parse(data); }, "json"); return result; } </code></pre> <p>I get this error when using this method</p> <p>SyntaxError: JSON Parse error: Unexpected identifier "undefined"</p>
php javascript jquery
[2, 3, 5]
3,685,702
3,685,703
Selecting all of the checkboxes in jQuery
<p>I have code which displays a person's info in a table (fields:name, surname, address, etc.) and one of the inputs is a checkbox. The code is as follows:</p> <pre><code>$("#table").append('&lt;tr class="trow'+j+'"&gt;'+ '&lt;td class="ids" id="z'+i+'"&gt;'+totrecs+'&lt;/td&gt;'+ '&lt;td&gt;'+member[i].jdate+'&lt;/td&gt;'+ '&lt;td class="users" '&lt;td id="contact'+i+'"&gt;'+member[i].fname+' '+member[i].lname+'&lt;/td&gt;'+ '&lt;td id="myaddress'+i+'"&gt;'+member[i].address1+' '+member[i].town+'&lt;/td&gt;'+ '&lt;td&gt;&lt;input type="checkbox" name="whome" id="showMe'+i+'"'+ 'class="boxes" onclick="getMe('+i+')" /&gt; &lt;/td&gt;&lt;/tr&gt;'); totrecs++; j++; } </code></pre> <p>button - <code>&lt;input type="button" id="selectall" title="Select All" value="Select All" /&gt;</code></p> <p>What I am trying to do is create a function sot that when a certain button is clicked, all of the checkboxes will be selected/checked.</p> <p>I would appreciate any help. Thank You.</p>
javascript jquery
[3, 5]
3,047,011
3,047,012
Count every Buton clicks
<p>the task is to count the number of clicks in a webform.</p> <p>here is the code.</p> <pre><code>public partial class _default : System.Web.UI.Page { int count = 1; private void Page_Load(object sender, System.EventArgs e) { Button btn = new Button(); btn.Text = "Click Me"; btn.Click += btn_Click; Label lbl = new Label(); form1.Controls.Add(btn); form1.Controls.Add(lbl); } protected void btn_Click(object sender, EventArgs e) { count++; //Label1.Text = count.ToString(); } } </code></pre> <p>the problem is that <strong>lbl</strong> is not recognised inside <strong>btn_Click()</strong> ... i cant figure it out... can any one suggest?</p>
c# asp.net
[0, 9]
974,697
974,698
String. Replace function issue!
<p>I think i need some help for the string replace function. This one do not replace and gives me same thing back. What might be the issue, guys?</p> <pre><code>FormattedURl = mysite.com/Merchant.aspx?1=lkdflfdfgj3242 lblclick.Text.Replace("&lt;a class=linkclass href=http://www.mysite.com/ target=_blank &gt; &lt;/a&gt;", "&lt;a class=linkclass href=" + FormattedURL1 + "target=_blank &gt;&lt;/a&gt;"); </code></pre> <p>Thank you in advance!!</p>
c# asp.net
[0, 9]
33,472
33,473
Cannot call method 'toLowerCase' of undefined
<p>I'm trying to refactor my js code to be more dry-conventioned, but stuck this error. Here is my code</p> <pre><code>function validate_field(e){ console.log(typeof e); $(e).focusout(function(e){ var price = $(e).val(); var number = parseInt(price, 10); console.log(number) if (number &lt; 0) { $(e).val(0); } }) } $(function(){ validate_field('#price'); }) </code></pre> <p>According to stacktrace error is somewhere here <code>var price = $(e).val();</code> What am i missing here?</p>
javascript jquery
[3, 5]
2,560,097
2,560,098
Need boolean value isTouched()
<p>I need to detect WHEN the screen is touched. The onTouchEvent method only detects when the finger is moving. I need method which returns boolean value true, when the finger touches screen and returns false, when its not. </p>
java android
[1, 4]
2,737,405
2,737,406
Pass accepts header parameter to jquery ajax
<p>Whwn i inspect the below code in Chrome Console it shows me in Request header </p> <blockquote> <p>Accept:undefined</p> </blockquote> <pre><code>jQuery.ajax({ url: _this.attr('href'), accepts: "application/json; charset=utf-8", }); }); </code></pre> <p>How do i set accept type as json . I dont want to set custom header or use beforeSend </p>
javascript jquery
[3, 5]
1,990,743
1,990,744
Hide the child div of the child div when the parent div is toggled/slideDown
<p>I want to achieve this effect - that when the parent div is toggled/slides down, the child div of the child div should also hide. </p> <p>Right now, I have a parent div, which toggles and shows child div. When I click on the link in the child div, a related child div toggles and shows. However, now if I don't toggle the child div again (to hide it) but directly toggle the parent div, the parent div toggles and hides the child div. But the sub-child of the child div still shows instead of hiding as well. </p> <p>Here is the code: <a href="http://jsfiddle.net/fuz3d/LECWe/3/" rel="nofollow">http://jsfiddle.net/fuz3d/LECWe/3/</a></p> <p>If you click on Settings, it will display the child div with two links - Create Album and Upload. If I click on create album, it will show a sub-child div. If I click on Settings now, its child div will hide, but the sub-child div still shows. </p> <p>How can I make it hidden when the parent div hides its child div? </p> <p>I don't want the sub-child to show on the click of the parent div though. </p>
javascript jquery
[3, 5]
3,302,679
3,302,680
How to call package installer to get the list of installable .apk files?
<p>I am trying to get package installer activity in android so that I can get the list of installable .apk files and choose which one to install in my device. Currently I am trying the following code and its killing the programme.</p> <pre><code>Intent intent = new Intent(); intent.setClassName("com.android.packageinstaller", "com.android.packageinstaller.PackageInstallerActivity"); startActivity(intent); </code></pre> <p>Is there anyway to get the list or where am I making mistake?</p>
java android
[1, 4]
4,508,723
4,508,724
JavaScript hide div element on scroll action
<p>I'm using this bit of code to hide a menu bar when users scroll on a page. It works fine on Chrome 17.0.963.78 but keeps on flickering in and out on other browsers, namely I.E. firefox and safari ..</p> <pre><code>$(window).load(function(){ $(document).scroll(function(){ $('#inner_floating').fadeOut(); var scrollA = $('body').scrollTop(); setTimeout(function(){ if(scrollA == $('body').scrollTop()){ $('#inner_floating').fadeIn(); } }, 100); }) }); </code></pre>
javascript jquery
[3, 5]
5,136,380
5,136,381
How to return variable from jquery function
<p>can you help me please... How to return variable from jquery function</p> <pre><code>var height = $(window).height(); $(window).resize(function(){ var height = $(window).height(); return height; }); setInterval(function() { $('div').append( 'Index: ' + height ); }, 500); </code></pre>
javascript jquery
[3, 5]
1,658,439
1,658,440
Getting all the children of an element that are textareas?
<p>I have a bunch of text areas that are children of a div that has an id. I want to get the text in each of those text areas in an array - so is there a way in jquery to get all the children that are of a certain type(in this case text area) of a certain parent?</p> <p>I've tried this -</p> <pre><code>$("#optionGroup_0").children('input[type=text], textarea'); </code></pre> <p>but that returns an empty array. I think the above method would work if I had the right selector for a text area, but I'm not sure.</p> <p>Can anyone help? </p>
javascript jquery
[3, 5]
1,554,656
1,554,657
How can I play a sound after a query?
<p>I have a store and I want to play a sound just after receiving an order. I store my orders in my database so I want to play a sound after running this check order query:</p> <pre><code>$order_check_query("SELECT * FROM orders WHERE status = 'pending'"); </code></pre> <p>I want to run this query every 5 minutes when I am logged in. If there are any pending orders I want to play a sound for 30 sec to notify me.</p>
php javascript
[2, 3]
4,248,517
4,248,518
using the window object for accessing global user defined objects and using text within html for creating additional specificity
<p>I don't do very much jquery / javascript but wanted to ask for some advice on the following piece. I have tried to cut out as much as possible. Most of this was semi-inherited code with catching a bunch of events just hardcoded in. I'd like to generalized them more by putting the object name in the html and accessing via jquery on processing (by_date, by_popularity). I retriev as string and access the object via window[current_obj]. Is this a good way to do this or am I missing something? Are there preferable ways to introduce specificity. thanks for any advice.</p> <pre><code>&lt;script&gt; var by_date={}; by_date.current_page=1; by_date.per_page=4; var by_popularity={}; by_popularity.current_page=1; by_popularity.per_page=4; $(function(){ $('.previous.active').live('click',function(){ window[current_obj].current_page--; process(window[current_obj]); }); }); function process(game_obj){ //will process and output new items here } &lt;/script&gt; &lt;div class="otherContainer"&gt; &lt;a class='previous active'&gt;Prev&lt;/a&gt;&lt;div style="display:none;"&gt;by_date&lt;/div&gt; | &lt;a class='next'&gt;Next&lt;/a&gt;&lt;div style="display:none;"&gt;by_date&lt;/div&gt; &lt;/div&gt; &lt;div class="topPrevNextContainer"&gt; &lt;a class='previous active'&gt;Prev&lt;/a&gt;&lt;div style="display:none;"&gt;by_popularity&lt;/div&gt; | &lt;a class='next'&gt;Next&lt;/a&gt;&lt;div style="display:none;"&gt;by_popularity&lt;/div&gt; &lt;/div&gt; </code></pre>
javascript jquery
[3, 5]
2,937,832
2,937,833
Android Hacking Prevention
<p>I am putting the final touches on my android app. The app is a full networking game, so it is always using the internet when you are running it. I want to prevent someone from extracting the .apk from the phone, decompiling the code and then changing and extending my classes to do bad things to my server. Here is how the app sets up the networking:</p> <ul> <li>Client connects to the server</li> <li>Server sends client a "session key" that is used for encryption</li> <li>Server and client communicate with encrypted data based on the key they share</li> </ul> <p>Now, I'm worried someone will decompile my code and change it so that they can do whatever they want in the game. Is there a way to make sure the classes haven't been changed? Is there a way to check the size of a .class file during runtime? Anyone have any ideas?</p>
java android
[1, 4]
2,444,642
2,444,643
Jquery Event Handling Question
<p>Say I have this code:</p> <pre><code>$(document).ready(function() { $(".foo").click(processFooClick); } </code></pre> <p>Once the document has loaded, then via javascript I dynamically add a new div with <code>foo</code> class to the document:</p> <pre><code>$("body").append( "&lt;div class='foo'&gt;click..&lt;/div&gt;"); </code></pre> <p>Would this new div also have the event handler automatically applied to it, or would I need to run the event setting code ( $(".foo").click(...) ) again?</p> <p>Would using jquery's <code>live</code> function help with this? If so, how?</p>
javascript jquery
[3, 5]
3,637,268
3,637,269
Continue with PHP or move to Java Framework
<p>I'm building a website for my friend's startup. I'm currently building it on PHP, MySQL, Apache. Everything is going pretty smooth till now, but one of my friend recommends i move to a Java framework because that'd be better when the site becomes bigger. I don't have any Java Knowledge and I have adequate knowledge of PHP but I'm a fast learner</p> <p>Should i continue with PHP (can PHP be used for big sites?) or should i move to a Java Framework? Any suggestions please.</p>
java php
[1, 2]
5,688,288
5,688,289
Get hidden field value Jquery?
<p>I have the following HTML </p> <pre><code>&lt;input type="hidden" name="conf1" value="7th IEEE/IFIP International Conference on Embedded and Ubiquitous Computing (EUC-09)"&gt; &lt;input type="hidden" name="conf2" value="IEEE International Symposium on Parallel and Distributed Processsing with Applications"&gt; &lt;input type="hidden" name="conf3" value="jkhga"&gt; &lt;input type="hidden" name="conf4" value="test"&gt; &lt;input type="hidden" name="conf5" value="The 3rd International Conference on Adaptive Business Information Systems (ABIS'09)"&gt; &lt;input type="text" name="published"&gt; </code></pre> <p>And i am trying to get the values of the hidden fields in to an array using jquery. Here is what i have tried:</p> <pre><code> var conferences = new Array(); conferences[0] = $('#conf1').val(); conferences[1] =$("[name='conf2']").val(); conferences[2] =$("[name='conf3']").val(); conferences[3] = $("[name='conf4']").val(); conferences[4] =$("[name='conf5']").val(); </code></pre> <p>Can anyone direct me on how to read them?<br> Thanks in Advance<br> Dean</p>
javascript jquery
[3, 5]
4,189,094
4,189,095
Help me escape this php/js and stop warning error on zend studio
<p>This shouldn't be too difficult but for the life of my cant sort it out and its driving me mad.</p> <pre><code>$script = " $(document).ready(function(){ $('.row').hover(function() { var id = ($(this).attr('id').replace(/\D/g, '')); $('.row-edit-' + id).css('display', 'block'); }, function() { var id = ($(this).attr('id').replace(/\D/g, '')); $('.row-edit-' + id).css('display', 'none'); }); }); "; </code></pre> <p>So its a bit of jquery inside a php tag, might be horrible to look at but as I'm using it sparingly its not too bad.</p> <p>If anyone here has studio or eclipse could they give it a quick fix?</p> <p>Thanks,</p> <p>Daniel</p>
php jquery
[2, 5]
5,796,043
5,796,044
JavaScript passing the Value to php query
<p>this is my first post here and hopefuly someone will help me fix this problem. I have this mysql query:</p> <pre><code>$query_history = " SELECT ProductProvider AS NameSS, type, StoreOpinionDate AS dating FROM cd_stores WHERE UserFID = '".$row_Profile['UserFID']."' UNION ALL SELECT BrandName AS NameSS, type, BrandOpinionDate AS dating FROM cd_brandopinions WHERE UserFID = '".$row_Profile['UserFID']."' UNION ALL SELECT CommentTitle AS NameSS, type, CommentDate AS dating from cd_comments WHERE UserFID = '".$row_Profile['UserFID']."' UNION ALL SELECT brands.ProductBrand AS NameSS, type, date AS dating from brandtrack INNER JOIN brands WHERE UserFID = '".$row_Profile['UserFID']."' and brandtrack.BrandID = brands.BrandID ORDER BY dating DESC LIMIT 9 "; </code></pre> <p>and follwing javascript:</p> <pre><code>&lt;script type="text/javascript" src="../admin/config/js/jquery/jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#loadmorebutton").click(function (){ $('#loadmorebutton').html('&lt;img src="facebook_style_loader.gif" /&gt;'); $.ajax({ url: "facebook_style_ajax_more.php?lastid=" + $(".postitem:last").attr("dating"), success: function(html){ if(html){ $("#postswrapper").append(html); $('#loadmorebutton').html('Load More'); }else{ $('#loadmorebutton').replaceWith('&lt;center&gt;No more posts to show.&lt;/center&gt;'); } } }); }); }); &lt;/script&gt; </code></pre> <p>now the problem is that when I inside form press submit button the Value "dating" from mysql query is not passed on acebook_style_ajax_more.php page using above JavaScript and Im getting empty value passed. What I need to change inside JS code to make it work?</p> <p>Thanks</p>
php javascript
[2, 3]
5,745,835
5,745,836
Set selection on longClick?
<p>How can I set a long-clicked item as selected? This does not work (item does not maintain selected when clicked):</p> <pre><code>listView.setOnItemLongClickListener(new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) { listView.setSelection(position); return true; } }); </code></pre>
java android
[1, 4]
2,391,010
2,391,011
Extend jQuery plugin/widget object to add method
<p>I often see developers add methods to their own jquery Widget by extending the widget object. I'm not certain I really understand why and would appreciate if somebody could explain.</p> <p>For example, the author(s) of <a href="https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.autocomplete.js#L551" rel="nofollow">jQuery UI Autocomplete Widget</a> add 2 methods to their widget, why didn't they just have it in the original widget object?</p>
javascript jquery
[3, 5]
4,697,368
4,697,369
How to create Multi language website in aspx with database
<p>How to create Multi language website in aspx where database store translations? I search many articles but there is not uniq solution.</p> <p>Anyone have good isea or know any good article?</p>
c# asp.net
[0, 9]
2,979,082
2,979,083
List view Item data insert to a List<> in c# asp.net
<p>My list view ItemTemplate is as follows</p> <pre><code>&lt;a href='&lt;%# getpath(Eval("IMAGE_PATH")) %&gt;' title='&lt;%# Eval("IMAGE_DESCRIPTION") %&gt;'&gt; &lt;asp:Image ID="capty" CssClass="capty" runat="server" AlternateText='&lt;%# Eval("IMAGE_DESCRIPTION") %&gt;' ImageUrl='&lt;%# retriveurl(Eval("IMAGE_PATH")) %&gt;' Height="100px" Width="150px"&gt; &lt;/asp:Image&gt; &lt;/a&gt; </code></pre> <p>my codebehind source is</p> <pre><code>int count=ListView1.Items.Count; List&lt;ImageGallery&gt; _list = new List&lt;ImageGallery&gt;(); for (int i = 0; i &lt; count; i++) { ImageGallery ob = new ImageGallery(); ob.ImageName = ?? ob.Description = ?? _list.Add(ob); } </code></pre> <p>now i want to insert the Eval("IMAGE_DESCRIPTION") data to a ob.Description and ob.ImageName=Eval("IMAGE_ID") .How to do this?</p> <pre><code>List&lt;ImageGallery&gt; _list = new List&lt;ImageGallery&gt;(); for (int i = 0; i &lt; ListView1.Items.Count; i++) { ImageGallery ob = new ImageGallery(); ob.ImageName = ""; ob.Description = " "; _list.Add(ob); } </code></pre>
c# asp.net
[0, 9]
6,030,822
6,030,823
Get number from one to x in a loop?
<p>How do I get all the digits from <code>0</code> - <code>x</code> if x is a variable like so:</p> <pre><code>var x = 5 </code></pre> <p>Then loop then so it logs them all individually by <code>console.log()</code>?</p> <p>I was thinking I could use <code>.each()</code>, but it might make more sense to use something like <code>for</code> or while. I would post code, but I honestly can't think of a good/possible way to do this.</p>
javascript jquery
[3, 5]
3,116,001
3,116,002
Browser History -> Database
<p>I want to fetch history from browser as soon as a web site is loaded in the browser. It should fetch clients' browser info and save it in a database so that admin may check out the website that is frequently opened and can do survey on the data.</p>
c# asp.net
[0, 9]
3,710,758
3,710,759
rename column in a list
<p>in a datatable you can rename column as follows:</p> <pre><code> dt.Column[0].ColumnName="name"; </code></pre> <p>Is it possible to do something similar with <code>list&lt;MyType&gt;</code>? I need to retrun list of objects with modified column names. to bind to a gridview some special way.</p>
c# asp.net
[0, 9]
1,229,666
1,229,667
How to set combination of key codes in javascript
<p>I use this code for replacing <kbd>Enter</kbd> key with <kbd>TAB</kbd> key :</p> <pre><code>function EnterTab() { if (event.keyCode == 13) event.keyCode = 9; return false; } </code></pre> <p>I want to know what can I do if I want replace right arrow key with <kbd>SHIFT</kbd> + <kbd>TAB</kbd>?</p>
javascript jquery
[3, 5]
1,128,843
1,128,844
IE 9 - Object doesn't support property or method 'Format'
<p>need a little help here.</p> <p>I decided to transfer some of my javascript function in one .js file. Those functions are working properly in other browser EXCEPT IE.</p> <p><strong>NOTE:</strong> Code below was store in a separate js file "<strong>my_js.js</strong>"</p> <pre><code>var dialogConfirmed = false; function DialogConfirmation(obj, title, dialogText) { if (!dialogConfirmed) { $('body').append("&lt;div id='dialog' title='" + title + "'&gt;'" + dialogText + "'&lt;/div&gt;"); $('#dialog').dialog ({ height: 150, modal: true, resizable: false, draggable: false, close: function(event, ui) { $('body').find('#dialog').remove(); }, buttons: { 'Yes': function() { $(this).dialog('close'); dialogConfirmed = true; if (obj) obj.click(); }, 'No': function() { $(this).dialog('close'); } } }); } return dialogConfirmed; } </code></pre> <p><strong>Usage</strong></p> <pre><code>&lt;asp:Button ID="btnAlert" runat="server" Text="Alert" OnClientClick="return DialogConfirmation(this, 'Popup Header', 'Popup Body Message');" onclick="btnAlert_Click" /&gt; </code></pre> <p>When clicking the button it throws and error pointing to method "<strong>Format</strong>" </p> <pre><code>**Microsoft JScript runtime error: Object doesn't support property or method 'Format'** </code></pre> <p>But checking my code doesn't use '<strong>Format</strong>'. Any idea on the error? I'm using EI 9 on my workstation.</p>
javascript jquery asp.net
[3, 5, 9]
5,709,934
5,709,935
How to do a clear interval in javascript?
<p>My Code:</p> <pre><code>$(function() { $('a.startSlideshow').click(function() { startSlideShow = window.setInterval(function() { slideSwitch() }, 1000); }); $('a.next').click(function() { if (startSlideShow) { clearInterval(startSlideShow); } nextSlide(); }); }); </code></pre> <p>My Intention:</p> <p>If a user clicks the startSlideshow link the slideshow function is executed every 1 seconds.</p> <p>If the user clicks the next link, the slideshow function is stopped IF IT HAS ALREADY BEEN EXECUTED.</p> <p>To be able to detect this, I stored the set interval as a variable. However when I check for it:</p> <pre><code> if (startSlideShow) { clearInterval(startSlideShow); } </code></pre> <p>It doesn't work. Right now my code works if I click on the start slideshow link before clicking next. But if the slideshow function was never started (i.e. I never clicked that link first but clicked next from the start) the code fails. </p> <p>basically this is causing the code to break for some reason when startSlideshow var hasn't been defined:</p> <pre><code> if (startSlideShow) { clearInterval(startSlideShow); } </code></pre> <p>I did try other ways of checking to see if that variable has been set, but all failed. How to solve this?</p>
javascript jquery
[3, 5]
2,084,701
2,084,702
How to apply the fore color and bold in message text using c#..net
<p>i am displaying the one confirm box after saving the values like this</p> <pre><code>showalert("Quote has been saved successfully. Your Submission Number is:" + SaveValue ); </code></pre> <p>now i have display the savevalue bold and underline and some fore color, how to apply(using any format and html styles also)</p>
c# asp.net
[0, 9]
3,585,064
3,585,065
question about 128 bit number
<p>can i represent 128 bit number in java? or in c++?</p>
java c++
[1, 6]
4,022,751
4,022,752
Loop through string of dropdown options and select
<p>I want to select an option in a string, where the string will be the contents of a dropdown, but I dont know how to loop through the string as an object please. In the example I would like "Saab" to be selected and the string alerted.</p> <pre><code>var x = '&lt;select&gt;&lt;option&gt;Volvo&lt;/option&gt; &lt;option&gt;Saab&lt;/option&gt; &lt;option&gt;Mercedes&lt;/option&gt; &lt;option&gt;Audi&lt;/option&gt; &lt;/select&gt;'; $.each($(x), function(index, value) { if ($(this).val() == "Saab"){ $(this).attr("selected","selected") } }); alert(x); </code></pre>
javascript jquery
[3, 5]
5,619,142
5,619,143
Simpler way to limit entries in a .each() loop
<p>I've been wanting to know if there's a good, jQuery-esque way to do the following:</p> <pre><code>var count = 0; $("p").each(function() { if (count &gt;= 5) return false; $(this).toggleClass("highlight"); count++; }); </code></pre> <p>Is there a similar function as <code>each()</code> in jQuery that will allow me to set a limit on how many items it'll loop over, or is this the best way of doing things?</p>
javascript jquery
[3, 5]
4,070,087
4,070,088
Javascript / jQuery: Only fire animation if mouse isn't over the element after page load
<p>I have a slider on a page and a function that fades out the previous/next arrows after a few seconds, and then when the user hovers over the slider they fade back in. The only issue is that when the slider loads and the user has their mouse hovering over it, the arrows still fade out, and the user has to move the mouse outside of the arrows and then back in to see them again. Here is my code:</p> <pre><code>var prevNextBtns = $('.direction-nav'), fadeOutArrowsTime = 3000; setTimeout(function () { prevNextBtns.stop().animate({'opacity': '0'}, fadeOutArrowsTime); }, fadeOutArrowsTime); prevNextBtns.closest('.slider-container').hover(function () { prevNextBtns.stop().animate({'opacity': '1'}, 500); }, function () { prevNextBtns.stop().animate({'opacity': '0'}, 500); }); </code></pre> <p>Basically I want the arrows to fade out after <code>3000</code> after the page loads, but <em>only</em> if the user doesn't have their mouse over.</p>
javascript jquery
[3, 5]
2,568,296
2,568,297
Is jQuery appropriate for all javascript purposes?
<p>I just posted a question a few minutes ago about whether jQuery and other frameworks are the new defacto standard in all javascript circumstances (adding my own reasoning for why in some cases it should not be used, such as simple form validation, or for mobile apps, where bandwidth is a premium) and the question was quickly closed and then deleted!</p> <p>This is very troublesome. The question is entirely along the guidelines of what we discuss here. It is rational and it is not speculative. There are reasonable arguments to be had on both sides. Maybe jQuery is so useful that it's worth the increased delay that mobile users will experience, or maybe it's not. Maybe in some cases it's unavoidable and in others total overkill. The bigger question (now that my previous one was basically dead on arrival... it lasted less than 5 minutes) is why is this so controversial? We're not arguing religion... or are we? Have certain topics become sacrosanct? And if so, is that healthy?</p> <p>Before you go screaming for the delete button, consider for a second that there's a case to be made for leaving as many questions alive and thriving as possible, rather than choking off every discussion that you have strong feelings about.</p>
javascript jquery
[3, 5]
3,979,221
3,979,222
How to read a string from a certain word onward in java?
<p>I want to use the uri value of an image (location on disk) in my app. For that, I have to use a string that starts with /sdcard/...</p> <p>I can open up a file manager to help select the picture, but even so every file manager adds something to the front, be it /mnt/sdcard or something else. I can't use substring because the number of letters in front of /sdcard isn't always the same.</p> <p>I want to read this string from /sdcard onward, is there a way I can do this? </p>
java android
[1, 4]
1,540,927
1,540,928
reference an array from using an object name
<p>Lets say I have a function <code>foo(bar){}</code> and the parameter <code>bar</code> accepts a jQuery object. Lets say I pass in <code>bubbleOne</code> as the parameter. </p> <p>Additionally I have an array called <code>bubbleOneDetails[]</code> that holds a lot of information about the <code>bubbleOne</code> object.</p> <p>How can I "reference" the array <code>bubbleOneDetails[]</code> only using my jQuery object <code>bubbleOne</code> ?</p> <p>basically I need something like "bubbleOne"+"Details"<a href="http://jsfiddle.net/77S98/3/" rel="nofollow">1</a>;</p> <hr> <p><strong>EDIT:</strong></p> <p>I have <code>function doAnimations(bubbleObject)</code></p> <p>I pass in <code>leftBubble</code> where <code>leftBubble = $('#leftBubble')</code></p> <p>I also have <code>leftBubblePrams = ["115px", "111px", "0px", "0px", "0.0", "37px"]</code></p> <p>I need to be able to do something like this</p> <pre><code>bubbleObject.animate({margin-top:'bubbleObject.Prams[0]'}); </code></pre> <p><a href="http://jsfiddle.net/77S98/3/" rel="nofollow">Fiddle</a></p>
javascript jquery
[3, 5]
1,292,737
1,292,738
Disable click if class ="X", jQuery
<p>Im trying to build a tabbed content box, and im wondering if its possible that i can disable 1 link with a specific class, such as 'disabled' </p> <p>I read somewhere about a function called preventDefault, would this work?</p> <p><a href="http://jsfiddle.net/Ssr5W/" rel="nofollow">http://jsfiddle.net/Ssr5W/</a></p>
javascript jquery
[3, 5]
2,848,196
2,848,197
converting jquery to pure javascript
<p>I have a function that creates an image with the canvas object. The last line of the function says this:</p> <pre><code>$('body').css({ 'background-image': "url(" + Canvas.toDataURL("image/png") + ")" }); </code></pre> <p>I'm looking to convert this line into pure javascript to remove the jQuery dependency. Any suggestions?</p> <p>Thanks.</p>
javascript jquery
[3, 5]
1,822,645
1,822,646
Illegal XML character
<p>I have the following table row:</p> <pre><code>&lt;tr id="trInbox" runat="server" class="normal" style='cursor:pointer; font-weight:&lt;%# StyleBold(Convert.ToBoolean(Eval("inbRead")) ) %&gt;' onclick='selectedRow(this,&lt;%# Eval("INBID") %&gt;)' onMouseOver="if(this.className!='selected') this.style.backgroundColor='#E2E1F4';" onMouseOut="if(this.className!='selected') this.style.backgroundColor='#FFFFFF'"&gt; </code></pre> <p>But, after I run this, I get the following error:</p> <blockquote> <p>illegal XML character [Break On This Error] </p> <p>selectedRow(this,&lt;%# Eval("INBID") %>)</p> </blockquote> <p>Can you tell me what syntax am I missing?</p>
c# asp.net
[0, 9]
2,454,698
2,454,699
In an Asp.net MVC view, how do I use jQuery to parse the XML just returned from a controller
<p>In my MVC view (using VS 2012 RC), I'm attempting to parse the XML freshly returned from my Controller. Here is my view code:</p> <pre><code>@model RzMvc.Models.PortfolioResponse @{ ViewBag.Title = "PortfolioList"; } &lt;script type="text/javascript"&gt; $(displayXmlResponse); function displayXmlResponse(){ var resp = $("#xmlResp"); $("#xmlTest").append(resp.children()); var xml = $("xmlResp").text; xmlDoc = $.parseXML(xml), $xml = $(xmlDoc), $title = $xml.find("portfolioSummary"); $("#xmlTest").append($title.text()); } &lt;/script&gt; &lt;h2&gt;PortfolioList&lt;/h2&gt; &lt;div&gt; &lt;p id="xmlTest"&gt;&lt;/p&gt; &lt;p id="xmlResp" &gt;@Model.XmlPortfolioResponse&lt;/p&gt; &lt;/div&gt; </code></pre> <p>The browser output looks like this:</p> <blockquote> <p>PortfolioList</p> <p>Portfolio Listing</p> <p>System.Xml.XmlDocument</p> </blockquote> <p>Any guidance would be greatly appreciated. Here's part of my Controller code:</p> <pre><code> public ActionResult PortfolioList() { XmlDocument xmlResponse = new XmlDocument(); xmlResponse.LoadXml(portfoliosResponse); var portf = new PortfolioResponse { XmlPortfolioResponse = xmlResponse }; return View(portf); } </code></pre> <p>Model code is:</p> <pre><code>namespace RzMvc.Models { public class PortfolioResponse { public XmlDocument XmlPortfolioResponse { get; set; } } } </code></pre>
jquery asp.net
[5, 9]
3,764,736
3,764,737
Check list box before entering a record
<p>In <code>ASP.NET/C#</code> how to check if the <code>listbox</code> has a duplicate value before entering a value from <code>textbox</code>.</p> <p>I tried</p> <pre><code>If(ListBox1.Items.Contains(TextBox1.Text)) { // do nothing } else { ListBox1.Items.Add(TextBox1.Text); } </code></pre> <p>I am getting error at first line.</p>
c# asp.net
[0, 9]
5,674,323
5,674,324
Running a script based on a dynamically generated DOM element
<p>I'm working with a third-party product. It uses JavaScript (non-JQuery) code on the page to generate DOM elements on the fly.</p> <p>Is it possible to run a jQuery script whenever this third-party code generates a DOM element matching a given selector?</p> <p>To explain in another way, I don't want to try and integrate with that code. I just want to watch for certain elements to be created, which is the cue to run my own custom jQuery.</p>
javascript jquery
[3, 5]
211,695
211,696
Use timertask to update clock each X seconds?
<p>I'm trying to update my digital clock using timertask. I have created a function called updateClock() which sets the hours and minutes to the current time but I haven't been able to get it to run periodically. From what I've read in other answers one of the best options is to use timertask however I haven't been able to make any example I found online work inside an Android activity.</p> <p>This is what I've written so far:</p> <pre><code>public class MainActivity extends Activity { TextView hours; TextView minutes; Calendar c; int cur_hours; int cur_minutes; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.clock_home); hours = (TextView) findViewById(R.id.hours); minutes = (TextView) findViewById(R.id.minutes); updateClock(); } public void updateClock() { c = Calendar.getInstance(); hours.setText("" + c.get(Calendar.HOUR)); minutes.setText("" + c.get(Calendar.MINUTE)); } public static void init() throws Exception { Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { updateClock(); // ERROR } }, 0, 1 * 5000); } } </code></pre> <p>How can I make it work?</p>
java android
[1, 4]
2,468,541
2,468,542
Move table from last index to first
<p>I am trying to move the last row in a table to the first row. I am moving the asp:Wizard's next navigation table row to the top.</p> <p>Here's my code. What am I doing wrong? The table has 8 rows. It's just a plain jane wizard right now.</p> <pre><code> $(document).ready(function () { var wizard = $("#Wizard1"); var k = $("#Wizard1 tbody tr td:first-child"); var m = $("#Wizard1 tbody tr td:first-child").children(":eq(8)"); var n = m.clone(); m.remove(); k.before(n); }); </code></pre> <p>What I did in the end, which I should have thought about, was i removed the rows and re-added the order. My syntax was a little off in the ? though after re-examine the tree. I apologize for the confusion, but the IE dev toolbar was placing the tree wrong in the inspector for some reason.</p> <pre><code> $(document).ready(function () { var k = $("#Wizard1 tr:first-child td:last-child table tr:first-child"); var n = k.clone(); k.remove(); $("#Wizard1 tr:first-child td:last-child table").append(n); }); </code></pre>
jquery asp.net
[5, 9]
67,608
67,609
C# ASP.NET Page Leaving event?
<p>I was looking for an event that would fire or a way to tell if the user was leaving a page. Either to navigate to another page or closing the page alltogether. Is this possible through the events that fire?</p>
c# asp.net
[0, 9]
410,284
410,285
Text labels in textbox being passed onsubmit
<p>I found this useful little method of displaying field titles within the text fields themselves.</p> <p><a href="http://viralpatel.net/blogs/2009/09/default-text-label-textbox-javascript-jquery.html" rel="nofollow">http://viralpatel.net/blogs/2009/09/default-text-label-textbox-javascript-jquery.html</a> </p> <p>Only problem is that if the fields aren't completed by the user then the title values get submitted.</p> <p>Could anyone tell me how to add a onsubmit check to make sure we don't submit default text?</p> <p>This is the javascript:</p> <pre><code>$('input[type="text"]').each(function () { this.value = $(this).attr('title'); $(this).addClass('text-label'); $(this).focus(function () { if (this.value == $(this).attr('title')) { this.value = ''; $(this).removeClass('text-label'); } }); $(this).blur(function () { if (this.value == '') { this.value = $(this).attr('title'); $(this).addClass('text-label'); } }); }); </code></pre> <p>Many thanks...</p>
javascript jquery
[3, 5]
2,764,751
2,764,752
add up widths of elements until a ceiling is meet
<p>I have a header text changes length. I also have a set of logos that have a static length.</p> <p><b>The problem:</b> When the header (text) gets too long or short the logos either do not use the space effectively or the logos end up going to another line.</p> <p><b>Solution in Simple Terms</b> I want a script that adds up the width of logos one-by-one and when a certain width is meet it stops showing the logos.</p> <h1>For Example:</h1> <p> - The logos are hidden.<br> - The header space is 400px<br> - The container is 800px<br> - remainder space is 400px<br> - the script would add up the logos one-by-one until the 400px was meet<br> - If the 4th logos was at 450px it would not show that logo or any other logo after. </p> <p><a href="http://jsfiddle.net/FDkRN/" rel="nofollow">http://jsfiddle.net/FDkRN/</a></p> <p>I tried what I know, but I am still new to js so any help would be great.</p> <p>Thanks in advance!</p>
javascript jquery
[3, 5]
5,825,314
5,825,315
JQuery vs GetElementById
<p>I'm trying to do something since yesterday, and I'm really stuck. Here is what « works » for now :</p> <pre><code>&lt;h1 onclick="functionToggle(&lt;?php echo "'".$base."'" ?&gt;)"&gt; &lt;?php echo $base ?&gt;&lt;/h1&gt; </code></pre> <p>which echo :</p> <pre><code>&lt;h1 onclick="functionToggle('helpers')"&gt; helpers&lt;/h1&gt; </code></pre> <p>And I have a div like this one :</p> <pre><code>&lt;div id="helpers" class="hidden"&gt; &lt;div class="fichier"&gt;audio_extensions March 02 2013 23:35:36.&lt;/div&gt; &lt;div class="fichier"&gt;ebook_extensions March 02 2013 19:42:55.&lt;/div&gt; &lt;div class="fichier"&gt;movie_extensions March 02 2013 20:28:01.&lt;/div&gt; &lt;div class="fichier"&gt;zip_extensions March 02 2013 19:50:21&lt;/div&gt; &lt;/div&gt; </code></pre> <p>The thing is : With this function, in JS :</p> <pre><code>&lt;script&gt; function functionToggle(elem){ etat=document.getElementById(elem).style.display; if(etat=="none"){ document.getElementById(elem).style.display="block"; } else{ document.getElementById(elem).style.display="none"; } } &lt;/script&gt; </code></pre> <p>This works. I just wanted to know how to do this with JQuery ? I have tried something like this :</p> <pre><code>&lt;script&gt; function functionToggle(elem){ $("#elem").toggle(); } &lt;/script&gt; </code></pre> <p>and many other combinaison, but it doesn't work. I don't have any error, it simply doesn't work.</p> <p>If you have a solution :)</p> <p>Kai23</p>
php javascript jquery
[2, 3, 5]