Fix OneDrive Embed Code Empty src Value Issue
Question details
The user needs to resolve an issue where generating a OneDrive embed code results in an incomplete or empty source URL.

- Product
- OneDrive
- Device & OS
- not provided
- Scenario
- Embedding a OneDrive file into a website or web page using the auto-generated iframe code.
- Observed behavior
- The generated embed code produces a src="?" attribute instead of the complete source URL, preventing the file from displaying. Clearing browser data or generating a new link fails to resolve the issue.
Before modifying the embed code, paste the original snippet generated by OneDrive into a plain text editor like Notepad so you can easily view and edit the URL parameters.
Manually Correct the Embed Code URL Parameters
By manually adjusting the URL parameters and removing the empty src attribute, you can restore the embed code's functionality.
This issue typically occurs due to recent changes in the OneDrive embed format backend, causing the auto-generator to output incomplete URL strings. Manually restructuring the code bypasses this bug.
Paste the original, unmodified embed code generated by OneDrive directly into your text editor.
Locate the '=2' within the URL string of the embed code and type an ampersand (&) immediately after it.
Copy the parameters that appear after the question mark in the broken src="?" section, and paste them right after the newly added ampersand.
Review the adjusted code and ensure there are no duplicate quotation marks around the final src value.
If necessary, modify the width and height attributes within the iframe tag to ensure the embedded file fits perfectly on your web page.

Contact Microsoft Q&A Community for Specialized Support
If manual adjustments do not work, the issue may require specialized backend support from the OneDrive team.
Try WPS Office for Seamless Document Management and Sharing
If you frequently encounter embedding and sharing issues with Microsoft OneDrive, consider using WPS Office as a highly compatible, hassle-free alternative. It provides reliable cloud sharing options without the complexity of broken embed codes.
- 1. Download and install WPS Office: Visit the official WPS website to download the free, lightweight office suite.
- 2. Save to WPS Cloud: Open your document in WPS Office and save it directly to the built-in WPS Cloud.
- 3. Share with ease: Click the 'Share' button to instantly generate a secure, working web link to distribute your files.

Frequently Asked Questions
Why does my OneDrive embed code show an empty src value?
This generally happens due to backend updates or bugs in the OneDrive embed format generator, which occasionally fails to compile the full URL, resulting in an incomplete src="?" parameter.
Will clearing my browser cache fix the OneDrive embed code error?
No. Clearing browser data, switching browsers, or simply generating a new link usually does not resolve this specific issue, as the problem lies within the code generation tool itself.
Is there a simpler way to share documents online without editing code?
Yes. By using alternatives like WPS Office, you can utilize built-in cloud sharing features to generate stable, public viewing links for your documents without having to manually edit HTML iframe attributes.




