Lina

Experience

2,450

0 Best Reply Awards

  • Member Since 7 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

30th October, 2017

Lina left a reply on Class 'Aws\S3\S3Client' Not Found • 3 weeks ago

I can't install in my server the:

composer require league/flysystem-aws-s3-v3


Error:
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 72 bytes) in phar:///opt/cpanel/composer/bin/composer/src/Composer/Repository/ComposerRepository.php on line 556

I have copied the vendor folder (backup-manager, aws, league) from local and throw it to the server.

I use it and is still showing an error:

composer dump-autoload -o
$ php artisan db:backup --database=mysql --destination=s3 --destinationPath=/empire/db_
 --timestamp="Y_m_d_H_i_s" --compression=gzip

  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Aws\S3\S3Client' not found

29th October, 2017

Lina left a reply on [Digital Ocean] Phpmyadmin Login With Https Is Failing • 3 weeks ago

I have the same error, when I compelte the login I am being redirected to port :80 in URL http and is having an error.

Lina started a new conversation Class 'Aws\S3\S3Client' Not Found • 3 weeks ago

[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Aws\S3\S3Client' not found

I am trying to send a backup to my S3 account from my server but appears this error when I try this command:

php artisan db:backup --database=mysql --destination=s3 --destinationPath=/empire/db_ --timestamp="Y-m-d H:i:s" --compression=gzip

22nd October, 2017

Lina left a reply on Error Using "has" Method • 1 month ago

Hi friend,

nice! Now is good:

Post_tag.php :

class Post_tag extends Model
{
    protected $table = "post_tags";
    protected $primaryKey = "id";
    public $timestamps  = true;

    protected $fillable = [
        'id', 'post_id', 'tag_id', 'created_at', 'updated_at',
    ];

    public function post()
    {
        return $this->belongsTo(Post::class);
    }

    public function tag()
    {
        return $this->belongsTo(Tag::class);
    }
}

also I found that tag was wrong:

Tag.php:

class Tag extends Model
{
    protected $table = "tags";
    protected $primaryKey = "id";
    public $timestamps  = true;

    protected $fillable = [
        'id', 'tag_name', 'tag_visited', 'created_at', 'updated_at',
    ];

    public function post_tags()
    {
        return $this->hasMany(Post_tag::class);
    }

    public function posts()
    {
        return $this->belongsToMany(Post::class, 'post_tags');
    }

}

And post.php:

    public function post_tags()
    {
        return $this->hasMany(Post_tag::class);
    }

    public function tags()
    {
        return $this->belongsToMany(Tag::class, 'post_tags')->withTimestamps();
    }

Lina started a new conversation Error Using "has" Method • 1 month ago

Hi,

I am working in a blog that has "posts", "tags" and a "post_tags" table.

But when I try to do this:

return Tag::has('post_tags')
            ->has('posts')
            ->get();

the Laravel show me an error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_blog_page.post_tag' doesn't exist (SQL: select * from `tags` where exists (select * from `post_tags` where `tags`.`id` = `post_tags`.`post_tags`) and exists (select * from `posts` inner join `post_tag` on `posts`.`id` = `post_tag`.`post_id` where `tags`.`id` = `post_tag`.`tag_id`))

Why is telling me "post_tag" not exist? Why is using "post_tag" instead "Post_tags?"

// Tag.php
class Tag extends Model
{
    protected $table = "tags";
    protected $primaryKey = "id";
    public $timestamps  = true;

    protected $fillable = [
        'id', 'tag_name', 'tag_visited', 'created_at', 'updated_at',
    ];

    public function post_tags()
    {
        return $this->hasMany(Post_tag::class, 'post_tags');
    }

    public function posts()
    {
        return $this->belongsToMany(Post::class);
    }

}

// Post.php
class Post extends Model
{
    protected $table = "posts";
    protected $primaryKey = "id";
    public $timestamps  = false;

    protected $fillable = [
        'id',
        'post_title',
        // 'post_type',
        'post_url',
        'post_description',
        'post_img',
        'post_content',
        'post_visited',
        'post_visible',
        'publication_date',
        'created_at',
        'updated_at',
    ];

    public function post_tags()
    {
        return $this->hasMany(Post_tag::class, 'post_tags');
    }

    public function tags()
    {
        return $this->belongsToMany(Tag::class, 'post_tags')->withTimestamps();
    }
}

// Post_tag.php
class Post_tag extends Model
{
    protected $table = "post_tags";
    protected $primaryKey = "id";
    public $timestamps  = true;

    protected $fillable = [
        'id', 'post_id', 'tag_id', 'created_at', 'updated_at',
    ];

    public function post()
    {
        return $this->belongsTo(Post::class);
    }

    public function tag()
    {
        return $this->belongsTo(Tag::class);
    }
}

Lina started a new conversation [Digital Ocean] Phpmyadmin Login With Https Is Failing • 1 month ago

Hi friends,

When I try to login in phpmyadmin with https de post request of the login fails and when I put "http" on the url goes well, what can I do to solve it?

Thanks bros!

Lina left a reply on Permissions Shell_exec('chmod -R 777 Public/images'); • 1 month ago

The permisions are not working right, why? code:

   exec('rm -rf sitemaps 2>&1', $output, $return_var);
        if(!empty($output)) dump($output);
        if(!empty($return_var)) dump($return_var);
        exec('mkdir sitemaps 2>&1', $output, $return_var);
        if(!empty($output)) dump($output);
        if(!empty($return_var)) dump($return_var);
        exec('chmod -R 777 sitemaps 2>&1', $output, $return_var);
        if(!empty($output)) dump($output);
        if(!empty($return_var)) dump($return_var);
        die();

Output:

array:1 [▼
  0 => "rm: cannot remove 'sitemaps': Permission denied"
]
1
array:2 [▼
  0 => "rm: cannot remove 'sitemaps': Permission denied"
  1 => "mkdir: cannot create directory 'sitemaps': File exists"
]
1
array:2 [▼
  0 => "rm: cannot remove 'sitemaps': Permission denied"
  1 => "mkdir: cannot create directory 'sitemaps': File exists"
]

20th October, 2017

Lina left a reply on Backups On Dropbox • 1 month ago

oh my fucking god, thanks bro!

Lina left a reply on Backups On Dropbox • 1 month ago

Hi, @Snapey what means "pushing to S3"?

Thanks

Lina left a reply on Permissions Shell_exec('chmod -R 777 Public/images'); • 1 month ago

Thanks, I will try to see the output :D

Is recommended bring to "www-data" permisions and what kind of permision should I give to it?

Thanks for your help.

18th October, 2017

Lina started a new conversation Looking For A Lib To Take Appointment And Select Some Options • 1 month ago

Hi friends,

I am looking for a lib to take appointment for my clients, just completing a form marking the specific datetime to have the meeting with some options of the items that they want to buy, something like this:

https://gtechniq.com/service/ http://demo1.booking-wp-plugin.com/demo/

Thanks for your time.

17th October, 2017

Lina started a new conversation Backups On Dropbox • 1 month ago

Hi friends,

What is the best way to do a backup of my DB? I had a method to work with Dropbox but the lib that I was using is deprecated:

https://github.com/backup-manager/laravel

15th October, 2017

Lina started a new conversation Permissions Shell_exec('chmod -R 777 Public/images'); • 1 month ago

Hi friends,

I was trying to use this but not work until I put the command on CLI.

<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    public function permissions()
    {
        shell_exec('chmod -R 777 sitemaps');
        shell_exec('chmod -R 777 storage');
        shell_exec('chmod -R 777 public/images');
        return "DONE";
    }
}

