EasyUI Forum
September 13, 2025, 08:59:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: i lost the style when send html code by json  (Read 6568 times)
pedroc
Newbie
*
Posts: 17


View Profile
« on: September 22, 2015, 09:40:47 AM »

hi, i have the next problem. When i send the htlm code through the json i lost the style. here show me code:

function submitForm() {
    if($('#user').val() != '' && $('#pass').val() != '') {
        $.ajax({
            type: "POST",
            url: "index.php/maincontroller/sing_in",
            dataType: "json",                       
            data: {user:$('#user').val(),pass:calcMD5($('#pass').val())},
            cache: false,
            success: function(data){
                if(dato.success == 'true') {
                    $("#dlogin").html('');          
                    $("#welcome").html("<a class='easyui-linkbutton'>Add</a>");   //this is problem    
                }
                ...

<div class="easyui-layout" style="width:100%;height:100%;">
    <div data-options="region:'north'" style="height:150px">
        <div style="position:relative"><img src=<?php echo base_url("img/header/header.png"); ?>>
            <div style="position:absolute; top:10; left:500;"><img src=<?php echo base_url("img/header/logo.png"); ?>></div>
            <div id="dlogin" style="position:absolute; top:110; left:1200;"><?php if(isset($login)) echo $login; ?></div>
            <div id="welcome" style="position:absolute; top:5%; left:80%;">
                   <!--should be shown here div whit style, but loses-->
            </div>
        </div>
    </div>

HELP ME PLEASE I NEED SOLVE THIS PROBLEM FAST
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 22, 2015, 06:42:04 PM »

Please try this:
Code:
$("#welcome").html("<a class='easyui-linkbutton'>Add</a>");
$.parser.parse('#welcome');
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!