server-side

Changing text content depending on button clicked

廉价感情. 提交于 2020-01-04 14:21:17
问题 I am sort of a beginner at this, but my objective is to have the header of my webpage changing, depending on what button was clicked on another page. More precisely, I have a webpage with 7 buttons on it coded like this: <form action="contribution.html"> <input type="submit" style="margin-right: 80px;margin-top: 25px;" value="I contribute"> </form> All of the buttons lead to the same "contribution.html" page, but I would like the header of that page to be different depending on what button

React server side rendering and lazy loading of webpack

旧街凉风 提交于 2020-01-04 09:17:55
问题 I am using server side rendering with lazy loading of Webpack 2.2.0 using import() method, and using babel-plugin-transform-ensure-ignore for server side only, everything runs without errors and perfectly working except one thing. when page is loaded I can see server side rendering, but when webpack calling my dynamic component, all page renders again, which is visible for users. I need to know how to handle such problems. I found it when saw that, my first line is <div data-reactroot="" data

Execute Javascript server side

為{幸葍}努か 提交于 2020-01-04 06:12:56
问题 I was interested in obfuscating my JS code, but I realized arround forums that it is useless. I would like to obfuscate my code anyway. So I was wondering, is that possible to execute JS code on server side (with an app in node.js for example), and just call via Ajax function with context (like dom, or something else), execute on server side, then give back result to page. It could be very usefull for me, that could permit to just show basic JS functions, but not core of my app... Perhaps a

In Dart on server-side, how to set headers in HttpClient

核能气质少年 提交于 2020-01-04 03:00:48
问题 I am trying to use the Dart HttpClient class (io library / server-side!) and I can not think how to do the EQUIVALENT of the Dart (client-side) call to setRequestHeader. Specifically I want to set "Content-type" to "application/json" as per this line (from Client-side): request.setRequestHeader("Content-type", "application/json"); I'm using the format: new HttpClient().postUrl(Uri.parse(url)) .then((HttpClientRequest request) => request.close()) .then((HttpClientResponse response) => response

Server-side getting dom properties (height of element)

匆匆过客 提交于 2020-01-03 03:03:12
问题 I want to scale all the HTML element's height in an HTML page. I am doing this with jQuery height() function, but it takes some time and causes problems in the browser. I decided I want to do this at the server. I tried to do this with ajax. But I couldn't. When I write height() function it doesn't return to me value of height() . It returns me just height() code. For example: I will send my html code to server with this function sendHtml('<table><tr><td>'.$variable.'</td></td></table>');

Are there any APIs for programmatically translating text on the server-side?

a 夏天 提交于 2020-01-02 04:49:29
问题 I've looked at Google Translate but from what I can tell it only offers a client-side JavaScript API for freely translating text between languages. What I need to do is translate text on the server side in Java. Is there a library that makes it possible to do this for free with Google Translate? 回答1: Here is a Java API... http://code.google.com/p/google-api-translate-java/ and just for reference, a PHP implementation - http://code.google.com/p/gtranslate-api-php/ 回答2: There is nothing

Run server-side js from php through exec()

≯℡__Kan透↙ 提交于 2020-01-01 18:57:30
问题 I have a site running on Apache/PHP, and as a matter of performance, I wrote a javascript to do a specific task. I have installed node.js on server, in order to run this javascript. When I call the script from the command line, it works fine. See the command below: > node myscript.js But I need it to run from a php page, and I am trying to do this by calling the exec() PHP function, like this: <?php exec('node myscript.js >/dev/null/ 2>&1 &'); ?> ...but it's not working. Am I doing something

Server Side HTML to PDF

余生长醉 提交于 2020-01-01 17:26:08
问题 I'm trying to find a C# library that will allow me to "Print" one of my HTML pages to a PDF file. I can't seem to find out if one currently exists that will allow you to do this. I've found several that will let you build a page, but haven't noticed if one would generate the pdf only based off of HTML. EDIT: I'm not allowed a budget on this at work so it will need to be an open source/free product. If not I'm aware of iTextSharp and will have to generate the pdf programmatically (which is

how to build a in-memory server side cache in php?

冷暖自知 提交于 2020-01-01 10:48:12
问题 I am trying to reduce the amount of database access by providing a in memory cache. I understand that I can get a cache by using session and cookies, however this only works on a per client basis. if the same query is made once in every session, then the cache will be useless. But I only want to access the database once and have it cached. Is there a way to make create a cache in memory that can be accessed by the server side script? I don't want to store the cache data in a file .. 回答1: You

Suggestions for .Net 3D physics engine [closed]

梦想与她 提交于 2020-01-01 09:01:54
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I need physics engine to simulate game world on server. I googled for .Net physics engines and they all were released in 2006-2009. So