Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:17:56+00:00 2026-06-14T07:17:56+00:00

I am trying to call a function and pass a parameter to a iframe

  • 0

I am trying to call a function and pass a parameter to a iframe javascript function from the parent.

I have

document.getElementById('iframeD').contentWindow.detect(name);

in my parent javascript

in my iframe..if I have

function detect(name){

   console.log(name);
}

it will gives me

Uncaught SyntaxError: Unexpected token name

However, if I only call the function without parameter

document.getElementById('iframeD').contentWindow.detect();

and make my iframe function

function detect(){

   console.log('I want to pass the pare');
}

it will works.

What can I do to solve this? Thanks for the help!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:17:57+00:00Added an answer on June 14, 2026 at 7:17 am

    name is a reserved keyword in JS, so you can’t use it for variables/arguments. Just use a different name both for your argument and when you call detect. Your code looks otherwise fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call c# function from javascript the code i have tried
I'm trying to pass a parameter from php into my javascript function inside html.
I am trying to call my function named isUrgencyTypeValid from my javascript code but
I am trying to pass an object as parameter to the javascript function as:
I am trying to use AjaxOptions.OnSuccess to call a javascript function and pass a
I'm trying to pass parameter of short type to C++ unmanaged function imported from
I am trying to pass a folder path from XSL to JavaScript. Function is
I'm trying to call a function in my ActionScript from my JavaScript, I've managed
I'm trying to call a function present in one class from another class by
I'm trying to call a function called animateRight in a file called ScanAnimation.m from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.