Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9316923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:44:55+00:00 2026-06-19T02:44:55+00:00

i have a slightly procedural problem, I have a php based server. Basically i

  • 0

i have a slightly procedural problem,

I have a php based server.
Basically i send a string to the server php file ( server.php file), this php file, performs some operations on this string and will then return the new string.

I want to add some js to the server.php file, which will run a few jquery dom traversing functions on the string. The string is a DOM.

I know that this is not what js was designed for,, i know that its supposed to only run on the browser,, but is there a simple workaround that i can do?

the string would look like this:

<body>      
<em>
    heres a em and this works as well

</em>
<p>
   here is another para and it works , BUT NOW LOOK AT THE NEXT LINE
    <br>
       where is this prepend,no prepend here, ladies and gentlement,,NADA.

</p>
<button onclick = "addtags()">here is the magic</button>

 </body>

so i need to do some, stuff on this via php, and then some aditional tree traversing,, and i love the jquery functions for this,,
I;m using the .text() , .contains(), .before(), .after(), .attr(‘class’) functions from jquery,, and if anyone can suggest any alternatives, its fine with me.. Can all this be done in XPATH??? i have no idea.. for me jquery works perfect.
Would i need to create a new .html file from the string that i receive and somehow run the js on that??

Best Regards,
RIchard.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T02:44:56+00:00Added an answer on June 19, 2026 at 2:44 am

    You cannot run js an php at the same time on the server. Theoretically it could be done, but not in the same execution flow.

    You can do DOM processing in php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a procedure which performs some task, but performs it in two slightly
I have slightly simplified the default index.php file supplied with WAMP, so that it
I have a slightly complex problem here. I need to show to the client
I know this question has been done but I have a slightly different twist
I am trying to build a model that will have slightly different equations based
I have a system that performs operations on lots of Things , these can
This is perhaps related to this question , but I have slightly more information.
So I'm a slightly seasoned php developer and have been 'doin the damn thing'
I have a slightly odd problem that I think is most likely due to
I have some cases in my code where I am building a large string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.