Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 278 Vote(s) - 3.39 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pass value from php to Jscript

#1
I have below code.
I am getting time from other page via get method into feedback.php.

Now I need to pass this value from feedback.php to chart.js on this line **['Time taken by you is', time]** then it will dispay chart on feedback.php page. How can I get this things done?

feedback.php

<script src="chart.js"></script>
<div id="chart_div"></div>
<div id="chart_div"></div>

**<?php $time= $_GET["sec"];?><br>**

chart.js

var data = google.visualization.arrayToDataTable([
['Time', 'Time taken by worker'],
['Worker 1 ', 200],
['Worker 2', 150],
['Worker 3', 300],
['Worker 4', 160],
['Worker 5', 140],
['Time taken by you is', time]
]);

Reply

#2
Try Below

**Define Time Var before load chart.js**



<script>
var TIME_VAR = '<?=$_GET["sec"];?>';
</script>
**Then load** `<script src="chart.js"></script>`

In **chart.js** you can use **TIME_VAR**

var data = google.visualization.arrayToDataTable([
['Time', 'Time taken by worker'],
['Worker 1 ', 200],
['Worker 2', 150],
['Worker 3', 300],
['Worker 4', 160],
['Worker 5', 140],
['Time taken by you is',TIME_VAR]
]);

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through