Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Remotely activating a javascript function through a php request

I am somewhat new to html/php/web-design, and i created an html page that can create a message via hovering over buttons.

<button class="letter" onmouseover="Over(65)">A</button><br>

and the javascript function, Over()

function Over(X){
    console.log("Over " + String.fromCharCode(X));
    let x = '<div class="out"><p id="text">';
    x += document.getElementById("text").innerHTML;
    x += String.fromCharCode(X);
    x += "</p></div>";
    $("div.out").replaceWith(x);
}

put simply, hover over button -> call Over() -> add letter to text

however, while exploring PHP, i got the idea to combine it with another project i had done earlier, using a function that can send chrome OS notifications. (functions at bottom)

My goal for this is to have a column of buttons on the right for letters, 2 buttons on the left for Back and Send. The Back Already works just using .slice(0, document.getElementById("text").innerHTML.length-1) Now i need to figure out how to make the send function output a notification to all other Windows/tabs i dont know if thats the right word

reference image

Page layout

If this is not enough info or if anyone needs a clearer explanation, i will take feedback <3

function notifyMe(
 body = "Notification Body",
 title = 'Notification title'
) {
 if (Notification.permission !== 'granted')
  Notification.requestPermission();
 else {
  var notification = new Notification('Notification title',{
   icon: 'icon.png',
   body: "Notification Body",
  });
  notification.onclick = function() {
   window.open('https://stackoverflow.com/');
  };
 }
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You really shouldn't be using PHP and JavaScript. To make it easier, it is just one or the other. But, you can create a php tag in HTML by saying <script type=text/php> I am pretty sure, and have them communicate on the same page.

You could just use element.onmouseover = function() { // YOUR CODE HERE } and then send out a remote that gets picked up on php. I don't use php, so sorry if I can't answer how to pick the remote up on php.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!