I'm messing around with some jQuery, I'm going to try to describe my issue as good as I can, as I'm a rookie. The script is just an example to show the issue I'm having.
$( "#activity" ).replaceWith("<?php ifSOMETHING {echo' <div id="hello">'} ");
The issue is, the script uses " ", the PHP is using the ' ' for the echo, so now what can I use for the <div id="hello"> as the " " is already used by the .replaceWith("")
EDIT: The full code:
<script>
$( '#activity' ).replaceWith('
<div id="chatwrap">
<div id="content">
<section class="box">
<ul id="chat"></ul>
<form id="chatForm" action="">
<?php if($steam->loggedIn()) {
echo'
<input id="chatMessage" type="text" class="text" maxlength="100" placeholder="Message..." autocomplete="off">
<div id="sendmes">
<div id="onlinewrap"><img src="img/users.png" class="tooltip" title="Players Online" alt="players online"><div id="onl"></div></div>
<div id="wrap_options">
<a href="#" class="emotes show-pop btn btn-default top" data-title="Emotes" data-content=""><img src="img/emotes.png"></a></div>
<input id="chatSend" type="submit" class="grey" value="Send">';
}else{
echo'
<center><a href="'.$steam->loginUrl().'" class="grey" style="width:150px;font-size:16px;line-height:30px;">Login to chat</a></center>';
}?>
</form>
</section>
</div>
</div>
</div>
');
</script>


"and'as you want because that it's two different languages, meaning that the php part won't be visible for the jQuery, only the data you echo will be.