English 中文(简体)
创建职能(JS),以拯救档案中的位置,并称这一功能
原标题:Create function (JS) to save string in the file and call this function

我在几天里用“网络”,但我没有掌握足够的经验,因此需要帮助。

What I need: Create simple page with textarea and button. When I press button, it takes data entered in textarea and saves it in N s string in the data/data.php file.

这是我迄今为止可以做的:

<!DOCTYPE html>
<html>
<head>
<title>Loading from DB</title>
<link rel="stylesheet" href="C:/__OSS/00. Soft/Webix/codebase/webix.css" type="text/css">
<script src="C:/__OSS/00. Soft/Webix/codebase/webix.js" type="text/javascript"></script>
</head>
<body>

<!--<?php
$filename = getcwd() . "data/data.php";
echo $filename;
$line_i_am_looking_for = 5;
$lines = file( $filename , FILE_IGNORE_NEW_LINES );
$lines[$line_i_am_looking_for] =  6my modified line ;
file_put_contents( $filename , implode( "
", $lines ) );
?>-->

<div class= header_comment >Test Button</div>
<div id="testB" style= height:600px ></div>
<hr>
<script type="text/javascript" charset="utf-8">

        webix.ready(function(){


          gridb = webix.ui({
                                container:"testB",
                 "view": "form",
  "elements": [
    {
      "view": "textarea",
      "name": "woNumber",
      "id": "textarea",
      "label": "",
      "width": 300,
      "height": 200,
      "options": [
        "onViewResize"
      ],
      "value": "",
      "placeholder": "WO number (separate with comma if several)",
      "labelPosition": "top"
    },
    {
      "view": "button",
      "name": "getWODetails",
      "label": "",
      "value": "Submit",
      "options": [
        "autowidth:true"
      ],
                on:{
                    onItemClick:function(id){
                        webix.message("Sikim BLEAT !!!");

/*                  onItemClick: getTextareaData;
*/
                    }
                },
      "labelPosition": "top"

    },
    {
      "view": "button",
      "id": "button1",
      "name": "getWODetails",
      "label": "",
      "value": "Passss",
      "options": [
        "autowidth:true"
      ],
                                on:{
                                        onItemClick:function(){
                                                webix.message("Values of textarea is "+$$( textarea ).getValue());
                                     }
                                },
      "labelPosition": "top"

    }

  ]
                        });     
        });

        </script>
</body>
</html>

So I can get value from textarea with $$( textarea ).getValue()), but have no idea how to write it in the file. I can do it easily with PHP (commented out part) but don t know how to make it works with Webix. I believe it is not so hard, but can t figure out what to do..

任何帮助都得到了高度评价。

问题回答

在网上,你可以使用一名助教。 以下信息:





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签