<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">

<channel>
	<title>Pancenjoss</title>
	<atom:link href="https://pancenjoss.com/feed/" rel="self" type="application/rss+xml"/>
	<link>https://pancenjoss.com/</link>
	<description>Melayani pembuatan website, aplikasi mobil, SEO, yang akan meningkatkan penjualan produk anda.</description>
	<lastBuildDate>Sun, 17 Oct 2021 12:32:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.10</generator>
	<itunes:explicit>no</itunes:explicit><itunes:subtitle>Melayani pembuatan website, aplikasi mobil, SEO, yang akan meningkatkan penjualan produk anda.</itunes:subtitle><item>
		<title>Find Elements from Ajax response using JQuery</title>
		<link>https://pancenjoss.com/find-elements-from-ajax-response-using-jquery/</link>
					<comments>https://pancenjoss.com/find-elements-from-ajax-response-using-jquery/#respond</comments>
		
		<dc:creator><![CDATA[masmu]]></dc:creator>
		<pubDate>Thu, 22 Jul 2021 03:26:29 +0000</pubDate>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQUery]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://pancenjoss.com/?p=590</guid>

					<description><![CDATA[<p>Some days ago, i was try to load another page by ajax. I only want certain element to replace my existing element. Due to my&#8230;</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/find-elements-from-ajax-response-using-jquery/">Find Elements from Ajax response using JQuery</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Some days ago, i was try to load another page by ajax. I only want certain element to replace my existing element. Due to my site based on WordPress, i think jquery is best option.</p>
<p>So here is my code</p>
<pre>
$.ajax({
&nbsp;&nbsp;&nbsp;&nbsp;url: "login.html"
}).done(function( data ) {
&nbsp;&nbsp;&nbsp;&nbsp;var kontener = $('<body>').html(data).find('.kontener'),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;content = kontener.find('#content');
&nbsp;&nbsp;&nbsp;&nbsp;$('body .kontener').html(content);
});
</pre>
<p>First thing we need to convert the data to jQuery HTML version, by set it as variable for further need as on line</p>
<pre>var kontener = $('<body>').html(data).find('.kontener')</pre>
<p>So, next we can find the element we want to use</p>
<pre>content = kontener.find('#content');</pre>
<p>And the last thing we need to do is replace it</p>
<pre>$('body .kontener').html(content);</pre>
<p>That&#8217;s how we get an element from ajax resppons by using jQuery. We can replace existing element with ajax, without loading page.</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/find-elements-from-ajax-response-using-jquery/">Find Elements from Ajax response using JQuery</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pancenjoss.com/find-elements-from-ajax-response-using-jquery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Simple Elementor Widget Example</title>
		<link>https://pancenjoss.com/simple-elementor-widget-example/</link>
					<comments>https://pancenjoss.com/simple-elementor-widget-example/#respond</comments>
		
		<dc:creator><![CDATA[masmu]]></dc:creator>
		<pubDate>Fri, 25 Sep 2020 04:39:51 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://pancenjoss.com/?p=573</guid>

					<description><![CDATA[<p>Create your own elementor widget is quite piece of cake. There is a example code from official Elementor. Which you can easily to edit it&#8230;</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/simple-elementor-widget-example/">Simple Elementor Widget Example</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Create your own elementor widget is quite piece of cake. There is a example code from official Elementor. Which you can easily to edit it depend on your purpose.</p>
<p>Source: <a href="https://developers.elementor.com/creating-a-new-widget/" target="_blank" rel="noopener noreferrer">https://developers.elementor.com/creating-a-new-widget/</a></p>
<pre class="EnlighterJSRAW" data-enlighter-language="php">/**
 * Elementor oEmbed Widget.
 *
 * Elementor widget that inserts an embbedable content into the page, from any given URL.
 *
 * @since 1.0.0
 */
class Elementor_oEmbed_Widget extends \Elementor\Widget_Base {

    /**
     * Get widget name.
     *
     * Retrieve oEmbed widget name.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget name.
     */
    public function get_name() {
        return 'oembed';
    }

    /**
     * Get widget title.
     *
     * Retrieve oEmbed widget title.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget title.
     */
    public function get_title() {
        return __( 'oEmbed', 'plugin-name' );
    }

    /**
     * Get widget icon.
     *
     * Retrieve oEmbed widget icon.
     *
     * @since 1.0.0
     * @access public
     *
     * @return string Widget icon.
     */
    public function get_icon() {
        return 'fa fa-code';
    }

    /**
     * Get widget categories.
     *
     * Retrieve the list of categories the oEmbed widget belongs to.
     *
     * @since 1.0.0
     * @access public
     *
     * @return array Widget categories.
     */
    public function get_categories() {
        return [ 'general' ];
    }

    /**
     * Register oEmbed widget controls.
     *
     * Adds different input fields to allow the user to change and customize the widget settings.
     *
     * @since 1.0.0
     * @access protected
     */
    protected function _register_controls() {

        $this-&gt;start_controls_section(
            'content_section',
            [
                'label' =&gt; __( 'Content', 'plugin-name' ),
                'tab' =&gt; \Elementor\Controls_Manager::TAB_CONTENT,
            ]
        );

        $this-&gt;add_control(
            'url',
            [
                'label' =&gt; __( 'URL to embed', 'plugin-name' ),
                'type' =&gt; \Elementor\Controls_Manager::TEXT,
                'input_type' =&gt; 'url',
                'placeholder' =&gt; __( 'https://your-link.com', 'plugin-name' ),
            ]
        );

        $this-&gt;end_controls_section();

    }

    /**
     * Render oEmbed widget output on the frontend.
     *
     * Written in PHP and used to generate the final HTML.
     *
     * @since 1.0.0
     * @access protected
     */
    protected function render() {

        $settings = $this-&gt;get_settings_for_display();

        $html = wp_oembed_get( $settings['url'] );

        echo '&lt;div class="oembed-elementor-widget"&gt;';

        echo ( $html ) ? $html : $settings['url'];

        echo '&lt;/div&gt;';

    }

}</pre>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/simple-elementor-widget-example/">Simple Elementor Widget Example</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pancenjoss.com/simple-elementor-widget-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to disable all WordPress Styles dan Scripts</title>
		<link>https://pancenjoss.com/wordpress-disable-all-styles-dan-scripts/</link>
					<comments>https://pancenjoss.com/wordpress-disable-all-styles-dan-scripts/#respond</comments>
		
		<dc:creator><![CDATA[masmu]]></dc:creator>
		<pubDate>Fri, 25 Sep 2020 03:09:29 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://pancenjoss.com/?p=560</guid>

					<description><![CDATA[<p>Sometimes we want to  check our WordPress site speed, without load any script or style. So this is the correct code to add in functions.php&#8230;</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/wordpress-disable-all-styles-dan-scripts/">How to disable all WordPress Styles dan Scripts</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes we want to  check our WordPress site speed, without load any script or style. So this is the correct code to add in functions.php</p>
<h3>Remove All Scripts</h3>
<pre>function pj_remove_all_scripts() {
   foreach( wp_scripts()-&gt;registered as $script ) {
      wp_dequeue_script( $script-&gt;handle );
      wp_deregister_script( $script-&gt;handle );
  }
}
add_action('wp_enqueue_scripts', 'pj_remove_all_scripts', 998);</pre>
<h3>Remove All Styles</h3>
<pre>function pj_remove_all_styles() {
   foreach( wp_styles()-&gt;registered as $style ) {
      wp_dequeue_style( $style-&gt;handle );
      wp_deregister_style( $style-&gt;handle );
  }
}
add_action('wp_enqueue_scripts', 'pj_remove_all_styles', 998);</pre>
<h3>Remove All Scripts on certain page or post</h3>
<pre>function pj_remove_all_scripts() {
   foreach( wp_scripts()-&gt;registered as $script ) {
      if( is_page(array( 42, 'about-me', 'Contact' )) || is_single(array(17,'beef-stew','Irish Stew')) ) {
         wp_dequeue_script( $script-&gt;handle );
         wp_deregister_script( $script-&gt;handle );
      }
  }
}
add_action('wp_enqueue_scripts', 'pj_remove_all_scripts', 998);</pre>
<p>You can add any conditional WordPress function, is_page(), is_single() or is_singular().</p>
<p>If your site still slow even after deregister all styles and scripts. Next thing you need to check is your query.<br />
I suggest you to use Query Monitor plugins</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/wordpress-disable-all-styles-dan-scripts/">How to disable all WordPress Styles dan Scripts</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pancenjoss.com/wordpress-disable-all-styles-dan-scripts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Get City Name by IP Address</title>
		<link>https://pancenjoss.com/how-to-get-city-name-by-ip-address/</link>
					<comments>https://pancenjoss.com/how-to-get-city-name-by-ip-address/#respond</comments>
		
		<dc:creator><![CDATA[masmu]]></dc:creator>
		<pubDate>Wed, 18 Dec 2019 13:49:56 +0000</pubDate>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://pancenjoss.com/?p=498</guid>

					<description><![CDATA[<p>I already search on google how to get city name by ip address for few hours, and found a simple way using third party REST&#8230;</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/how-to-get-city-name-by-ip-address/">How To Get City Name by IP Address</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I already search on google how to get city name by ip address for few hours, and found a simple way using third party REST API. There are many services which can provide the data for free. In this tutorial we get the data from keycdn and ipapi</p>
<h2>PHP Code</h2>
<pre>&lt;?php 
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    $ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
    $ip = $_SERVER['REMOTE_ADDR'];
}
// get city name from keycdn geo json 
$json = "https://tools.keycdn.com/geo.json?host=$ip"; 
$data = file_get_contents($json); 
$data = json_decode($data, true); 
$kota = $data['data']['geo']['city']; 

// get city name from ipapi json 
$url = "https://ipapi.co/json/"; 
$data = file_get_contents($json); 
$kota = $data['city']; 

// Show it 
echo $kota; 
?&gt;
</pre>
<p>There are limitation for each free service. But i think it&#8217;s good enough to use it for development purpose.</p>
<p>The post <a rel="nofollow" href="https://pancenjoss.com/how-to-get-city-name-by-ip-address/">How To Get City Name by IP Address</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pancenjoss.com/how-to-get-city-name-by-ip-address/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mobil Toyota Irak</title>
		<link>https://pancenjoss.com/mobil-toyota-irak/</link>
					<comments>https://pancenjoss.com/mobil-toyota-irak/#respond</comments>
		
		<dc:creator><![CDATA[Firman Day]]></dc:creator>
		<pubDate>Mon, 22 May 2017 11:48:12 +0000</pubDate>
				<category><![CDATA[Sales-Mobil]]></category>
		<guid isPermaLink="false">https://pancenjoss.com/?p=49</guid>

					<description><![CDATA[<p>The post <a rel="nofollow" href="https://pancenjoss.com/mobil-toyota-irak/">Mobil Toyota Irak</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>The post <a rel="nofollow" href="https://pancenjoss.com/mobil-toyota-irak/">Mobil Toyota Irak</a> appeared first on <a rel="nofollow" href="https://pancenjoss.com">Pancenjoss</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://pancenjoss.com/mobil-toyota-irak/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>