• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

truncated Javascript alert in Safari 9.0.1

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a page that uses Javascript to display an alert when I click on some text. New in Safari 9.0.1 (MacOS El Capitan), the alerts are being truncated by Safari. For example, this code on the page:

alert('Alomerovic, Arnela has an extension of 0.6 days.\nBryan, Lindsey has an extension of 0.3 days.\nBullock, Hannah R. has an extension of 0.25 days.\nCooke, Alexander C. has an extension of .75 days.\nDunlap, John H. has an extension of 1 day.\nEvans, Logan J. has an extension of 0.6 days.\nJEON, HAYCE has an extension of 1 day.\nMcAteer, Jordan P. has an extension of 2.7 days.\nMeredith, Luke T. has an extension of 1.5 days.\nMueller, Rebecca J. has an extension of 1 day.\nNguyen, Thuy N. has an extension of .8 days.\nPaschke, Kimberlyn E. has an extension of 1.0 day.\nTran, Angela has an extension of .5 days.\nWatkins, Benjamin C. has an extension of .5 days.\nWeiss, Blaine E. has an extension of 0.08 days.');

gives rise to this alert:

Alomerovic, Arnela has an extension of 0.6 days.
Bryan, Lindsey has an extension of 0.3 days.
Bullock, Hannah R. has an extension of 0.25 days.
Cooke, Alexander C. has an extension of .75 days.
Dunlap, John H. has an extension of 1 day.
Evans, Logan J. has an extension of 0.6 days.
JEON, HAYCE has an extension of 1 day.
McAteer, Jordan P. has an extension of 2.7 days.
Meredith, Luke T. has an extension of 1.5 days.
Mueller, Rebecca J. has an extension of 1 day.
Nguyen, Thuy N. has an extension o

And this code on the page:

alert('Barnes, Kevin M. has an extension of 1 day.\nBryan, Lindsey has an extension of 0.5 days.\nDunlap, John H. has an extension of 2 days.\nHolland, Emma K. has an extension of 2 days.\nJEON, HAYCE has an extension of 2 days.\nLoya, Edward K. has an extension of 1 day.\nMcAteer, Jordan P. has an extension of 2 days.\nMeredith, Luke T. has an extension of 1 day.\nNguyen, Thuy N. has an extension of 0.7 days.\nNickell, Danielle has an extension of 2 days.\nPaschke, Kimberlyn E. has an extension of 1.5 days.\nThompson, Brandyn L. has an extension of 1 day.\nTran, Angela has an extension of 1.5 days.\nWatkins, Benjamin C. has an extension of .5 days.\nWeiss, Blaine E. has an extension of 0.28 days.\nYu, Samuel S. has an extension of 1.65 days.');

gives rise to this alert:

Barnes, Kevin M. has an extension of 1 day.
Bryan, Lindsey has an extension of 0.5 days.
Dunlap, John H. has an extension of 2 days.
Holland, Emma K. has an extension of 2 days.
JEON, HAYCE has an extension of 2 days.
Loya, Edward K. has an extension of 1 day.
McAteer, Jordan P. has an extension of 2 days.
Meredith, Luke T. has an extension of 1 day.
Nguyen, Thuy N. has an extension of 0.7 days.
Nickell, Danielle has an extension of 2 days.
Paschke, Kimberlyn E. has an extension of 1.5 days.
Tho

There is no scroll bar in the alert window. I'm attaching a screen shot of one of the alerts.

Am I missing a setting somewhere, or is this a bug? I don't observe this behavior in Chrome or Firefox, nor did I observe this behavior in previous versions of Safari.
Screen-Shot-2015-11-12-at-10.29.48-AM.png
[Thumbnail for Screen-Shot-2015-11-12-at-10.29.48-AM.png]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd say it's intentional; alerts aren't really meant to be used that way. In fact, I'd say in modern web apps, alerts shouldn't be used at all. I'd employ something like a jQuery UI Dialog to display your text.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic