0

I am receiving this error:

Uncaught SyntaxError: Unexpected token <

which in turn is causing this error:

Uncaught ReferenceError: nfForms is not defined
at n.initialize (front-end.js:1)
at n.s.Object (front-end-deps.js:20)
at new n (backbone.min.js:1)
at n.initialize (front-end.js:2)
at n.s.Object (front-end-deps.js:20)
at new n (backbone.min.js:1)
at n.initialize (front-end.js:3)
at n.s.Object (front-end-deps.js:20)
at n.constructor (front-end-deps.js:21)
at new n (backbone.min.js:1)

but I cannot find the "<" that is causing the issue. I am created my own landing page template for a plug in called Inbound Pro on wordpress. I have checked my code, the source code, and the file that says the issue is on but I cannot find the "<" that is causing the problem. Am I crazy or is their a bigger issue at play here?

https://idsource.com/go/general-quote-page/

**EDIT - Further info: I forgot to mention that the main issue that I am having because of this error is that the form in the blue section won't load. I'm using the Ninja Forms plugin for my forms and one of the errors above states that "nfForms is not defined".

**EDIT - html for page:

<?php

/* Landing Page Boiler Plate */
$key = lp_get_parent_directory(dirname(__FILE__));
$path = LANDINGPAGES_UPLOADS_URLPATH ."$key/";
$url = plugins_url();

/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_init');

/* Load $post data and start normal WordPress Loop */
if (have_posts()) : while (have_posts()) : the_post();
$id = get_the_ID();
$title = get_the_title($id);
$content = lp_get_value($post, $key, 'main-content');
$conversion_area = lp_get_value($post, $key, 'conversion-area-content');

$sharetext = lp_get_value($post, $key,  'sharetext' );
$share_link = lp_get_value($post, $key,  'shareurl' );
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <title><?php wp_title(); ?></title>
    <meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width">

    <?php wp_head(); // Load Regular WP Head
          do_action('lp_head'); // Load Custom Landing Page Specific Header Items
    ?>

    <link rel="stylesheet" href="<?php echo $path;?>lp.css" type="text/css">

    <?php if ($share_link != ""){
        $share_link = $share_link;
    } else {
        $share_link = get_permalink( $id );
    } ?>

</head>
<body>

    <header>
        <div class="page_center large">
            <?php $logo = get_field('logo'); 
                        if( !empty($logo) ): 
                    ?>
                        <img src="<?php echo $logo['url']; ?>" alt="<?php echo $logo['alt']; ?>">

                    <?php endif; ?>
        </div>
    </header>

    <section class="lp_banner">
        <div class="page_center large">
            <?php the_field('banner_content'); ?>
        </div>

        <div class="page_center large thirds">
        <?php
            // check if the repeater field has rows of data
            if( have_rows('banner_repeater') ):

                // loop through the rows of data
                while ( have_rows('banner_repeater') ) : the_row();
        ?>
            <div class="third">
                <?php $image = get_sub_field('repeater_image'); 
                    if( !empty($image) ): 
                ?>
                <img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>">
                <?php endif; ?>
                <span><?php the_sub_field('repeater_text'); ?></span>
            </div>

            <?php

            endwhile;

            else :

                // no rows found

            endif;

            ?>

        </div>
    </section>

    <section class="lp_form">
        <div class="page_center">
                <?php the_field('quote_section_content'); ?>
            <div class="form_wrap">
                <?php the_field('quote_section_form'); ?>
            </div>
        </div>
    </section>

    <section class="designer">
        <div class="page_center large">
            <div class="left">
                <?php the_field('designer_section_text'); ?>
            </div>
            <div class="right">
                <div class="page_center">
                    <?php $desImage = get_field('designer_section_image'); 
                        if( !empty($desImage) ): 
                    ?>
                        <img src="<?php echo $desImage['url']; ?>" alt="<?php echo $desImage['alt']; ?>">

                    <?php endif; ?>
                </div>
            </div>
        </div>
    </section>

        <?php break;
            endwhile; endif; // End wordpress loop
        ?>
    <footer>
        <?php

        do_action('wp_footer');
        do_action('lp_footer');
        ?>
    </footer>
</body>
</html>
JSum
  • 597
  • 9
  • 20
  • 2
    chrome says line 157 (next to the error in the right margin) which is the invalid `var formDisplay = 1;` line of js. – Alex K. Apr 07 '17 at 14:29
  • Ok I see it in the view source, but it is not in my template code, it is generated by (I guess) the ninja forms script? this isn't an issue on any of the other pages of the site, just this one.... – JSum Apr 07 '17 at 14:35
  • nf wont generate it itself, its to do with how you incorporate it into your document, around the `` part – Alex K. Apr 07 '17 at 14:38
  • again though, that's not me. I can post my template code here so you can see. This is generated by the scripts on the page, and is only breaking on this specific page. – JSum Apr 07 '17 at 14:40
  • It would be a good idea to post your template code so that everyone can see what might be causing the issue. – Malco Apr 07 '17 at 14:40
  • so the dodgy `

    ` comes from the result of `the_field('quote_section_form');` - what is it?

    – Alex K. Apr 07 '17 at 14:44
  • that is an advanced custom fields plugin field that I created to insert the form on the page, and I think I just realized what happened. checking now... – JSum Apr 07 '17 at 14:46
  • I thought that maybe, because I am using a wysiwig to insert the form short code, that it has auto-wrapped the shortcode in

    tags. This isn't the case though...

    – JSum Apr 07 '17 at 14:48
  • what does the output of the_field('quote_section_form'); look like? – Alex K. Apr 07 '17 at 14:50
  • The output should be a javascript rendered ninja forms form. The pulsing load animation is from ninja forms as well. – JSum Apr 07 '17 at 14:52
  • @AlexK. I changed the field type from wysiwig to textarea and now the form generates correctly. Thanks. Do you want to post something so I can choose it as the right answer? – JSum Apr 07 '17 at 14:53

0 Answers0