XHTML Interview Questions and Answers for internship

100 XHTML Internship Interview Questions and Answers
  1. What is XHTML?

    • Answer: XHTML (Extensible HyperText Markup Language) is a reformulation of HTML 4 as an XML application. It emphasizes stricter syntax rules than HTML, requiring well-formed XML documents with properly closed tags and attributes enclosed in quotes.
  2. What are the differences between HTML and XHTML?

    • Answer: XHTML is stricter than HTML. XHTML requires well-formed XML, meaning all tags must be closed, attributes must be quoted, and the document must have a single root element. HTML is more lenient and allows for many practices that are invalid in XHTML.
  3. What is the correct way to declare a DOCTYPE in XHTML?

    • Answer: The DOCTYPE declaration for XHTML 1.0 Strict is: Other versions (Transitional and Frameset) have different DOCTYPE declarations.
  4. Explain the importance of namespaces in XHTML.

    • Answer: Namespaces prevent naming conflicts when using elements from multiple vocabularies (like XHTML and SVG) within the same document. They provide a way to uniquely identify elements and attributes.
  5. What is the role of the `xmlns` attribute?

    • Answer: The `xmlns` attribute declares the XML namespace for an element, preventing naming collisions. For instance, `xmlns="http://www.w3.org/1999/xhtml"` declares that the document uses the XHTML namespace.
  6. How do you handle comments in XHTML?

    • Answer: XHTML uses standard XML comments: <!-- This is a comment -->
  7. What are XHTML's structural elements?

    • Answer: Key structural elements include <html>, <head>, <body>, and others that organize the document's content.
  8. How do you create a hyperlink in XHTML?

    • Answer: <a href="url">Link Text</a>, ensuring the `href` attribute is properly quoted.
  9. How do you create an image in XHTML?

    • Answer: <img src="image.jpg" alt="Image description" /> Note the self-closing tag and the required `alt` attribute.
  10. What is the purpose of the `alt` attribute in the `img` tag?

    • Answer: The `alt` attribute provides alternative text for images, crucial for accessibility (screen readers) and SEO. It describes the image's content.
  11. Explain the importance of validating XHTML.

    • Answer: Validation ensures the document conforms to the XHTML specification, catching errors like unclosed tags or invalid attribute values. This improves the document's robustness and interoperability.
  12. How would you validate an XHTML document?

    • Answer: Use an online validator like the W3C Markup Validation Service to check the document's validity against the chosen XHTML DTD.
  13. What are the different DTDs for XHTML?

    • Answer: XHTML 1.0 has three DTDs: Strict, Transitional, and Frameset. Strict is the most conforming, Transitional allows some presentational elements, and Frameset supports frames.
  14. What is the difference between XHTML Strict, Transitional, and Frameset?

    • Answer: Strict is the most minimalist, disallowing presentational elements. Transitional allows some presentational elements for backward compatibility. Frameset supports frames, a less common layout method now.
  15. What is the preferred character encoding for XHTML documents?

    • Answer: UTF-8 is the preferred character encoding for XHTML, supporting a wide range of characters.
  16. How do you include CSS in an XHTML document?

    • Answer: Using the <link> tag in the <head> section: <link rel="stylesheet" type="text/css" href="style.css" />
  17. How do you include JavaScript in an XHTML document?

    • Answer: Using the <script> tag, either inline or by referencing an external file. Example for external: <script src="script.js" type="text/javascript"></script>
  18. What is the purpose of the `lang` attribute?

    • Answer: The `lang` attribute specifies the language of the content within an element, important for accessibility and internationalization.
  19. What are some common XHTML form elements?

    • Answer: <form>, <input> (various types like text, password, submit), <textarea>, <select>, <button>.
  20. How do you create a table in XHTML?

    • Answer: Using <table>, <tr> (table row), <th> (table header), and <td> (table data) elements.
  21. What are some best practices for writing semantically correct XHTML?

    • Answer: Use appropriate elements for their intended purpose (e.g., headings for headings, paragraphs for paragraphs), maintain a logical structure, and follow accessibility guidelines.
  22. Explain the concept of accessibility in XHTML.

    • Answer: Making web pages usable by people with disabilities, using techniques like alt text for images, proper heading structure, and semantic markup.
  23. What is the role of metadata in XHTML?

    • Answer: Metadata provides information about the document, like title, description, keywords, and author, often used by search engines and browsers.
  24. How do you define metadata in XHTML?

    • Answer: Using the <meta> tag within the <head> section. Examples: <meta charset="UTF-8" />, <meta name="description" content="Page description" />
  25. What are some common XHTML validation errors?

    • Answer: Unclosed tags, missing quotes around attribute values, missing DOCTYPE declaration, invalid character entities.
  26. How do you handle special characters in XHTML?

    • Answer: Using character entities, like & for ampersand, < for less than, and > for greater than.
  27. What are the advantages of using XHTML?

    • Answer: Stricter syntax leads to more robust and interoperable documents. Better support for XML-related technologies. Improved accessibility and SEO.
  28. What are the disadvantages of using XHTML?

    • Answer: Stricter syntax can be more challenging for beginners. Not all browsers handled XHTML equally well in the past (though this is less of an issue now).
  29. Explain the concept of XML namespaces.

    • Answer: Namespaces avoid element name collisions when combining different XML vocabularies. They provide unique identification for elements and attributes.
  30. How do you create a list in XHTML?

    • Answer: Using <ul> (unordered list) with <li> (list item) elements for bullet points, or <ol> (ordered list) for numbered lists.
  31. How do you embed a video in XHTML?

    • Answer: Typically using the <object> or <embed> tags, though the best approach is often to use a video player API like those from YouTube or Vimeo.
  32. How do you create a form with multiple input fields in XHTML?

    • Answer: Nest multiple <input> elements within a <form> element, each with different `name` and `type` attributes.
  33. Describe the role of the `type` attribute in the `input` tag.

    • Answer: The `type` attribute specifies the type of input field, such as `text`, `password`, `submit`, `radio`, `checkbox`, etc.
  34. What is the purpose of the `value` attribute in the `input` tag?

    • Answer: The `value` attribute sets the initial or default value of the input field.
  35. What is the purpose of the `name` attribute in the `input` tag?

    • Answer: The `name` attribute gives the input field a name, allowing its value to be submitted with the form.
  36. How do you handle user input in XHTML forms?

    • Answer: User input is submitted to a server-side script (often PHP, Python, etc.) via the form's `action` attribute. The server-side script then processes the data.
  37. What is the role of the `action` attribute in the `form` tag?

    • Answer: The `action` attribute specifies the URL of the server-side script that will process the form data.
  38. What is the role of the `method` attribute in the `form` tag?

    • Answer: The `method` attribute specifies the HTTP method used to submit the form data, typically `GET` or `POST`.
  39. What is the difference between GET and POST methods?

    • Answer: GET appends form data to the URL, while POST sends data in the request body. POST is generally preferred for security and handling larger amounts of data.
  40. How do you create a dropdown menu in XHTML?

    • Answer: Using the <select> element with nested <option> elements to define the options.
  41. How do you create radio buttons in XHTML?

    • Answer: Use multiple <input type="radio"> elements with the same `name` attribute to create a group of mutually exclusive options.
  42. How do you create checkboxes in XHTML?

    • Answer: Use multiple <input type="checkbox"> elements, each with a unique `name` attribute.
  43. What are some common accessibility issues with forms?

    • Answer: Lack of labels for form elements, inadequate color contrast, missing alternative text for images within the form, insufficient instructions for users.
  44. How can you improve the accessibility of your XHTML forms?

    • Answer: Use clear and concise labels for all form elements using the `label` element, ensure sufficient color contrast, provide alternative text for images, and include clear instructions.
  45. How do you style XHTML elements using CSS?

    • Answer: By linking an external CSS stylesheet using the <link> tag, or by embedding CSS within <style> tags in the <head> section, or by using inline styles (generally discouraged).
  46. Explain the concept of cascading in CSS.

    • Answer: CSS rules cascade, meaning that if multiple rules apply to an element, the browser uses a specific order to determine which rule takes precedence.
  47. What is the box model in CSS?

    • Answer: The box model describes how elements are rendered visually: content, padding, border, and margin.
  48. How do you create a simple layout using CSS?

    • Answer: Using CSS properties like `float`, `display`, `position`, and `width` to position and size elements in a desired layout.
  49. What are some common CSS layout techniques?

    • Answer: Floating, positioning (absolute, relative), flexbox, grid layout.
  50. What is responsive web design?

    • Answer: Designing websites to adapt to different screen sizes and devices using techniques like fluid grids, flexible images, and media queries.
  51. How do you create a responsive layout using CSS?

    • Answer: Using media queries to apply different CSS styles based on screen size, and utilizing flexible layout techniques.
  52. What are media queries in CSS?

    • Answer: Media queries allow applying different CSS rules depending on the device's characteristics, such as screen width, orientation, and resolution.
  53. What are some tools for developing and debugging XHTML and CSS?

    • Answer: Web browsers' developer tools (for debugging), text editors or IDEs (for development), and validators (for checking validity).
  54. What are some common challenges in XHTML development?

    • Answer: Maintaining strict syntax, ensuring cross-browser compatibility (though less critical now), managing complex layouts, and balancing accessibility concerns.
  55. How do you handle different browser rendering differences?

    • Answer: Through careful CSS coding, using browser-specific CSS hacks where necessary, and testing thoroughly on different browsers.
  56. What is semantic HTML?

    • Answer: Using HTML elements for their intended purpose, conveying meaning and structure, rather than just for visual presentation.
  57. Why is semantic HTML important?

    • Answer: Improves code readability, maintainability, accessibility (screen readers), SEO, and adaptability to future changes.
  58. Give examples of semantic HTML elements.

    • Answer: <header>, <nav>, <main>, <article>, <aside>, <footer>, <section>, and more.
  59. How do you structure a basic XHTML page for SEO?

    • Answer: Use descriptive titles and meta descriptions, relevant keywords, proper heading structure, clean and semantic markup.
  60. What is the role of the `` element?</strong></p> <ul> <li><strong>Answer:</strong> The `title` element sets the title of the HTML document, displayed in the browser tab or window title bar, and crucial for SEO.</li> </ul> </li> <li> <p><strong>What is the role of the `<meta>` element?</strong></p> <ul> <li><strong>Answer:</strong> The `meta` element provides metadata about the HTML document, including character set, description, keywords, and more, vital for SEO.</li> </ul> </li> <li> <p><strong>What are some common SEO best practices for XHTML?</strong></p> <ul> <li><strong>Answer:</strong> Use descriptive titles and meta descriptions, structured data, relevant keywords, internal and external linking, mobile-friendliness, fast loading speed.</li> </ul> </li> <li> <p><strong>How do you ensure your XHTML site is mobile-friendly?</strong></p> <ul> <li><strong>Answer:</strong> Use responsive design techniques (media queries, flexible layouts, fluid images), test on various devices, and consider using mobile-specific content if necessary.</li> </ul> </li> <li> <p><strong>What is the importance of website performance in XHTML development?</strong></p> <ul> <li><strong>Answer:</strong> Fast loading speed improves user experience, search engine rankings, and conversion rates. Optimizing images, minimizing HTTP requests, and using efficient code are key.</li> </ul> </li> <li> <p><strong>How do you optimize images for use in XHTML?</strong></p> <ul> <li><strong>Answer:</strong> Use appropriate image formats (JPEG for photos, PNG for graphics), compress images without significant quality loss, and use responsive images (<code><picture></code> or <code>srcset</code> attribute).</li> </ul> </li> <li> <p><strong>Explain the concept of progressive enhancement.</strong></p> <ul> <li><strong>Answer:</strong> Building a website that works well for older browsers and then progressively adding more features and improvements for newer browsers, ensuring basic functionality for everyone.</li> </ul> </li> <li> <p><strong>What is graceful degradation?</strong></p> <ul> <li><strong>Answer:</strong> Designing a website that gracefully handles situations where features or technologies are not supported by the user's browser, ensuring a reasonable fallback experience.</li> </ul> </li> <li> <p><strong>Describe your experience with XHTML development.</strong></p> <ul> <li><strong>Answer:</strong> *(This requires a personalized answer based on your actual experience. Mention specific projects, technologies used, and challenges overcome.)*</li> </ul> </li> <li> <p><strong>What are your strengths and weaknesses as an XHTML developer?</strong></p> <ul> <li><strong>Answer:</strong> *(This requires a personalized answer, highlighting your skills and areas for improvement honestly.)*</li> </ul> </li> <li> <p><strong>Why are you interested in this XHTML internship?</strong></p> <ul> <li><strong>Answer:</strong> *(This requires a personalized answer demonstrating your genuine interest in the internship and the company.)*</li> </ul> </li> <li> <p><strong>What are your salary expectations for this internship?</strong></p> <ul> <li><strong>Answer:</strong> *(This requires research and a realistic answer based on industry standards and the internship's location.)*</li> </ul> </li> <li> <p><strong>What are your career goals?</strong></p> <ul> <li><strong>Answer:</strong> *(This requires a personalized answer demonstrating your ambition and long-term vision.)*</li> </ul> </li> </ol><br><p>Thank you for reading our blog post on 'XHTML Interview Questions and Answers for internship'.We hope you found it informative and useful.Stay tuned for more insightful content!</p> </div> <!--Optional Url Button --> <!--Optional Url Button --> <div class="post-tags"> </div> </div> <!--include next previous post --> <div class="col-sm-12 post-next-prev"> <div class="row"> <div class="col-sm-6 col-xs-12 left"> <p> <span><i class="icon-angle-left" aria-hidden="true"></i>Previous Article</span> </p> <h3 class="title"> <a href="https://ngt-internship.com/webmethods-interview-questions-and-answers-12003"> WebMethods Interview Questions and Answers </a> </h3> </div> <div class="col-sm-6 col-xs-12 right"> <p> <span>Next Article<i class="icon-angle-right" aria-hidden="true"></i></span> </p> <h3 class="title"> <a href="https://ngt-internship.com/xhtml-interview-questions-and-answers-for-freshers-75007"> XHTML Interview Questions and Answers for freshers </a> </h3> </div> </div> </div> <!--Include banner--> <!--include about author --> <section class="section section-related-posts"> <div class="section-head"> <h4 class="title">Related Posts</h4> </div> <div class="section-content"> <div class="row"> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/wrapper-class-in-java-interview-questions-and-answers-for-10-years-experience-87421"> Wrapper Class in Java Interview Questions and Answers for... </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/scheme-interview-questions-and-answers-for-10-years-experience-64563"> Scheme Interview Questions and Answers for 10 years experience </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/main-method-in-java-interview-questions-and-answers-for-2-years-experience-18612"> main() Method in Java Interview Questions and Answers for... </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> <div class="col-sm-12"></div> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/xquery-interview-questions-and-answers-for-10-years-experience-58079"> XQuery Interview Questions and Answers for 10 years experience </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/top-c-exception-handling-interview-questions-and-answers-for-7-years-experience-37759"> Top C++ Exception Handling Interview Questions and Answers... </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> <!--include post item--> <div class="col-sm-4 col-xs-12"> <!--Post item small--> <div class="post-item-mid post-item-no-image"> <h3 class="title"> <a href="https://ngt-internship.com/lua-interview-questions-and-answers-for-internship-36394"> Lua Interview Questions and Answers for internship </a> </h3> <p class="post-meta"> <span><i class="icon-comment"></i>0</span> </p> </div> </div> </div> </div> </section> <section id="comments" class="section"> <div class="col-sm-12 col-xs-12"> <div class="row"> <div class="comment-section"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#site_comments">Comments</a></li> </ul> <div class="tab-content"> <div id="site_comments" class="tab-pane fade in active"> <!-- include comments --> <form id="make_comment"> <input type="hidden" name="parent_id" value="0"> <input type="hidden" name="post_id" value="2813"> <div class="form-row"> <div class="row"> <div class="form-group col-md-6"> <label>Name</label> <input type="text" name="name" class="form-control form-input" maxlength="40" placeholder="Name"> </div> <div class="form-group col-md-6"> <label>Email</label> <input type="email" name="email" class="form-control form-input" maxlength="100" placeholder="Email"> </div> </div> </div> <div class="form-group"> <label>Comment</label> <textarea name="comment" class="form-control form-input form-textarea" maxlength="4999" placeholder="Comment"></textarea> </div> <button type="submit" class="btn btn-md btn-custom">Post Comment</button> </form> <div id="message-comment-result" class="message-comment-result"></div> <div id="comment-result"> <input type="hidden" value="5" id="post_comment_limit"> <div class="row"> <div class="col-sm-12"> <div class="comments"> <ul class="comment-list"> </ul> </div> </div> </div> </div> </div> </div> </div> </div> </div> </section> </div> <div id="sidebar" class="col-sm-4 col-xs-12"> <!--include sidebar --> <!--Include banner--> </div> </div> </div> </div> <!-- /.Section: wrapper --> <script> $(function () { $('.post-text iframe').wrap('<div class="embed-responsive embed-responsive-16by9"></div>'); $('.post-text iframe').addClass('embed-responsive-item'); }); $(".fb-comments").attr("data-href", window.location.href); </script> <!-- Start Footer Section --> <footer id="footer"> <div class="container"> <div class="row footer-widgets"> <!-- footer widget about--> <div class="col-sm-4 col-xs-12"> <div class="footer-widget f-widget-about"> <div class="col-sm-12"> <div class="row"> <p class="footer-logo"> <img src="https://ngt-internship.com/uploads/logo/logo_66d3d001c65481.png" alt="logo" class="logo"> </p> <p> </p> </div> </div> </div> </div><!-- /.col-sm-4 --> <!-- footer widget random posts--> <div class="col-sm-4 col-xs-12"> <!--Include footer random posts partial--> <!--Partial: Footer Random Posts--> <div class="footer-widget f-widget-random"> <div class="col-sm-12"> <div class="row"> <h4 class="title">Random Posts</h4> <div class="title-line"></div> <ul class="f-random-list"> <!--List random posts--> <li class=" post-item-no-image"> <div class="list-right"> <h5 class="title"> <a href="https://ngt-internship.com/air-moving-technician-interview-questions-and-answers-63990"> air moving technician Interview Questions and Answers </a> </h5> </div> </li> <li class=" post-item-no-image"> <div class="list-right"> <h5 class="title"> <a href="https://ngt-internship.com/shopify-interview-questions-and-answers-for-2-years-experience-97094"> Shopify Interview Questions and Answers for 2 years experience </a> </h5> </div> </li> <li class=" post-item-no-image"> <div class="list-right"> <h5 class="title"> <a href="https://ngt-internship.com/c-interview-questions-and-answers-for-2-years-experience-66028"> C# Interview Questions and Answers for 2 years experience </a> </h5> </div> </li> </ul> </div> </div> </div> </div><!-- /.col-sm-4 --> <!-- footer widget follow us--> <div class="col-sm-4 col-xs-12"> <div class="col-sm-12 footer-widget f-widget-follow"> <div class="row"> <h4 class="title">Social Media</h4> <ul> <!--Include social media links--> <!--if facebook url exists--> <!--if twitter url exists--> <!--if pinterest url exists--> <!--if instagram url exists--> <!--if linkedin url exists--> <!--if vk url exists--> <!--if telegram url exists--> <!--if youtube url exists--> <!--if rss active--> </ul> </div> </div> </div> <!-- .col-md-3 --> </div> <!-- .row --> <!-- Copyright --> <div class="footer-bottom"> <div class="row"> <div class="col-md-12"> <div class="footer-bottom-left"> <p>Copyright © 2024 ngt-internship.com - All Rights Reserved.</p> </div> <div class="footer-bottom-right"> <ul class="nav-footer"> <li> <a href="https://ngt-internship.com/terms-conditions">Terms & Conditions </a> </li> </ul> </div> </div> </div> <!-- .row --> </div> </div> </footer> <!-- Scroll Up Link --> <a href="#" class="scrollup"><i class="icon-arrow-up"></i></a> <!-- End Footer Section --> <script> var base_url = 'https://ngt-internship.com/';var fb_app_id = '';var csfr_token_name = 'varient_csrf_token';var csfr_cookie_name = 'varient_csrf_cookie';var lang_folder = 'default';var is_recaptcha_enabled = false;var sweetalert_ok = 'OK';var sweetalert_cancel = 'Cancel';</script> <!-- Plugins--> <script src="https://ngt-internship.com/assets/js/plugins-1.7.js"></script> <script> $(document).ready(function(){$("#featured-slider").slick({autoplay:true,autoplaySpeed:4900,slidesToShow:1,slidesToScroll:1,infinite:true,speed:200,rtl:rtl,swipeToSlide:true,cssEase:"linear",lazyLoad:"progressive",prevArrow:$("#featured-slider-nav .prev"),nextArrow:$("#featured-slider-nav .next"),});$("#random-slider").slick({autoplay:true,autoplaySpeed:4900,slidesToShow:1,slidesToScroll:1,infinite:true,speed:200,rtl:rtl,lazyLoad:"progressive",prevArrow:$("#random-slider-nav .prev"),nextArrow:$("#random-slider-nav .next"),});$("#post-detail-slider").slick({autoplay:false,autoplaySpeed:4900,slidesToShow:1,slidesToScroll:1,infinite:false,speed:200,rtl:rtl,adaptiveHeight:true,lazyLoad:"progressive",prevArrow:$("#post-detail-slider-nav .prev"),nextArrow:$("#post-detail-slider-nav .next"),});$(".main-menu .dropdown").hover(function(){$(".li-sub-category").removeClass("active");$(".sub-menu-inner").removeClass("active");$(".sub-menu-right .filter-all").addClass("active")},function(){});$(".main-menu .navbar-nav .dropdown-menu").hover(function(){var b=$(this).attr("data-mega-ul");if(b!=undefined){$(".main-menu .navbar-nav .dropdown").removeClass("active");$(".mega-li-"+b).addClass("active")}},function(){$(".main-menu .navbar-nav .dropdown").removeClass("active")});$(".li-sub-category").hover(function(){var b=$(this).attr("data-category-filter");$(".li-sub-category").removeClass("active");$(this).addClass("active");$(".sub-menu-right .sub-menu-inner").removeClass("active");$(".sub-menu-right .filter-"+b).addClass("active")},function(){});$(".news-ticker ul li").delay(500).fadeIn(500);$(".news-ticker").easyTicker({direction:"up",easing:"swing",speed:"fast",interval:4000,height:"30",visible:0,mousePause:1,controls:{up:".news-next",down:".news-prev",}});$(window).scroll(function(){if($(this).scrollTop()>100){$(".scrollup").fadeIn()}else{$(".scrollup").fadeOut()}});$(".scrollup").click(function(){$("html, body").animate({scrollTop:0},700);return false});$("form").submit(function(){$("input[name='"+csfr_token_name+"']").val($.cookie(csfr_cookie_name))});$(document).ready(function(){$('[data-toggle-tool="tooltip"]').tooltip()})});$("#form_validate").validate();$("#search_validate").validate();$(document).on("click",".btn-open-mobile-nav",function(){if($("#navMobile").hasClass("nav-mobile-open")){$("#navMobile").removeClass("nav-mobile-open");$("#overlay_bg").hide()}else{$("#navMobile").addClass("nav-mobile-open");$("#overlay_bg").show()}});$(document).on("click","#overlay_bg",function(){$("#navMobile").removeClass("nav-mobile-open");$("#overlay_bg").hide()});$(".close-menu-click").click(function(){$("#navMobile").removeClass("nav-mobile-open");$("#overlay_bg").hide()});$(window).on("load",function(){$(".show-on-page-load").css("visibility","visible")});$(document).ready(function(){$("iframe").attr("allowfullscreen","")});var custom_scrollbar=$(".custom-scrollbar");if(custom_scrollbar.length){var ps=new PerfectScrollbar(".custom-scrollbar",{wheelPropagation:true,suppressScrollX:true})}var custom_scrollbar=$(".custom-scrollbar-followers");if(custom_scrollbar.length){var ps=new PerfectScrollbar(".custom-scrollbar-followers",{wheelPropagation:true,suppressScrollX:true})}$(".search-icon").click(function(){if($(".search-form").hasClass("open")){$(".search-form").removeClass("open");$(".search-icon i").removeClass("icon-times");$(".search-icon i").addClass("icon-search")}else{$(".search-form").addClass("open");$(".search-icon i").removeClass("icon-search");$(".search-icon i").addClass("icon-times")}});$(document).ready(function(){$("#form-login").submit(function(a){a.preventDefault();var b=$(this);var c=b.serializeArray();c.push({name:csfr_token_name,value:$.cookie(csfr_cookie_name)});$.ajax({url:base_url+"auth_controller/login_post",type:"post",data:c,success:function(e){var d=JSON.parse(e);if(d.result==1){location.reload()}else{if(d.result==0){document.getElementById("result-login").innerHTML=d.error_message}}}})})});function make_reaction(c,d,b){var a={post_id:c,reaction:d,lang:b};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({method:"POST",url:base_url+"home_controller/save_reaction",data:a}).done(function(e){document.getElementById("reactions_result").innerHTML=e})}$(document).ready(function(){$("#make_comment_registered").submit(function(b){b.preventDefault();var c=$(this).serializeArray();var a={};var d=true;$(c).each(function(f,e){if($.trim(e.value).length<1){$("#make_comment_registered [name='"+e.name+"']").addClass("is-invalid");d=false}else{$("#make_comment_registered [name='"+e.name+"']").removeClass("is-invalid");a[e.name]=e.value}});a.limit=$("#post_comment_limit").val();a.lang_folder=lang_folder;a[csfr_token_name]=$.cookie(csfr_cookie_name);if(d==true){$.ajax({type:"POST",url:base_url+"home_controller/add_comment_post",data:a,success:function(f){var e=JSON.parse(f);if(e.type=="message"){document.getElementById("message-comment-result").innerHTML=e.message}else{document.getElementById("comment-result").innerHTML=e.message}$("#make_comment_registered")[0].reset()}})}});$("#make_comment").submit(function(b){b.preventDefault();var c=$(this).serializeArray();var a={};var d=true;$(c).each(function(f,e){if($.trim(e.value).length<1){$("#make_comment [name='"+e.name+"']").addClass("is-invalid");d=false}else{$("#make_comment [name='"+e.name+"']").removeClass("is-invalid");a[e.name]=e.value}});a.limit=$("#post_comment_limit").val();a.lang_folder=lang_folder;a[csfr_token_name]=$.cookie(csfr_cookie_name);if(is_recaptcha_enabled==true){if(typeof a["g-recaptcha-response"]==="undefined"){$(".g-recaptcha").addClass("is-recaptcha-invalid");d=false}else{$(".g-recaptcha").removeClass("is-recaptcha-invalid")}}if(d==true){$(".g-recaptcha").removeClass("is-recaptcha-invalid");$.ajax({type:"POST",url:base_url+"home_controller/add_comment_post",data:a,success:function(f){var e=JSON.parse(f);if(e.type=="message"){document.getElementById("message-comment-result").innerHTML=e.message}else{document.getElementById("comment-result").innerHTML=e.message}if(is_recaptcha_enabled==true){grecaptcha.reset()}$("#make_comment")[0].reset()}})}})});$(document).on("click",".btn-subcomment-registered",function(){var a=$(this).attr("data-comment-id");var b={};b.lang_folder=lang_folder;b[csfr_token_name]=$.cookie(csfr_cookie_name);$("#make_subcomment_registered_"+a).ajaxSubmit({beforeSubmit:function(){var d=$("#make_subcomment_registered_"+a).serializeArray();var c=$.trim(d[0].value);if(c.length<1){$(".form-comment-text").addClass("is-invalid");return false}else{$(".form-comment-text").removeClass("is-invalid")}},type:"POST",url:base_url+"home_controller/add_comment_post",data:b,success:function(d){var c=JSON.parse(d);if(c.type=="message"){document.getElementById("message-subcomment-result-"+a).innerHTML=c.message}else{document.getElementById("comment-result").innerHTML=c.message}$(".visible-sub-comment form").empty()}})});$(document).on("click",".btn-subcomment",function(){var a=$(this).attr("data-comment-id");var b={};b.lang_folder=lang_folder;b[csfr_token_name]=$.cookie(csfr_cookie_name);b.limit=$("#post_comment_limit").val();var c="#make_subcomment_"+a;$(c).ajaxSubmit({beforeSubmit:function(){var d=$("#make_subcomment_"+a).serializeArray();var e=true;$(d).each(function(g,f){if($.trim(f.value).length<1){$(c+" [name='"+f.name+"']").addClass("is-invalid");e=false}else{$(c+" [name='"+f.name+"']").removeClass("is-invalid");b[f.name]=f.value}});if(is_recaptcha_enabled==true){if(typeof b["g-recaptcha-response"]==="undefined"){$(c+" .g-recaptcha").addClass("is-recaptcha-invalid");e=false}else{$(c+" .g-recaptcha").removeClass("is-recaptcha-invalid")}}if(e==false){return false}},type:"POST",url:base_url+"home_controller/add_comment_post",data:b,success:function(e){if(is_recaptcha_enabled==true){grecaptcha.reset()}var d=JSON.parse(e);if(d.type=="message"){document.getElementById("message-subcomment-result-"+a).innerHTML=d.message}else{document.getElementById("comment-result").innerHTML=d.message}$(".visible-sub-comment form").empty()}})});function load_more_comment(c){var b=parseInt($("#post_comment_limit").val());var a={post_id:c,limit:b};a.lang_folder=lang_folder;a[csfr_token_name]=$.cookie(csfr_cookie_name);$("#load_comment_spinner").show();$.ajax({type:"POST",url:base_url+"home_controller/load_more_comment",data:a,success:function(d){setTimeout(function(){$("#load_comment_spinner").hide();var e=JSON.parse(d);if(e.result==1){document.getElementById("comment-result").innerHTML=e.html_content}},1000)}})}function delete_comment(a,c,b){swal({text:b,icon:"warning",buttons:[sweetalert_cancel,sweetalert_ok],dangerMode:true,}).then(function(f){if(f){var e=parseInt($("#post_comment_limit").val());var d={id:a,post_id:c,limit:e};d.lang_folder=lang_folder;d[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/delete_comment_post",data:d,success:function(h){var g=JSON.parse(h);if(g.result==1){document.getElementById("comment-result").innerHTML=g.html_content}}})}})}function show_comment_box(a){if($("#sub_comment_form_"+a).html().length>0){$("#sub_comment_form_"+a).empty()}else{$(".visible-sub-comment").empty();var c=parseInt($("#post_comment_limit").val());var b={comment_id:a,limit:c};b.lang_folder=lang_folder;b[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/load_subcomment_box",data:b,success:function(d){$("#sub_comment_form_"+a).append(d)}})}}function like_comment(b){var c=parseInt($("#post_comment_limit").val());var a={id:b,limit:c};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/like_comment_post",data:a,success:function(e){var d=JSON.parse(e);if(d.result==1){document.getElementById("lbl_comment_like_count_"+b).innerHTML=d.like_count}}})}function dislike_comment(b){var c=parseInt($("#post_comment_limit").val());var a={id:b,limit:c};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/dislike_comment_post",data:a,success:function(e){var d=JSON.parse(e);if(d.result==1){document.getElementById("lbl_comment_like_count_"+b).innerHTML=d.like_count}}})}function view_poll_results(b){$("#poll_"+b+" .question").hide();$("#poll_"+b+" .result").show()}function view_poll_options(b){$("#poll_"+b+" .result").hide();$("#poll_"+b+" .question").show()}$(document).ready(function(){var b;$(".poll-form").submit(function(h){h.preventDefault();if(b){b.abort()}var a=$(this);var g=a.find("input, select, button, textarea");var j=a.serializeArray();j.push({name:csfr_token_name,value:$.cookie(csfr_cookie_name)});var i=$(this).attr("data-form-id");b=$.ajax({url:base_url+"home_controller/add_vote",type:"post",data:j,});b.done(function(c){g.prop("disabled",false);if(c=="required"){$("#poll-required-message-"+i).show();$("#poll-error-message-"+i).hide()}else{if(c=="voted"){$("#poll-required-message-"+i).hide();$("#poll-error-message-"+i).show()}else{document.getElementById("poll-results-"+i).innerHTML=c;$("#poll_"+i+" .result").show();$("#poll_"+i+" .question").hide()}}})})});function add_delete_from_reading_list(b){$(".tooltip").hide();var a={post_id:b,};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"ajax_controller/add_delete_reading_list_post",data:a,success:function(c){location.reload()}})}function load_more_posts(){$(".btn-load-more").prop("disabled",true);$("#load_posts_spinner").show();var c=parseInt($("#load_more_posts_last_id").val());var b=parseInt($("#load_more_posts_lang_id").val());var a={load_more_posts_last_id:c,load_more_posts_lang_id:b};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/load_more_posts",data:a,success:function(e){var d=JSON.parse(e);if(d.result==1){setTimeout(function(){$("#last_posts_content").append(d.html_content);$("#load_more_posts_last_id").val(d.last_id);$("#load_posts_spinner").hide();$(".btn-load-more").prop("disabled",false);if(d.hide_button){$(".btn-load-more").hide()}},300)}else{setTimeout(function(){$("#load_more_posts_last_id").val(d.last_id);$("#load_posts_spinner").hide();$(".btn-load-more").hide()},300)}}})}function load_more_comments(f){var e=parseInt($("#vr_comment_limit").val());var d={post_id:f,limit:e,};d[csfr_token_name]=$.cookie(csfr_cookie_name);$("#load_comments_spinner").show();$.ajax({method:"POST",url:base_url+"home_controller/load_more_comments",data:d}).done(function(a){setTimeout(function(){$("#load_comments_spinner").hide();$("#vr_comment_limit").val(e+5);document.getElementById("comment-result").innerHTML=a},500)})}$(document).on("click",".widget-popular-posts .btn-nav-tab",function(){$(".widget-popular-posts .loader-popular-posts").show();var b=$(this).attr("data-date-type");var c=$(this).attr("data-lang-id");var a={date_type:b,lang_id:c};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"ajax_controller/get_popular_posts",data:a,success:function(e){var d=JSON.parse(e);if(d.result==1){setTimeout(function(){document.getElementById("tab_popular_posts_response").innerHTML=d.html_content;$(".widget-popular-posts .loader-popular-posts").hide()},500)}$(".widget-popular-posts .loader-popular-posts").hide()}})});$(document).on("click",".visual-color-box",function(){var a=$(this).attr("data-color");$(".visual-color-box").empty();$(this).html('<i class="icon-check"></i>');$("#input_user_site_color").val(a)});function hide_cookies_warning(){$(".cookies-warning").hide();var a={};a[csfr_token_name]=$.cookie(csfr_cookie_name);$.ajax({type:"POST",url:base_url+"home_controller/cookies_warning",data:a,success:function(b){}})}$("#print_post").on("click",function(){$(".post-content .title, .post-content .post-meta, .post-content .post-image, .post-content .post-text").printThis({importCSS:true,})});$(document).ajaxStop(function(){function d(a){$("#poll_"+a+" .question").hide();$("#poll_"+a+" .result").show()}function c(a){$("#poll_"+a+" .result").hide();$("#poll_"+a+" .question").show()}});$(document).ready(function(){$(".validate_terms").submit(function(a){if(!$(".checkbox_terms_conditions").is(":checked")){a.preventDefault();$(".custom-checkbox .checkbox-icon").addClass("is-invalid")}else{$(".custom-checkbox .checkbox-icon").removeClass("is-invalid")}})});$(document).ready(function(){$(".post-content .post-text table").each(function(){table=$(this);tableRow=table.find("tr");table.find("td").each(function(){tdIndex=$(this).index();if($(tableRow).find("th").eq(tdIndex).attr("data-label")){thText=$(tableRow).find("th").eq(tdIndex).data("label")}else{thText=$(tableRow).find("th").eq(tdIndex).text()}$(this).attr("data-label",thText)})})});$(document).ready(function(){$(".gallery-post-buttons a").css("opacity","1")});$(document).ready(function(b){b(".image-popup-single").magnificPopup({type:"image",titleSrc:function(a){return a.el.attr("title")+"<small></small>"},image:{verticalFit:true,},gallery:{enabled:false,navigateByImgClick:true,preload:[0,1]},removalDelay:100,fixedContentPos:true,})});$(document).on("click","#btn_subscribe_footer",function(){var a=$("#newsletter_email_footer").val();$("#newsletter_email_modal").val(a);$("#modal_newsletter").modal("show")}); </script> </body> </html>