12th October, 2017

Lina started a new conversation How To Improve This Code ^^' • 1 month ago

Hi friends,

How can I increase my skill programming?

I have a code question, how can I do this in short code?

if($beShareValue > $typeOfPaymentAdmin->fixedAmount) $beShareValue = $typeOfPaymentAdmin->fixedAmount;`

5th October, 2017

Lina started a new conversation [CSS] How To Expand A Div With An Image Until The Height Of The Other Div? • 1 month ago

See the image: https://gyazo.com/31ed2106dc399abd4263336b0d96f346 I am using materialize.css

HTML: https://gyazo.com/e5abd14cf92dbcf45dc99ad1f03f9704

I want to put right the image with a complete height, how can I do this?

Lina left a reply on Laravel How To Modify Pagination On Vendor Correctly • 1 month ago

SOLVED:

@if($posts->total() > 10)
    <div class="card text-center hoverable">
        {{ $posts->render('pagination.default') }} <!--- This is a custom view on resources/views/pagination/default.blade.php
    </div>
@endif 

Content:

@if ($paginator->hasPages())
    <ul class="pagination">

        @if ($paginator->onFirstPage())
            <li class="disabled">
                <a>
                    <i class="material-icons">chevron_left</i>
                </a>
            </li>
        @else
            <li>
                <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="waves-effect">
                    <i class="material-icons">chevron_left</i>
                </a>
            </li>
        @endif

        @foreach ($elements as $element)
            @if (is_string($element))
                <li class="disabled">
                    <a href="javascript:void(0);" class="waves-effect">
                        {{ $element }}
                    </a>
                </li>
            @endif

            @if (is_array($element))
                @foreach ($element as $page => $url)
                    @if ($page == $paginator->currentPage())
                        <li class="active">
                            <a href="javascript:void(0);" class="waves-effect">
                                {{ $page }}
                            </a>
                        </li>
                    @else
                        <li>
                            <a href="{{ $url }}" class="waves-effect">
                                {{ $page }}
                            </a>
                        </li>
                    @endif
                @endforeach
            @endif
        @endforeach

        @if ($paginator->hasMorePages())
            <li>
                <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="waves-effect">
                    <i class="material-icons">chevron_right</i>
                </a>
            </li>
        @else
            <li class="disabled">
                <a>
                    <i class="material-icons">chevron_right</i>
                </a>
            </li>
        @endif
    </ul>
@endif

Lina started a new conversation Laravel How To Modify Pagination On Vendor Correctly • 1 month ago

Hello

what I want to do is to modify the pagination page by default of laravel to change the layout (CSS) and some html things, he identified the file path a modification that is:

provider / laravel / framework / src / Light / Page / resources / views / default.blade.php

And I want to change it to a file that called it new.blade.php with a paginator conntent changeing some class and styles.

What is the right way to change the vendor file having in count that when I do a "composer install" or "composer update" the file used to do the pagination should be the new.blade.php

Lina left a reply on How To Delete Post_tags And Tag In A Same Instruction • 1 month ago

Yes Sir! This is what I was looking for, thank you so much!

Lina started a new conversation How To Delete Post_tags And Tag In A Same Instruction • 1 month ago

Hi friends,

I have this code and I want to do on the best way:

    public function deleteTag(Request $request)
    {
        Tag::find($request->id)->post_tags()->delete();
        return Tag::destroy($request->id);
    }

Delete the post_tags and the tags

post_tags (tag_id, post_id) tags(id, tag_name)

28th September, 2017

Lina left a reply on Faker/Factory Not Found On Heroku Db:seed • 1 month ago

I deleted my app in heroku and I installed all again with composer update -dev and the faker in composer.json -> require-dev and it works.

27th September, 2017

Lina left a reply on [JS] Select2 Problems Setting Values By Default • 1 month ago

Solution:

Blade

<h2 class="card-inside-title">Tags</h2>
                            <div class="form-group">
                                <select class="form-control" multiple="multiple" id="tags" name="tags[]">
                                    @if(!empty($post))
                                        @foreach($post->post_tags as $postTag)
                                            <option selected="selected" value="{{$postTag->tag->id}}">{{$postTag->tag->tag_name}}</option>
                                        @endforeach
                                    @endif
                                </select>
                            </div>

JS

            $('#tags').select2({
                tags: true,
                width: '100%',
                tokenSeparators: [','],
                ajax: {
                    url: '{{ url("getTagsSelect2") }}',
                    dataType: 'json',
                    data: function(params) {
                        return {
                            term: params.term
                        }
                    },
                    processResults: function (data, page) {
                        return {
                            results: data
                        };
                    },
                }
            });

Lina started a new conversation Faker/Factory Not Found On Heroku Db:seed • 1 month ago

Hi friends,

I have problems doing the migration on heroku when I do:

heroku run php artisan db:seed

`` $ heroku run php artisan db:seed Running php artisan db:seed on jaquenews... starting, run.7385 (Free) Running php artisan db:seed on jaquenews... connecting, run.7385 (Free) Running php artisan db:seed on jaquenews... up, run.7385 (Free)

  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes yes

Seeding: UsersTableSeeder

[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Faker\Factory' not found ``

Code: database -> seeds -> UserTableSeeder.php

``

26th September, 2017

Lina left a reply on How To Seed Database After Deploying The Laravel App On Heroku? • 1 month ago

I have an error with faker:

Seeding: UsersTableSeeder

[Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Faker\Factory' not found

21st September, 2017

Lina started a new conversation When A Mail Is Not Sent How To Not Block The Function? • 2 months ago

Hi friends,

sometimes when I try to send a mail the functions "sendEmail" explodes because my server can't send the email in a concret momment, I don't want to change the server, what I want is to find a solution, if the server could not send the mail in an hipotetic case, how can I not block the function?

Thanks!

14th September, 2017

Lina started a new conversation [JS] Select2 Problems Setting Values By Default • 2 months ago

Hi friends,

I am trying to use the select2 lib (https://select2.org/data-sources/formats) to create an input to add tags associated with a Posts of the Blog, but when I charge the page the values of the tags are not appearing in the input like a introduced values.

https://gyazo.com/6359955a1ef17ce85c8d7409fb336298

        <div class="form-group">
        <label for="tags" class="control-label">Tags</label>
             <select id="tags" name="tags[]" class="form-control" multiple="multiple">
             </select>
        </div>
     
        $('#tags').select2({
    // What values should I do add to set values by default?
            multiple: true,
            results: {
                  "id": 3,
                  "text": "Option 3",
            },
            tokenSeparators: [','],
            ajax: {
                url: '{{ url("getTagsSelect2") }}',
                dataType: 'json',
                data: function(params) {
                    return {
                        term: params.term
                    }
                },
                processResults: function (data, page) {
                    return {
                        results: data
                    };
                },
            },
        });

I tired this but is not working:

        $('#tags').select2({
           multiple:true,
           ajax:{}}).select2({"data": 
        [{"id":"2127","text":"Henry Ford"},{"id":"2199","text":"Tom Phillips"}]});

Thanks for your help

12th September, 2017

Lina left a reply on Eloquent Relationships Question (whereHas) • 2 months ago

[Solved] Thanks to: https://laracasts.com/discuss/channels/eloquent/wherehas-relationship-getting-the-latest-row-but-want-to-do-a-where-on-this-result

public function getPostTags($tag_id = null)
{
    return \App\Post::whereHas('post_tags', function ($query) use ($tag_id){
        $query->where('post_tags.tag_id', '=', $tag_id);
    })->get();
}

Lina started a new conversation Eloquent Relationships Question (whereHas) • 2 months ago

Hi friends,

how can I pass a param to the where inside the function?

public function getPostTags($tag_id = null)
{
    return \App\Post::whereHas('post_tags', function ($query){
        $query->where('post_tags.tag_id', '=', $tag_id);
    })->get();
}

I have the table "Post" with a list of posts and the table"Post_tags" which relation the "posts" with "tags" (post_id, tag_id). Then I want to get the posts with a concret tag_id.

8th September, 2017

Lina left a reply on Execute Artisan Command From Code • 2 months ago

Finally works with Artisan::call('down');

Lina left a reply on Artisan Command Is Not Killed After Execution And Eats Memory • 2 months ago

I have a similar problem, I am doing a call with cronn jobs and my server present some problems for overload, could be for this?

Cron jobs statured 7% of CPU.

Lina started a new conversation Execute Artisan Command From Code • 2 months ago

Hi friends,

I want to execute an artisan command from a controller, how can I do that?

I tried this but doesn't work...

   use Artisan;
   ....

  public function putUnderMaintenance()
  {
     Artisan::call('down', []);
  }

Lina left a reply on Maintenance Mode (excluding Some Routes) • 2 months ago

How can you change the expluded ips?

hen can i put this array to access from anyside of my code like a global variable?

7th September, 2017

Lina left a reply on Cropit Problems With Image In Base64, How Can I Get The Image Edited? • 2 months ago

I am trying to work with cropit to edit images and stored the editions but... oops something is wrong...

Lina started a new conversation Cropit Problems With Image In Base64, How Can I Get The Image Edited? • 2 months ago

Hi friends,

how can I convert a base64 images to a file image to do that?

        $fileName = rand(11111, 99999).$request->post_img->getClientOriginalName();
        if(!$request->post_img->move('images/', $fileName))
        {
            throw new \Exception("Error with the image while processing the request", 500);
        }

When I try to do the "$request->post_img->getClientOriginalName();" always crash, the image is a base64 code, I tried this too but it give problems:

$data = explode(',', $request->post_img); $code = base64_decode($data[1]); $fileName = rand(11111, 99999).".jpeg"; file_put_contents('directory/'.$fileName, $code); $fileName = rand(11111, 99999).$request->post_img->getClientOriginalName(); if(!$request->post_img->move('images/', $fileName)) { throw new \Exception("Error with the image while processing the request", 500); }

Someone can explain me how images works? And how should I store it efficently?

Thanks for your help.

Lina left a reply on How To Use A NPM Package In Laravel? • 2 months ago

where is the gulpfile.js????

6th September, 2017

Lina left a reply on Catch Exceptions • 2 months ago

I am catching the tokenmismatchexception but I want to catch the exception that I said, how can i do?

public function render($request, Exception $exception)
{
    if($exception instanceof TokenMismatchException)
    {
        Alert::error('Seems you couldn\'t submit form for a long time. Please try again.', 'Oops!')->persistent("Close");;
        return redirect($request->fullUrl());
    }
    return parent::render($request, $exception);
}

Lina started a new conversation Catch Exceptions • 2 months ago

How can I catch a Laravel exception for example when you send a Post request and the "Post" is not in the route files to show an alert to the user while using ajax?

https://gyazo.com/5e2dc9559d5ea8a4eeb6a5756f722bbd

Thanks for your help

Lina started a new conversation How Create An Object With Eloquent And Return The Id? • 2 months ago

Hi friends,

how can we create a Post and return the id if we don't know it?

This works?

        $post = new Post;
        $post->post_title = $request->post_title;
        $post->post_img = $request->post_img;
        $post->post_description = $request->post_description;
        $post->post_content = $request->post_content;
        $post->post_visible = 1;
        $post->post_visited = 0;
        $post->created_at = \Carbon::now('Europe/Madrid');
        $post->updated_at = \Carbon::now('Europe/Madrid');
        $post->save();
        return json_encode($post->id);

Lina started a new conversation [QUESTION] Do You Know Packages To Upload An Edit Cover Images? • 2 months ago

Hi firends,

I am doing a personal blog, do you know some package/plugin to upload and edit in real time the cover images?

I am disposed to accept ideas to create the post cover image.

Thank you so much

3rd September, 2017

Lina started a new conversation Https With Laragon + Nginx • 2 months ago

Hi friends,

I have a problem setting the https url in my localhost. I am using Laragon with Nginx with ports 8080 and 8343.

SO: Windows 10 64bits.

Error capture: https://gyazo.com/57fd66f01ff77c332871b8f304a46d9a

Lina left a reply on POST Ajax Acting Like GET • 2 months ago

I found the error the meta tag token was not in the header of index file:

Now post is working nicely!

Lina left a reply on POST Ajax Acting Like GET • 2 months ago

going on not working:

Route::post('/setTagName', '[email protected]');

$(document).on('click', '#edit-button-test', function(e){
        var edit_id = this.getAttribute("data-id");
        var edit_name = this.getAttribute("value");
        var route = "{{ url('/changeTagName') }}";
        $.post({
            url: route,
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            data: {
                'id': edit_id,
                'tag_name': edit_name,
            },
            contentType: "application/json; charset=utf-8",
            dataType: 'json',
            success: function(data){
                console.log(data);
                swal("Nice!", "The new value is: " + data, "success");
            },
            error: function(data){
                console.log(data.responseJSON);
                msgError = "";
                if(data.responseJSON.message != "")
                {
                    $.each(data.responseJSON, function(key, value){
                        msgError = msgError+'<li>'+value+'</li>';
                    });
                }
                swal({
                    title: "Error 500",
                    text: msgError,
                    type: 'error',
                    confirmButtonText: false
                });
            }
        });
    });

Error:

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251 Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251 Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException

2nd September, 2017

Lina left a reply on Ajax POST Request Response • 2 months ago

I found the error, now seems that is working like a GET instead of a POST.

Lina started a new conversation POST Ajax Acting Like GET • 2 months ago

C:\laragon\www\blog\vendor\laravel\framework\src\Illuminate\Routing\RouteCollection.php#251

When I send a post request I get an error of a GET request: the route is not find, right because is a POST! but isn't working:

``$(document).on('click', '#edit-button', function(e){
        e.preventDefault();
        var edit_id = this.getAttribute("data-id");
        var edit_name = this.getAttribute("data-name");
        var route = "{{ url('/changeTagName') }}";
        swal({
            title: "Edit",
            text: "Write new value",
            type: "input",
            showCancelButton: true,
            closeOnConfirm: false,
            inputPlaceholder: edit_name,
            inputValue: edit_name
        }, function (inputValue) {
            if (inputValue === false) return false;
            if (inputValue === "")
            {
                swal.showInputError("You need to write something!");
                return false
            }
            // Change the value and return true/false
            $.ajax({
                type: "POST",
                url: route,
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                data: {
                    'id': edit_id,
                    'tag_name': inputValue,
                },
                contentType: "application/json; charset=utf-8",
                dataType: 'json',
                success: function(data){
                    console.log(data);
                    swal("Nice!", "The new value is: " + data, "success");
                },
                error: function(data){
                    console.log(data.responseJSON);
                    msgError = "";
                    if(data.responseJSON.message != "")
                    {
                        $.each(data.responseJSON, function(key, value){
                            msgError = msgError+'<li>'+value+'</li>';
                        });
                    }
                    swal({
                        title: "Error 500",
                        text: msgError,
                        type: 'error',
                        confirmButtonText: false
                    });
                }
            });
        });
    });´´

Lina started a new conversation Ajax POST Request Response • 2 months ago

Hi friends,

How can I get the value of a request with errors?

For example if the error is 500 how can I show this error in text with the object request?

IMG: https://gyazo.com/7164b2644b5240aa1dda1688977f2ef9

Lina started a new conversation DataTables With Laravel "show Rows" Repited Twice • 2 months ago

Hi friends,

I am trying to use datatables but this shit is happening:

https://gyazo.com/5d0a7065e95b8f6c119a1a5637d27e00 https://gyazo.com/66501e955689d54a691ede5417a5a1ed

Code: https://gyazo.com/1e43e8135c2d8263b38b501d0721521a

What can I do to solve this error?

1st September, 2017

Lina left a reply on The DB Is Not Working With Http, Can't Login • 2 months ago

Yes, I need use http sometimes to interact with http request to an api that has no https.

What can I do?

Lina started a new conversation The DB Is Not Working With Http, Can't Login • 2 months ago

Hi friends,

I can't login into my aplication when I use http instead of https, I have tried do another petitions to other urls and not work to access to DB methods. The error apears in my server what should I do?

Thanks for your dear help.

30th August, 2017

Lina started a new conversation Javascript Clone And Replace The Dom • 2 months ago

I am taking the html of the web useing clone method with jquery because I modify the element with a searcher that put content on the dom, however when I paste the old content there are a chart (sparkline) that lose the values. How can I fix that?

Before modify the dom: https://i.gyazo.com/4fc54c43362c5bd44b2e81c545f8f2db.png

Modifying the dom: https://gyazo.com/95a89dbd40966606bc2412a25755aa84

After replaceWith (The data of the sparkline desapeared): https://gyazo.com/aae5b0832a8737d4bfde0debddbb9476

Code:

`$(document).ready(function(){ var divClone; $('#search-post-open').click(function(e) { divClone = $("#main-page").clone(); }); $('#search-post-close').click(function(e) { $("#main-page").replaceWith(divClone); });

});`

28th August, 2017

Lina started a new conversation Convert The Response From JSON To HTML An Show With SeetAlerts • 2 months ago

HI friends,

I want to get a response from an ajax call and if is an error convert to html an show the error type with sweet alerts:

`error: function(data){

                var message = $.each(data.responseJSON, function(key, value){
                    return '<li>'+value+'</li>';
                });
                swal("Oops...", "Something went wrong!", message); // I don't know how to do that.
            }`

25th August, 2017

Lina left a reply on Problema Mostrando La Petición De Respuesta • 2 months ago

Parece y digo parece que es el tamaño de la pantalla porque en otros dispositivos funciona, de ser así tema zanjado... Menudo infierno.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.