w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Wanting to POST a Javascript Variable (From Client Side) to PHP File (Server Side) with AJAX JQUERY call
There could be many different things going wrong here. First, I think your jQuery's $.post snippet is wrong (you're missing a matching curvy bracket and a semicolon at the end) so I find it weird that your server informs you about a successful POST. I'd change this: function() { jQuery.post( 'packed_data.php', {'packed_dat': packed_dat}, function() { alert('Write OK!'); }) Into this: $.post('packed_data.php', { packed_dat: packed_dat }, function (data) { alert('Write OK!'); }); And then, in your packed_data.php script, give $uid a default value so in case $_POST['packed_dat'] isn't set, it still creates a file or not (and from that distinguish whether the problem is in the server side or in the client side).

Categories : PHP

Crop and upload image on client-side without server-side code involve
The solution i used: First I use a 3rd party javascript library to select the crop area like jCrop. Once i got the coordinates (x1,x2,y1,y2), i draw a copy of an image to a canvas. var canvas = document.getElementById('drawcanvas'); var context = canvas.getContext('2d'); canvas.width = canvas.width; // clear canvas var imageObj = new Image(); imageObj.onload = function() { // draw cropped image // ... context.drawImage(imageObj, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, sourceWidth, sourceHeight); var dataURL = canvas.toDataURL(); }; imageObj.src = // image url After i drew the canvas, i converted the canvas to a DataURL which is in base64 format. On

Categories : Javascript

client side and server side page generation
From my experience, there are two scenarios in which you'd want to render client-side: You are building a pure client-side JS application. You want to serve the data for different platforms (web, desktop, mobile native). Unless you identify your page with one of the previous scenarios (which I assume you don't), I recommend you to render in server side. Although the response is going to be bigger (server side computing time is negligible), the perceived speed compared to client side rendering is going to be faster. If you need to serve a very big page, note that you could autoload chunks of HTML via AJAX whenever the user reaches the bottom of the page without the need of client side templates.

Categories : Javascript

load part of page when cash page in server side
you need to add AJAX request that will run once on document-ready to get rating from PHP page and update the rating $(document).ready( function(){ $('#productvote-20').load('Rating.php?productId=1'); }) And in that PHP file, you need to output this.. but don't cache that page <input type='checkbox' name='vote' value='1' /> <input type='checkbox' name='vote' value='2' /> <input type='checkbox' name='vote' value='3' /> <input type='checkbox' name='vote' value='4' /> <input type='checkbox' name='vote' value='5' />

Categories : PHP

Getting "A page can have only one server-side Form tag" error, not using a master page
After adding one control you have a form with runat="server" tag: <form id="Form1" runat="server"> <asp:Menu ID="StockMenu" runat="server"> You already mentioned you have 16 usercontrol in one page. So you have 16 forms with runat="server" tag. Which is not allowed. Solution: As Chris Lively suggested, strip out the the form tag from your wsercontrols. Add just one form tag in the page. You should be ok. Here's how should all your controls should look like: <asp:Menu ID="Menu1" runat="server"> <Items> <asp:MenuItem Text="One Day" /> <asp:MenuItem Text="Five Days" /> <asp:MenuItem Text="Three Months" /> <asp:MenuItem Text="Six Months" /> <asp:MenuItem Text="One Year" /> </Ite

Categories : Asp Net

asp.net page wait others server side / asynchrone page
WebForms are not ideal for asynchronous operations. Add SignalR to your project and use a Hub to push status data back to your page to update the current state of the process you are running Asynchronously. An example of a technique to perform this type of asynchronous notification is covered in my blog post titled "A Guide to using ASP.Net SignalR with RadNotifications"

Categories : Asp Net

Is it possible yet to make a single page web page without using server side such as PHP?
Client side javascript can know about the query string on a URL. In javascript, it can be accessed through location.search. You could have your javscript show and hide different sections of the page based on the information in the query string.

Categories : PHP

Test code with out writing server side code
Yes, there is. It's called dependency injection : http://en.wikipedia.org/wiki/Dependency_injection Create this interface public interface ISocket{ void close(): OutputStream getOutputStream(); } And make sure your socket class herits from it. Your constructor becomes private void sendToRemoteServer(){ ISocket client; When you want to test locally, just pass as argument any implementation of ISocket that do whatever you want with the close method and the getOutputStream methods.

Categories : Android

How to update the database,while changing in our server side
please use insert or replase raw query instead this look this. SQLite "INSERT OR REPLACE INTO" vs. "UPDATE ... WHERE" String query = INSERT OR REPLACE INTO DATABASE_TABLE_PROJ (CATEGORY_COLUMN_ID,CATEGORY_COLUMN_TITLE,CATEGORY_COLUMN_CONTENT,CATEGORY_COLUMN_COUNT) VALUES ('1', 'Muhammad','xyz','2'); db.execSQL(query);

Categories : Java

Android Code for Corresponding Server Side Code
Here is library which provides useful file uploading functions you are looking for from your android device. See this link also (it may be helpful to your requirements).

Categories : Android

Server Sent Events, server-side code
Your understanding is correct. PHP needs to keep running, and in PHP you will need a loop, and you'll quickly run out of free Apache threads. If you need to handle lots of connections you need to use event-based server like Node.js or Tornado that can handle lots of open connections. If you'd rather use PHP, then a partial solution is to close connection after few seconds. The browser will reconnect, so you'll get a hybrid of polling and SSE. In PHP you can check sys_getloadavg() to decide whether you can keep connection open or you're running short on free processes.

Categories : PHP

Update data on client side by server push
have you looked at SignalR. Its a server Push Framework which uses HTML5 WWeb Socket beneath. I have created chat server here using SignalR. https://github.com/omkarpanhalkar/AjaxChatRoom

Categories : C#

Update a label in server side in ASP.Net after Button Click
Hard to tell but by the sounds of it you have a submit button and the onclick needs to update this label, something like this should work. I'm using viewstate but session would work here, as would a redirect to the same page with a querystring parameter. Not sure if I've understood your question correctly though. protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { if(Viewstate["updateLabel"] == "true") { lblYourLabel.Text = "I'm updated now!"; Viewstate["updateLabel"] = ""; } } } protected void btnYourButton_Click(Object sender, Eventargs e) { ViewState["updateLabel"] = "true"; //Do other stuff here if you want }

Categories : Asp Net

ASP.Net - GridView server-side variable for each row?
The Session would be the best place to store small data that you need across PostBacks but can't sent to the client. You could put a Dictionary indexed by row identifier into session and use that to fetch your secret key. Note that sessions are maintained across pages, so unless you are ok with the information being in memory till the user signs out(gets logged out eventually) you will have to delete it when done.

Categories : Asp Net

Server Side Includes with variable (IIS 7)
By the extension I guess you would use Classic ASP. Then something like this should work: <!--#include file="header.asp"--> You can put this in each file you want to have a header. Of couse, you should create that "header.asp" page first ;) For highligthing the tab of the page you're in, there're several methods. IMHO, I suggest a clientside script to do that. JS or jQuery of course. You could check the file name of the URL you are in and give the proper class to the tab so it will be highligthed. Example ( jQuery needed ): var currentPage = window.location.pathname.substring(url.lastIndexOf('/')+1); if(currentPage == 'default.asp') $('li.homepage a').addClass('current'); This simple code retrives the file name and, by it, add a class to the corresponding element in your na

Categories : HTML

How to find a client side element in an update panel from code behind?
Try this: <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div id="MyElement" runat="server"> </div> </ContentTemplate> </asp:UpdatePanel> in code behind protected void Page_Load(object sender, EventArgs e) { if(IsPostBack) { var c = MyElement; } } in javascript var MyElement=document.getElementById('<%= MyElement.ClientID');

Categories : C#

SVN hooks. Is there such thing as post-update server side hook?
Post-update hooks doesn't exist in Subversion, but they aren't needed in your case: There aren't reasons to require update WC in the case of missing intersection between files in transaction and changed by earlier commits, not existing in WC If such intersection exist, commit will be blocked automatically and developer must update and merge foreign changes before own commit

Categories : Svn

How to use server side variable in outer javascript
As already stated in the comments, you may extract only the logic pieces into the external file, while preserving a small inline script for passing the variables. As a very simplified example, you may extract from: <script> alert(${helloWorld}); </script> the following part into a separate file: function sayHello(message) { alert(message); } And keep the variables in an inline script: <script> var helloWorld = ${helloWorld}; sayHello(helloWorld); </script> This also encourages some separation of concerns which is a good design recommendation anyway. I am not diving into any other good practices such as the module pattern in this place.

Categories : Javascript

ModalPopupExtender from Server Side Code in c#
The example code is shown below: HTML CODE: <!-- Hidden Field --> <asp:HiddenField ID="hidForModel" runat="server" /> <asp:ModalPopupExtender ID="WarningModal" TargetControlID="hidForModel" runat="server" CancelControlID="btnWarning" DropShadow="true" PopupControlID="pnlIssues" > </asp:ModalPopupExtender> <!-- Panel --> <asp:Panel ID="pnlIssues" runat="server" BorderColor="Black" BorderStyle="Outset" BorderWidth="2" BackColor="Wheat" Width="400px" Height="106px"> <center> <h2 class="style2"> Information</h2> <p> <h3> <asp:Label ID="lblWarning" runat="server"> </asp:Label></h3> </p> <!-- Label in the Panel to turn off the popup --> <asp

Categories : Ajax

Angularjs: restoring model value in $watch after failed update on server side
Basically, you are doing it right. The watcher watches the watched object, so the best thing you can do is to tell it to close one eye for next watch. You can use $timeout to set a temporary flag that gets cleaned up ASAP _skipWatch = false rollBackLocally = (newVal, oldVal) -> _skipWatch = true angular.copy oldVal, newVal # schedule flag reset just at the end of the current $digest cycle $timeout (-> _skipWatch = false), 0 $scope.$watch 'obj.value', (newVal, oldVal) -> return if _skipWatch MyService.doSomething().then ((response) -> $scope.results.push(response)), (-> rollBackLocally newVal, oldVal)

Categories : Angularjs

My Server Side Validation in PHP Comes when the Page is loaded
Are you using GET or POST to submit your form data? If you're using POST, you can check the request method: if($_SERVER['REQUEST_METHOD'] == 'POST') { // Validate form data } else { // Display form } If you're using GET you should check if any of the data you need is set. For example: if(isset($_GET["arg1"]) || isset($_GET["arg2"]) || isset($_GET["arg3"]) || ...) { // Validate data } else { // Display form }

Categories : PHP

How to pass a geolocation variable from client to server side
Inorder to pass the user Geolocation from client side to server side as soon as the user allows for his Geolocation to be used, is by Assigning user position variable (pos) to a HTML element (location) Then, auto submitting a HTML form that contains a POST method. Both the above codes have to be written within Google Geolocation API, as shown below in the excerpt. var infowindow = new google.maps.InfoWindow({ map: map, position: pos, content: 'Location found using HTML5.' }); // the below line has been inserted to assign a JS variable to HTML input field called 'geolocation' document.getElementById('location').value = pos map.setCenter(pos); // the below line has been inserted to autosubmit the form. document.getElementById("geolocation").submit(); Below is th

Categories : Javascript

Accessing a dynamic variable in javascript from Server Side using c#
<%= %> is an equivalent of Response.Write which is not intended to work with AJAX (which what UpdatePanel is). If you need to display something in an UpdatePanel - assign it to a property of a control (it could be some standard ASP.NET Control like Label and its Text property or even a SPAN with runat="server" and its innerHTML property)

Categories : C#

Use server side code if javsascript is disabled
You do it the other way around. You write HTML that works with server side code, then layer JavaScript over the top that stops the HTTP request that would trigger the server side code. The specifics depend on exactly what you want to do, but will usually involve calling the Event.preventDefault() method having bound an event listener. For example, given a form: function calc(evt) { var form = this; alert(+this.elements.first.value + +this.elements.second.value); evt.preventDefault() } var form = document.querySelector('form'); form.addEventListener('submit', calc); See also: Progressive Enhancement and Unobtrusive JavaScript

Categories : Javascript

Can't disable server side HtmlAnchor from code behind
Try this: btnSubmitPhaseBackward.Attributes.Add("disabled", "disabled"); UPDATE: So it turns out that the disabled attribute does not really do what you think it should, to truly disable an HtmlAnchor you have to remove the href attribute, like this: btnSubmitPhaseBackward.Attributes.Remove("href"); To re-enable the HtmlAnchor you would need to add the href attribute back, like this: btnSubmitPhaseBackward.Attributes.Add("href", "http://www.stackoverflow.com");

Categories : C#

Testing the server side code before deploying
When I was testing my server-side I didn't find any other way rather than connecting via wifi, this way it was working just fine (in your code you need to use ipv4, not localhost, just as reminder). I'm not good with network stuff, but I don't think it's possible using usb to create some kind of LAN. Have u tried from emulator? How to connect to my http://localhost web server from Android Emulator in Eclipse

Categories : Android

How to integrate Paypal into ASP.Net c# server side code
Please find the link below to integrate Sandbox Paypal Integration https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/ug_sandbox/

Categories : C#

Javascript update to asp:HiddenField isnot detected server side in IE, but works in Chrome
You could use a two button approach. Use the delete button you have now to call the JavaScript. <asp:Button ID="ButtonDelete" runat="server" Text="Delete" OnClientClick='<%# Eval("DataBoundGuidField","javascript:RunJavaScript({0});") %>' /> A secondary button will actually post the page back. <asp:Button ID="HdnDeleteButton" runat="server" Text="Delete" OnClick="DeleteButtonClickHandler" Style="display: none;" /> Use Javascript to set your hidden filed and click a hidden button to do server side processing function RunJavaScript(id){ $('#<%=TargetField.ClientID %>').value = id; //Call the hidden delete button for server side $('#<%=HdnDeleteButton.ClientID %>').click(); }

Categories : C#

Is there a way to call some server side code when the "New" button is pressed?
You can use ASPxGridView.InitNewRow to catch when the new insert is initiated. You can then use ASPxGridView.CancelRowEditing to catch a cancellation. http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_InitNewRowtopic http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_CancelRowEditingtopic

Categories : C#

How to access servlet attribute in GWT server side code?
You have to get the attribute from the ServletContext instead of from the HttpServletRequest Try this inside your RPC method: public class MyServiceImpl extends RemoteServiceServlet implements MyService { @Override public void MyMethod() { this.getThreadLocalRequest() .getSession().getServletContext() .getAttribute("config"); } }

Categories : Java

Adding checkbox with JS, and find it in server side code (ASP.NET)
In cases like these, I like to take advantage of HTML5 data attribute (http://www.w3.org/TR/2010/WD-html5-20101019/elements.html#embedding-custom-non-visible-data-with-the-data-attributes) This allows you to embed a target for your checkbox in its markup. The following hasn't been tested, and I took a guess about your checkbox markup, hopefully it gives you the idea. function loadImage(array, index) { for (i = 0; i < array.length; i++) { var imageId = 'img_"+i+"'; $("#parentDiv").append("<span style='padding-left: 10px; margin-top: 5px;' id='span_" + i + "'></span>"); $("#span_" + i + "").append("<img style='width: 100px; height: 90px;' id='" + imgeId + "' src='" + array[index] + "' />"); $("#parentDiv").append('<input type="che

Categories : Javascript

How to write APNs server side code in scala?
You are missing an implicit conversion from the java.util.List returned and the scala List that you want. Try adding the following import: import scala.collection.JavaConversions._ And tweak this line: val notifications:List[PushedNotification] = javapns.Push.payload(payload, keystoreFile, keystorePassword, false, devices) To this: val notifications:List[PushedNotification] = javapns.Push.payload(payload, keystoreFile, keystorePassword, false, devices).toList Also, it looks like you will be pushing two times to each device here as the calls to payload and alert both push notifications to the devices. If you only really wanted to send the complex payload that you build, then your code should probably be: val results = javapns.Push.payload(payload, keystoreFile, keystorePassword,

Categories : Scala

Server side QR-Code generator alternative for Google's API?
A quicksearch learnes us the following: http://phpqrcode.sourceforge.net/ You could be using this: Step 1 . download the phpqrcode library and put it in a folder on your server Step 2. Use the following script: if (!isset($_GET['text'])) die('No text given'); include('../lib/full/qrlib.php'); include('config.php'); QRcode::png($_GET['text']); Step 3. Save it and enjoy it!

Categories : PHP

Events raised in .net code is does not seem to occur in COM code when deployed with Side by side manifests
After a long time (and several failed attempts) It turned out I could make this work by making one tiny change: Make the VB6 code compile to P-Code instead of native code. I'm pretty sure this somehow affects how marshalling between threads is handles, but I've been unable to find any information confirming that theory. At least it works... Or Not! (24. October 2013) It turned out that in real life compiling to P-Code was not enough. In another implementation of this pattern we ended up with the event just disappearing into nowhere, with no exceptions (we thought) and no traces. So more investigation was due: 1. The real issue Wrapping the event triggering in a try-catch clause revealed that there was in fact an exception being thrown, it just never surfaced anywhere if (OnHappened

Categories : C#

Specify page size in jquery datatable server side pagination
It may be that the server doesn't respect the iDisplayLength value. In this case you must also update the server side.

Categories : Javascript

How can I do a live-updating web page without server-side scripting access?
It can be done using XMLHttpRequest, as long as both HTML files will be stored in the same location (to avoid CORS constraints). Have a look at this MDN article for examples on how to use XMLHttpRequest. The high-level view would be: // live webpage var xhr = new XMLHttpRequest(); xhr.onload = function () { /* parse xhr.repsonseText */ }; xhr.onerror = function () { /* ... */ }; xhr.open('get', 'server-updated-page.html', true); xhr.send();

Categories : Javascript

Efficient session variable server-side caching with Python+Flask
Your instinct is correct, it's probably not the way to do it. Session data should only be ephemeral information that is not too troublesome to lose and recreate. For example, the user will just have to login again to restore it. Configuration data or anything else that's necessary on the server and that must survive a logout is not part of the session and should be stored in a DB. Now, if you really need to easily keep this information client-side and it's not too much of a problem if it's lost, then use a session cookie for logged in/out state and a permanent cookie with a long lifespan for the rest of the configuration information. If the information it too much size-wise, then the only option I can think of is to store the data other than the logged in/out state in a DB.

Categories : Python

How can we let our web designers code complex web apps without a server side language?
I think you have several options here. Get them to use node.js so they can use their JavaScript skills. Get them to use Ruby on Rails, they will probably appreciate using a new technology, and you get a great framework to boot. But probably more importantly, you should ask them what they think. You might be surprised.

Categories : Asp Net Mvc

Enable an Ajax ComboBox using either javascript or server side C# code
I stumbled on how to solve this problem by trial and error. Instead of var IMEI = $find("<%=cbIMEI.ClientID %>"); I used var IMEIID = '<%= cbIMEI.ClientID %>'; var IMEI = document.getElementById(IMEIID); Doing this, IMEI.disabled = false; works perfectly. I don't at all understand why, but there it is.

Categories : C#

unable to get checked property of htmlinoutcheckbox on server side(code behind)
In order for your dynamically created controls to interact with viewstate, events and other stages in the page life-cycle, they need to be created in the Init event. Creating these controls later in the life-cycle will exclude them from taking part in post value binding, viewstate binding, etc. Also note that you must recreate the controls on EVERY postback. protected void Page_Init(object sender, EventArgs e) { // Do any dynamic control re/creation here. }

Categories : HTML



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.