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
1,258,606
1,258,607
How to use if or try catch block inside server tag
<p>I am wondering if it is possible to use an if statement or a try catch block within a server tag? ie:</p> <pre><code>'&lt;%= if(grid!=null){((DropDownList)this.grid.FindControl("SRPType")).ClientID} %&gt;' </code></pre>
c# asp.net
[0, 9]
34,633
34,634
Cannot use document javascript object when running from Java
<p>I have the following javascript code that runs from java:</p> <pre><code>var doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null); doc.documentElement.innerHTML = xmlResponse; </code></pre> <p>And I get the following error:</p> <pre><code>Caused by: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "document" is not defined. (&lt;Unknown source&gt;#13) at sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3773) at sun.org.mozilla.javascript.internal.ScriptRuntime.constructError(ScriptRuntime.java:3751) at sun.org.mozilla.javascript.internal.ScriptRuntime.notFoundError(ScriptRuntime.java:3836) at sun.org.mozilla.javascript.internal.ScriptRuntime.name(ScriptRuntime.java:1762) at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:1790) at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:854) at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:164) at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:429) at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116) at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109) at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:3163) at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:175) at sun.org.mozilla.javascript.internal.Context.evaluateReader(Context.java:1159) at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:210) ... 16 more </code></pre> <p>Do you have any clue of how to solve it?</p>
java javascript
[1, 3]
4,965,284
4,965,285
'undefined' function when triggering a click of a link with jQuery
<p>For some reason this works in FF 11, Chrome, and even in IE but not in FF 3.6 or Safari 5.</p> <p>Basically I'm triggering the click of a link with:</p> <pre><code>var $currentItem = $('#' + currentId); var modalSeriesList = $('.js-modal-series'); var index = modalSeriesList.index($currentItem); var $nextItem = modalSeriesList[index + 1]; var nextClick = function() { $(document).off('keydown.general'); $nextItem.click(); } $(document).off('keydown.general'); if ($nextItem) { $nextButton.click(nextClick); }​ </code></pre> <p>But when I click on the link in FF 3.6 or Safari 5 I get the following error:</p> <p><code>TypeError: 'undefined' is not a function (evaluating '$nextItem.click()')</code></p> <p>Is there any particular "gotcha" that I don't know about here using the following method? </p>
javascript jquery
[3, 5]
6,105
6,106
How to call a java script function from code behind some button click condition?
<p>i want to open a model pop up on some button click in code behind which has got a few if else condition. First of all i am unable to fix what would be best approach. What i options i think are followign. 1) calling a jquery model pop up 2) ajax model pop up</p> <p>It is a button which fix on some button click condition to open the model pop up, if model pop says yes then, i want client to rediret to some payemnt page where he will pay to purchase the item.</p> <p>Right now i am using the Jquery model pop up which i am calling like this</p> <pre><code> protected void imgClientFreeEval_Click(object sender, System.Web.UI.ImageClickEventArgs e) { ----- ---some code not typed if (SurveyCount &gt; 1) { Session["YourAssessment"] = true; Session["MyAssessment"] = false; ScriptManager.RegisterStartupScript(this, this.GetType(), "tmp", "&lt;script&gt;xyz()&lt;/script&gt;", true); //Response.Redirect("~/yourAssessment.aspx"); } } </code></pre> <p>and i have model pop up like this</p> <pre><code> function xyz() { // alert('hi tpo all'); // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore! // $("#dialog:ui-dialog").dialog("destroy"); $(document).ready(function () { $("#dialog-confirm").dialog({ resizable: false, height: 140, modal: true, autoOpen: false, buttons: { "OK": function () { $(this).dialog("close"); window.location.replace("http://stackoverflow.com"); }, Cancel: function () { window.location.replace("http://stackoverflow.com"); $(this).dialog("close"); } } }); }); } </code></pre> <p>Now the problem is that this function not getting called at all. what is wrong with this, i am toiling for long, if possible please suggest me best approach how should i execute it. i am unable to call this javasccipt function from code behind button click.</p>
javascript jquery asp.net
[3, 5, 9]
529,936
529,937
jQuery: hover div set link to visible
<p>I have a that contains a link with class 'remove-project' that I want to default to hidden and set to visible when the div is hovered. So far I have this (which doesn't work)</p> <pre><code>$('.project-container').hover(function() { $(.remove-project).show(); }, function() { $(.remove-project).hide(); }); &lt;?php foreach($user['Project'] as $project) { echo '&lt;div class=project-container&gt;'; echo $html-&gt;link($project['title'], array('controller' =&gt; 'projects', 'action' =&gt; 'view', $project['slug'])).' &lt;small&gt;Posted '.$time-&gt;niceShort($project['created']).'&amp;nbsp;&lt;/small&gt;&lt;a href= class=remove-project&gt;Delete&lt;/a&gt;'; echo '&lt;br /&gt;'; echo strip_tags($text-&gt;truncate( $project['description'], 400, array( 'ending' =&gt; '...', 'exact' =&gt; false, 'html' =&gt; false ))); echo '&lt;br /&gt;&lt;br /&gt;'; echo '&lt;b&gt;Tags&lt;/b&gt;: '.$project['tags']; echo '&lt;/div&gt;'; echo '&lt;br /&gt;&lt;br /&gt;'; } ?&gt; </code></pre> <p>I think I'm going wrong with </p> <pre><code>$(.remove-project).show(); </code></pre> <p>Can someon help me out?</p>
javascript jquery
[3, 5]
5,924,064
5,924,065
Is it possible to bind two separate functions to the same event
<p>Basically I'd like to bind function A to all inputs. Something like this:</p> <pre><code>$('input').bind('change', function() { bla bla bla }); </code></pre> <p>And then later I would like to bind something different in addition like this:</p> <pre><code>$('#inputName').bind('change', function() { do additional processing..}); </code></pre> <p>Is that possible? Does it work? Am I missing the syntax? Is that fine actually fine (meaning I have a bug elsewhere that's causing one of these not to bind)?</p>
javascript jquery
[3, 5]
3,740,482
3,740,483
How to live-style an user input using javascript/jquery
<p>im searching for a libary or suggestions for making a real time styler in javascript/jquery. The idea is that my users have a html text input, i need to detect in real time some patterns and apply an style to it, for example is the user writes #some_text all after the # should be considered like a tag a have to be bold like <strong>#some_text</strong>. </p> <p>Im very new at javascript so i have no idea of where to begin, i did some research but i didn't find any already made libary. Thanks for any help and suggestions!</p>
javascript jquery
[3, 5]
3,102,503
3,102,504
Asp.net Menu displaying diffrent menu items depending on access level
<p>I'm trying to create an asp menu for a website. The site will have 2 levels of user Master users (which will have more options) and Sub users which will have limited menu options. </p> <p>I was wonder does anyone knows if a way to hide menu items? I've tried google but I can't really find much.</p> <p>Here's the Asp code</p> <pre><code>&lt;asp:Menu id="MainMenu" runat="server" StaticDisplayLevels="1" Orientation="Horizontal" &gt; &lt;Items&gt; &lt;asp:MenuItem Text="Setup" Value=""&gt; &lt;asp:MenuItem ID="DepoAccount" Text="Depo Account Details" Value="" NavigateUrl="~/AccountManagment.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text="User Accounts" Value="" NavigateUrl="~/ImplantParameters.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text="Actions" Value=""&gt; &lt;asp:MenuItem Text="View Consignments" Value="" NavigateUrl="~/Consignements.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text="Add Consignments" Value="" NavigateUrl="~/Consignements.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text="Utitlies" Value=""&gt; &lt;asp:MenuItem Text="Export" Value="" NavigateUrl="~/ImplantParameters.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;/asp:MenuItem&gt; &lt;asp:MenuItem Text="Reports" Value=""&gt; &lt;asp:MenuItem Text="Manifest" Value="" NavigateUrl="~/ImplantParameters.aspx"&gt;&lt;/asp:MenuItem&gt; &lt;/asp:MenuItem&gt; &lt;/Items&gt; &lt;/asp:Menu&gt; </code></pre> <p>I have worked out how to hide the whole menu when the user is not logged in MainMenu.Visible = false</p> <p>Any pointers would be greatly appreciated.</p>
c# asp.net
[0, 9]
2,251,883
2,251,884
Dynamically deny access to locations
<p>I'm looking to dynamically instruct ASP.NET to deny access to specific locations. So, instead of having something like the following in the Web.config, I'd like to do that through C# code.</p> <blockquote> <pre><code>&lt;location path="specialDir"&gt; &lt;system.webServer&gt; &lt;security&gt; &lt;authorization&gt; &lt;add accessType="Deny" roles="FileDeny" /&gt; &lt;/authorization&gt; &lt;/security&gt; &lt;/system.webServer&gt; &lt;/location&gt; </code></pre> </blockquote> <p>Any ideas?</p>
c# asp.net
[0, 9]
923,063
923,064
__dopostback is not working in javascript function
<p>am calling <code>__dopostback</code> function in javascript while closing event of browser but its not working in Chrome.</p> <p>the same function is working in IE </p> <p>can any one give me the solution.</p> <pre><code>&lt;script type="text/javascript" language="javascript"&gt; function doUnload() { var btnlogout = document.getElementById("ctl00_lbtn_Logout"); alert(btnlogout); __doPostBack(btnlogout, ''); } &lt;/script&gt; </code></pre>
javascript asp.net
[3, 9]
3,374,941
3,374,942
jQuery ID Number Range
<p>I am trying to write a jQuery script that will add a class to list items within a certain ID range. I use numbers in my ID's and want to adjust a range of ID's.</p> <pre><code>&lt;li id="item-15"&gt;Something&lt;/li&gt; &lt;li id="item-16"&gt;Something&lt;/li&gt; &lt;li id="item-17"&gt;Something&lt;/li&gt; &lt;li id="item-18"&gt;Something&lt;/li&gt; &lt;li id="item-19"&gt;Something&lt;/li&gt; </code></pre> <p>I want to add a class to say items 16 through 19. How would I do this?</p> <pre><code>jQuery('li#item-[16-19]).addClass('the-class'); </code></pre> <p>I am not really sure how to do it. Maybe <code>.each()</code>?</p>
javascript jquery
[3, 5]
5,281,915
5,281,916
Simple jQuery issue - how to check if $(this) is the last $(this) clicked?
<p>I am essentially adding radio-buttons functionality to buttons with the class "tagbutton". There is a flaw with my code, because _this is never _last...</p> <pre><code> taguid = ""; _last = ""; $('.tagbutton').live('click', function() { _this = $(this); if(_last) { //There was a last object if(_last == _this) { // The last object was the current object alert('deactiveate for this obj'); } else { // The last object was not the current object alert('deactivate last, activate this'); } } else { alert('first object activated'); var taguid = $(this).prev().attr('data-uid'); alert(taguid); _last = $(this); } }); </code></pre>
javascript jquery
[3, 5]
3,061,229
3,061,230
Javascript MVC + listening and dispatching events with jQuery
<p>I'm learning javascript and have a question about listening and dispatching events with jQuery. </p> <p>In my Model, I have a function that triggers a change event: </p> <pre><code>Model.prototype.setCurrentID = function(currentID) { this.currentID = currentID; $('body').trigger('change'); } </code></pre> <p>The trigger event requires an element, so I bound it to the 'body'. Is this good practice or bad practice? </p> <p>In AS3, which I'm more familiar, I would simply dispatch a global event from the model, passing in a const value, listening for this event with an instance of the Model:</p> <pre><code>var model:Model = new Model(); model.addEventListener(CONST_VALUE, handlerFunction); </code></pre> <p>In jQuery, within my View object, I need to attach an element to the listener as well, so I bound it to the 'body' once again:</p> <pre><code>var View = function(model, controller) { var model; var controller; this.model = model; this.controller = controller; $('body').change(function(evt) { updateSomething(evt); }); function updateSomething(evt){console.log('updating...')}; } </code></pre> <p>It's working, but I'm interested in your take on the subject.</p>
javascript jquery
[3, 5]
4,272,707
4,272,708
Delaying while loop in AJAX success function
<p>Hi guys i have the following code </p> <pre><code>$.ajax({ url: "http://localhost/twee/chat/getnumcom", type: 'POST', data: form_data, success: function(html) { var data = parseInt(html); page = 20 * data ; while ( counter &lt; page ) { $.get("http://localhost/twee/chat/"+id+"/"+counter,function(data){ $('#c').append($(data).find('#c').html()); }); counter = counter + 20 ; } } }); alert($('#600').length); $.scrollTo('#600'); </code></pre> <p>This is what it does. Originitally it appends data to my window until #600 is found. Technically i have a function which mathematically calculates where 600 should be. This is fine and the div is loaded nicely.</p> <p>Howvever i added the alert specifically to check if the div is loaded. A value of 0 means no and a value of 1 means yes. In my firebug console, when the function is fired up, the while loop is still executing but the alert already displays a value of 0. Consequently, the scrolling is not done. </p> <p>If i fire up the function again immediately after it has been executed, i get a 1 which means the div has been loaded. </p> <p>Is there a way to delay the scroll function until the while loop has executed? I always thought the code would be executed procedurally and the alert would be displayed after all the data has been loaded. </p> <p>I guess a timer would be an option but i don't want to use that. I am not really sure how much milliseconds i should set the timer to. </p>
javascript jquery
[3, 5]
1,300,609
1,300,610
ASP.NET Server.Execute
<p>I'm having some problems with Server.Execute that I can't seem to find any details on.</p> <pre><code>Page page = new WidgetProcessor(Widget); Server.Execute(page, htmlTextWriter, true); </code></pre> <p>The Widget in the above code is a simple object that knows how to instantiate a usercontrol. The WidgetProcessor takes a Widget and adds the widgets control to the page. This works fine on the initial load, it doesn't seem to handle postbacks however; it never actually fires the user controls events, it just consistently returns the original page as if you had never posted back.</p> <p>I've found this article from 2003: <a href="http://support.microsoft.com/kb/817036" rel="nofollow">http://support.microsoft.com/kb/817036</a>, though I would think they would have fixed this by now.</p> <p>Any help would be appreciated.</p>
c# asp.net
[0, 9]
3,809,398
3,809,399
jQuery obscurity
<p>This is kind of funky. But take a look at the code snippet below :</p> <pre><code>$('.classname').bind('click', somefunction); function somefunction() { console.log($(this)); // **displays[&lt;div&gt;,context&lt;div&gt;]** } </code></pre> <p>And if I tweak the above to:</p> <pre><code>$('.classname').bind('click', function(){ somefunction(); }); function somefunction(){ console.log($(this)); // **displays [Window]** } </code></pre> <p>I am not quite sure why 'this' assumes two different values depending on how the function is being called back. The thing is, I do need this to be ,context and the function to be called like </p> <pre><code>function(event){ somefunction(event); } </code></pre> <p>because I need the event. But not quite sure what's up here. </p> <p>Any leads, people?</p>
javascript jquery
[3, 5]
2,144,802
2,144,803
how to check the first time user of my App in android?
<p>In my App, first it shows a splash screen. after that another activity, then my main activity must be show. this is my design plan. the second activity(i.e before main activity) must be show for the first time user of the app. if he/she closes the app.splash screen will redirect to main activity automatically. how to do this ? Any Idea? i am developing my app for android phones.</p>
java android
[1, 4]
2,935,362
2,935,363
Remove statically added controls at runtime
<p><strong>The Scenario:</strong> I have an asp.net website where I show a div popup on page load for taking a few user details. When a user inputs the details, or closes the popup, I set up a flag cookie so that the popup is not displayed again for the user. The div is in the MasterPage so that it is displayed no matter on which page a user lands first time. The div contains an UpdatePanel which has all the controls required for taking the details. This whole functionality is working fine.</p> <p><strong>The Problem:</strong> Now this div popup is not showing(by setting display:none) on subsequent postbacks(which I want), but the html markup is still loading with the page unnecessarily adding to the page size. What I would idealy want to do is: Check if flag cookie is set. If no, show the popup, else remove the popup's markup from the page.</p> <p>Now since the div is not a server control, I cannot possibly remove it and the all the controls inside it. So, I thought of removing the UpdatePanel from the page:</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["flag"] != null) { if (Page.Controls.Contains(updpnl_contact)) { Page.Controls.Remove(updpnl_contact); updpnl_contact.Dispose(); } } } </code></pre> <p>But I guess this tends to work with dynamically added controls only, and since the control is added at Design Time, it is not being removed.</p> <p>Is there any way I can achieve this?</p>
c# asp.net
[0, 9]
4,021,462
4,021,463
Dynamic creation of divs
<p>I want to create dynamic divs in a ASP.NET application.</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { List&lt;produkt&gt; produkte = Repository.GetProductsRanged(0, 9).ToList(); } </code></pre> <p>As you can see, there is a of products (10 elements) and I want to put some of there attributes in divs. Every product should have it owns div. How can I do this dynamicaly?</p> <p>Thanks in advance!</p>
c# asp.net
[0, 9]
913,067
913,068
How would you create a Fancy Panel which applies extra styles?
<p>I would like a FancyPanel Control that automatically applies styles the content in it, for example</p> <pre><code>&lt;asp:FancyPanel runat="server" id="pnl1"&gt; &lt;Header&gt; Header Text &lt;/Header&gt; &lt;Body&gt; //any regular aspx markup &lt;/Body&gt; &lt;Footer&gt; Footer Text &lt;/Footer&gt; &lt;/asp:FancyPanel&gt; </code></pre> <p>So basically when this gets rendered I can now wrap everything in the header in a div with a bold text style and add rounded corners (I don't need advice for styling, just the FancyPanel side of things, an empty div is good enough). All the Header, Body and Footer need to be able to accept regular server controls to be embedded in them.</p> <p>How do I create this type of control?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,521,266
2,521,267
Differentiate between current domain and domain of requested image
<p>I want to be able to differentiate between images requested from the current domain and from external domains to deal with canvas and cross domain requests. I am currently proxying all absolutely sourced images and not proxying local ones using</p> <pre><code>if ( $(this).attr('src').substr(0, 4) == 'http') { … </code></pre> <p>However, this is obviously inefficient. What is the best way to differentiate between images on the current domain and those on another domain?</p>
javascript jquery
[3, 5]
2,269,629
2,269,630
How to remove validation focus in particular validation control
<p>i discover final line's validation has higher priority than i set focus of first line's validation control even when i set focus it code behind.</p> <p>want to disable some validation focus</p> <p>discover even if i SetFocusOnError="false" on some validation, it still not scroll to the top of page</p> <p>after testing several times, most of time success, having a few cases failed. I am not sure whether someone doing things in the production site at the same time. i have already used all my methods.</p> <p>i discover one thing in production site, when scroll down to the bottom page, i have to press twice submit button in order to focus to the top of page, </p> <p>however when not scroll to the bottom of page, it do not focus to the top of page, just sometimes lucky it focus, most of cases it do not focus to the top of page</p> <p><strong>Firefox and internet explorer 100% success using this method, Chrome sometimes success and most of time failed in this case</strong></p> <p>However, i still can not set focus in code behind</p>
c# asp.net
[0, 9]
831,807
831,808
jQuery each on appended elements
<p>I'm using autocomplete plugin in jQuery and I've created a method which appens elements selected in autocomplete result.</p> <pre><code>$("#buscar").autocomplete({ source: "procesos/buscarPersona.php", minLength: 2, select: function(event, ui ){ var name = ui.item.value; var id = ui.item.id_persona; $("#acreditados tbody").append('&lt;tr id='+id+'&gt;&lt;td&gt;'+name+'&lt;td&gt;&lt;td&gt;Monto: $&lt;input name="monto_'+id+'" type="text" /&gt;&lt;img id="delete_'+id+'" src="img/ico-delete.gif" /&gt;&lt;/td&gt;&lt;/tr&gt;'); } }); </code></pre> <p>As you can see my code appends input elements to my page. Then in other method I want to do operations with values in previously added inputs.</p> <pre><code>$("#tablaAm").click(function(){ var montoTotal = 0; $("input[name^='monto_']").each(function(index){ alert(index + ': ' + $(this).val()); }); }); </code></pre> <p>The problem is that .each() isn't working for this new elements. I tried .each() for inputs that exists when the page is loaded and I have no problem with it, the problem are elements appended after load.</p> <p>How can I make this work? I tried live() method but I think .each is not an event.</p>
javascript jquery
[3, 5]
4,038,188
4,038,189
how to upload file of size 500 MB or more in ASP.net aplication
<p>Please let me know the possible ways of uploading a large file (say 500 MB excel File) in an ASP.net application. This was asked in an interview and I have no idea on how to achieve this.</p>
c# asp.net
[0, 9]
2,556,553
2,556,554
where does the Editable.append() implemented?
<p>Here is the code :</p> <pre><code>Editable text = (Editable)mResults.getText(); //mResults is a TextView. </code></pre> <p>I want to know, when i call <code>text.append("***")</code>,which implements is called? I can't find where the Editable interface is implemented.</p>
java android
[1, 4]
1,707,917
1,707,918
Save android value and retrieve it again
<p>I have the following void</p> <pre><code>protected void onPaymentSuccess(PaymentResponse response) { // Stuff... } </code></pre> <p>I want to save a string within a void for example</p> <pre><code>String key = "JHIJHFEIRUFHEURFGEU5"; </code></pre> <p>And i want to be able to retrieve it again (this string to be saved to phone) after phone restart, closing application.</p>
java android
[1, 4]
1,951,307
1,951,308
android minutes:seconds
<p>I'm looking for a solution to display <code>minutes:seconds</code> duration from <code>1785.16 string android device</code></p> <p>In php its simple:</p> <pre><code>&lt;?php $seconds = '1785.16'; $minutes = floor($seconds/60); $secondsleft = $seconds%60; if($minutes&lt;10) $minutes = "0" . $minutes; if($secondsleft&lt;10) $secondsleft = "0" . $secondsleft; echo "$minutes:$secondsleft"; ?&gt; This will display: 29:45 </code></pre>
java android
[1, 4]
1,209,439
1,209,440
add slideUp and slideDown to hidden divs
<p>I'm using the below to create a fade-in and fade-out effect on a hidden div on a FAQ page. Problem is, it makes the hidden div snap open and closed which is quite irritating. I'm not too hot on javascript and can't figure out how to get <code>slideUp</code> and <code>slideDown</code> into this, as I'd like it to also slide up and slide down. Is there any way to get a sliding function into this script? Thanks.</p> <pre><code>$(document).ready(function() { $("a[name^='faq-']").each(function() { $(this).click(function() { if( $("#" + this.name).is(':hidden') ) { $("#" + this.name).fadeIn('slow'); } else { $("#" + this.name).fadeOut('slow'); } return false; }); }); }); </code></pre>
javascript jquery
[3, 5]
182,924
182,925
using document.images.src property in javascript i want to get list of images source
<p>I am able to get it when hardcoding but throwing error while trying it with for loop.</p> <pre><code>for(i=0;i&lt;document.images.length;i++) { document.writeln(document.images[i].src); } </code></pre> <p>actually after printing first index value loop is terminating error:cannot read object property src....</p> <p>but below hardcoded one is working fine:</p> <pre><code>document.write(document.images[0].src); document.write(document.images[1].src); document.write(document.images[2].src); document.write(document.images[3].src); </code></pre>
javascript asp.net
[3, 9]
1,523,175
1,523,176
jQuery(document).ready() load() aspx
<p>I am using jQuery 1.3.1 and saying <code>$('#somediv').load('somepage.aspx')</code> An aspx that have a Repeater which loads few images. When loading is complete a <code>cycle()</code> function (jQuery plug-in) will be called upon them.</p> <p>Now I have this working on <a href="http://www.techlipse.net/test/agb" rel="nofollow">http://www.techlipse.net/test/agb</a> via the function called from the menu-event-handlers (a combo box). When it is loaded via the event handler of the combobox I call <code>cycle()</code> plugin as a callback function to the <code>load()</code> method, or function .. I think I might have misunderstood some of the fundemantals of javascript, or why the <code>document.ready()</code> is firing long before the images are fully loaded therefore failing the <code>cycle()</code> plug in. When it is said to be a bug of jQuery1.3.1 that it does wait for them to load. Posted here:</p> <p><a href="http://stackoverflow.com/questions/477463/jquery-is-waiting-for-images-to-load-before-executing-document-ready/1156171#1156171">http://stackoverflow.com/questions/477463/jquery-is-waiting-for-images-to-load-before-executing-document-ready/1156171#1156171</a></p> <p>any help .?</p>
asp.net jquery
[9, 5]
771,455
771,456
Build separate pages or not
<p>I have about 20 grid views that I have to create. All of them are pretty standard across the board. Just take IEnumerable T and display it in a grid view, that's it. </p> <p>I would prefer to create one aspx page and have the grid view be dynamically generated by using ITemplate. And I guess for the data source use IEnumerable Object. </p> <p>Are there significant performance considerations between doing it the way I'd like to do it or would it be better to go ahead and build the 20 or more grid views on separate aspx pages? </p> <p>An example of a concern I have is taking List T and casting to IEnumerable T where T is type Object. </p>
c# asp.net
[0, 9]
2,717,492
2,717,493
How to use JQuery selectors on a HTML String?
<pre><code>$.get(url, function(data){} </code></pre> <p>This JQery function returns a string with the code of the page 'url'. How can I use the JQuery selectors on it to extract the tags informations that I need?</p>
javascript jquery
[3, 5]
2,499,196
2,499,197
Best way to create master page that has menu and links but displays main content from other pages
<p>I've got a bunch of asp pages that I'm upgrading to asp.net. I'm trying to figure out a good way to achieve the following:</p> <p>I basically wan't a portal page that has a menu bar and links to other sites in the company intranet but instead of redirecting to the other site when the link is clicked, it loads the page into the current one so that the links and menu bar are accessible to all of the other sites. My goal is to make it so that when a new website needs to be made, the developer can just add in the guts for the page, and add another link to the master page.</p> <p>What would be a clean way to achieve this? Would it be best to have all of these (now separate) web applications bundled into one asp.net web application project, or is there an easy way to share a master page across many asp.net projects?</p> <p>I'm new to asp.net and web development so any help is appreciated, thanks.</p>
c# asp.net
[0, 9]
1,633,939
1,633,940
Is there internal layout with icon and text?
<p>I know that there are many iternal layouts which I can use for adapters - android.R.layout.simple_list_item_1, android.R.layout.select_dialog_item, etc. But is there any internal layout which I can use for making item with icon and text (image_<em>_</em>_text)? Why android.id should I use for it? </p>
java android
[1, 4]
6,013,106
6,013,107
Hidden variable Vs Server variable accessing on client side in javascript
<p>I'm evaluating two options of accessing a server side data on client side. Little bit confused about the efficiency or may be you can call it as finding best approach to do it.</p> <p>I need to access a server side data may be an integer value in javascript on client side. I know about two options to do it.</p> <ol> <li><p>Create a public variable or property on server side and set it to javascript variable on client side as below:</p> <pre><code>var value = eval(&lt;% =value %&gt;); </code></pre></li> <li><p>Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().</p></li> </ol> <p>Which is the best approach and what are the pros and cons?</p>
c# asp.net javascript
[0, 9, 3]
3,617,593
3,617,594
How to change execution context in jQuery without invoking the function
<p>I'm a lover of MooTools, and get used to bind the callback functions, for example:</p> <pre><code>element.addEvent('click', callback.bind(this)); </code></pre> <p>Assume <em>this</em> is the current execution context. This statement means that, I'm binding the execution context of <em>this</em> to the function <em>callback</em>. Also, as far as I know, certain browsers (e.g., Chrome) have added bind() into their JavaScript engines.</p> <p>Now my job needs me to switch to using jQuery. Clearly, the bind() has a different meaning in jQuery, which is close to addEvent() in MooTools. I could not figure out a way to change the execution context. I had to do the following:</p> <pre><code>var that = this; element.click(function () { callback.apply(that); // Have to invoke it, and also with extra function wrapper }); </code></pre> <p>But I wanted to do something like:</p> <pre><code>element.click(callback.*bind*(this)); </code></pre> <p>Any jQuery guru has ideas?</p>
javascript jquery
[3, 5]
5,952,167
5,952,168
How to grab just one part of a page in jQuery?
<p>I have an form being submitted via AJAX. The response from the server in an entire web page (HTML). I would like to alert only the content within a span tag with the id "message" which exists on that response page. I don't want to alert the entire page. How to do this?</p> <pre><code>$.ajax({ url: '/accounts/login/', data: $(this).serialize(), success: function(output) { alert(output) } }); </code></pre> <p>My code alerts the whole page.</p>
javascript jquery
[3, 5]
2,555,022
2,555,023
can I call a javascript function in another project?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/7974131/how-can-i-call-javascript-function-from-another-project-in-same-solution">how can I call javascript function from another project in same solution?</a> </p> </blockquote> <p>I am using an asp.net 3.5 web solution with js which contains 2 projects ProjectA and ProjectB. Is it possible to call a js function which is defined in ProjectA in a scriptfile from somewhere in ProjectB? what would the script reference be?</p>
javascript asp.net
[3, 9]
23,206
23,207
JQuery - Switch text on click not working properly
<p>If you take a look at <a href="http://mountainfoodstorage.com/index.php/media" rel="nofollow">this page here</a> you will see that I have a Youtube gallery setup which for the most part works. When you click onto a thumbnail, it switches the video but it doesn't switch the text at the right side properly. It seems to be loading text behind the video and in some cases requires two clicks to switch the text on the right.</p> <p>Looking at my jQuery below, may someone please help me with determining the issue?</p> <p>Thanks!</p> <pre><code>&lt;script&gt; function replaceVideo(id) { originalSrc = jQuery("iframe", "#" + id).attr("src"); autoPlay = originalSrc + "&amp;autoplay=1"; jQuery("iframe", "#" + id).attr("src", autoPlay); video = jQuery(".video-content", "#" + id).html(); text = jQuery(".video-description").html(); jQuery(".vid_desc").html(text); jQuery(".flex-video").html(video); jQuery("iframe", "#" + id).attr("src", originalSrc); } jQuery(".video-list li").click(function() { id = jQuery(this).attr("id"); replaceVideo(id); }); jQuery(window).load(function() { if(window.location.search.substring(1)) { element = window.location.search.substring(1).split('&amp;'); if (document.getElementById(element[0])) { document.onload = replaceVideo(element[0]); } } }); &lt;/script&gt; </code></pre>
javascript jquery
[3, 5]
2,682,788
2,682,789
How to define function parameter with jQuery
<p>i have some syntax problem... This is my little script:</p> <pre><code>$('.basket_details, .advanced_search_panel, .producers_major_panel').hover(function () { mouse_is_inside = true; }, function () { mouse_is_inside = false; }); $("body").mouseup(function () { if (mouse_is_inside) { $('.advanced_search_panel, .producers_major_panel').fadeOut('slow'); $('.basket_details').slideUp('slow'); } }); </code></pre> <p>everything's fine but my chrome console screaming that i have syntax errors, and <code>mouse_is_inside</code> is not define, how to correct this mistake?</p>
javascript jquery
[3, 5]
2,517,460
2,517,461
Registering javascipt with ScriptManager is working inconsistently
<p>I'm developing an ASP.NET page. Currently there is no AJAX on the page. in the code behind for different button click events, I am registering the script below. The purpose of the script is to scroll the window to a particular anchor tag. The method is as follows:</p> <pre><code>public void RegisterAnchor(string anchorTag) { Page.ClientScript.RegisterStartupScript(Page.GetType(), "navigate", "window.onload = function() {window.location.hash='#" + anchorTag + "';}", true); } </code></pre> <p>I have two different anchor tags are that valid and defined in the same way. However, one is working and one is not. What can I check to identify the cause of this behavior? </p> <p>Anchor tag in ascx:</p> <pre><code>&lt;a name="EditDlg"&gt;&lt;/a&gt; </code></pre>
javascript asp.net
[3, 9]
1,793,096
1,793,097
Save form element server side
<p>How do I check and save Server Side the value of the check element (so it saves the input when user clicks back) on these form elements instead of doing this? This is not working when I click "Back" button. The check item shows as checked but in reality the action is blank.</p> <pre><code>&lt;label&gt; &lt;input type="radio" name="proptype" id="RESI" value="RESI" checked="checked" onClick="this.form.action='?frame=TEST&amp;base=fc';" /&gt; Residential&lt;/label&gt; &lt;label&gt; &lt;input type="radio" name="proptype" id="LOTL" value="LOTL" onClick="this.form.action='?frame=TEST1&amp;base=fc';" /&gt; Land and Lots&lt;/label&gt; </code></pre>
php javascript
[2, 3]
2,398,716
2,398,717
How to cancel/undo onclick once done
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/14637427/how-to-undo-an-onclick">How to undo an “onclick”</a> </p> </blockquote> <p>I'm auto embedding YouTube video.</p> <p>When clicking on the preview picture, it hides the preview and shows the video.</p> <p>I want to go back to the preview when people are clicking somewhere else out of the video.</p> <p>I have this :</p> <pre><code>&lt;div onclick=\"$(this).html(decodeURIComponent('$embed'));\" style='cursor: pointer;'&gt; &lt;img src='$vignette' style='width:150px; cursor: pointer;'&gt; &lt;img class='play' src='https://s-static.ak.fbcdn.net/rsrc.php/v2/yG/r/Gj2ad6O09TZ.png'&gt; </code></pre> <p></p> <p>and tried this but I'm pretty sure I'm in the wrong way:</p> <pre><code>$(function() { $('html').click(function() { $("#iframetoclose").hide(); }); }); </code></pre> <p>I think the best way would be to reload something. I don't know how to start. Could you please help me ?</p> <p>Thank you !</p>
javascript jquery
[3, 5]
588,419
588,420
Using ASP.Net tags in a .js file?
<p>Is it possible to embed <code>&lt;% ... %&gt;</code> tags in a javascript file and have it render the appropriate server-side code? How can this be done?</p>
javascript asp.net
[3, 9]
29,884
29,885
scan barcode using android phone camera using ASP.net webpage?
<p>i am asp developer. i want to use android phone camera as scanner. How can i do that? the output need to goes in textbox on web page. Is there is any API or Javascript for this?</p>
javascript android asp.net
[3, 4, 9]
2,527,738
2,527,739
ASP .NET - How to refresh a databound DataList?
<p>I have a DataList that is bound to a SQlDataSource. The SQLDataSource returns a stored procedure value containing the max indentity value in a table.</p> <p>On the same page as the DataList I have a DetailsView that is used to add new records to the table. </p> <p>The problem is that after adding a new record to the table the Datalist value shows the previous indentity value. </p> <p>How do I have the page automatically refresh the DataList?</p>
c# asp.net
[0, 9]
819,968
819,969
Add all elements in array
<p>I have function that is getting the width of my images in list and I need to count them all together. When I do it in foreach it brings some weird number.</p> <p>This function is getting width of every element, I really don't care about every element, just how much width they are taking together...</p> <pre><code>var listWidth = []; $('#thumbContainer ul li').each(function(){ listWidth.push($(this).width()); }); </code></pre>
javascript jquery
[3, 5]
5,660,457
5,660,458
How to make a click on a child element not be considered a click on it's parent in jQuery?
<p>The question of how to detect a click on anywhere except a specified element has been answered a couple of items like here:</p> <p><a href="http://stackoverflow.com/questions/321239/event-on-a-click-everywhere-on-the-page-outside-of-the-specific-div">Event on a click everywhere on the page outside of the specific div</a></p> <p>The problem I have is trying to figure out how to detect a click anywhere except a given element including one of it's children.</p> <p>For example in this code:</p> <p><a href="http://jsfiddle.net/K5cEm/" rel="nofollow">http://jsfiddle.net/K5cEm/</a></p> <pre><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function() { $(document).click(function(e) { $('#somediv').hide(); }); $('#somediv').click(function(e) { e.stopPropagation(); }); }); &lt;/script&gt; &lt;div style="border: 1px solid red; width:100px; height: 100px" id="somediv"&gt; &lt;span style="display: block; border: 1px solid green; width:50px; height: 50px; margin: 0 auto" id="someSpan"&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p>Clicking anywhere outside the red div should cause it to hide. Not only that but also clicking on it's child element (the green span) should cause it to hide. The only time it shouldn't hide is if you click on it but not on the span. As it stands now, the click on the span is also considered a click on the parent div hence it doesn't hide the div if the span is clicked.</p> <p>How to achieve this?</p>
javascript jquery
[3, 5]
338,800
338,801
How to filter same name controls using JQuery
<p>I have a tabcontainer control which contains 5 tabs. Each tab contains a usercontrol if i create a button e.g btnControl1 in usercontrol of tab1 &amp; in second tab's usercontrol i create a button with the same name btnControl1. How can i filter tab1's usercontrol's btnControl1 &amp; tab2's usercontrol's btnControl1 using Jquery</p>
jquery asp.net
[5, 9]
4,061,740
4,061,741
Android FragmentManager Listeners
<p>While searching for the best way to store and notify listeners (weak references vs strong references, anonymous listeners vs garbage collector), I took a look at how Google implement their listeners. The following code codes from the FragmentManager class:</p> <pre><code>ArrayList&lt;OnBackStackChangedListener&gt; mBackStackChangeListeners; public void removeOnBackStackChangedListener(OnBackStackChangedListener listener) { if (mBackStackChangeListeners != null) { mBackStackChangeListeners.remove(listener); } } void reportBackStackChanged() { if (mBackStackChangeListeners != null) { for (int i=0; i&lt;mBackStackChangeListeners.size(); i++) { mBackStackChangeListeners.get(i).onBackStackChanged(); } } } </code></pre> <p>If there is a listener removed in its <code>onBackStackChanged</code>, something like:</p> <pre><code>@Override void onBackStackChanged() { mFragmentManager.removeOnBackStackChangedListener(this); } </code></pre> <p>It seems to me that the next listener in the ArrayList will be skipped. </p> <p>Am I missing something? Is this something that is not supposed to be done?</p>
java android
[1, 4]
2,872,687
2,872,688
Disable Chars in TextBox
<p>Is there a possibility to disable some Inputs like Spacebar, Linebreak etc. in an TextView / TextBox?</p>
java android
[1, 4]
5,679,966
5,679,967
JavaScript Namespace with jQuery
<p>How do you manage namespace for a custom JavaScript library depends on jQuery?</p> <p>Do you create your own namespace, say <code>foo</code> and add your objects there? e.g. <code>foo.myClass, foo.myFunction</code></p> <p>Or do you add your objects to jQuery's namespace? e.g. <code>jQuery.myClass, jQuery.myFunction</code></p> <p>Which is the more common practice and why?</p>
javascript jquery
[3, 5]
3,537,360
3,537,361
javascript confirm value not working
<p>i have a confirm and alert message box. both are getting displayed at the right time.</p> <p>but in confirm box when i press cancel the applyaction_button_click is getting executed, which should not happen as i return false.</p> <p>Similar is the case with alert box which returns false still applyaction_button_click is getting executed.</p> <p>here is my code:</p> <pre><code> protected void Page_Load(object sender, EventArgs e) { ApplyAction_Button.Attributes.Add("onclick", "ShowConfirm();"); } protected void ApplyAction_Button_Click(object sender, EventArgs e) { // Action to be applied } </code></pre> <p>JS function:</p> <pre><code> function ShowConfirm() { //check if checkbox is checked if is checked then display confirm message else display alert message var frm = document.forms['aspnetForm']; var flag = false; for (var i = 0; i &lt; document.forms[0].length; i++) { if (document.forms[0].elements[i].id.indexOf('Select_CheckBox') != -1) { if (document.forms[0].elements[i].checked) { flag = true } } } if (flag == true) { if (confirm("Are you sure you want to proceed?") == true) { return true; } else { return false; } } else { alert('Please select at least Checkbox.') return false; } } </code></pre> <p>thanks</p>
c# javascript asp.net
[0, 3, 9]
3,299,384
3,299,385
Append parameters to a URL based on checkboxes
<p>So I have a list of 8 checkboxes in a form. These checkboxes are supposed to control a link that will load in a frame. However I have no idea where to start...<br> Checkbox1(appendThis1) - checked<br> Checkbox2(appendThis2)<br> Checkbox3(appendThis3) - checked<br> Checkbox4(appendThis4)<br> Checkbox5(appendThis5) - checked<br> Checkbox6(appendThis6)<br> Checkbox7(appendThis7)<br> Checkbox8(appendThis8)<br></p> <p>So based on this I would have a base URL such as <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> and since checkbox1,3, and 5 are check the appendThis1, appendThis2, appendThis3 would be added to the end of the url but none of the other checkboxes would append anything to the URL. Each checkbox would add or remove its specific parameter to the URL.<br> Also whenever a checkbox is check it will reload the URL.</p>
php javascript
[2, 3]
2,736,183
2,736,184
Creating and assigning console.log a new object
<p>I have seen code like this in several places:</p> <pre><code>(function() { var method; var noop = function noop() {}; var methods = [ 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 'timeStamp', 'trace', 'warn' ]; var length = methods.length; var console = (window.console = window.console || {}); while (length--) { method = methods[length]; // Only stub undefined methods. if (!console[method]) { console[method] = noop; } } }()); </code></pre> <p>Specifically I am interested in this line of code </p> <pre><code>var console = (window.console = window.console || {}); </code></pre> <p>Why are we creating a new <code>window.console</code> object if <code>window.console</code> is not defined ?</p> <p>So why are we setting <code>window.console={}</code>?</p>
javascript jquery
[3, 5]
3,121,069
3,121,070
How to load images from the local machine to JS object avoiding loading to the server
<p>I want to load an image file from the computer directly to any js object without using any server-side component. For example, I want to select a picture from the local machine and display it on a webpage. Is there a way to avoid file upload to the server?</p> <p>In fact I want to write a kind of multiple image loader, but before loading to the server I want to rotate some images, create an xml-file with some data like user id, image file names list and to zip all images and this xml and then send it to the server. How can I do that on the client side?</p>
javascript jquery
[3, 5]
4,502,712
4,502,713
jQuery conflicts of many scripts
<p>I am asking my question after I have tried many ways to solve it but i couldn't. I have conflicts with jQuery scripts in my site. The other I have changed the $ to jQuery and they worked but this script didn't work for me.</p> <p>This code below works only the second script but the first script no.</p> <pre><code>&lt;script defer="defer"&gt; jquery.noConflict(); (function ($) { $("#insured_list").tablesorterPager({ container: jquery("#pager") }); })(jQuery); &lt;/script&gt; &lt;script defer="defer"&gt; (function ($) { $("#insured_list").tablesorter({ widthFixed: true, widgets: ['zebra'] }) })(jQuery); &lt;/script&gt; </code></pre> <p>before it was like that</p> <pre><code>&lt;script defer="defer"&gt; $(document).ready(function() $("#insured_list").tablesorterPager({container: jquery("#pager")}); .tablesorter({widthFixed: true, widgets: ['zebra']}) }); </code></pre> <p>and neither worked, no page script no sorter. I tried noconflict but it didnt seem to work.</p>
php jquery
[2, 5]
1,576,448
1,576,449
Call onSaveInstanceState without calling super.onSaveInstanceState(outState)
<p>If I will use this code without calling super.onSaveInstanceState(outState);</p> <pre><code>@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putLong(ID, mId); } </code></pre> <p>like this: </p> <pre><code>@Override protected void onSaveInstanceState(Bundle outState) { outState.putLong(ID, mId); } </code></pre> <p>What problems can be?</p>
java android
[1, 4]
5,758,787
5,758,788
Parsing a string with Jquery or Javascript
<p>How do i pull out the 30 or the 55 basically the number before the last number</p> <pre><code>http://something.com:9090/general/35/30/205 http://something.com:9090/general/3/55/27 http://something.com:9090/general/36/30/277 </code></pre>
javascript jquery
[3, 5]
4,835,500
4,835,501
What is the fastest way to check whether a specific UserID exists in the array using Jquery or Javascript
<p>I have an array of objects <code>gAllMedicalFilesClaimantsArray</code> with 2 properties (UserID &amp; UserInfo)</p> <p>For example:</p> <pre><code>gAllMedicalFilesClaimantsArray[0].UserID = "111"; gAllMedicalFilesClaimantsArray[0].UserInfo = "AAA-111"; gAllMedicalFilesClaimantsArray[1].UserID = "222"; gAllMedicalFilesClaimantsArray[1].UserInfo = "BDD-478333"; </code></pre> <p>What is the fastest way to check whether a specific UserID exists in the array using Jquery or Javascript because <code>gAllMedicalFilesClaimantsArray</code> has got 8000 records?</p> <p>Thanks</p>
javascript jquery
[3, 5]
5,029,946
5,029,947
jquery click event on container and not contents
<p>I have a h3 which is clickable, (it fires a drop down). It also contains a input check box to turn on/off a value, however I don't want it to trigger the drop down.</p> <p>Any ideas how this can be done?</p> <p>Here's my markup</p> <pre><code>&lt;div id="" class="dropDownTitle"&gt; &lt;h3 class="h3"&gt; Some text here &lt;input id="" type="checkbox" /&gt;&lt;/h3&gt; &lt;/div&gt; </code></pre> <p>Again I want the h3 to trigger the drop down, but not the input contained within it.</p> <p>More than happy to get this done in pure javascript rather than jquery, the trigger just fires the function dropDownMenu();</p> <p>cheers</p> <p>Andy</p>
javascript jquery
[3, 5]
3,803,726
3,803,727
JavaScript: value of an object on a click event
<p>I'm working on a codecademy.com lesson that's teaching me how to build a bar graph with jQuery. The last set of instructions are to add a click event to $bar to display it's value. It explains</p> <blockquote> <p>Anonymous functions go like this: <code>function(arg) { code }</code>. In this case, a .click handler will have e, the click event, as its argument, so your implementation should have <code>function(e) { alert code }</code> within the <code>.click()</code>.</p> </blockquote> <p>Here's the function I'm supposed to modify</p> <pre><code>// Exercise 5 function addBarClickEvent($bar,value) { // add a click event to the bar that // pops up an alert with the bars value $bar.click( // your code goes here! } ); } </code></pre> <p>I tried both of the solutions shown below but neither worked. The lesson doesn't provide a solution unfortunately. Can anyone help. </p> <pre><code>// Exercise 5 function addBarClickEvent($bar,value) { // add a click event to the bar that // pops up an alert with the bars value $bar.click( // your code goes here! alert($bar.value) //my attempt alert(e.value) //my second attempt } ); } </code></pre> <p>I'm getting this error message</p> <blockquote> <p>Make sure to define the argument to .click as an anonymous function that displays the alert.</p> </blockquote>
javascript jquery
[3, 5]
1,338,600
1,338,601
"Magic" constants in C# like PHP has?
<p>I am building a logging control for a C# project and would like to be able to call it with the name of the current source code File, Line, Class, Function, etc. PHP uses "magic constants" that have all of this info: <a href="http://php.net/manual/en/language.constants.predefined.php" rel="nofollow">http://php.net/manual/en/language.constants.predefined.php</a> but I don't see anything like that in the C# compiler language. </p> <p>Am I looking for something that doesn't exist? </p>
c# php
[0, 2]
2,069,128
2,069,129
How to make a textbox empty in code behind
<p>I have a textbox (txtbox1) which has some value in it. I want to empty the value of textbox. Is that possible in code behind? If yes, how?</p> <p>Thanks!</p>
c# asp.net
[0, 9]
2,890,378
2,890,379
how to set login control to compare the credentials stored in web.config?
<p>I have set my credential in web.config as :</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="Login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20"&gt; &lt;credentials passwordFormat="MD5"&gt; &lt;user name="Nayeem" password="pwd"&gt;&lt;/user&gt; &lt;/credentials&gt; &lt;/forms&gt; &lt;/authentication&gt; &lt;authorization&gt; &lt;deny users="?"/&gt; &lt;/authorization&gt; </code></pre> <p>and have my login control as :</p> <pre><code>&lt;asp:Login ID="LoginEmployees" runat="server"/&gt; </code></pre> <p>I want my login control to authenticate with the credentials given in the web.config file</p>
c# asp.net
[0, 9]
3,507,216
3,507,217
Android multitasking problem
<p>I have an android application which main view consists of a tab-bar with three tabs in it.</p> <p>When developing and running the application on the device through adb I get the following behavior:</p> <ul> <li>When clicking the phone button "Home screen" and relaunching the application it seems as the application continues where I was before pressing the button (remembers selected tab etc...) (apparently its still running in the background).</li> </ul> <p>However when I export and sign the application (using Eclipse) it suddenly always seem to start a new instance of the application when returning from home screen.</p> <p>Why does it behave so different in those cases? And what do I need to do in my application in order to always have the "running in background" behavior.</p>
java android
[1, 4]
1,495,690
1,495,691
What are best practices for combining PHP and Jquery?
<p>I am building a MySQL/PHP ticketing system application for a fairly big company which will possibly have between 1000-2000 users. This is my first real enterprise application and so I really want to make sure I do things properly based on best practices. I am not what you would call a seasoned developer. I know how to write code and make it work but i've never had a mentor or anyone to correct my work so I have no idea if the way I do things is good or bad... or even ass backwards. </p> <p>We have 4 levels of access for the system and so the application needs to read these from the users session. My partner did the back end DB programming and i'm in charge of front-end interface. I've spent the last 6 months writing small tools using pure Jquery and so I have become a big fan of it, and find that I can do things really quickly with it. For interface work I love it. However, session management can only be done in PHP afaik. </p> <p>That's not necesarily a problem since I can include bits of JS and PHP on the same page though I prefer not to if I don't have to. For instance, my login page is just JS/HTML which makes an ajax request to a PHP login web service. Any time I can delegate processing tasks to PHP I prefer to write a service which I can use in an AJAX call. </p> <p>If I have to deal with sessions however, I don't think i'm going to be able to do that. Or can I? I'm interested in hearing from you professionals out there on what you feel are the best practices related to this. </p> <p>Many thanks in advance. </p>
php jquery
[2, 5]
5,635,214
5,635,215
Javascript - Regx to check for characters
<p>All,</p> <p>I am looking for a JavaScript function that checks for the following characters (without commas) in a string. If they are present, it would return false, else returns true</p> <pre><code>&lt;,&gt;,(,),#,"",',:,:: </code></pre> <p>Thanks</p>
javascript jquery
[3, 5]
3,797,730
3,797,731
JQuery script runs twice
<p>some JQuery scripts in web page runs twice. What is all about ? Maybe somebody faced such problem ? </p> <p>For example(code that gets total items number from DB and runs in $(document).ready(function(){}); ):</p> <pre><code>$.post("/index/getitemscount/", {} ,function(data){ $('#items_count_div').html(data); }, 'text'); </code></pre> <p>As I see in FireBug(Firefox plugin), code runs twice...</p> <p>Your help would be appreciated.</p>
javascript jquery
[3, 5]
2,505,146
2,505,147
Child and parent simultaneous resize
<p>I am trying to make simple picture resizer on my web. However I have got one problem. Everything works fine if I am trying to resize parent. But another story is when I am trying to also resize child.</p> <p>Those are parts of my code:</p> <pre><code>var newElement2 = document.createElement('div'); var newElement2Id = 'p'+prefix+i; newElementId = prefix+i; newElement.setAttribute('id',newElementId); newElement2.setAttribute('id',newElement2Id); newElement.appendChild(newElement2); newElement2.style.position = 'absolute'; newElement2.style.left = 0+"px"; newElement2.style.top = 0+"px"; newElement2.style.background = "#E6E6E6"; //........................// var childs = dragDrop.El.childNodes; dragDrop.addMarkers(dragDrop.El,childs[1]); //..........................// addMarkers: function(obj,extra){ var width = parseInt($(obj).css('left')); var maxW = dragDrop.Elements[$(obj).attr('id')].MaxRight-width; var height = parseInt($(obj).css('top')); var maxH = dragDrop.Elements[$(obj).attr('id')].MaxBottom-height; $(obj).resizable( { minWidth:50, minHeight:50, maxWidth:maxW, maxHeight:maxH }); if(extra!=null&amp;&amp;extra!=undefined) { $(extra).resizable( { minWidth:50, minHeight:50, maxWidth:maxW, maxHeight:maxH }); } }, //...................................// </code></pre> <p>This is not a whole code. It is too long. I hope that it is enough to help. So, the thing is when I am trying to resize child it doesn't want to. When I've changed the order of resize so first was child and then parent I wasn't able to resize anything.</p> <p>Can anyone tell me what am I doing wrong?</p>
javascript jquery
[3, 5]
3,617,468
3,617,469
jQuery.scrollTop() not triggering $(window).scroll() in IE
<p>I am creating a one page website where links can scroll the page down to an element specified in the hash part of the url. In Firefox &amp; Chrome it works fine, yet when trying it in IE the <code>scroll</code> event doesn't seem to be triggered on page load.</p> <p>This is the code that checks the hash and scrolls to a specific part of the document, this happens in <code>$(document).ready()</code></p> <pre><code>if(location.hash != '' &amp;&amp; location.hash != '#!/home') { var obj_id = location.hash.substr(3, location.hash.length); $('html, body').scrollTop($('#' + obj_id).offset().top - 80); } </code></pre> <p>I've tried forcing it to trigger the scroll by adding <code>$(window).scroll()</code> at the end of that code, but that just seems to reset the scroll to 0.</p> <p>Thanks,</p> <p><strong>Edit</strong></p> <p>Sorry, I don't think I was making myself clear, but this bit of code technically works fine, but I have a <code>$(window).scroll(function() { ... });</code> event handler further on in my script which, when scrolled past a certain point, attaches my header to the top of the page.</p> <p>Here is that code:</p> <pre><code>var obj = $('#header-background'); var obj_height = $('#header-background').outerHeight(true); obj.wrap('&lt;div style="width: ' + obj.outerWidth(true) + 'px; height: ' + obj_height + 'px; display: block"&gt;'); var top = obj.offset().top - parseFloat(obj.css('marginTop').replace(/auto/,0)) + 20; $(window).scroll(function() { var y = $(this).scrollTop(); if(y - (obj_height - 80) &gt;= top) { obj.addClass('fixed').css({ 'height': '80px' }); } else { obj.removeClass('fixed').css({ 'height': '245px' }, 'fast'); } }); </code></pre>
javascript jquery
[3, 5]
4,663,748
4,663,749
How do I unserialize a jQuery-serialize value in php
<p>I am able to send jquery serialize value in php file. But I can't unserialize jquery serialize value in php. Now Please, tell me How do I unserialize jquery serialize value in php file. my jquery code is :</p> <pre><code> &lt;script type="text/javascript"&gt; // index.php function get(){ $('#age').hide(); $.post('data.php',{ name: $('form').serialize() }, function (output){ $('#age').html(output).fadeIn(1000); }); } &lt;/script&gt; </code></pre> <p>data.php file is:</p> <pre><code>&lt;?php echo var_dump(unserialize($_POST['name'])); ?&gt; </code></pre> <p>I use above code for unserialize jquery serialize value but I don't get any result</p>
php jquery
[2, 5]
225,063
225,064
Scan folder in javascript
<p>I like the JavaScript equivalence of the php funtion : echo json_encode(glob("images/*.jpg")) ?>);</p> <p>is it possible ?</p>
php javascript
[2, 3]
3,062,195
3,062,196
Fastest jQuery autoellipsis plugin?
<p>I'm looking for a jQuery autoellipsis plugin. (autoellipsis plugins will add <code>...</code> at the end of a multiline text.)</p> <p>I know these plugins: <a href="http://pvdspek.github.com/jquery.autoellipsis/" rel="nofollow">autoellipsis</a> and <a href="http://dotdotdot.frebsite.nl/" rel="nofollow">dotdotdot</a>. but both working slowly in my jQuery Mobile project.</p> <p>What is the fastest jQuery autoellipsis plugin?</p> <p>EDIT: I have to call autoellipsis plugin on window resize event.</p>
javascript jquery
[3, 5]
3,472,754
3,472,755
bottom left & bottom right of HTML element
<p>How could I get bottom left x-y &amp; bottom right x-y of any HTML element? I wanted to assign it to another <code>&lt;div&gt;&lt;/div&gt;</code></p>
jquery asp.net
[5, 9]
3,792,718
3,792,719
jquery replacing special characters in a string
<p>I will replace <code>c:\pictures\picture1.png</code> to <code>c:\\pictures\\picture1.png</code> </p> <p>i.e: </p> <pre><code>var data="c:\pictures\picture1.png" data=data.raplace('\','\\'); </code></pre> <p>in asp.net it can run with</p> <pre><code>data=data.replace('\\','\\\\'); </code></pre> <p>when I use this method in jquery it replaced only the firs '\' character and it comes so:</p> <pre><code>c:\\pictures\picture1.png </code></pre> <p>how can I replace all '\' characters</p>
jquery asp.net
[5, 9]
5,409,859
5,409,860
How to get the text of several td which have same id name?
<p>i have table in that five td which contain same id. Id="divParent" but in that different text, i want to access all the text in array which id ="divParent" in other page using java script. how to get this i tried to do this using this code;</p> <pre><code>var divParent=new Array(); divParent=window.parent.document.getElementById('divParent'); </code></pre>
javascript asp.net
[3, 9]
4,222,380
4,222,381
How to display data in particular gridview when particular checkbox is selected?
<p>I have 6 check boxes in 1 panel, and 6 gridviews i other seven differnt panels. when i check checkbox 1, the data should be displayed in gridview one and so on. How to do this?</p>
c# asp.net
[0, 9]
1,231,712
1,231,713
Visual C# : how to login to a website(that is built via asp.net classic) and keep the user logged in ..
<p>Step 1 : Log into a website Step 2 : navigate a a particular page Step 3 : download a file (I suppose webclient would be ideal here) </p> <p>would like all this to be happening silently without the user knowing it . I do not want to use the webbrowser object for the same reason</p> <p>Note : The Website is built by someone else disconnects if the user is idle for a certain period of time. </p> <p>Problem is , I have no idea reagarding how to go about keeping the user logged in that website using c# . I do not have a concrete idea of it yet . i just wanted someone to point me in the right direction . </p> <p>Thanks </p>
c# asp.net
[0, 9]
441,657
441,658
Javascript Copy Clipboard function which works perfectly on all latest browsers
<p>I have got below cocpy clipboard function which works perfectly on latest Internet Explorer as well as Latest Firefox.</p> <pre><code>function copyToClipboardCrossbrowser(s) { //s = document.getElementById(s).value; if( window.clipboardData &amp;&amp; clipboardData.setData ) { clipboardData.setData("Text", s); } else { // You have to sign the code to enable this or allow the action in about:config by changing //user_pref("signed.applets.codebase_principal_support", true); netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var clip = Components.classes["@mozilla.org/widget/clipboard;1"].createInstance(Components.interfaces.nsIClipboard); if (!clip) return; // create a transferable var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable); if (!trans) return; // specify the data we wish to handle. Plaintext in this case. trans.addDataFlavor('text/unicode'); // To get the data from the transferable we need two new objects var str = new Object(); var len = new Object(); var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); str.data= s; trans.setTransferData("text/unicode",str, str.data.length * 2); var clipid=Components.interfaces.nsIClipboard; if (!clip) return false; clip.setData(trans,null,clipid.kGlobalClipboard); } } </code></pre> <p>Can you please suggest what changes I need to do in above function so that works perfectly on safari as well as opera.</p> <p>I know there is way if we install shockwave on these browsers using flash to get copied data. I just don't want to go for flash solution.</p> <p>Thanks.</p> <p>Best Regards, Manoj</p>
javascript jquery
[3, 5]
5,270,760
5,270,761
PHP JSON and <script> tag
<p>I am using PHP to send a json string to jQuery ajax. I am simply using $("#id").html(data.result) to display the html from the fetched page. Now on the fetched page I am looping through MySQL results. I need to run a piece of javascript on each result so I can start a countdown timer for each result.</p> <p>My problem is that the calling page simply displays the actual javascript script as a string.</p> <pre><code>$row_array['result'] .= '&lt;script&gt;trigger script&lt;/script&gt;' </code></pre> <p>Any suggestions?</p> <p>Thanks</p>
php jquery
[2, 5]
4,954,441
4,954,442
How to handle ConnectTimeoutException Android
<p>Does anyone know how to handle a ConnectTimeoutException? i'm posting variables to a url using AsyncTask but my internet connection is shocking so i'm recieving null data back because of a ConnectTimeoutException. What are the best ways to handle this for example if time out occurs try run again etc i have not had this problem before so don't have a clue how to handle but i feel it needs handling to improve user experience. so any ideas?</p>
java android
[1, 4]
4,578,650
4,578,651
jQuery: Returning the text from first-child or self
<p>I am trying to get the text inside an element and I only want to get the text if it's inside the first-child of a placehoder div or if there are no childrent and it's only text inside.<br /> So the two scenarios are:</p> <pre><code>&lt;div id="wrap"&gt;text1&lt;/div&gt; </code></pre> <p>and</p> <pre><code>&lt;div id="wrap"&gt;&lt;b&gt;text1&lt;/b&gt;&lt;b&gt;text2&lt;/b&gt;&lt;/div&gt; </code></pre> <p>So In both cases I want to get back <code>"text1"</code><br /> I know how to do it with 2 different queries but I am trying to unite them into one </p> <pre><code>$("#wrap :first-child").text() $("#wrap").text() </code></pre>
javascript jquery
[3, 5]
2,244,171
2,244,172
find character array length in Android
<p>to get length of string</p> <pre><code>String str=strLenData.toString(); int ipLen= str.length(); return ipLen; </code></pre> <p>whatever be the value of <code>strLenData</code>, value of <code>str</code>= <em>[C@40523f80</em>. As a result, for every char[] I input, the length is shown as 11. </p> <p>I have to use the length as a limit to a loop. Many a times the actual length of char [] would be less than 11. In those cases, the application crashes with the <code>java.lang.ArrayIndexOutOfBoundsException</code>. </p> <p>Is there any other method to find the length of array. In C++ we might look for <code>'\x0'</code> to mark the end of string. But I guess that is not valid case in Android. </p>
java android
[1, 4]
122,941
122,942
Sending JavaScript code from c# windows application to a running instance of IE does not work?
<p>I'm working on a project in which I need to send a JavaScript function from c# windows application to a running instance of internet explorer and then the IE run the script and return the result to my c# application. (Very confusing? =) )</p> <p>Just to make it more clear, here is the case:</p> <p>I get the <code>IHTMLDocument2</code> of the running instance of internet explorer like this:</p> <pre><code> htmlDocument = ObjectFromLresult(lResult,typeof(IHTMLDocument).GUID, IntPtr.Zero) as IHTMLDocument2; </code></pre> <p>Then I want to send a JavaScript function to the IE instance, the code can be something like this:</p> <pre><code>string code = "function myTest() { alert('ready'); } myTest();"; </code></pre> <p>I use the following code to send the JavaScript code:</p> <pre><code>htmlDocument.Script.GetType().InvokeMember("eval", System.Reflection.BindingFlags.InvokeMethod, null, htmlDocument.Script, new object[] { code }); </code></pre> <p><strong>now here is the question:</strong></p> <p>Sending the above simple JavaScript code to IE works fine, but if I want to send codes that work with events (like <code>onmouseover</code>, <code>onmouseclick</code> ,etc), it does not work and results in the following exception:</p> <p><em>TargetInvocationException was unhandled. Exception has been thrown by the target of an invocation.</em></p> <p>Q: how I can send JavaScript codes that use events like :</p> <pre><code>document.body.onmouseover = function(mEvent){...}; </code></pre> <p><strong>note:</strong> It's not ASP.net or web application, It's desktop application.</p> <p>I always appreciated the knowledge and great ideas of you. Thanks in advance. :)</p>
c# javascript
[0, 3]
2,235,909
2,235,910
Pass C# Values To Javascript
<p>On loading the page I want to pass a value to my javascript function from a server side variable.</p> <p>I cannot seem to get it to work this is what I have:</p> <p>Asp.Net</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { string blah="ER432"; } </code></pre> <p>Javascript</p> <pre><code>&lt;script type="text/javascript"&gt; var JavascriptBlah = '&lt;%=blah%&gt;'; initObject.backg.product_line = JavascriptBlah; &lt;/script&gt; </code></pre> <p>Adding this to the page</p> <pre><code> public string blah { get; set; } protected void Page_Load(object sender, EventArgs e) { blah="ER432"; } </code></pre> <p>I still am getting an error: CS0103: The name 'blah' does not exist in the current context</p> <p>Also I would like to try and accomplish this without using hdden fields</p>
c# javascript asp.net
[0, 3, 9]
1,159,694
1,159,695
How to get the current iteration of each() loop in jQuery?
<pre><code> $('#selectDropDowns select').each(function() { // do usual stuff // do extra stuff only if this is the 4th iteration }); </code></pre> <p>In order to do the extra stuff on the 4th iteration, how can I detect it?</p>
javascript jquery
[3, 5]
5,644,371
5,644,372
jQuery: Get related or nearly elements?
<p><strong>My codes in HTML:</strong></p> <pre><code>&lt;p&gt;&lt;input type="text" class="txt" id="u" /&gt;&lt;label for="u"&gt;user&lt;/label&gt;&lt;/p&gt; &lt;p&gt;&lt;input type="text" class="txt" id="p" /&gt;&lt;label for="p"&gt;pass&lt;/label&gt;&lt;/p&gt; </code></pre> <p><strong>Javascript:</strong></p> <pre><code>$(document).ready(function() { if( $('.txt').val() ) { //change st in related label tag } }); </code></pre> <p>How to do that? Please help me solve this issue. Thank you very much !</p>
javascript jquery
[3, 5]
5,713,236
5,713,237
how asp.net update panel conditional update works?
<p>I use VS2010,C# to develop a web app for a company, they want to have a music playing while user views their site, I've found some controls (flash and JavaScript) to play mp3 files, but the problem is that whenever there is a postback, music starts to play from beginning, and it is not good, music should continue playing, I've used an update panel with update mode set to conditional, then inserted my JavaScript mp3 player inside this update panel, but when page has a post back (caused by some buttons outside the update panel) my music starts from beginning! I think setting update mode to conditional should update the update panel only when there is a postback caused by controls inside it, how can I prevent my JavaScript player from re-start when there is an outside postback? should I use something else? what is going wrong here?</p> <pre><code> &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt; &lt;/asp:ScriptManager&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;script type="text/javascript" language="JavaScript" src="http://www.phenomenontest.com/audio-player.js"&gt;&lt;/script&gt; &lt;object type="application/x-shockwave-flash" data="http://www.phenomenontest.com/player.swf" id="audioplayer1" height="24" width="290"&gt; &lt;param name="movie" value="http://www.phenomenontest.com/player.swf"/&gt; &lt;param name="FlashVars" value="autostart=yes&amp;playerID=audioplayer1&amp;soundFile=http://www.phenomenontest.com/silas.mp3"/&gt; &lt;param name="quality" value="high"/&gt; &lt;param name="menu" value="false"/&gt; &lt;param name="wmode" value="transparent"/&gt; &lt;/object&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; </code></pre>
javascript asp.net
[3, 9]
2,610,893
2,610,894
Basic jQuery fadeIn, fadeOut problem?
<p>Below are my code, When I click Next Box it show the Box B second box and hide Box A and so on then if Box C is loaded the last box it will show alert that "There is no Box left"</p> <p><strong>My CSS</strong></p> <pre><code>.hide{ display:none} </code></pre> <p><strong>My HTML</strong></p> <pre><code>&lt;div class="q"&gt;Box A&lt;/div&gt; &lt;div class="q hide"&gt;Box B&lt;/div&gt; &lt;div class="q hide"&gt;Box C&lt;/div&gt; &lt;a href="#" id="btnNext"&gt;Next Box&lt;/a&gt; &lt;div id="alert" class="hide"&gt;There is no Box left&lt;/div&gt; </code></pre> <p><strong>My JS script</strong></p> <pre><code>$(function() { $("#btnNext").click(function(){ $(this).parents('.q').fadeOut(500, function(){ if($('.q:last')){ $("#alert").fadeIn(500); }else{ $(this).next().fadeIn(500); } }); }); }); </code></pre>
javascript jquery
[3, 5]
3,069,777
3,069,778
How much of a transition is programming Java to iPhone apps?
<p>I'm a highly skilled Java dev contemplating learning iPhone development. Mac only dev aspects aside, how much of a leap would learning the mobile application stack be? Sure I understand that its closer to C in how one should approach it, and with that comes memory management and so on. </p> <p>My queries would also include </p> <ol> <li>How well is OOP/OOAD supported? </li> <li>Is there some API(s) which enable unit testing? </li> </ol> <p>I'd encourage those who answer to quote external sites and references to help elaborate the detail</p>
java iphone
[1, 8]
3,360,304
3,360,305
pass several parameters to php using js
<p>I have some problems when trying to pass some parameters to PHP via JS.</p> <p>Here's the situation:</p> <p>HTML:</p> <pre><code>&lt;form id="numbtns" method="post" action="imphp.php"&gt; &lt;button id="1" onClick="pass(this.id)"&gt;1&lt;/button&gt; &lt;button id="2" onClick="pass(this.id)"&gt;2&lt;/button&gt; &lt;button id="3" onClick="pass(this.id)"&gt;3&lt;/button&gt; &lt;button id="confirm" onClick="save()"&gt;submit&lt;/button&gt; &lt;/form&gt; </code></pre> <p>JS: </p> <pre><code>pass(clicked_id) { var btn = document.getElementById(clicked_id); **// I have no idea what to do next to give the ids to the php file.** } save() { **// I want function save() to collect the parameters from function pass(), and pass them to 'imphp.php' when submit button is clicked. I'm stuck here.** } </code></pre> <p>PHP:</p> <pre><code>// connection part, let's skip it. ... $num = $_POST['num']; $query = sprintf("SELECT id, num FROM tb WHERE num = $num"); </code></pre> <p>I know maybe it's a quick and stupid question for u, but I cannot figure it out for hours. So... could anyone help me out, I'd be very appreciate that.</p> <p>Thx in advance.</p>
php javascript
[2, 3]
3,690,358
3,690,359
Make checkbox and a textbox Readonly
<p>Following is my javascript code,is there a way to make checkbox and textbox readonly?</p> <pre><code>//display textboxes and checkbox when condition is true. if($$("id").value =="something"){ document.getElementById("textboxl").style.display=""; document.getElementById("chkbox1").style.display=""; document.getElementById("textbox2").style.display=""; document.getElementById("chkbox2").style.disable=""; } </code></pre> <p>I have to display and then disable it(i mean make it readonly).</p>
javascript jquery
[3, 5]
5,295,080
5,295,081
how to enable tool bar in IE9 using JavaScript?
<p>I am using IE 9 . I need to enable tool bar in IE 9 using JavaScript <code>toolbar=yes</code> while opening a new window.</p> <pre><code>window.open('NZFReferenceSelector.aspx?RefID=' + refID, '_self', 'toolbar=yes', false); </code></pre> <p>It works in IE7. </p> <p>it shows tool bar with out left and right arrows. how to get arrows?</p> <p>Application developed in vs2010.</p>
javascript asp.net
[3, 9]
4,791,165
4,791,166
Generating Text box control from behind "C#"
<p>i am kinda new to asp.net, and also my english not really good, anyway i hope you still can get my point. nah i have a question here, basically i trying to integrate my app with LinkedIn, so i am using REST API, when i click a button it redirect my page to request data from LinkedIn, it returned XML data, and it contain user's education data, the count of user's education data is uncertain, so i decided to generate text box control from behind ("C#"). i do this :</p> <pre><code> TextBox txt; int i; foreach (var element in person) { if ((element.Name == "first-name") || (element.Name == "last-name")) { tbName.Text = tbName.Text + " " + element.Value; } else if (element.Name == "skills") { i = 1; foreach (var child in element.Elements()) { if (child.Name == "skill") { txt = new TextBox(); txt.ID = "tbSkills" + i; txt.Width = 200; txt.Visible = true; txt.ReadOnly = true; txt.Text = child.Element("skill").Element("name").Value; form1.FindControl("divMoreSkills").Controls.Add(txt); i++; } } } else if (element.Name == "industry") { tbIndustry.Text = element.Value; } else if (element.Name == "educations") { i = 1; foreach (var child in element.Elements()) { if (child.Name == "education") { txt = new TextBox(); txt.ID = "tbEducations" + i; txt.Width = 200; txt.Visible = true; txt.ReadOnly = true; txt.Text = child.Element("school-name").Value; form1.FindControl("divMoreEducations").Controls.Add(txt); i++; } } } } } </code></pre> <p>my question is, if i want to use text box i generated previously later, does C# will recognize it? because the control i generated did not have runat server property.</p> <p>thank you.</p>
c# asp.net
[0, 9]
3,890,226
3,890,227
jQuery .keyup() delay
<p>I've got a search field.</p> <p>Right now it searches for every keyup. So if someone types Windows, it will make a search with AJAX for every keypress: W, Wi, Win, Wind, Windo, Window, Windows.</p> <p>I want to have a delay, so it only searches when the user stops typing for 200 ms.</p> <p>There is no option for this in the keyup function, and I have tried <code>setTimeout</code>, but it didn't work.</p> <p>How can I do that?</p>
javascript jquery
[3, 5]
5,859,898
5,859,899
Passing Javascript variables in php
<p>I have 2 pages: details.php and terrainChooser.php</p> <p>Terrain Chooser creates a td tag with an element and adds to it 3 input type="hidden" with information to retrieve.</p> <pre><code>window.opener.document.getElementById(elementID).innerHTML = " &lt;input readonly type='text' style='background-color:#eed8bb;border:0;' name='parcName" + parcNum + "' value=\"" + txt + "\" /&gt; &lt;input type='hidden' id='parcId" +parcNum + "' value='" + id + "' /&gt; &lt;input type='hidden' id='regID" + parcNum + "' value='" + regID + "' /&gt; &lt;input type='hidden' id='muni" + parcNum + "' value=" + muni +" /&gt;"; </code></pre> <p>Inside details, they have been retrieved for a purpose and are used to display the values of the 3 input type hidden.</p> <p>My question is, how do i go about using those javascript variables to say pass them through an sql statement in my php part say:</p> <pre><code>$SQL = "update T_TOURNOI_PARC set F_PARCID1 = $parc[0], WHERE F_TOURNOIINFOID = $tournoiId"; $rs-&gt;execute($SQL); </code></pre> <p>Where $parc[0] would have the 3 values.</p> <p>This doesn`t work but is there something like this i can use?</p> <pre><code>&lt;script type="text/javascript"&gt; /* &lt;![[CDATA */ var test = document.getElementById['muni1'].value /* ]]&gt; */ &lt;/script&gt; &lt;?php $test = ('&lt;script type="text/javascript"&gt;test&lt;/script&gt;'); ?&gt; </code></pre>
php javascript
[2, 3]
3,172,208
3,172,209
how can I calculate number of options tag when I get the select box with $this
<p>I have a question as to how can I calculate number of options tag when I get the select box with $this.</p> <p>Like that:</p> <pre><code> $("select[name=rabetas]").click(function(){ var $this = $(this); </code></pre> <p>And...?</p> <p>how can I do this?</p>
javascript jquery
[3, 5]
2,590,195
2,590,196
Android - Accessing a variable in Activity (Using synchronization)
<p>I have a question in synchronization between threads in Android. </p> <p>What I have is: </p> <p>2 thread spawned from an activity, and each of this thread is accessing a field in the activity simultaneously. </p> <p>What I am thinking of is to use synchronize, such as </p> <pre><code>synchronize private void functionA() </code></pre> <p>or </p> <pre><code>synchronize(mContext){ .... } </code></pre> <p>(where mContext is context of activity) </p> <p>But I am not sure if it will really work. </p> <p>Or does anyone has any better ideas? </p> <p>Thanks. </p>
java android
[1, 4]
2,244,814
2,244,815
Javascript - Browser skips back to top of page on image change
<p>I have some simple code to replace an image src. It is working correctly but everytime the image is updated, the browser skips right back to the top of the page.</p> <p>I have several image tags in my page. All of which hidden, except for the first one. The script just iterates through them and uses the src attribute to update the first image.</p> <p>Here is the code I am using:</p> <pre><code>var j = jQuery.noConflict(); var count = 1; var img; function update_main_image() { count++; if (j('#main_image_picture_'+count).length &gt; 0) { img = j('#main_image_picture_'+count).attr('src'); } else { count = 1; img = j('#main_image_picture_'+count).attr('src'); } j(".main_image_picture_auto").fadeOut(1500, function() { j(this).fadeIn(); j(this).attr("src", img); }); } j(document).ready(function() { setInterval(update_main_image, 6000); }); </code></pre> <p>Any ideas what might be causing it? Any advice appreciated.</p> <p>Thanks.</p>
javascript jquery
[3, 5]